directus-extension-module-permissions 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +137 -0
- package/dist/api.js +1 -0
- package/dist/app.js +8 -0
- package/package.json +68 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 domdus
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Module Permissions
|
|
2
|
+
|
|
3
|
+
Control what non-admin users see in the Directus Data Studio — the left module bar, middle Module Navigation, Content nav, Users role tree, right sidebar, and where they land after login — based on their roles and policies.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Directus stores the left module bar as a single project-wide setting. This extension brings back **per-role and per-policy visibility**, and adds similar controls for other Studio areas that often show more than certain teams should see.
|
|
8
|
+
|
|
9
|
+
Open **Module Permissions** from the left bar (admins only). Rules only affect **non-admin** users. **Administrators always see everything** and are never redirected by these rules.
|
|
10
|
+
|
|
11
|
+
> **Important:** Most of these controls change what appears in the interface. They are **not a full security lock**. Users may still reach data through the API or permissions if those allow it. Use Directus permissions for real access control; use this extension to tidy and simplify the Studio experience.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
### Modules
|
|
16
|
+
|
|
17
|
+
Reorder the left module bar, enable or disable entries, add custom links, and hide or show modules for selected roles and policies. Optionally block deep links when a module is hidden. Also hide the middle Module Navigation panel per module for matched roles/policies.
|
|
18
|
+
|
|
19
|
+
<img alt="Modules settings" src="https://raw.githubusercontent.com/domdus/directus-extension-module-permissions/main/docs/screenshot_modules.png" width="800" />
|
|
20
|
+
|
|
21
|
+
- **Reorder & toggle** the left module bar (same idea as Project Settings → Modules)
|
|
22
|
+
- **Add custom links** to the module bar
|
|
23
|
+
- **Hide** a module for selected roles/policies, or **show it only** to those roles/policies
|
|
24
|
+
- Optionally **block deep links** when a module is hidden (e.g. typing `/users` in the address bar)
|
|
25
|
+
- **Hide Module Navigation** — hide the middle navigation column for selected modules when the user matches
|
|
26
|
+
|
|
27
|
+
### Sidebar
|
|
28
|
+
|
|
29
|
+
Hide individual right-sidebar panels, or force the whole sidebar collapsed or hidden for matched roles and policies.
|
|
30
|
+
|
|
31
|
+
<img alt="Sidebar settings" src="https://raw.githubusercontent.com/domdus/directus-extension-module-permissions/main/docs/screenshot_sidebar.png" width="800" />
|
|
32
|
+
|
|
33
|
+
- **Hide individual right-sidebar panels** (Layout Options, Revisions, Comments, Activity Log, and more) for selected roles/policies
|
|
34
|
+
- **Force the whole sidebar** collapsed (icons only) or fully hidden
|
|
35
|
+
- Purely visual — does not change permissions
|
|
36
|
+
|
|
37
|
+
### Content
|
|
38
|
+
|
|
39
|
+
Hide collections from the Content navigation while keeping normal permissions for relations and the API.
|
|
40
|
+
|
|
41
|
+
<img alt="Content settings" src="https://raw.githubusercontent.com/domdus/directus-extension-module-permissions/main/docs/screenshot_content.png" width="800" />
|
|
42
|
+
|
|
43
|
+
- **Hide collections** from the Content navigation for selected roles/policies
|
|
44
|
+
- Collections stay available in relations and the API if permissions allow
|
|
45
|
+
- Optionally **block deep links** to hidden collections
|
|
46
|
+
|
|
47
|
+
### Users
|
|
48
|
+
|
|
49
|
+
Control which roles appear in the Users module’s navigation tree.
|
|
50
|
+
|
|
51
|
+
<img alt="Users settings" src="https://raw.githubusercontent.com/domdus/directus-extension-module-permissions/main/docs/screenshot_users.png" width="800" />
|
|
52
|
+
|
|
53
|
+
- **Own Role Only** — matched users only see their own role (and parent roles) in the Users navigation tree
|
|
54
|
+
- **Role Visibility** — hide or show specific roles in that tree
|
|
55
|
+
- Optionally **block deep links** to hidden role pages
|
|
56
|
+
|
|
57
|
+
### Start Page
|
|
58
|
+
|
|
59
|
+
Choose where matched users land after login.
|
|
60
|
+
|
|
61
|
+
<img alt="Start Page settings" src="https://raw.githubusercontent.com/domdus/directus-extension-module-permissions/main/docs/screenshot_startpage.png" width="800" />
|
|
62
|
+
|
|
63
|
+
- Set where matched users **land after login** (for example `/files` or `/content`)
|
|
64
|
+
- Without **Force Redirect**, a user’s saved last page still wins
|
|
65
|
+
- With **Force Redirect**, they go to your start page even if they have a last page
|
|
66
|
+
- Explicit shared links with `?redirect=` still work as expected
|
|
67
|
+
|
|
68
|
+
### Settings
|
|
69
|
+
|
|
70
|
+
- **Export / import** your Module Permissions config as JSON (backup or move between projects)
|
|
71
|
+
- **Remove extension data** cleanly before uninstall (only this extension’s settings — not your module bar order)
|
|
72
|
+
|
|
73
|
+
## How rules work
|
|
74
|
+
|
|
75
|
+
For most visibility options you pick:
|
|
76
|
+
|
|
77
|
+
1. **Hide for matched roles/policies** — those people don’t see it
|
|
78
|
+
2. **Show only for matched roles/policies** — everyone else doesn’t see it
|
|
79
|
+
|
|
80
|
+
You can match by **role**, **policy**, or both. If either matches, the rule applies.
|
|
81
|
+
|
|
82
|
+
Some lists (Start Page, Sidebar mode, Own Role Only, Hide Module Navigation) support a **catch-all**: leave roles and policies empty and place the rule last so it applies to everyone who didn’t match an earlier rule.
|
|
83
|
+
|
|
84
|
+
## Installation
|
|
85
|
+
|
|
86
|
+
Requires **Directus 11 or 12**.
|
|
87
|
+
|
|
88
|
+
### npm
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npm install directus-extension-module-permissions
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Place the package in your Directus `extensions` folder (or install into a project that loads extensions from `node_modules`), then restart Directus.
|
|
95
|
+
|
|
96
|
+
### Marketplace
|
|
97
|
+
|
|
98
|
+
Search for **Module Permissions** in **Settings → Marketplace**. This bundle includes an API hook, so some environments only allow App extensions from the Marketplace — use the npm/manual install below if install is blocked.
|
|
99
|
+
|
|
100
|
+
### Manual Installation
|
|
101
|
+
|
|
102
|
+
1. Install and build:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
cd directus-extension-module-permissions
|
|
106
|
+
npm install
|
|
107
|
+
npm run build
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
2. Copy the built package into your Directus `extensions` folder (include `package.json` and the `dist` folder).
|
|
111
|
+
|
|
112
|
+
3. Restart Directus.
|
|
113
|
+
|
|
114
|
+
4. In the Data Studio:
|
|
115
|
+
|
|
116
|
+
1. Open **Settings → Project Settings → Modules**
|
|
117
|
+
2. Enable **Module Permissions**
|
|
118
|
+
3. Open **Module Permissions** from the left bar
|
|
119
|
+
|
|
120
|
+
## Getting started
|
|
121
|
+
|
|
122
|
+
1. Open **Module Permissions** as an admin.
|
|
123
|
+
2. Start with **Modules** — reorder the bar and hide modules your Editors or other roles shouldn’t see.
|
|
124
|
+
3. Use **Sidebar**, **Content**, and **Users** to simplify those screens for the same roles.
|
|
125
|
+
4. Set a **Start Page** if you want a clear landing page after login.
|
|
126
|
+
5. Optionally **Export JSON** from Settings so you can restore the config later.
|
|
127
|
+
|
|
128
|
+
## Tips
|
|
129
|
+
|
|
130
|
+
- Always pair Studio visibility rules with the right **permissions** in Directus Access Control.
|
|
131
|
+
- Test with a non-admin account (or another browser profile) after saving.
|
|
132
|
+
- Export your config before major changes or before uninstalling.
|
|
133
|
+
- Uninstall cleanup only removes this extension’s data — your normal module bar and other project settings stay intact.
|
|
134
|
+
|
|
135
|
+
## License
|
|
136
|
+
|
|
137
|
+
MIT
|
package/dist/api.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=["interface","display","layout","module","panel","theme"],t=["hook","endpoint"],n=["operation"];function r(e,t,n){function r(n,r){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,r);for(const e in s.prototype)e in n||Object.defineProperty(n,e,{value:s.prototype[e].bind(n)});n._zod.constr=s,n._zod.def=r}const o=n?.Parent??Object;class i extends o{}function s(e){var t;const o=n?.Parent?new i:this;r(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class o extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class i extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const s={};function a(e){return s}function c(e,t){return"bigint"==typeof t?t.toString():t}function u(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function d(e){return null==e}function l(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const p=Symbol("evaluating");function f(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==p)return void 0===r&&(r=p,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function h(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function m(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function _(e){return JSON.stringify(e)}const y="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function v(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const g=u(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function w(e){if(!1===v(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==v(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function z(e){return w(e)?{...e}:Array.isArray(e)?[...e]:e}const b=new Set(["string","number","symbol"]);function k(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function A(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function $(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function Z(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function S(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function P(e){return"string"==typeof e?e:e?.message}function E(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=P(e.inst?._zod.def?.error?.(e))??P(t?.error?.(e))??P(n.customError?.(e))??P(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function j(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function x(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const T=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,c,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},O=r("$ZodError",T),I=r("$ZodError",T,{Parent:Error});const F=e=>(t,n,r,i)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new o;if(c.issues.length){const t=new(i?.Err??e)(c.issues.map(e=>E(e,s,a())));throw y(t,i?.callee),t}return c.value},C=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map(e=>E(e,i,a())));throw y(t,o?.callee),t}return s.value},D=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new o;return s.issues.length?{success:!1,error:new(e??O)(s.issues.map(e=>E(e,i,a())))}:{success:!0,data:s.value}},R=D(I),U=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>E(e,o,a())))}:{success:!0,data:i.value}},N=U(I),L=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return F(e)(t,n,o)},W=e=>(t,n,r)=>F(e)(t,n,r),B=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return C(e)(t,n,o)},M=e=>async(t,n,r)=>C(e)(t,n,r),V=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return D(e)(t,n,o)},J=e=>(t,n,r)=>D(e)(t,n,r),K=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return U(e)(t,n,o)},q=e=>async(t,n,r)=>U(e)(t,n,r),G=/^[cC][^\s-]{8,}$/,H=/^[0-9a-z]+$/,Y=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,X=/^[0-9a-vA-V]{20}$/,Q=/^[A-Za-z0-9]{27}$/,ee=/^[a-zA-Z0-9_-]{21}$/,te=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ne=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,re=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,oe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const ie=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,se=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ae=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ce=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ue=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,de=/^[A-Za-z0-9_-]*$/,le=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,pe=/^\+(?:[0-9]){6,14}[0-9]$/,fe="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",he=new RegExp(`^${fe}$`);function me(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const _e=/^(?:true|false)$/i,ye=/^[^A-Z]*$/,ve=/^[^a-z]*$/,ge=r("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),we=r("$ZodCheckMaxLength",(e,t)=>{var n;ge.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!d(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const o=j(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ze=r("$ZodCheckMinLength",(e,t)=>{var n;ge.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!d(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const o=j(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),be=r("$ZodCheckLengthEquals",(e,t)=>{var n;ge.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!d(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,o=r.length;if(o===t.length)return;const i=j(r),s=o>t.length;n.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ke=r("$ZodCheckStringFormat",(e,t)=>{var n,r;ge.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Ae=r("$ZodCheckRegex",(e,t)=>{ke.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),$e=r("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ye),ke.init(e,t)}),Ze=r("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ve),ke.init(e,t)}),Se=r("$ZodCheckIncludes",(e,t)=>{ge.init(e,t);const n=k(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Pe=r("$ZodCheckStartsWith",(e,t)=>{ge.init(e,t);const n=new RegExp(`^${k(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ee=r("$ZodCheckEndsWith",(e,t)=>{ge.init(e,t);const n=new RegExp(`.*${k(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),je=r("$ZodCheckOverwrite",(e,t)=>{ge.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class xe{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const Te={major:4,minor:1,patch:12},Oe=r("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Te;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,i=Z(e);for(const s of t){if(s._zod.def.when){if(!s._zod.def.when(e))continue}else if(i)continue;const t=e.issues.length,a=s._zod.check(e);if(a instanceof Promise&&!1===n?.async)throw new o;if(r||a instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await a;e.issues.length!==t&&(i||(i=Z(e,t)))});else{if(e.issues.length===t)continue;i||(i=Z(e,t))}}return r?r.then(()=>e):e},n=(n,i,s)=>{if(Z(n))return n.aborted=!0,n;const a=t(i,r,s);if(a instanceof Promise){if(!1===s.async)throw new o;return a.then(t=>e._zod.parse(t,s))}return e._zod.parse(a,s)};e._zod.run=(i,s)=>{if(s.skipChecks)return e._zod.parse(i,s);if("backward"===s.direction){const t=e._zod.parse({value:i.value,issues:[]},{...s,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,s)):n(t,i,s)}const a=e._zod.parse(i,s);if(a instanceof Promise){if(!1===s.async)throw new o;return a.then(e=>t(e,r,s))}return t(a,r,s)}}e["~standard"]={validate:t=>{try{const n=R(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return N(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),Ie=r("$ZodString",(e,t)=>{var n;Oe.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Fe=r("$ZodStringFormat",(e,t)=>{ke.init(e,t),Ie.init(e,t)}),Ce=r("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ne),Fe.init(e,t)}),De=r("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=re(e))}else t.pattern??(t.pattern=re());Fe.init(e,t)}),Re=r("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=oe),Fe.init(e,t)}),Ue=r("$ZodURL",(e,t)=>{Fe.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:le.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Ne=r("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Fe.init(e,t)}),Le=r("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ee),Fe.init(e,t)}),We=r("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=G),Fe.init(e,t)}),Be=r("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=H),Fe.init(e,t)}),Me=r("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Y),Fe.init(e,t)}),Ve=r("$ZodXID",(e,t)=>{t.pattern??(t.pattern=X),Fe.init(e,t)}),Je=r("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Q),Fe.init(e,t)}),Ke=r("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=me({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${fe}T(?:${r})$`)}(t)),Fe.init(e,t)}),qe=r("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=he),Fe.init(e,t)}),Ge=r("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${me(t)}$`)),Fe.init(e,t)}),He=r("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=te),Fe.init(e,t)}),Ye=r("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ie),Fe.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),Xe=r("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=se),Fe.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Qe=r("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ae),Fe.init(e,t)}),et=r("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ce),Fe.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function tt(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const nt=r("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ue),Fe.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{tt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});const rt=r("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=de),Fe.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{(function(e){if(!de.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return tt(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),ot=r("$ZodE164",(e,t)=>{t.pattern??(t.pattern=pe),Fe.init(e,t)});const it=r("$ZodJWT",(e,t)=>{Fe.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),st=r("$ZodBoolean",(e,t)=>{Oe.init(e,t),e._zod.pattern=_e,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),at=r("$ZodUnknown",(e,t)=>{Oe.init(e,t),e._zod.parse=e=>e}),ct=r("$ZodNever",(e,t)=>{Oe.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function ut(e,t,n){e.issues.length&&t.issues.push(...S(n,e.issues)),t.value[n]=e.value}const dt=r("$ZodArray",(e,t)=>{Oe.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},r);a instanceof Promise?i.push(a.then(t=>ut(t,n,e))):ut(a,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function lt(e,t,n,r){e.issues.length&&t.issues.push(...S(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function pt(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function ft(e,t,n,r,o,i){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const o of Object.keys(t)){if(a.has(o))continue;if("never"===u){s.push(o);continue}const i=c.run({value:t[o],issues:[]},r);i instanceof Promise?e.push(i.then(e=>lt(e,n,o,t))):lt(i,n,o,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const ht=r("$ZodObject",(e,t)=>{Oe.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=u(()=>pt(t));f(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const o=v,i=t.catchall;let s;e._zod.parse=(t,n)=>{s??(s=r.value);const a=t.value;if(!o(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=s.shape;for(const e of s.keys){const r=u[e]._zod.run({value:a[e],issues:[]},n);r instanceof Promise?c.push(r.then(n=>lt(n,t,e,a))):lt(r,t,e,a)}return i?ft(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),mt=r("$ZodObjectJIT",(e,t)=>{ht.init(e,t);const n=e._zod.parse,r=u(()=>pt(t));let o;const i=v,a=!s.jitless,c=a&&g.value,d=t.catchall;let l;e._zod.parse=(s,u)=>{l??(l=r.value);const p=s.value;return i(p)?a&&c&&!1===u?.async&&!0!==u.jitless?(o||(o=(e=>{const t=new xe(["shape","payload","ctx"]),n=r.value,o=e=>{const t=_(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let s=0;for(const e of n.keys)i[e]="key_"+s++;t.write("const newResult = {};");for(const e of n.keys){const n=i[e],r=_(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${r}, ...iss.path] : [${r}]\n })));\n }\n \n \n if (${n}.value === undefined) {\n if (${r} in input) {\n newResult[${r}] = undefined;\n }\n } else {\n newResult[${r}] = ${n}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),s=o(s,u),d?ft([],p,s,u,l,e):s):n(s,u):(s.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),s)}});function _t(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter(e=>!Z(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>E(e,r,a())))}),t)}const yt=r("$ZodUnion",(e,t)=>{Oe.init(e,t),f(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),f(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),f(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),f(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>l(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},i);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then(t=>_t(t,o,e,i)):_t(a,o,e,i)}}),vt=r("$ZodIntersection",(e,t)=>{Oe.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,o=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([t,n])=>wt(e,t,n)):wt(e,o,i)}});function gt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(w(e)&&w(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),o={...e,...t};for(const n of r){const r=gt(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};o[n]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=gt(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function wt(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Z(e))return e;const r=gt(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const zt=r("$ZodRecord",(e,t)=>{Oe.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!w(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[];if(t.keyType._zod.values){const s=t.keyType._zod.values;n.value={};for(const e of s)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){const s=t.valueType._zod.run({value:o[e],issues:[]},r);s instanceof Promise?i.push(s.then(t=>{t.issues.length&&n.issues.push(...S(e,t.issues)),n.value[e]=t.value})):(s.issues.length&&n.issues.push(...S(e,s.issues)),n.value[e]=s.value)}let a;for(const e in o)s.has(e)||(a=a??[],a.push(e));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{n.value={};for(const s of Reflect.ownKeys(o)){if("__proto__"===s)continue;const c=t.keyType._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(c.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(e=>E(e,r,a())),input:s,path:[s],inst:e}),n.value[c.value]=c.value;continue}const u=t.valueType._zod.run({value:o[s],issues:[]},r);u instanceof Promise?i.push(u.then(e=>{e.issues.length&&n.issues.push(...S(s,e.issues)),n.value[c.value]=e.value})):(u.issues.length&&n.issues.push(...S(s,u.issues)),n.value[c.value]=u.value)}}return i.length?Promise.all(i).then(()=>n):n}}),bt=r("$ZodEnum",(e,t)=>{Oe.init(e,t);const n=function(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>b.has(typeof e)).map(e=>"string"==typeof e?k(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),kt=r("$ZodLiteral",(e,t)=>{if(Oe.init(e,t),0===t.values.length)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(e=>"string"==typeof e?k(e):e?k(e.toString()):String(e)).join("|")})$`),e._zod.parse=(n,r)=>{const o=n.value;return e._zod.values.has(o)||n.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),n}}),At=r("$ZodTransform",(e,t)=>{Oe.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new i(e.constructor.name);const s=t.transform(n.value,n);if(r.async){return(s instanceof Promise?s:Promise.resolve(s)).then(e=>(n.value=e,n))}if(s instanceof Promise)throw new o;return n.value=s,n}});function $t(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Zt=r("$ZodOptional",(e,t)=>{Oe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",f(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),f(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${l(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>$t(t,e.value)):$t(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),St=r("$ZodNullable",(e,t)=>{Oe.init(e,t),f(e._zod,"optin",()=>t.innerType._zod.optin),f(e._zod,"optout",()=>t.innerType._zod.optout),f(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${l(e.source)}|null)$`):void 0}),f(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),Pt=r("$ZodDefault",(e,t)=>{Oe.init(e,t),e._zod.optin="optional",f(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Et(e,t)):Et(r,t)}});function Et(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const jt=r("$ZodPrefault",(e,t)=>{Oe.init(e,t),e._zod.optin="optional",f(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),xt=r("$ZodNonOptional",(e,t)=>{Oe.init(e,t),f(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(t=>Tt(t,e)):Tt(o,e)}});function Tt(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Ot=r("$ZodCatch",(e,t)=>{Oe.init(e,t),f(e._zod,"optin",()=>t.innerType._zod.optin),f(e._zod,"optout",()=>t.innerType._zod.optout),f(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>E(e,n,a()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>E(e,n,a()))},input:e.value}),e.issues=[]),e)}}),It=r("$ZodPipe",(e,t)=>{Oe.init(e,t),f(e._zod,"values",()=>t.in._zod.values),f(e._zod,"optin",()=>t.in._zod.optin),f(e._zod,"optout",()=>t.out._zod.optout),f(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ft(e,t.in,n)):Ft(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ft(e,t.out,n)):Ft(r,t.out,n)}});function Ft(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Ct=r("$ZodReadonly",(e,t)=>{Oe.init(e,t),f(e._zod,"propValues",()=>t.innerType._zod.propValues),f(e._zod,"values",()=>t.innerType._zod.values),f(e._zod,"optin",()=>t.innerType._zod.optin),f(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Dt):Dt(r)}});function Dt(e){return e.value=Object.freeze(e.value),e}const Rt=r("$ZodCustom",(e,t)=>{ge.init(e,t),Oe.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>Ut(t,n,r,e));Ut(o,n,r,e)}});function Ut(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(x(e))}}class Nt{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Lt(){return new Nt}const Wt=Lt();function Bt(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...$(t)})}function Mt(e,t){return new we({check:"max_length",...$(t),maximum:e})}function Vt(e,t){return new ze({check:"min_length",...$(t),minimum:e})}function Jt(e,t){return new be({check:"length_equals",...$(t),length:e})}function Kt(e){return new je({check:"overwrite",tx:e})}function qt(e){const t=function(e,t){const n=new ge({check:"custom",...$(t)});return n._zod.check=e,n}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(x(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(x(r))}},e(n.value,n)));return t}const Gt=r("ZodISODateTime",(e,t)=>{Ke.init(e,t),zn.init(e,t)});function Ht(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...$(t)})}(Gt,e)}const Yt=r("ZodISODate",(e,t)=>{qe.init(e,t),zn.init(e,t)});function Xt(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...$(t)})}(Yt,e)}const Qt=r("ZodISOTime",(e,t)=>{Ge.init(e,t),zn.init(e,t)});function en(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...$(t)})}(Qt,e)}const tn=r("ZodISODuration",(e,t)=>{He.init(e,t),zn.init(e,t)});function nn(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...$(t)})}(tn,e)}const rn=r("ZodError",(e,t)=>{O.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>r({issues:e}));else if("invalid_key"===o.code)r({issues:o.issues});else if("invalid_element"===o.code)r({issues:o.issues});else if(0===o.path.length)n._errors.push(t(o));else{let e=n,r=0;for(;r<o.path.length;){const n=o.path[r];r===o.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(o))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,c,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,c,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),on=F(rn),sn=C(rn),an=D(rn),cn=U(rn),un=L(rn),dn=W(rn),ln=B(rn),pn=M(rn),fn=V(rn),hn=J(rn),mn=K(rn),_n=q(rn),yn=r("ZodType",(e,t)=>(Oe.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(m(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]})),e.clone=(t,n)=>A(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>on(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>an(e,t,n),e.parseAsync=async(t,n)=>sn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>cn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>un(e,t,n),e.decode=(t,n)=>dn(e,t,n),e.encodeAsync=async(t,n)=>ln(e,t,n),e.decodeAsync=async(t,n)=>pn(e,t,n),e.safeEncode=(t,n)=>fn(e,t,n),e.safeDecode=(t,n)=>hn(e,t,n),e.safeEncodeAsync=async(t,n)=>mn(e,t,n),e.safeDecodeAsync=async(t,n)=>_n(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...$(n)})}(vr,e,t)}(t,n)),e.superRefine=t=>e.check(qt(t)),e.overwrite=t=>e.check(Kt(t)),e.optional=()=>cr(e),e.nullable=()=>dr(e),e.nullish=()=>cr(dr(e)),e.nonoptional=t=>function(e,t){return new fr({type:"nonoptional",innerType:e,...$(t)})}(e,t),e.array=()=>qn(e),e.or=t=>Xn([e,t]),e.and=t=>new Qn({type:"intersection",left:e,right:t}),e.transform=t=>_r(e,new sr({type:"transform",transform:t})),e.default=t=>{return n=t,new lr({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():z(n)}});var n},e.prefault=t=>{return n=t,new pr({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():z(n)}});var n},e.catch=t=>{return new hr({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>_r(e,t),e.readonly=()=>new yr({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Wt.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Wt.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Wt.get(e);const n=e.clone();return Wt.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),vn=r("_ZodString",(e,t)=>{Ie.init(e,t),yn.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new Ae({check:"string_format",format:"regex",...$(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Se({check:"string_format",format:"includes",...$(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Pe({check:"string_format",format:"starts_with",...$(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Ee({check:"string_format",format:"ends_with",...$(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Vt(...t)),e.max=(...t)=>e.check(Mt(...t)),e.length=(...t)=>e.check(Jt(...t)),e.nonempty=(...t)=>e.check(Vt(1,...t)),e.lowercase=t=>e.check(function(e){return new $e({check:"string_format",format:"lowercase",...$(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Ze({check:"string_format",format:"uppercase",...$(e)})}(t)),e.trim=()=>e.check(Kt(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return Kt(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(Kt(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(Kt(e=>e.toUpperCase()))}),gn=r("ZodString",(e,t)=>{Ie.init(e,t),vn.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...$(t)})}(bn,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...$(t)})}($n,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...$(t)})}(Nn,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...$(t)})}(Zn,t)),e.guid=t=>e.check(Bt(kn,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...$(t)})}(An,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...$(t)})}(An,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...$(t)})}(An,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...$(t)})}(An,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...$(t)})}(Sn,t)),e.guid=t=>e.check(Bt(kn,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...$(t)})}(Pn,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...$(t)})}(En,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...$(t)})}(jn,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...$(t)})}(Dn,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...$(t)})}(Rn,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...$(t)})}(xn,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...$(t)})}(Tn,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...$(t)})}(On,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...$(t)})}(In,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...$(t)})}(Fn,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...$(t)})}(Cn,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...$(t)})}(Un,t)),e.datetime=t=>e.check(Ht(t)),e.date=t=>e.check(Xt(t)),e.time=t=>e.check(en(t)),e.duration=t=>e.check(nn(t))});function wn(e){return function(e,t){return new e({type:"string",...$(t)})}(gn,e)}const zn=r("ZodStringFormat",(e,t)=>{Fe.init(e,t),vn.init(e,t)}),bn=r("ZodEmail",(e,t)=>{Re.init(e,t),zn.init(e,t)}),kn=r("ZodGUID",(e,t)=>{Ce.init(e,t),zn.init(e,t)}),An=r("ZodUUID",(e,t)=>{De.init(e,t),zn.init(e,t)}),$n=r("ZodURL",(e,t)=>{Ue.init(e,t),zn.init(e,t)}),Zn=r("ZodEmoji",(e,t)=>{Ne.init(e,t),zn.init(e,t)}),Sn=r("ZodNanoID",(e,t)=>{Le.init(e,t),zn.init(e,t)}),Pn=r("ZodCUID",(e,t)=>{We.init(e,t),zn.init(e,t)}),En=r("ZodCUID2",(e,t)=>{Be.init(e,t),zn.init(e,t)}),jn=r("ZodULID",(e,t)=>{Me.init(e,t),zn.init(e,t)}),xn=r("ZodXID",(e,t)=>{Ve.init(e,t),zn.init(e,t)}),Tn=r("ZodKSUID",(e,t)=>{Je.init(e,t),zn.init(e,t)}),On=r("ZodIPv4",(e,t)=>{Ye.init(e,t),zn.init(e,t)}),In=r("ZodIPv6",(e,t)=>{Xe.init(e,t),zn.init(e,t)}),Fn=r("ZodCIDRv4",(e,t)=>{Qe.init(e,t),zn.init(e,t)}),Cn=r("ZodCIDRv6",(e,t)=>{et.init(e,t),zn.init(e,t)}),Dn=r("ZodBase64",(e,t)=>{nt.init(e,t),zn.init(e,t)}),Rn=r("ZodBase64URL",(e,t)=>{rt.init(e,t),zn.init(e,t)}),Un=r("ZodE164",(e,t)=>{ot.init(e,t),zn.init(e,t)}),Nn=r("ZodJWT",(e,t)=>{it.init(e,t),zn.init(e,t)}),Ln=r("ZodBoolean",(e,t)=>{st.init(e,t),yn.init(e,t)});function Wn(e){return function(e,t){return new e({type:"boolean",...$(t)})}(Ln,e)}const Bn=r("ZodUnknown",(e,t)=>{at.init(e,t),yn.init(e,t)});function Mn(){return new Bn({type:"unknown"})}const Vn=r("ZodNever",(e,t)=>{ct.init(e,t),yn.init(e,t)});function Jn(e){return function(e,t){return new e({type:"never",...$(t)})}(Vn,e)}const Kn=r("ZodArray",(e,t)=>{dt.init(e,t),yn.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Vt(t,n)),e.nonempty=t=>e.check(Vt(1,t)),e.max=(t,n)=>e.check(Mt(t,n)),e.length=(t,n)=>e.check(Jt(t,n)),e.unwrap=()=>e.element});function qn(e,t){return function(e,t,n){return new e({type:"array",element:t,...$(n)})}(Kn,e,t)}const Gn=r("ZodObject",(e,t)=>{mt.init(e,t),yn.init(e,t),f(e,"shape",()=>t.shape),e.keyof=()=>rr(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Mn()}),e.loose=()=>e.clone({...e._zod.def,catchall:Mn()}),e.strict=()=>e.clone({...e._zod.def,catchall:Jn()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!w(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const r=m(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return h(this,"shape",n),n},checks:[]});return A(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!w(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return h(this,"shape",n),n},checks:e._zod.def.checks};return A(e,n)}(e,t),e.merge=t=>function(e,t){const n=m(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return h(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return A(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return A(e,m(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return h(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=m(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return h(this,"shape",r),r},checks:[]});return A(e,r)}(e,t),e.partial=(...t)=>function(e,t,n){const r=m(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return h(this,"shape",o),o},checks:[]});return A(t,r)}(ar,e,t[0]),e.required=(...t)=>function(e,t,n){const r=m(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)o[t]=new e({type:"nonoptional",innerType:r[t]});return h(this,"shape",o),o},checks:[]});return A(t,r)}(fr,e,t[0])});function Hn(e,t){const n={type:"object",shape:e??{},...$(t)};return new Gn(n)}const Yn=r("ZodUnion",(e,t)=>{yt.init(e,t),yn.init(e,t),e.options=t.options});function Xn(e,t){return new Yn({type:"union",options:e,...$(t)})}const Qn=r("ZodIntersection",(e,t)=>{vt.init(e,t),yn.init(e,t)});const er=r("ZodRecord",(e,t)=>{zt.init(e,t),yn.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function tr(e,t,n){return new er({type:"record",keyType:e,valueType:t,...$(n)})}const nr=r("ZodEnum",(e,t)=>{bt.init(e,t),yn.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const o={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);o[r]=t.entries[r]}return new nr({...t,checks:[],...$(r),entries:o})},e.exclude=(e,r)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new nr({...t,checks:[],...$(r),entries:o})}});function rr(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new nr({type:"enum",entries:n,...$(t)})}const or=r("ZodLiteral",(e,t)=>{kt.init(e,t),yn.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ir(e,t){return new or({type:"literal",values:Array.isArray(e)?e:[e],...$(t)})}const sr=r("ZodTransform",(e,t)=>{At.init(e,t),yn.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new i(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(x(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(x(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n)):(n.value=o,n)}});const ar=r("ZodOptional",(e,t)=>{Zt.init(e,t),yn.init(e,t),e.unwrap=()=>e._zod.def.innerType});function cr(e){return new ar({type:"optional",innerType:e})}const ur=r("ZodNullable",(e,t)=>{St.init(e,t),yn.init(e,t),e.unwrap=()=>e._zod.def.innerType});function dr(e){return new ur({type:"nullable",innerType:e})}const lr=r("ZodDefault",(e,t)=>{Pt.init(e,t),yn.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const pr=r("ZodPrefault",(e,t)=>{jt.init(e,t),yn.init(e,t),e.unwrap=()=>e._zod.def.innerType});const fr=r("ZodNonOptional",(e,t)=>{xt.init(e,t),yn.init(e,t),e.unwrap=()=>e._zod.def.innerType});const hr=r("ZodCatch",(e,t)=>{Ot.init(e,t),yn.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const mr=r("ZodPipe",(e,t)=>{It.init(e,t),yn.init(e,t),e.in=t.in,e.out=t.out});function _r(e,t){return new mr({type:"pipe",in:e,out:t})}const yr=r("ZodReadonly",(e,t)=>{Ct.init(e,t),yn.init(e,t),e.unwrap=()=>e._zod.def.innerType});const vr=r("ZodCustom",(e,t)=>{Rt.init(e,t),yn.init(e,t)});const gr="directus:extension",wr=Hn({app:wn(),api:wn()}),zr=Hn({request:cr(Hn({urls:qn(wn()),methods:qn(Xn([ir("GET"),ir("POST"),ir("PATCH"),ir("PUT"),ir("DELETE")]))})),log:cr(Hn({})),sleep:cr(Hn({}))}),br=cr(Hn({enabled:Wn(),requestedScopes:zr})),kr=Xn([Hn({type:rr(t),name:wn(),source:wn()}),Hn({type:rr(e),name:wn(),source:wn()}),Hn({type:rr(n),name:wn(),source:wr})]),Ar=Hn({host:wn(),hidden:Wn().optional()}),$r=Hn({type:rr(e),path:wn(),source:wn()}),Zr=Hn({type:rr(t),path:wn(),source:wn(),sandbox:br}),Sr=Hn({type:rr(n),path:wr,source:wr,sandbox:br}),Pr=Hn({type:ir("bundle"),partial:Wn().optional(),path:wr,entries:qn(kr)});qn(kr);const Er=Ar.and(Xn([$r,Zr,Sr,Pr]));Hn({name:wn(),version:wn(),type:Xn([ir("module"),ir("commonjs")]).optional(),description:wn().optional(),icon:wn().optional(),dependencies:tr(wn(),wn()).optional(),devDependencies:tr(wn(),wn()).optional(),[gr]:Er});const jr="module_permissions",xr={own_role_only:[],roles:[],hide_navigation:[]},Tr={version:1,rules:[],homes:[],collections:[],sidebar_panels:[],sidebar_modes:[],users:{...xr,own_role_only:[],roles:[],hide_navigation:[]}};function Or(e){if("string"!=typeof e)return null;let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:/i.test(t)||t.startsWith("//")?null:(t=t.split("#")[0]??t,t?(t.startsWith("/")||(t=`/${t}`),"/admin"===t?t="/":t.startsWith("/admin/")&&(t=t.slice(6)||"/"),t.includes("..")||t.length>512?null:(t=t.replace(/\/{2,}/g,"/"),t)):null):null}function Ir(e){return{id:String(e.id),visibility:"show"===e.visibility?"show":"hide",roles:Array.isArray(e.roles)?e.roles.map(String):[],policies:Array.isArray(e.policies)?e.policies.map(String):[],block_routes:!1!==e.block_routes}}function Fr(e){if(!e||"object"!=typeof e)return{...Tr,rules:[],homes:[],collections:[],sidebar_panels:[],sidebar_modes:[],users:{...xr,own_role_only:[],roles:[],hide_navigation:[]}};const t=e,n=Array.isArray(t.rules)?t.rules.filter(e=>Boolean(e&&"object"==typeof e&&e.id)).map(e=>Ir(e)):[],r=Array.isArray(t.homes)?t.homes.filter(e=>Boolean(e&&"object"==typeof e&&e.id)).map(e=>({id:String(e.id),path:"string"==typeof e.path?e.path:"",roles:Array.isArray(e.roles)?e.roles.map(String):[],policies:Array.isArray(e.policies)?e.policies.map(String):[],force:!0===e.force})).filter(e=>function(e){return null!==Or(e)}(e.path)):[],o=Array.isArray(t.collections)?t.collections.filter(e=>Boolean(e&&"object"==typeof e&&e.id)).map(e=>Ir(e)):[],i=Array.isArray(t.sidebar_panels)?t.sidebar_panels.filter(e=>Boolean(e&&"object"==typeof e&&e.id)).map(e=>({id:String(e.id),visibility:"show"===e.visibility?"show":"hide",roles:Array.isArray(e.roles)?e.roles.map(String):[],policies:Array.isArray(e.policies)?e.policies.map(String):[]})):[],s=Array.isArray(t.sidebar_modes)?t.sidebar_modes.filter(e=>Boolean(e&&"object"==typeof e&&e.id&&e.mode)).map(e=>({id:String(e.id),mode:"hidden"===e.mode?"hidden":"collapsed",roles:Array.isArray(e.roles)?e.roles.map(String):[],policies:Array.isArray(e.policies)?e.policies.map(String):[]})):[],a=function(e){if(!e||"object"!=typeof e)return{own_role_only:[],roles:[],hide_navigation:[]};const t=e;return{own_role_only:Array.isArray(t.own_role_only)?t.own_role_only.filter(e=>Boolean(e&&"object"==typeof e&&e.id)).map(e=>({id:String(e.id),roles:Array.isArray(e.roles)?e.roles.map(String):[],policies:Array.isArray(e.policies)?e.policies.map(String):[]})):[],roles:Array.isArray(t.roles)?t.roles.filter(e=>Boolean(e&&"object"==typeof e&&e.id)).map(e=>Ir(e)):[],hide_navigation:Array.isArray(t.hide_navigation)?t.hide_navigation.filter(e=>Boolean(e&&"object"==typeof e&&e.id)).map(e=>({id:String(e.id),modules:Array.isArray(e.modules)?e.modules.map(String).filter(Boolean):[],roles:Array.isArray(e.roles)?e.roles.map(String):[],policies:Array.isArray(e.policies)?e.policies.map(String):[]})).filter(e=>e.modules.length>0):[]}}(t.users),c=Array.isArray(t.blocked_ids)?t.blocked_ids.map(String):void 0,u=Array.isArray(t.blocked_collection_ids)?t.blocked_collection_ids.map(String):void 0,d=null===t.home_path?null:"string"==typeof t.home_path?Or(t.home_path):void 0,l="boolean"==typeof t.home_force?t.home_force:void 0,p=Array.isArray(t.sidebar_hidden_panels)?t.sidebar_hidden_panels.map(String):void 0,f="collapsed"===t.sidebar_mode||"hidden"===t.sidebar_mode||"default"===t.sidebar_mode?t.sidebar_mode:void 0,h="boolean"==typeof t.users_own_role_only?t.users_own_role_only:void 0,m=Array.isArray(t.users_allowed_role_ids)?t.users_allowed_role_ids.map(String):void 0,_=Array.isArray(t.users_hidden_role_ids)?t.users_hidden_role_ids.map(String):void 0,y=Array.isArray(t.users_blocked_role_ids)?t.users_blocked_role_ids.map(String):void 0,v=Array.isArray(t.navigation_hidden_modules)?t.navigation_hidden_modules.map(String):void 0;return{version:1,rules:n,homes:r,collections:o,sidebar_panels:i,sidebar_modes:s,users:a,...c?{blocked_ids:c}:{},...u?{blocked_collection_ids:u}:{},...void 0!==d?{home_path:d}:{},...void 0!==l?{home_force:l}:{},...p?{sidebar_hidden_panels:p}:{},...f?{sidebar_mode:f}:{},...void 0!==h?{users_own_role_only:h}:{},...m?{users_allowed_role_ids:m}:{},..._?{users_hidden_role_ids:_}:{},...y?{users_blocked_role_ids:y}:{},...v?{navigation_hidden_modules:v}:{}}}function Cr(e){return(e.roles?.length??0)>0||(e.policies?.length??0)>0}function Dr(e,t){if(!Cr(e))return!1;const n=new Set(t.roleIds),r=new Set(t.policyIds);return!!(e.roles||[]).some(e=>n.has(e))||!!(e.policies||[]).some(e=>r.has(e))}function Rr(e,t){if(!e||!Cr(e))return!1;const n=Dr(e,t);return!("hide"!==e.visibility||!n)||"show"===e.visibility&&!n}function Ur(e,t,n){if(!Array.isArray(e))return[];const r=Fr(t).rules,o=new Map(r.map(e=>[e.id,e])),i=[];for(const t of e){const e=Rr(o.get(t.id),n);if("link"!==t.type)e?i.push({...t,enabled:!1}):i.push({...t});else{if(!1===t.enabled||e)continue;i.push({...t})}}return i}function Nr(e,t,n){if(!Array.isArray(e))return[];const r=Fr(t).rules,o=new Map(r.map(e=>[e.id,e])),i=[];for(const t of e){const e=o.get(t.id);Rr(e,n)&&(e&&!1===e.block_routes||i.push(t.id))}return i}function Lr(e,t){const n=Fr(e).collections,r=[];for(const e of n)Rr(e,t)&&!1!==e.block_routes&&r.push(e.id);return r}function Wr(e,t){const n=Fr(e).homes;if(!n.length)return null;const r=n.filter(e=>Cr(e)),o=n.filter(e=>!Cr(e));for(const e of r){if(!Dr(e,t))continue;const n=Or(e.path);if(n)return{path:n,force:!0===e.force}}for(const e of o){const t=Or(e.path);if(t)return{path:t,force:!0===e.force}}return null}function Br(e,t){return Wr(e,t)?.path??null}function Mr(e,t){return!0===Wr(e,t)?.force}function Vr(e,t){const n=Fr(e).sidebar_panels,r=[];for(const e of n)Rr(e,t)&&r.push(String(e.id));return r}function Jr(e,t){const n=Fr(e).sidebar_modes;if(!n.length)return"default";const r=n.filter(e=>Cr(e)),o=n.filter(e=>!Cr(e));for(const e of r)if(Dr(e,t))return e.mode;return o[0]?o[0].mode:"default"}function Kr(e,t){const n=Fr(e).users.own_role_only;if(!n.length)return!1;const r=n.filter(e=>Cr(e)),o=n.filter(e=>!Cr(e));for(const e of r)if(Dr(e,t))return!0;return o.length>0}function qr(e){return[...e.roleIds]}function Gr(e,t){const n=Fr(e).users.roles,r=[];for(const e of n)Rr(e,t)&&r.push(String(e.id));return r}function Hr(e,t){const n=Fr(e).users.roles,r=[];for(const e of n)Rr(e,t)&&!1!==e.block_routes&&r.push(String(e.id));return r}function Yr(e,t){const n=Fr(e).users.hide_navigation,r=new Set,o=n.filter(e=>Cr(e)),i=n.filter(e=>!Cr(e));for(const e of o)if(Dr(e,t))for(const t of e.modules)r.add(String(t));for(const e of i)for(const t of e.modules)r.add(String(t));return[...r]}function Xr(e,t,n){if(!Array.isArray(e))return[];const r=Fr(t),o=Kr(r,n),i=(r.users?.roles?.length??0)>0;if(!o&&!i)return e;const s=e.filter(e=>{const t=e?.id;return!t||function(e,t,n){const r=Fr(t),o=Kr(r,n),i=new Set(qr(n));return!(new Set(Gr(r,n)).has(String(e))||o&&!i.has(String(e)))}(String(t),r,n)}),a=new Set(s.map(e=>String(e.id)).filter(Boolean));return s.map(e=>{const t=e?.parent;return null==t||""===t||a.has(String(t))?e:{...e,parent:null}})}async function Qr(e,t){const n=new Set,r=new Set;if(!t?.user&&!t?.role)return{roleIds:[],policyIds:[]};if(t.role&&n.add(t.role),Array.isArray(t.roles))for(const e of t.roles)e&&n.add(String(e));for(const t of[...n]){let r=t;for(let t=0;t<25&&r;t++){const t=await e("directus_roles").select("parent").where({id:r}).first();if(!t?.parent)break;const o=String(t.parent);if(n.has(o))break;n.add(o),r=o}}const o=e("directus_access").select("policy");o.where(e=>{let r=!1;t.user&&(e.where({user:t.user}),r=!0),n.size>0&&(r?e.orWhereIn("role",[...n]):e.whereIn("role",[...n]))});const i=await o;for(const e of i||[])e?.policy&&r.add(String(e.policy));return{roleIds:[...n],policyIds:[...r]}}async function eo(e){try{const t=await e("directus_settings").select(jr).first();return Fr(t?.[jr])}catch{return{...Tr}}}var to=({filter:e,action:t,init:n},{services:r,database:o,getSchema:i,logger:s})=>{let a=null;const c=()=>(a||(a=async function(e,t,n,r){try{const o=await n.schema.hasColumn("directus_settings",jr);if(o&&await n("directus_fields").where({collection:"directus_settings",field:jr}).first())return;const i=await t(),{FieldsService:s}=e,a=new s({schema:i,accountability:{admin:!0}}),c=await a.readAll("directus_settings"),u=c?.some(e=>e.field===jr);if(u&&o)return;o&&u||(await a.createField("directus_settings",{field:jr,type:"json",meta:{collection:"directus_settings",field:jr,special:["cast-json"],interface:"input-code",hidden:!0,readonly:!1,width:"full",note:"Managed by Module Permissions extension. Do not edit manually."},schema:{default_value:JSON.stringify(Tr)}}),r.info(`[module-permissions] Created directus_settings.${jr}`))}catch(e){const t=String(e?.message||e||"");if(/already exists|duplicate|SQLITE_ERROR/i.test(t))return void r.warn(`[module-permissions] Field ensure skipped: ${t}`);r.error(`[module-permissions] Failed to ensure field: ${t}`)}}(r,i,o,s)),a);n("app.before",async()=>{await c()}),t("server.start",async()=>{await c()}),e("settings.read",async(e,t,n)=>{await c();const r=n?.accountability??null;if(r?.admin)return e;const i=function(e){return Array.isArray(e)?e:e&&"object"==typeof e&&Array.isArray(e.data)?e.data:null}(e);if(!i?.length)return e;const s=await Qr(o,r);for(const e of i){if(!e||"object"!=typeof e)continue;const t=Fr(e[jr]),n=e.module_bar;e.module_bar=Ur(n,t,s);const r=Kr(t,s);e[jr]={version:1,rules:[],homes:[],collections:[],sidebar_panels:[],sidebar_modes:[],users:{own_role_only:[],roles:[],hide_navigation:[]},blocked_ids:Nr(n,t,s),blocked_collection_ids:Lr(t,s),home_path:Br(t,s),home_force:Mr(t,s),sidebar_hidden_panels:Vr(t,s),sidebar_mode:Jr(t,s),users_own_role_only:r,...r?{users_allowed_role_ids:qr(s)}:{},users_hidden_role_ids:Gr(t,s),users_blocked_role_ids:Hr(t,s),navigation_hidden_modules:Yr(t,s)}}return e}),e("collections.read",async(e,t,n)=>{await c();const r=n?.accountability??null;if(r?.admin)return e;const i=function(e){return Array.isArray(e)?{list:e,wrap:e=>e}:e&&"object"==typeof e&&Array.isArray(e.data)?{list:e.data,wrap:t=>({...e,data:t})}:null}(e);if(!i?.list?.length)return e;const s=await eo(o);if(!s.collections.length)return e;const a=await Qr(o,r),u=function(e,t,n){if(!Array.isArray(e))return[];const r=Fr(t).collections,o=new Map(r.map(e=>[e.id,e]));return e.map(e=>{const t=e?.collection||e?.meta?.collection;if(!t)return e;if(!Rr(o.get(String(t)),n))return e;const r={...e};return r.meta={...e.meta||{},hidden:!0},"hidden"in r&&(r.hidden=!0),r})}(i.list,s,a);return i.wrap?i.wrap(u):u}),e("roles.read",async(e,t,n)=>{await c();const r=n?.accountability??null;if(!r?.user||r.admin)return e;const i=function(e){return Array.isArray(e)?{list:e,wrap:e=>e}:e&&"object"==typeof e&&Array.isArray(e.data)?{list:e.data,wrap:t=>({...e,data:t})}:null}(e);if(!i?.list?.length)return e;const s=await eo(o),a=await Qr(o,r);if(!(Kr(s,a)||s.users?.roles?.length>0))return e;const u=Xr(i.list,s,a);return i.wrap?i.wrap(u):u}),e("settings.update",async(e,t,n)=>{const r=n?.accountability??null;return r?.admin?e:e&&"object"==typeof e?(jr in e&&delete e[jr],"module_bar"in e&&delete e.module_bar,e):e})};const no=[{name:"module-permissions-hook",config:to}],ro=[],oo=[];export{ro as endpoints,no as hooks,oo as operations};
|
package/dist/app.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{useApi as e,useStores as t,defineModule as n}from"@directus/extensions-sdk";import*as o from"vue";import{ref as i,computed as r,defineComponent as a,resolveComponent as l,openBlock as s,createBlock as c,withCtx as d,createVNode as u,onMounted as f,resolveDirective as p,createElementVNode as m,normalizeClass as v,unref as h,createElementBlock as g,Fragment as b,renderList as y,createTextVNode as _,toDisplayString as w,createCommentVNode as x,withModifiers as S,withDirectives as k,isRef as E}from"vue";import{useI18n as C}from"vue-i18n";const A="module_permissions",O=[{id:"layout",name:"Layout Options",icon:"layers",context:"collection"},{id:"archive",name:"Archive",icon:"archive",context:"collection"},{id:"refresh",name:"Auto Refresh",icon:"sync",context:"collection"},{id:"export",name:"Import / Export",icon:"import_export",context:"collection"},{id:"revisions",name:"Revisions",icon:"change_history",context:"item"},{id:"comments",name:"Comments",icon:"chat_bubble_outline",context:"item"},{id:"shares",name:"Shares",icon:"share",context:"item"},{id:"flows",name:"Flows",icon:"bolt",context:"both"},{id:"activity",name:"Activity Log",icon:"pending_actions",context:"both"}],D={own_role_only:[],roles:[],hide_navigation:[]},I={version:1,rules:[],homes:[],collections:[],sidebar_panels:[],sidebar_modes:[],users:{...D,own_role_only:[],roles:[],hide_navigation:[]}};function R(e){if("string"!=typeof e)return null;let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:/i.test(t)||t.startsWith("//")?null:(t=t.split("#")[0]??t,t?(t.startsWith("/")||(t=`/${t}`),"/admin"===t?t="/":t.startsWith("/admin/")&&(t=t.slice(6)||"/"),t.includes("..")||t.length>512?null:(t=t.replace(/\/{2,}/g,"/"),t)):null):null}function P(e){return null!==R(e)}function T(e){return{id:String(e.id),visibility:"show"===e.visibility?"show":"hide",roles:Array.isArray(e.roles)?e.roles.map(String):[],policies:Array.isArray(e.policies)?e.policies.map(String):[],block_routes:!1!==e.block_routes}}function M(e){if(!e||"object"!=typeof e)return{...I,rules:[],homes:[],collections:[],sidebar_panels:[],sidebar_modes:[],users:{...D,own_role_only:[],roles:[],hide_navigation:[]}};const t=e,n=Array.isArray(t.rules)?t.rules.filter(e=>Boolean(e&&"object"==typeof e&&e.id)).map(e=>T(e)):[],o=Array.isArray(t.homes)?t.homes.filter(e=>Boolean(e&&"object"==typeof e&&e.id)).map(e=>({id:String(e.id),path:"string"==typeof e.path?e.path:"",roles:Array.isArray(e.roles)?e.roles.map(String):[],policies:Array.isArray(e.policies)?e.policies.map(String):[],force:!0===e.force})).filter(e=>P(e.path)):[],i=Array.isArray(t.collections)?t.collections.filter(e=>Boolean(e&&"object"==typeof e&&e.id)).map(e=>T(e)):[],r=Array.isArray(t.sidebar_panels)?t.sidebar_panels.filter(e=>Boolean(e&&"object"==typeof e&&e.id)).map(e=>({id:String(e.id),visibility:"show"===e.visibility?"show":"hide",roles:Array.isArray(e.roles)?e.roles.map(String):[],policies:Array.isArray(e.policies)?e.policies.map(String):[]})):[],a=Array.isArray(t.sidebar_modes)?t.sidebar_modes.filter(e=>Boolean(e&&"object"==typeof e&&e.id&&e.mode)).map(e=>({id:String(e.id),mode:"hidden"===e.mode?"hidden":"collapsed",roles:Array.isArray(e.roles)?e.roles.map(String):[],policies:Array.isArray(e.policies)?e.policies.map(String):[]})):[],l=function(e){if(!e||"object"!=typeof e)return{own_role_only:[],roles:[],hide_navigation:[]};const t=e;return{own_role_only:Array.isArray(t.own_role_only)?t.own_role_only.filter(e=>Boolean(e&&"object"==typeof e&&e.id)).map(e=>({id:String(e.id),roles:Array.isArray(e.roles)?e.roles.map(String):[],policies:Array.isArray(e.policies)?e.policies.map(String):[]})):[],roles:Array.isArray(t.roles)?t.roles.filter(e=>Boolean(e&&"object"==typeof e&&e.id)).map(e=>T(e)):[],hide_navigation:Array.isArray(t.hide_navigation)?t.hide_navigation.filter(e=>Boolean(e&&"object"==typeof e&&e.id)).map(e=>({id:String(e.id),modules:Array.isArray(e.modules)?e.modules.map(String).filter(Boolean):[],roles:Array.isArray(e.roles)?e.roles.map(String):[],policies:Array.isArray(e.policies)?e.policies.map(String):[]})).filter(e=>e.modules.length>0):[]}}(t.users),s=Array.isArray(t.blocked_ids)?t.blocked_ids.map(String):void 0,c=Array.isArray(t.blocked_collection_ids)?t.blocked_collection_ids.map(String):void 0,d=null===t.home_path?null:"string"==typeof t.home_path?R(t.home_path):void 0,u="boolean"==typeof t.home_force?t.home_force:void 0,f=Array.isArray(t.sidebar_hidden_panels)?t.sidebar_hidden_panels.map(String):void 0,p="collapsed"===t.sidebar_mode||"hidden"===t.sidebar_mode||"default"===t.sidebar_mode?t.sidebar_mode:void 0,m="boolean"==typeof t.users_own_role_only?t.users_own_role_only:void 0,v=Array.isArray(t.users_allowed_role_ids)?t.users_allowed_role_ids.map(String):void 0,h=Array.isArray(t.users_hidden_role_ids)?t.users_hidden_role_ids.map(String):void 0,g=Array.isArray(t.users_blocked_role_ids)?t.users_blocked_role_ids.map(String):void 0,b=Array.isArray(t.navigation_hidden_modules)?t.navigation_hidden_modules.map(String):void 0;return{version:1,rules:n,homes:o,collections:i,sidebar_panels:r,sidebar_modes:a,users:l,...s?{blocked_ids:s}:{},...c?{blocked_collection_ids:c}:{},...void 0!==d?{home_path:d}:{},...void 0!==u?{home_force:u}:{},...f?{sidebar_hidden_panels:f}:{},...p?{sidebar_mode:p}:{},...void 0!==m?{users_own_role_only:m}:{},...v?{users_allowed_role_ids:v}:{},...h?{users_hidden_role_ids:h}:{},...g?{users_blocked_role_ids:g}:{},...b?{navigation_hidden_modules:b}:{}}}function V(e){return(e.roles?.length??0)>0||(e.policies?.length??0)>0}function U(e,t){if(!e||!V(e))return!1;const n=function(e,t){if(!V(e))return!1;const n=new Set(t.roleIds),o=new Set(t.policyIds);return!!(e.roles||[]).some(e=>n.has(e))||!!(e.policies||[]).some(e=>o.has(e))}(e,t);return!("hide"!==e.visibility||!n)||"show"===e.visibility&&!n}function j(e,t){const n=R(e);if(!n||"/"===n)return!1;const o=t instanceof Set?t:new Set(t),i=N(n);return!!i&&o.has(i)}function N(e){const t=R(e);if(!t||"/"===t)return null;return t.split("/").filter(Boolean)[0]||null}function L(e){const t=R(e);if(!t)return null;const n=t.split("/").filter(Boolean);return"content"!==n[0]?null:n[1]&&"+"!==n[1]?n[1]:null}function $(e){return e.map(e=>{if("link"===e.type){const{type:t,id:n,name:o,url:i,icon:r,enabled:a,locked:l}=e;return{type:t,id:n,name:o,url:i,icon:r,enabled:a,locked:l}}const{type:t,id:n,enabled:o,locked:i}=e;return{type:t,id:n,enabled:o,locked:i}})}function F(e){const t=M(e);return{version:1,rules:t.rules,homes:t.homes.map(e=>({id:e.id,path:R(e.path)||e.path,roles:e.roles,policies:e.policies,force:!0===e.force})),collections:t.collections,sidebar_panels:t.sidebar_panels,sidebar_modes:t.sidebar_modes,users:{own_role_only:t.users.own_role_only,roles:t.users.roles,hide_navigation:t.users.hide_navigation}}}const B={content:{name:"Content",icon:"box"},visual:{name:"Visual Editor",icon:"design_services"},users:{name:"User Directory",icon:"people_alt"},files:{name:"File Library",icon:"folder"},insights:{name:"Insights",icon:"insights"},settings:{name:"Settings",icon:"settings"},docs:{name:"Documentation",icon:"help"},deployments:{name:"Deployments",icon:"rocket_launch"},activity:{name:"Activity",icon:"history"}};function H(e,t){const n=B[e];return{name:t?.name||n?.name||e,icon:t?.icon||n?.icon||"box"}}function q(e){return JSON.parse(JSON.stringify(e))}function X(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Y(e,t){if("string"!=typeof e)return String(e??"");if(!e.startsWith("$t:"))return e;const n=e.slice(3).trim();if(!n)return e;try{const e=t(n);if(e&&e!==n)return e}catch{}return n}const z=i(!0),W=i(!1),G=i(!1),K=i([]),J=i(q(I)),Q=i([]),Z=i(q(I)),ee=i([]),te=i([]),ne=i(null),oe=i(null),ie=i(null),re=i(null),ae=i(null),le=i(null),se=i([]),ce=i(null),de=i(null),ue=i(null),fe=i(null),pe=i(null),me=i(null),ve=i(null),he=i(null),ge=i(null),be=i(null),ye=i(null),_e=i(null);let we=null;function xe(e){const t=J.value.users||D;return{version:1,rules:e.rules??J.value.rules??[],homes:e.homes??J.value.homes??[],collections:e.collections??J.value.collections??[],sidebar_panels:e.sidebar_panels??J.value.sidebar_panels??[],sidebar_modes:e.sidebar_modes??J.value.sidebar_modes??[],users:e.users?{own_role_only:e.users.own_role_only??t.own_role_only??[],roles:e.users.roles??t.roles??[],hide_navigation:e.users.hide_navigation??t.hide_navigation??[]}:{own_role_only:t.own_role_only??[],roles:t.roles??[],hide_navigation:t.hide_navigation??[]}}}function Se(){const n=e(),{t:o}=C(),{useSettingsStore:i,useUserStore:a}=t(),l=i(),s=a(),c=r({get:()=>J.value.homes||[],set(e){J.value=xe({homes:e})}}),d=r({get:()=>K.value.map(e=>{if("link"===e.type)return{...e,to:e.url,name:e.name,icon:e.icon||"link"};const t=H(e.id);return{...e,to:`/${e.id}`,name:t.name,icon:t.icon}}),set(e){K.value=$(e)}}),u=r(()=>!X($(K.value),$(Q.value))||!X(F(J.value),F(Z.value))),f=r(()=>{const e=oe.value;return!e||(!e.name?.trim()||!e.icon?.trim()||!e.url?.trim())}),p=r(()=>{const e=le.value;return!e||!P(e.path)});function m(){ne.value=null,oe.value=null}function v(){ae.value=null,le.value=null}function h(){ie.value=null,re.value=null}const g=r(()=>(J.value.collections||[]).map(e=>function(e){const t=se.value.find(t=>t.collection===e);return{collection:e,name:t?.name||e,icon:t?.icon||"box"}}(e.id))),b=r(()=>{const e=new Set((J.value.collections||[]).map(e=>e.id)),t="+"===ce.value?null:ce.value;return se.value.filter(n=>!e.has(n.collection)||n.collection===t).map(e=>({text:e.name===e.collection?e.collection:`${e.name} (${e.collection})`,value:e.collection}))}),y=r(()=>{const e=de.value;return!e||(!e.id?.trim()||0===(e.roles?.length??0)&&0===(e.policies?.length??0))});function _(){ce.value=null,de.value=null}const w=O,x=r({get:()=>J.value.sidebar_modes||[],set(e){J.value=xe({sidebar_modes:e})}});function S(){ue.value=null,fe.value=null}function k(){pe.value=null,me.value=null}const E=r({get:()=>J.value.users?.own_role_only||[],set(e){J.value=xe({users:{...J.value.users||D,own_role_only:e}})}});function T(){ve.value=null,he.value=null}const V=r(()=>(J.value.users?.roles||[]).map(e=>{const t=ee.value.find(t=>t.value===e.id);return{id:e.id,name:t?.text||e.id}})),U=r(()=>{const e=new Set((J.value.users?.roles||[]).map(e=>e.id)),t="+"===ge.value?null:ge.value;return ee.value.filter(n=>!e.has(n.value)||n.value===t)}),j=r(()=>{const e=be.value;return!e||(!e.id?.trim()||0===(e.roles?.length??0)&&0===(e.policies?.length??0))});function N(){ge.value=null,be.value=null}const L=r({get:()=>J.value.users?.hide_navigation||[],set(e){J.value=xe({users:{...J.value.users||D,hide_navigation:e}})}}),B=r(()=>{const e=K.value.filter(e=>"module"===e.type).map(e=>({text:H(e.id).name||e.id,value:e.id})),t=new Set(e.map(e=>e.value));for(const n of["content","users","files","insights","settings","module-permissions"]){if(t.has(n))continue;const o=H(n);e.push({text:o.name||n,value:n})}return e.sort((e,t)=>e.text.localeCompare(t.text))}),Se=r(()=>{const e=_e.value;return!e||0===(e.modules?.length??0)});function ke(){ye.value=null,_e.value=null}async function Ee(){z.value=!0;try{await(l.hydrate?.())}catch{}try{const e=await n.get("/settings",{params:{fields:["module_bar",A]}}),t=e.data?.data,i=Array.isArray(t)?t[0]:t,r=function(e){const t=new Set(e.filter(e=>"module"===e.type).map(e=>e.id)),n=[];t.has("module-permissions")||n.push({type:"module",id:"module-permissions",enabled:!0});for(const e of["content","users","files","insights","settings"])t.has(e)||n.push({type:"module",id:e,enabled:!1,locked:"settings"===e||void 0});return[...e,...n]}(Array.isArray(i?.module_bar)?q(i.module_bar):[]),a=M(i?.[A]);K.value=r,J.value=a,Q.value=q(r),Z.value=q(a),await async function(){const[e,t]=await Promise.all([n.get("/roles",{params:{limit:-1,fields:["id","name"],sort:"name"}}),n.get("/policies",{params:{limit:-1,fields:["id","name"],sort:"name"}})]);ee.value=(e.data?.data||[]).map(e=>({text:Y(e.name,o),value:e.id})),te.value=(t.data?.data||[]).map(e=>({text:Y(e.name,o),value:e.id}))}(),await async function(){try{const e=await n.get("/collections",{params:{limit:-1}}),t=e.data?.data||[];se.value=t.filter(e=>{const t=e?.collection;return!(!t||"string"!=typeof t)&&!t.startsWith("directus_")&&(null!==e?.meta?.accountability||null!==e?.schema)&&(null!==e?.schema||!0===e?.meta?.singleton||e?.meta)}).map(e=>({collection:e.collection,name:e.meta?.translations?.[0]?.translation||e.meta?.collection||e.collection,icon:e.meta?.icon||(null===e.schema?"folder":"box")})).sort((e,t)=>e.name.localeCompare(t.name))}catch{se.value=[]}}()}finally{z.value=!1}}return{loading:z,saving:W,cleaning:G,hasEdits:u,previewItems:d,homeItems:c,roleOptions:ee,policyOptions:te,linkEditing:ne,linkValues:oe,linkSaveDisabled:f,ruleEditingId:ie,ruleDraft:re,homeEditing:ae,homeDraft:le,homeSaveDisabled:p,collectionCatalog:se,configuredCollections:g,availableCollectionOptions:b,collectionEditingId:ce,collectionDraft:de,collectionSaveDisabled:y,sidebarPanelCatalog:w,sidebarPanelEditingId:ue,sidebarPanelDraft:fe,sidebarModeItems:x,sidebarModeEditing:pe,sidebarModeDraft:me,usersOwnRoleItems:E,usersOwnRoleEditing:ve,usersOwnRoleDraft:he,configuredUsersRoles:V,availableUsersRoleOptions:U,usersRoleEditingId:ge,usersRoleDraft:be,usersRoleSaveDisabled:j,hideNavItems:L,hideNavEditing:ye,hideNavDraft:_e,hideNavSaveDisabled:Se,moduleSelectOptions:B,hasRule:function(e){const t=J.value.rules.find(t=>t.id===e);return!!t&&((t.roles?.length??0)>0||(t.policies?.length??0)>0)},ruleSummary:function(e){const t=J.value.rules.find(t=>t.id===e);if(!t)return"";const n=(t.roles?.length??0)+(t.policies?.length??0);return`${"show"===t.visibility?"Show":"Hide"} · ${n}`},homeSummary:function(e){const t=e.roles?.length??0,n=e.policies?.length??0,o=e.force?"Force · ":"";return 0===t&&0===n?`${o}Catch-all default`:`${o}${t} role(s) · ${n} polic(ies)`},hasCollectionRule:function(e){const t=(J.value.collections||[]).find(t=>t.id===e);return!!t&&((t.roles?.length??0)>0||(t.policies?.length??0)>0)},collectionRuleSummary:function(e){const t=(J.value.collections||[]).find(t=>t.id===e);if(!t)return"";const n=(t.roles?.length??0)+(t.policies?.length??0);return`${"show"===t.visibility?"Show":"Hide"} · ${n}`},hasSidebarPanelRule:function(e){const t=(J.value.sidebar_panels||[]).find(t=>t.id===e);return!!t&&((t.roles?.length??0)>0||(t.policies?.length??0)>0)},sidebarPanelRuleSummary:function(e){const t=(J.value.sidebar_panels||[]).find(t=>t.id===e);if(!t)return"";const n=(t.roles?.length??0)+(t.policies?.length??0);return`${"show"===t.visibility?"Show":"Hide"} · ${n}`},sidebarModeSummary:function(e){const t=e.roles?.length??0,n=e.policies?.length??0,o="hidden"===e.mode?"Force hidden":"Force collapsed";return 0===t&&0===n?`${o} · Catch-all`:`${o} · ${t} role(s) · ${n} polic(ies)`},usersOwnRoleSummary:function(e){const t=e.roles?.length??0,n=e.policies?.length??0;return 0===t&&0===n?"Catch-all":`${t} role(s) · ${n} polic(ies)`},hasUsersRoleRule:function(e){const t=(J.value.users?.roles||[]).find(t=>t.id===e);return!!t&&((t.roles?.length??0)>0||(t.policies?.length??0)>0)},usersRoleRuleSummary:function(e){const t=(J.value.users?.roles||[]).find(t=>t.id===e);if(!t)return"";const n=(t.roles?.length??0)+(t.policies?.length??0);return`${"show"===t.visibility?"Show":"Hide"} · ${n}`},hideNavSummary:function(e){const t=(e.modules||[]).join(", ")||"—",n=e.roles?.length??0,o=e.policies?.length??0;return`${t} · ${0===n&&0===o?"Catch-all":`${n} role(s) · ${o} polic(ies)`}`},toggleEnabled:function(e,t){K.value=K.value.map(n=>n.id===e.id?{...n,enabled:Boolean(t)}:n)},editLink:function(e){if(ne.value=e,"+"===e)return void(oe.value={id:crypto.randomUUID(),type:"link",enabled:!0,url:"",name:"",icon:"link"});const t=K.value.find(t=>t.id===e&&"link"===t.type);oe.value=t?q(t):null},closeLinkEditor:m,onLinkDrawerToggle:function(e){e||m()},saveLink:function(){oe.value&&!f.value&&ne.value&&("+"===ne.value?K.value=[...K.value,{...oe.value}]:K.value=K.value.map(e=>e.id===ne.value?{...oe.value}:e),m())},removeLink:function(e){K.value=K.value.filter(t=>t.id!==e),J.value=xe({rules:J.value.rules.filter(t=>t.id!==e)})},editHome:function(e){if(ae.value=e,"+"===e)return void(le.value={id:crypto.randomUUID(),path:"/content",roles:[],policies:[],force:!1});const t=(J.value.homes||[]).find(t=>t.id===e);le.value=t?q(t):null},closeHomeEditor:v,onHomeDrawerToggle:function(e){e||v()},saveHome:function(){if(!le.value||p.value||!ae.value)return;const e=R(le.value.path);if(!e)return;const t={id:"+"===ae.value?le.value.id:ae.value,path:e,roles:[...le.value.roles||[]],policies:[...le.value.policies||[]],force:!0===le.value.force},n=[...J.value.homes||[]];if("+"===ae.value)n.push(t);else{const e=n.findIndex(e=>e.id===ae.value);-1===e?n.push(t):n[e]=t}J.value=xe({homes:n}),v()},removeHome:function(e){J.value=xe({homes:(J.value.homes||[]).filter(t=>t.id!==e)})},openRuleEditor:function(e){ie.value=e.id;const t=J.value.rules.find(t=>t.id===e.id);re.value=t?q(t):{id:e.id,visibility:"hide",roles:[],policies:[],block_routes:!0}},closeRuleEditor:h,onRuleDrawerToggle:function(e){e||h()},saveRule:function(){if(!re.value||!ie.value)return;const e={...re.value,id:ie.value,roles:[...re.value.roles||[]],policies:[...re.value.policies||[]],block_routes:!1!==re.value.block_routes},t=J.value.rules.filter(e=>e.id!==ie.value);0===e.roles.length&&0===e.policies.length?J.value=xe({rules:t}):J.value=xe({rules:[...t,e]}),h()},clearRule:function(){ie.value&&(J.value=xe({rules:J.value.rules.filter(e=>e.id!==ie.value)}),h())},openCollectionEditor:function(e){if(ce.value=e,"+"===e)return void(de.value={id:"",visibility:"hide",roles:[],policies:[],block_routes:!0});const t=(J.value.collections||[]).find(t=>t.id===e);de.value=t?q(t):{id:e,visibility:"hide",roles:[],policies:[],block_routes:!0}},closeCollectionEditor:_,onCollectionDrawerToggle:function(e){e||_()},saveCollectionRule:function(){if(!de.value||!ce.value||y.value)return;const e=String(de.value.id).trim();if(!e)return;const t={...de.value,id:e,roles:[...de.value.roles||[]],policies:[...de.value.policies||[]],block_routes:!1!==de.value.block_routes},n="+"===ce.value?e:ce.value,o=(J.value.collections||[]).filter(t=>t.id!==n&&t.id!==e);J.value=xe({collections:[...o,t]}),_()},clearCollectionRule:function(){ce.value&&"+"!==ce.value&&(J.value=xe({collections:(J.value.collections||[]).filter(e=>e.id!==ce.value)}),_())},removeCollectionRule:function(e){J.value=xe({collections:(J.value.collections||[]).filter(t=>t.id!==e)})},openSidebarPanelEditor:function(e){ue.value=e;const t=(J.value.sidebar_panels||[]).find(t=>t.id===e);fe.value=t?q(t):{id:e,visibility:"hide",roles:[],policies:[]}},closeSidebarPanelEditor:S,onSidebarPanelDrawerToggle:function(e){e||S()},saveSidebarPanelRule:function(){if(!fe.value||!ue.value)return;const e={...fe.value,id:ue.value,roles:[...fe.value.roles||[]],policies:[...fe.value.policies||[]]},t=(J.value.sidebar_panels||[]).filter(e=>e.id!==ue.value);0===e.roles.length&&0===e.policies.length?J.value=xe({sidebar_panels:t}):J.value=xe({sidebar_panels:[...t,e]}),S()},clearSidebarPanelRule:function(){ue.value&&(J.value=xe({sidebar_panels:(J.value.sidebar_panels||[]).filter(e=>e.id!==ue.value)}),S())},editSidebarMode:function(e){if(pe.value=e,"+"===e)return void(me.value={id:crypto.randomUUID(),mode:"collapsed",roles:[],policies:[]});const t=(J.value.sidebar_modes||[]).find(t=>t.id===e);me.value=t?q(t):null},closeSidebarModeEditor:k,onSidebarModeDrawerToggle:function(e){e||k()},saveSidebarMode:function(){if(!me.value||!pe.value)return;const e={id:"+"===pe.value?me.value.id:pe.value,mode:"hidden"===me.value.mode?"hidden":"collapsed",roles:[...me.value.roles||[]],policies:[...me.value.policies||[]]},t=[...J.value.sidebar_modes||[]];if("+"===pe.value)t.push(e);else{const n=t.findIndex(e=>e.id===pe.value);-1===n?t.push(e):t[n]=e}J.value=xe({sidebar_modes:t}),k()},removeSidebarMode:function(e){J.value=xe({sidebar_modes:(J.value.sidebar_modes||[]).filter(t=>t.id!==e)})},editUsersOwnRole:function(e){if(ve.value=e,"+"===e)return void(he.value={id:crypto.randomUUID(),roles:[],policies:[]});const t=(J.value.users?.own_role_only||[]).find(t=>t.id===e);he.value=t?q(t):null},closeUsersOwnRoleEditor:T,onUsersOwnRoleDrawerToggle:function(e){e||T()},saveUsersOwnRole:function(){if(!he.value||!ve.value)return;const e={id:"+"===ve.value?he.value.id:ve.value,roles:[...he.value.roles||[]],policies:[...he.value.policies||[]]},t=[...J.value.users?.own_role_only||[]];if("+"===ve.value)t.push(e);else{const n=t.findIndex(e=>e.id===ve.value);-1===n?t.push(e):t[n]=e}J.value=xe({users:{...J.value.users||D,own_role_only:t}}),T()},removeUsersOwnRole:function(e){J.value=xe({users:{...J.value.users||D,own_role_only:(J.value.users?.own_role_only||[]).filter(t=>t.id!==e)}})},openUsersRoleEditor:function(e){if(ge.value=e,"+"===e)return void(be.value={id:"",visibility:"hide",roles:[],policies:[],block_routes:!0});const t=(J.value.users?.roles||[]).find(t=>t.id===e);be.value=t?q(t):{id:e,visibility:"hide",roles:[],policies:[],block_routes:!0}},closeUsersRoleEditor:N,onUsersRoleDrawerToggle:function(e){e||N()},saveUsersRoleRule:function(){if(!be.value||!ge.value||j.value)return;const e=String(be.value.id).trim();if(!e)return;const t={...be.value,id:e,roles:[...be.value.roles||[]],policies:[...be.value.policies||[]],block_routes:!1!==be.value.block_routes},n="+"===ge.value?e:ge.value,o=(J.value.users?.roles||[]).filter(t=>t.id!==n&&t.id!==e);J.value=xe({users:{...J.value.users||D,roles:[...o,t]}}),N()},clearUsersRoleRule:function(){ge.value&&"+"!==ge.value&&(J.value=xe({users:{...J.value.users||D,roles:(J.value.users?.roles||[]).filter(e=>e.id!==ge.value)}}),N())},removeUsersRoleRule:function(e){J.value=xe({users:{...J.value.users||D,roles:(J.value.users?.roles||[]).filter(t=>t.id!==e)}})},editHideNav:function(e){if(ye.value=e,"+"===e)return void(_e.value={id:crypto.randomUUID(),modules:["users"],roles:[],policies:[]});const t=(J.value.users?.hide_navigation||[]).find(t=>t.id===e);_e.value=t?q(t):null},closeHideNavEditor:ke,onHideNavDrawerToggle:function(e){e||ke()},saveHideNav:function(){if(!_e.value||!ye.value||Se.value)return;const e={id:"+"===ye.value?_e.value.id:ye.value,modules:[..._e.value.modules||[]].map(String).filter(Boolean),roles:[..._e.value.roles||[]],policies:[..._e.value.policies||[]]},t=[...J.value.users?.hide_navigation||[]];if("+"===ye.value)t.push(e);else{const n=t.findIndex(e=>e.id===ye.value);-1===n?t.push(e):t[n]=e}J.value=xe({users:{...J.value.users||D,hide_navigation:t}}),ke()},removeHideNav:function(e){J.value=xe({users:{...J.value.users||D,hide_navigation:(J.value.users?.hide_navigation||[]).filter(t=>t.id!==e)}})},ensureLoaded:function(){return we||(we=Ee().finally(()=>{})),we},save:async function(){if(u.value&&!0===s.currentUser?.admin_access){W.value=!0;try{const e={module_bar:$(K.value),[A]:F(J.value)};await n.patch("/settings",e);try{await(l.hydrate?.())}catch{}Q.value=q(K.value),Z.value=q(J.value)}finally{W.value=!1}}},cleanupExtensionData:async function(){if(!0!==s.currentUser?.admin_access)throw new Error("Admin access required");G.value=!0;let e=!1,t=!1;try{try{await n.patch("/settings",{[A]:null}),e=!0}catch(e){const t=e?.response?.status,n=String(e?.response?.data?.errors?.[0]?.message||e?.message||"");if(400!==t&&403!==t&&!/unknown|does not exist|forbidden/i.test(n))throw e}try{await n.delete(`/fields/directus_settings/${A}`),t=!0}catch(e){const n=e?.response?.status;if(404!==n)throw e;t=!0}J.value=q(I),Z.value=q(I),ne.value=null,oe.value=null,ie.value=null,re.value=null,ae.value=null,le.value=null,ce.value=null,de.value=null,ue.value=null,fe.value=null,pe.value=null,me.value=null,ve.value=null,he.value=null,ge.value=null,be.value=null,ye.value=null,_e.value=null,we=null;try{await(l.hydrate?.())}catch{}return{clearedValue:e,deletedField:t}}finally{G.value=!1}},exportPermissionsConfig:function(){const e={...F(J.value),exported_at:(new Date).toISOString(),extension:"directus-extension-module-permissions"},t=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),n=URL.createObjectURL(t),o=document.createElement("a"),i=(new Date).toISOString().slice(0,19).replace(/[:T]/g,"-");o.href=n,o.download=`module-permissions-${i}.json`,o.click(),URL.revokeObjectURL(n)},importPermissionsConfig:async function(e){if(!0!==s.currentUser?.admin_access)throw new Error("Admin access required");if(!e||"object"!=typeof e)throw new Error("Invalid JSON: expected an object");const t=e,o=F(t.module_permissions&&"object"==typeof t.module_permissions?t.module_permissions:t);if(!(Array.isArray(o.rules)&&Array.isArray(o.homes)&&Array.isArray(o.collections)&&Array.isArray(o.sidebar_panels)&&Array.isArray(o.sidebar_modes)&&o.users&&Array.isArray(o.users.own_role_only)&&Array.isArray(o.users.roles)&&Array.isArray(o.users.hide_navigation)))throw new Error("Invalid config: missing rules/homes/collections/sidebar/users arrays");J.value=o,await n.patch("/settings",{[A]:o}),Z.value=q(o);try{await(l.hydrate?.())}catch{}we=null},MODULE_PERMISSIONS_FIELD:A}}function ke(e){const t=function(e){if("string"!=typeof e||!e)return null;const t=Number.parseInt(e.split(".")[0]||"",10);return Number.isFinite(t)?t:null}(e);return null!=t?t>=12:"undefined"!=typeof document&&Boolean(document.querySelector("#navigation.module-bar")||document.querySelector("aside.module-nav:not(#navigation)"))}function Ee(){const{useServerStore:e}=t(),n=e();return r(()=>{const e=["page"];return ke(n?.info?.version)&&e.push("page--padded-top"),e})}var Ce=a({__name:"navigation",setup:e=>(e,t)=>{const n=l("v-icon"),o=l("v-list-item-icon"),i=l("v-text-overflow"),r=l("v-list-item-content"),a=l("v-list-item"),f=l("v-divider"),p=l("v-list");return s(),c(p,{nav:""},{default:d(()=>[u(a,{to:"/module-permissions/modules"},{default:d(()=>[u(o,null,{default:d(()=>[u(n,{name:"view_sidebar",class:"icon-flip-x"})]),_:1}),u(r,null,{default:d(()=>[u(i,{text:"Modules"})]),_:1})]),_:1}),u(a,{to:"/module-permissions/sidebar"},{default:d(()=>[u(o,null,{default:d(()=>[u(n,{name:"view_sidebar"})]),_:1}),u(r,null,{default:d(()=>[u(i,{text:"Sidebar"})]),_:1})]),_:1}),u(a,{to:"/module-permissions/content"},{default:d(()=>[u(o,null,{default:d(()=>[u(n,{name:"box"})]),_:1}),u(r,null,{default:d(()=>[u(i,{text:"Content"})]),_:1})]),_:1}),u(a,{to:"/module-permissions/users"},{default:d(()=>[u(o,null,{default:d(()=>[u(n,{name:"people_alt"})]),_:1}),u(r,null,{default:d(()=>[u(i,{text:"Users"})]),_:1})]),_:1}),u(a,{to:"/module-permissions/start-page"},{default:d(()=>[u(o,null,{default:d(()=>[u(n,{name:"home"})]),_:1}),u(r,null,{default:d(()=>[u(i,{text:"Start Page"})]),_:1})]),_:1}),u(f),u(a,{to:"/module-permissions/settings"},{default:d(()=>[u(o,null,{default:d(()=>[u(n,{name:"settings"})]),_:1}),u(r,null,{default:d(()=>[u(i,{text:"Settings"})]),_:1})]),_:1})]),_:1})}}),Ae=[],Oe=[];function De(e,t){if(e&&"undefined"!=typeof document){var n,o=!0===t.prepend?"prepend":"append",i=!0===t.singleTag,r="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(i){var a=Ae.indexOf(r);-1===a&&(a=Ae.push(r)-1,Oe[a]={}),n=Oe[a]&&Oe[a][o]?Oe[a][o]:Oe[a][o]=l()}else n=l();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function l(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),i=0;i<n.length;i++)e.setAttribute(n[i],t.attributes[n[i]]);var a="prepend"===o?"afterbegin":"beforeend";return r.insertAdjacentElement(a,e),e}}De("\n.icon-flip-x[data-v-67936547] {\n\ttransform: scaleX(-1);\n}\n",{});var Ie=(e,t)=>{const n=e.__vccOpts||e;for(const[e,o]of t)n[e]=o;return n},Re=Ie(Ce,[["__scopeId","data-v-67936547"]]);const Pe={key:0,class:"loading"},Te={key:0,class:"empty"},Me={key:1,class:"list"},Ve={class:"info"},Ue={class:"name"},je={class:"to"},Ne={key:0,class:"drawer-content"},Le={class:"field"},$e={class:"field"},Fe={class:"field"},Be={class:"field"},He={class:"field checkbox-field"};var qe=a({__name:"collections-view",setup(e){const t=Ee(),{loading:n,saving:o,hasEdits:i,configuredCollections:r,availableCollectionOptions:a,roleOptions:E,policyOptions:C,collectionEditingId:A,collectionDraft:O,collectionSaveDisabled:D,hasCollectionRule:I,collectionRuleSummary:R,openCollectionEditor:P,closeCollectionEditor:T,onCollectionDrawerToggle:M,saveCollectionRule:V,clearCollectionRule:U,removeCollectionRule:j,ensureLoaded:N,save:L}=Se();return f(()=>{N()}),(e,f)=>{const N=l("v-breadcrumb"),$=l("v-icon"),F=l("v-button"),B=l("sidebar-detail"),H=l("v-progress-circular"),q=l("v-chip"),X=l("v-list-item"),Y=l("v-select"),z=l("v-checkbox"),W=l("v-drawer"),G=l("private-view"),K=p("tooltip");return s(),c(G,{title:"Content",icon:"box"},{headline:d(()=>[u(N,{items:[{name:"Module Permissions",to:"/module-permissions/modules"}]})]),navigation:d(()=>[u(Re)]),actions:d(()=>[k((s(),c(F,{disabled:!h(i),loading:h(o),icon:"",rounded:"",onClick:h(L)},{default:d(()=>[u($,{name:"check"})]),_:1},8,["disabled","loading","onClick"])),[[K,"Save",void 0,{bottom:!0}]])]),sidebar:d(()=>[u(B,{icon:"info",title:"About",close:""},{default:d(()=>[...f[7]||(f[7]=[m("p",{class:"sidebar-text"},[_(" Hide specific collections from the Content module navigation while keeping read permissions for relations and API access. Optional deep-link blocking covers "),m("code",null,"/content/<collection>"),_(". Admins are never affected. This is UI visibility only — not a security boundary. ")],-1)])]),_:1})]),default:d(()=>[m("div",{class:v(h(t))},[h(n)?(s(),g("div",Pe,[u(H,{indeterminate:""})])):(s(),g(b,{key:1},[f[9]||(f[9]=m("p",{class:"page-intro"}," Add only the collections that need visibility rules. Unlisted collections keep normal Content behavior. Assign roles or policies to hide or show a collection in the nav, and optionally block deep links. ",-1)),0===h(r).length?(s(),g("div",Te,"No collection rules yet.")):(s(),g("div",Me,[(s(!0),g(b,null,y(h(r),e=>(s(),c(X,{key:e.collection,block:"",dense:"",clickable:"",class:"module-row enabled",onClick:t=>h(P)(e.collection)},{default:d(()=>[u($,{class:"icon",name:e.icon},null,8,["name"]),m("div",Ve,[m("div",Ue,[_(w(e.name)+" ",1),h(I)(e.collection)?(s(),c(q,{key:0,"x-small":"",class:"rule-chip"},{default:d(()=>[_(w(h(R)(e.collection)),1)]),_:2},1024)):x("v-if",!0)]),m("div",je,"/content/"+w(e.collection),1)]),m("div",{class:"row-actions",onClick:f[0]||(f[0]=S(()=>{},["stop"]))},[k((s(),c(F,{icon:"","x-small":"",secondary:"",onClick:t=>h(P)(e.collection)},{default:d(()=>[u($,{name:"policy"})]),_:1},8,["onClick"])),[[K,"Visibility rules"]]),k((s(),c(F,{icon:"","x-small":"",secondary:"",onClick:t=>h(j)(e.collection)},{default:d(()=>[u($,{name:"close"})]),_:1},8,["onClick"])),[[K,"Remove"]])])]),_:2},1032,["onClick"]))),128))])),u(F,{class:"add-link",onClick:f[1]||(f[1]=e=>h(P)("+"))},{default:d(()=>[...f[8]||(f[8]=[_("Add Collection",-1)])]),_:1})],64))],2),u(W,{"model-value":null!==h(A),title:"+"===h(A)?"Add Collection":"Collection Visibility",icon:"policy","onUpdate:modelValue":h(M),onCancel:h(T)},{actions:d(()=>[k((s(),c(F,{disabled:h(D),icon:"",rounded:"",onClick:h(V)},{default:d(()=>[u($,{name:"check"})]),_:1},8,["disabled","onClick"])),[[K,"Apply",void 0,{bottom:!0}]])]),default:d(()=>[h(O)?(s(),g("div",Ne,[f[15]||(f[15]=m("p",{class:"hint"}," Pick a collection and at least one role or policy. Read permissions are never changed here. ",-1)),m("div",Le,[f[10]||(f[10]=m("label",null,"Collection",-1)),u(Y,{modelValue:h(O).id,"onUpdate:modelValue":f[2]||(f[2]=e=>h(O).id=e),items:h(a),"item-text":"text","item-value":"value",disabled:"+"!==h(A),placeholder:"Select collection"},null,8,["modelValue","items","disabled"])]),m("div",$e,[f[11]||(f[11]=m("label",null,"Visibility",-1)),u(Y,{modelValue:h(O).visibility,"onUpdate:modelValue":f[3]||(f[3]=e=>h(O).visibility=e),items:[{text:"Hide for matched roles/policies",value:"hide"},{text:"Show only for matched roles/policies",value:"show"}]},null,8,["modelValue"])]),m("div",Fe,[f[12]||(f[12]=m("label",null,"Roles",-1)),u(Y,{modelValue:h(O).roles,"onUpdate:modelValue":f[4]||(f[4]=e=>h(O).roles=e),multiple:"",items:h(E),"item-text":"text","item-value":"value",placeholder:"Select roles"},null,8,["modelValue","items"])]),m("div",Be,[f[13]||(f[13]=m("label",null,"Policies",-1)),u(Y,{modelValue:h(O).policies,"onUpdate:modelValue":f[5]||(f[5]=e=>h(O).policies=e),multiple:"",items:h(C),"item-text":"text","item-value":"value",placeholder:"Select policies"},null,8,["modelValue","items"])]),m("div",He,[u(z,{modelValue:h(O).block_routes,"onUpdate:modelValue":f[6]||(f[6]=e=>h(O).block_routes=e),label:"Block deep links to /content/<collection> when this rule hides it"},null,8,["modelValue"])]),h(A)&&"+"!==h(A)&&h(I)(h(A))?(s(),c(F,{key:0,secondary:"",onClick:h(U)},{default:d(()=>[...f[14]||(f[14]=[_(" Remove rule ",-1)])]),_:1},8,["onClick"])):x("v-if",!0)])):x("v-if",!0)]),_:1},8,["model-value","title","onUpdate:modelValue","onCancel"])]),_:1})}}});De("\n.page[data-v-fd096c41] {\n\tpadding-inline: var(--content-padding);\n\tpadding-block-start: 0;\n\tpadding-block-end: var(--content-padding-bottom);\n\tmax-width: 720px;\n}\n.page--padded-top[data-v-fd096c41] {\n\tpadding-block-start: var(--content-padding);\n}\n.loading[data-v-fd096c41] {\n\tdisplay: flex;\n\tjustify-content: center;\n\tpadding: 4rem;\n}\n.page-intro[data-v-fd096c41] {\n\tmargin: 0 0 24px;\n\tline-height: 1.55;\n\tcolor: var(--theme--foreground);\n}\n.list[data-v-fd096c41] {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tmargin-bottom: 12px;\n\tpadding: 0;\n}\n.module-row.enabled[data-v-fd096c41] {\n\t--v-list-item-color: var(--theme--foreground);\n}\n.icon[data-v-fd096c41] {\n\tmargin: 0 0.6875rem;\n}\n.info[data-v-fd096c41] {\n\tflex: 1;\n\tmin-width: 0;\n}\n.name[data-v-fd096c41] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tfont-weight: 600;\n}\n.to[data-v-fd096c41] {\n\tfont-family: var(--theme--fonts--monospace--font-family, monospace);\n\tfont-size: 12px;\n\topacity: 0.75;\n}\n.rule-chip[data-v-fd096c41] {\n\tmargin-inline-start: 4px;\n}\n.row-actions[data-v-fd096c41] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n}\n.add-link[data-v-fd096c41] {\n\tmargin-top: 4px;\n}\n.empty[data-v-fd096c41] {\n\tmargin-bottom: 12px;\n\tcolor: var(--theme--foreground);\n}\n.drawer-content[data-v-fd096c41] {\n\tpadding: var(--content-padding);\n\tpadding-block-end: var(--content-padding-bottom);\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 20px;\n}\n.field label[data-v-fd096c41] {\n\tdisplay: block;\n\tmargin-bottom: 8px;\n\tfont-weight: 600;\n}\n.hint[data-v-fd096c41],\n.sidebar-text[data-v-fd096c41] {\n\tmargin: 0;\n\tline-height: 1.5;\n\tcolor: var(--theme--foreground);\n}\n.sidebar-text code[data-v-fd096c41],\n.hint code[data-v-fd096c41] {\n\tfont-family: var(--theme--fonts--monospace--font-family, monospace);\n\tfont-size: 0.9em;\n}\n.checkbox-field[data-v-fd096c41] {\n\tpadding-top: 4px;\n}\n",{});var Xe=Ie(qe,[["__scopeId","data-v-fd096c41"]]);function Ye(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ze(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch{}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})}),n}var We={exports:{}},Ge=ze(o);
|
|
2
|
+
/**!
|
|
3
|
+
* Sortable 1.14.0
|
|
4
|
+
* @author RubaXa <trash@rubaxa.org>
|
|
5
|
+
* @author owenm <owen23355@gmail.com>
|
|
6
|
+
* @license MIT
|
|
7
|
+
*/
|
|
8
|
+
function Ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function Je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ke(Object(n),!0).forEach(function(t){Ze(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ke(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Qe(e){return Qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qe(e)}function Ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function et(){return et=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},et.apply(this,arguments)}function tt(e,t){if(null==e)return{};var n,o,i=function(e,t){if(null==e)return{};var n,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function nt(e){return function(e){if(Array.isArray(e))return ot(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ot(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ot(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function it(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var rt=it(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),at=it(/Edge/i),lt=it(/firefox/i),st=it(/safari/i)&&!it(/chrome/i)&&!it(/android/i),ct=it(/iP(ad|od|hone)/i),dt=it(/chrome/i)&&it(/android/i),ut={capture:!1,passive:!1};function ft(e,t,n){e.addEventListener(t,n,!rt&&ut)}function pt(e,t,n){e.removeEventListener(t,n,!rt&&ut)}function mt(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function vt(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function ht(e,t,n,o){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&mt(e,t):mt(e,t))||o&&e===n)return e;if(e===n)break}while(e=vt(e))}return null}var gt,bt=/\s+/g;function yt(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(bt," ").replace(" "+t+" "," ");e.className=(o+(n?" "+t:"")).replace(bt," ")}}function _t(e,t,n){var o=e&&e.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in o||-1!==t.indexOf("webkit")||(t="-webkit-"+t),o[t]=n+("string"==typeof n?"":"px")}}function wt(e,t){var n="";if("string"==typeof e)n=e;else do{var o=_t(e,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function xt(e,t,n){if(e){var o=e.getElementsByTagName(t),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function St(){var e=document.scrollingElement;return e||document.documentElement}function kt(e,t,n,o,i){if(e.getBoundingClientRect||e===window){var r,a,l,s,c,d,u;if(e!==window&&e.parentNode&&e!==St()?(a=(r=e.getBoundingClientRect()).top,l=r.left,s=r.bottom,c=r.right,d=r.height,u=r.width):(a=0,l=0,s=window.innerHeight,c=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(t||n)&&e!==window&&(i=i||e.parentNode,!rt))do{if(i&&i.getBoundingClientRect&&("none"!==_t(i,"transform")||n&&"static"!==_t(i,"position"))){var f=i.getBoundingClientRect();a-=f.top+parseInt(_t(i,"border-top-width")),l-=f.left+parseInt(_t(i,"border-left-width")),s=a+r.height,c=l+r.width;break}}while(i=i.parentNode);if(o&&e!==window){var p=wt(i||e),m=p&&p.a,v=p&&p.d;p&&(s=(a/=v)+(d/=v),c=(l/=m)+(u/=m))}return{top:a,left:l,bottom:s,right:c,width:u,height:d}}}function Et(e,t,n){for(var o=It(e,!0),i=kt(e)[t];o;){if(!(i>=kt(o)[n]))return o;if(o===St())break;o=It(o,!1)}return!1}function Ct(e,t,n,o){for(var i=0,r=0,a=e.children;r<a.length;){if("none"!==a[r].style.display&&a[r]!==jn.ghost&&(o||a[r]!==jn.dragged)&&ht(a[r],n.draggable,e,!1)){if(i===t)return a[r];i++}r++}return null}function At(e,t){for(var n=e.lastElementChild;n&&(n===jn.ghost||"none"===_t(n,"display")||t&&!mt(n,t));)n=n.previousElementSibling;return n||null}function Ot(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===jn.clone||t&&!mt(e,t)||n++;return n}function Dt(e){var t=0,n=0,o=St();if(e)do{var i=wt(e),r=i.a,a=i.d;t+=e.scrollLeft*r,n+=e.scrollTop*a}while(e!==o&&(e=e.parentNode));return[t,n]}function It(e,t){if(!e||!e.getBoundingClientRect)return St();var n=e,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=_t(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return St();if(o||t)return n;o=!0}}}while(n=n.parentNode);return St()}function Rt(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function Pt(e,t){return function(){if(!gt){var n=arguments;1===n.length?e.call(this,n[0]):e.apply(this,n),gt=setTimeout(function(){gt=void 0},t)}}}function Tt(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function Mt(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function Vt(e,t){_t(e,"position","absolute"),_t(e,"top",t.top),_t(e,"left",t.left),_t(e,"width",t.width),_t(e,"height",t.height)}function Ut(e){_t(e,"position",""),_t(e,"top",""),_t(e,"left",""),_t(e,"width",""),_t(e,"height","")}var jt="Sortable"+(new Date).getTime();function Nt(){var e,t=[];return{captureAnimationState:function(){(t=[],this.options.animation)&&[].slice.call(this.el.children).forEach(function(e){if("none"!==_t(e,"display")&&e!==jn.ghost){t.push({target:e,rect:kt(e)});var n=Je({},t[t.length-1].rect);if(e.thisAnimationDuration){var o=wt(e,!0);o&&(n.top-=o.f,n.left-=o.e)}e.fromRect=n}})},addAnimationState:function(e){t.push(e)},removeAnimationState:function(e){t.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var o in t)if(t.hasOwnProperty(o)&&t[o]===e[n][o])return Number(n);return-1}(t,{target:e}),1)},animateAll:function(n){var o=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof n&&n());var i=!1,r=0;t.forEach(function(e){var t=0,n=e.target,a=n.fromRect,l=kt(n),s=n.prevFromRect,c=n.prevToRect,d=e.rect,u=wt(n,!0);u&&(l.top-=u.f,l.left-=u.e),n.toRect=l,n.thisAnimationDuration&&Rt(s,l)&&!Rt(a,l)&&(d.top-l.top)/(d.left-l.left)===(a.top-l.top)/(a.left-l.left)&&(t=function(e,t,n,o){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*o.animation}(d,s,c,o.options)),Rt(l,a)||(n.prevFromRect=a,n.prevToRect=l,t||(t=o.options.animation),o.animate(n,d,l,t)),t&&(i=!0,r=Math.max(r,t),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},t),n.thisAnimationDuration=t)}),clearTimeout(e),i?e=setTimeout(function(){"function"==typeof n&&n()},r):"function"==typeof n&&n(),t=[]},animate:function(e,t,n,o){if(o){_t(e,"transition",""),_t(e,"transform","");var i=wt(this.el),r=i&&i.a,a=i&&i.d,l=(t.left-n.left)/(r||1),s=(t.top-n.top)/(a||1);e.animatingX=!!l,e.animatingY=!!s,_t(e,"transform","translate3d("+l+"px,"+s+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),_t(e,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),_t(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout(function(){_t(e,"transition",""),_t(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1},o)}}}}var Lt=[],$t={initializeByDefault:!0},Ft={mount:function(e){for(var t in $t)$t.hasOwnProperty(t)&&!(t in e)&&(e[t]=$t[t]);Lt.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),Lt.push(e)},pluginEvent:function(e,t,n){var o=this;this.eventCanceled=!1,n.cancel=function(){o.eventCanceled=!0};var i=e+"Global";Lt.forEach(function(o){t[o.pluginName]&&(t[o.pluginName][i]&&t[o.pluginName][i](Je({sortable:t},n)),t.options[o.pluginName]&&t[o.pluginName][e]&&t[o.pluginName][e](Je({sortable:t},n)))})},initializePlugins:function(e,t,n,o){for(var i in Lt.forEach(function(o){var i=o.pluginName;if(e.options[i]||o.initializeByDefault){var r=new o(e,t,e.options);r.sortable=e,r.options=e.options,e[i]=r,et(n,r.defaults)}}),e.options)if(e.options.hasOwnProperty(i)){var r=this.modifyOption(e,i,e.options[i]);void 0!==r&&(e.options[i]=r)}},getEventProperties:function(e,t){var n={};return Lt.forEach(function(o){"function"==typeof o.eventProperties&&et(n,o.eventProperties.call(t[o.pluginName],e))}),n},modifyOption:function(e,t,n){var o;return Lt.forEach(function(i){e[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[t]&&(o=i.optionListeners[t].call(e[i.pluginName],n))}),o}};function Bt(e){var t=e.sortable,n=e.rootEl,o=e.name,i=e.targetEl,r=e.cloneEl,a=e.toEl,l=e.fromEl,s=e.oldIndex,c=e.newIndex,d=e.oldDraggableIndex,u=e.newDraggableIndex,f=e.originalEvent,p=e.putSortable,m=e.extraEventProperties;if(t=t||n&&n[jt]){var v,h=t.options,g="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||rt||at?(v=document.createEvent("Event")).initEvent(o,!0,!0):v=new CustomEvent(o,{bubbles:!0,cancelable:!0}),v.to=a||n,v.from=l||n,v.item=i||n,v.clone=r,v.oldIndex=s,v.newIndex=c,v.oldDraggableIndex=d,v.newDraggableIndex=u,v.originalEvent=f,v.pullMode=p?p.lastPutMode:void 0;var b=Je(Je({},m),Ft.getEventProperties(o,t));for(var y in b)v[y]=b[y];n&&n.dispatchEvent(v),h[g]&&h[g].call(t,v)}}var Ht=["evt"],qt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,i=tt(n,Ht);Ft.pluginEvent.bind(jn)(e,t,Je({dragEl:Yt,parentEl:zt,ghostEl:Wt,rootEl:Gt,nextEl:Kt,lastDownEl:Jt,cloneEl:Qt,cloneHidden:Zt,dragStarted:pn,putSortable:an,activeSortable:jn.active,originalEvent:o,oldIndex:en,oldDraggableIndex:nn,newIndex:tn,newDraggableIndex:on,hideGhostForTarget:Tn,unhideGhostForTarget:Mn,cloneNowHidden:function(){Zt=!0},cloneNowShown:function(){Zt=!1},dispatchSortableEvent:function(e){Xt({sortable:t,name:e,originalEvent:o})}},i))};function Xt(e){Bt(Je({putSortable:an,cloneEl:Qt,targetEl:Yt,rootEl:Gt,oldIndex:en,oldDraggableIndex:nn,newIndex:tn,newDraggableIndex:on},e))}var Yt,zt,Wt,Gt,Kt,Jt,Qt,Zt,en,tn,nn,on,rn,an,ln,sn,cn,dn,un,fn,pn,mn,vn,hn,gn,bn=!1,yn=!1,_n=[],wn=!1,xn=!1,Sn=[],kn=!1,En=[],Cn="undefined"!=typeof document,An=ct,On=at||rt?"cssFloat":"float",Dn=Cn&&!dt&&!ct&&"draggable"in document.createElement("div"),In=function(){if(Cn){if(rt)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Rn=function(e,t){var n=_t(e),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=Ct(e,0,t),r=Ct(e,1,t),a=i&&_t(i),l=r&&_t(r),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+kt(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+kt(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){var d="left"===a.float?"left":"right";return!r||"both"!==l.clear&&l.clear!==d?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||s>=o&&"none"===n[On]||r&&"none"===n[On]&&s+c>o)?"vertical":"horizontal"},Pn=function(e){function t(e,n){return function(o,i,r,a){var l=o.options.group.name&&i.options.group.name&&o.options.group.name===i.options.group.name;if(null==e&&(n||l))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(o,i,r,a),n)(o,i,r,a);var s=(n?o:i).options.group.name;return!0===e||"string"==typeof e&&e===s||e.join&&e.indexOf(s)>-1}}var n={},o=e.group;o&&"object"==Qe(o)||(o={name:o}),n.name=o.name,n.checkPull=t(o.pull,!0),n.checkPut=t(o.put),n.revertClone=o.revertClone,e.group=n},Tn=function(){!In&&Wt&&_t(Wt,"display","none")},Mn=function(){!In&&Wt&&_t(Wt,"display","")};Cn&&document.addEventListener("click",function(e){if(yn)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),yn=!1,!1},!0);var Vn=function(e){if(Yt){e=e.touches?e.touches[0]:e;var t=(i=e.clientX,r=e.clientY,_n.some(function(e){var t=e[jt].options.emptyInsertThreshold;if(t&&!At(e)){var n=kt(e),o=i>=n.left-t&&i<=n.right+t,l=r>=n.top-t&&r<=n.bottom+t;return o&&l?a=e:void 0}}),a);if(t){var n={};for(var o in e)e.hasOwnProperty(o)&&(n[o]=e[o]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[jt]._onDragOver(n)}}var i,r,a},Un=function(e){Yt&&Yt.parentNode[jt]._isOutsideThisEl(e.target)};function jn(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=et({},t),e[jt]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Rn(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==jn.supportPointer&&"PointerEvent"in window&&!st,emptyInsertThreshold:5};for(var o in Ft.initializePlugins(this,e,n),n)!(o in t)&&(t[o]=n[o]);for(var i in Pn(t),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!t.forceFallback&&Dn,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?ft(e,"pointerdown",this._onTapStart):(ft(e,"mousedown",this._onTapStart),ft(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(ft(e,"dragover",this),ft(e,"dragenter",this)),_n.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),et(this,Nt())}function Nn(e,t,n,o,i,r,a,l){var s,c,d=e[jt],u=d.options.onMove;return!window.CustomEvent||rt||at?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=t,s.from=e,s.dragged=n,s.draggedRect=o,s.related=i||t,s.relatedRect=r||kt(t),s.willInsertAfter=l,s.originalEvent=a,e.dispatchEvent(s),u&&(c=u.call(d,s,a)),c}function Ln(e){e.draggable=!1}function $n(){kn=!1}function Fn(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,o=0;n--;)o+=t.charCodeAt(n);return o.toString(36)}function Bn(e){return setTimeout(e,0)}function Hn(e){return clearTimeout(e)}jn.prototype={constructor:jn,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(mn=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,Yt):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,o=this.options,i=o.preventOnFilter,r=e.type,a=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(a||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,c=o.filter;if(function(e){En.length=0;var t=e.getElementsByTagName("input"),n=t.length;for(;n--;){var o=t[n];o.checked&&En.push(o)}}(n),!Yt&&!(/mousedown|pointerdown/.test(r)&&0!==e.button||o.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!st||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=ht(l,o.draggable,n,!1))&&l.animated||Jt===l)){if(en=Ot(l),nn=Ot(l,o.draggable),"function"==typeof c){if(c.call(this,e,l,this))return Xt({sortable:t,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),qt("filter",t,{evt:e}),void(i&&e.cancelable&&e.preventDefault())}else if(c&&(c=c.split(",").some(function(o){if(o=ht(s,o.trim(),n,!1))return Xt({sortable:t,rootEl:o,name:"filter",targetEl:l,fromEl:n,toEl:n}),qt("filter",t,{evt:e}),!0})))return void(i&&e.cancelable&&e.preventDefault());o.handle&&!ht(s,o.handle,n,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(e,t,n){var o,i=this,r=i.el,a=i.options,l=r.ownerDocument;if(n&&!Yt&&n.parentNode===r){var s=kt(n);if(Gt=r,zt=(Yt=n).parentNode,Kt=Yt.nextSibling,Jt=n,rn=a.group,jn.dragged=Yt,ln={target:Yt,clientX:(t||e).clientX,clientY:(t||e).clientY},un=ln.clientX-s.left,fn=ln.clientY-s.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Yt.style["will-change"]="all",o=function(){qt("delayEnded",i,{evt:e}),jn.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!lt&&i.nativeDraggable&&(Yt.draggable=!0),i._triggerDragStart(e,t),Xt({sortable:i,name:"choose",originalEvent:e}),yt(Yt,a.chosenClass,!0))},a.ignore.split(",").forEach(function(e){xt(Yt,e.trim(),Ln)}),ft(l,"dragover",Vn),ft(l,"mousemove",Vn),ft(l,"touchmove",Vn),ft(l,"mouseup",i._onDrop),ft(l,"touchend",i._onDrop),ft(l,"touchcancel",i._onDrop),lt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Yt.draggable=!0),qt("delayStart",this,{evt:e}),!a.delay||a.delayOnTouchOnly&&!t||this.nativeDraggable&&(at||rt))o();else{if(jn.eventCanceled)return void this._onDrop();ft(l,"mouseup",i._disableDelayedDrag),ft(l,"touchend",i._disableDelayedDrag),ft(l,"touchcancel",i._disableDelayedDrag),ft(l,"mousemove",i._delayedDragTouchMoveHandler),ft(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&ft(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,a.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Yt&&Ln(Yt),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;pt(e,"mouseup",this._disableDelayedDrag),pt(e,"touchend",this._disableDelayedDrag),pt(e,"touchcancel",this._disableDelayedDrag),pt(e,"mousemove",this._delayedDragTouchMoveHandler),pt(e,"touchmove",this._delayedDragTouchMoveHandler),pt(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?ft(document,"pointermove",this._onTouchMove):ft(document,t?"touchmove":"mousemove",this._onTouchMove):(ft(Yt,"dragend",this),ft(Gt,"dragstart",this._onDragStart));try{document.selection?Bn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(bn=!1,Gt&&Yt){qt("dragStarted",this,{evt:t}),this.nativeDraggable&&ft(document,"dragover",Un);var n=this.options;!e&&yt(Yt,n.dragClass,!1),yt(Yt,n.ghostClass,!0),jn.active=this,e&&this._appendGhost(),Xt({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(sn){this._lastX=sn.clientX,this._lastY=sn.clientY,Tn();for(var e=document.elementFromPoint(sn.clientX,sn.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(sn.clientX,sn.clientY))!==t;)t=e;if(Yt.parentNode[jt]._isOutsideThisEl(e),t)do{if(t[jt]){if(t[jt]._onDragOver({clientX:sn.clientX,clientY:sn.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Mn()}},_onTouchMove:function(e){if(ln){var t=this.options,n=t.fallbackTolerance,o=t.fallbackOffset,i=e.touches?e.touches[0]:e,r=Wt&&wt(Wt,!0),a=Wt&&r&&r.a,l=Wt&&r&&r.d,s=An&&gn&&Dt(gn),c=(i.clientX-ln.clientX+o.x)/(a||1)+(s?s[0]-Sn[0]:0)/(a||1),d=(i.clientY-ln.clientY+o.y)/(l||1)+(s?s[1]-Sn[1]:0)/(l||1);if(!jn.active&&!bn){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(Wt){r?(r.e+=c-(cn||0),r.f+=d-(dn||0)):r={a:1,b:0,c:0,d:1,e:c,f:d};var u="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");_t(Wt,"webkitTransform",u),_t(Wt,"mozTransform",u),_t(Wt,"msTransform",u),_t(Wt,"transform",u),cn=c,dn=d,sn=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!Wt){var e=this.options.fallbackOnBody?document.body:Gt,t=kt(Yt,!0,An,!0,e),n=this.options;if(An){for(gn=e;"static"===_t(gn,"position")&&"none"===_t(gn,"transform")&&gn!==document;)gn=gn.parentNode;gn!==document.body&&gn!==document.documentElement?(gn===document&&(gn=St()),t.top+=gn.scrollTop,t.left+=gn.scrollLeft):gn=St(),Sn=Dt(gn)}yt(Wt=Yt.cloneNode(!0),n.ghostClass,!1),yt(Wt,n.fallbackClass,!0),yt(Wt,n.dragClass,!0),_t(Wt,"transition",""),_t(Wt,"transform",""),_t(Wt,"box-sizing","border-box"),_t(Wt,"margin",0),_t(Wt,"top",t.top),_t(Wt,"left",t.left),_t(Wt,"width",t.width),_t(Wt,"height",t.height),_t(Wt,"opacity","0.8"),_t(Wt,"position",An?"absolute":"fixed"),_t(Wt,"zIndex","100000"),_t(Wt,"pointerEvents","none"),jn.ghost=Wt,e.appendChild(Wt),_t(Wt,"transform-origin",un/parseInt(Wt.style.width)*100+"% "+fn/parseInt(Wt.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,o=e.dataTransfer,i=n.options;qt("dragStart",this,{evt:e}),jn.eventCanceled?this._onDrop():(qt("setupClone",this),jn.eventCanceled||((Qt=Mt(Yt)).draggable=!1,Qt.style["will-change"]="",this._hideClone(),yt(Qt,this.options.chosenClass,!1),jn.clone=Qt),n.cloneId=Bn(function(){qt("clone",n),jn.eventCanceled||(n.options.removeCloneOnHide||Gt.insertBefore(Qt,Yt),n._hideClone(),Xt({sortable:n,name:"clone"}))}),!t&&yt(Yt,i.dragClass,!0),t?(yn=!0,n._loopId=setInterval(n._emulateDragOver,50)):(pt(document,"mouseup",n._onDrop),pt(document,"touchend",n._onDrop),pt(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,Yt)),ft(document,"drop",n),_t(Yt,"transform","translateZ(0)")),bn=!0,n._dragStartId=Bn(n._dragStarted.bind(n,t,e)),ft(document,"selectstart",n),pn=!0,st&&_t(document.body,"user-select","none"))},_onDragOver:function(e){var t,n,o,i,r=this.el,a=e.target,l=this.options,s=l.group,c=jn.active,d=rn===s,u=l.sort,f=an||c,p=this,m=!1;if(!kn){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),a=ht(a,l.draggable,r,!0),D("dragOver"),jn.eventCanceled)return m;if(Yt.contains(e.target)||a.animated&&a.animatingX&&a.animatingY||p._ignoreWhileAnimating===a)return R(!1);if(yn=!1,c&&!l.disabled&&(d?u||(o=zt!==Gt):an===this||(this.lastPutMode=rn.checkPull(this,c,Yt,e))&&s.checkPut(this,c,Yt,e))){if(i="vertical"===this._getDirection(e,a),t=kt(Yt),D("dragOverValid"),jn.eventCanceled)return m;if(o)return zt=Gt,I(),this._hideClone(),D("revert"),jn.eventCanceled||(Kt?Gt.insertBefore(Yt,Kt):Gt.appendChild(Yt)),R(!0);var v=At(r,l.draggable);if(!v||function(e,t,n){var o=kt(At(n.el,n.options.draggable)),i=10;return t?e.clientX>o.right+i||e.clientX<=o.right&&e.clientY>o.bottom&&e.clientX>=o.left:e.clientX>o.right&&e.clientY>o.top||e.clientX<=o.right&&e.clientY>o.bottom+i}(e,i,this)&&!v.animated){if(v===Yt)return R(!1);if(v&&r===e.target&&(a=v),a&&(n=kt(a)),!1!==Nn(Gt,r,Yt,t,a,n,e,!!a))return I(),r.appendChild(Yt),zt=r,P(),R(!0)}else if(v&&function(e,t,n){var o=kt(Ct(n.el,0,n.options,!0)),i=10;return t?e.clientX<o.left-i||e.clientY<o.top&&e.clientX<o.right:e.clientY<o.top-i||e.clientY<o.bottom&&e.clientX<o.left}(e,i,this)){var h=Ct(r,0,l,!0);if(h===Yt)return R(!1);if(n=kt(a=h),!1!==Nn(Gt,r,Yt,t,a,n,e,!1))return I(),r.insertBefore(Yt,h),zt=r,P(),R(!0)}else if(a.parentNode===r){n=kt(a);var g,b,y,_=Yt.parentNode!==r,w=!function(e,t,n){var o=n?e.left:e.top,i=n?e.right:e.bottom,r=n?e.width:e.height,a=n?t.left:t.top,l=n?t.right:t.bottom,s=n?t.width:t.height;return o===a||i===l||o+r/2===a+s/2}(Yt.animated&&Yt.toRect||t,a.animated&&a.toRect||n,i),x=i?"top":"left",S=Et(a,"top","top")||Et(Yt,"top","top"),k=S?S.scrollTop:void 0;if(mn!==a&&(b=n[x],wn=!1,xn=!w&&l.invertSwap||_),g=function(e,t,n,o,i,r,a,l){var s=o?e.clientY:e.clientX,c=o?n.height:n.width,d=o?n.top:n.left,u=o?n.bottom:n.right,f=!1;if(!a)if(l&&hn<c*i){if(!wn&&(1===vn?s>d+c*r/2:s<u-c*r/2)&&(wn=!0),wn)f=!0;else if(1===vn?s<d+hn:s>u-hn)return-vn}else if(s>d+c*(1-i)/2&&s<u-c*(1-i)/2)return function(e){return Ot(Yt)<Ot(e)?1:-1}(t);if((f=f||a)&&(s<d+c*r/2||s>u-c*r/2))return s>d+c/2?1:-1;return 0}(e,a,n,i,w?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,xn,mn===a),0!==g){var E=Ot(Yt);do{E-=g,y=zt.children[E]}while(y&&("none"===_t(y,"display")||y===Wt))}if(0===g||y===a)return R(!1);mn=a,vn=g;var C=a.nextElementSibling,A=!1,O=Nn(Gt,r,Yt,t,a,n,e,A=1===g);if(!1!==O)return 1!==O&&-1!==O||(A=1===O),kn=!0,setTimeout($n,30),I(),A&&!C?r.appendChild(Yt):a.parentNode.insertBefore(Yt,A?C:a),S&&Tt(S,0,k-S.scrollTop),zt=Yt.parentNode,void 0===b||xn||(hn=Math.abs(b-kt(a)[x])),P(),R(!0)}if(r.contains(Yt))return R(!1)}return!1}function D(l,s){qt(l,p,Je({evt:e,isOwner:d,axis:i?"vertical":"horizontal",revert:o,dragRect:t,targetRect:n,canSort:u,fromSortable:f,target:a,completed:R,onMove:function(n,o){return Nn(Gt,r,Yt,t,n,kt(n),e,o)},changed:P},s))}function I(){D("dragOverAnimationCapture"),p.captureAnimationState(),p!==f&&f.captureAnimationState()}function R(t){return D("dragOverCompleted",{insertion:t}),t&&(d?c._hideClone():c._showClone(p),p!==f&&(yt(Yt,an?an.options.ghostClass:c.options.ghostClass,!1),yt(Yt,l.ghostClass,!0)),an!==p&&p!==jn.active?an=p:p===jn.active&&an&&(an=null),f===p&&(p._ignoreWhileAnimating=a),p.animateAll(function(){D("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(a===Yt&&!Yt.animated||a===r&&!a.animated)&&(mn=null),l.dragoverBubble||e.rootEl||a===document||(Yt.parentNode[jt]._isOutsideThisEl(e.target),!t&&Vn(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function P(){tn=Ot(Yt),on=Ot(Yt,l.draggable),Xt({sortable:p,name:"change",toEl:r,newIndex:tn,newDraggableIndex:on,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){pt(document,"mousemove",this._onTouchMove),pt(document,"touchmove",this._onTouchMove),pt(document,"pointermove",this._onTouchMove),pt(document,"dragover",Vn),pt(document,"mousemove",Vn),pt(document,"touchmove",Vn)},_offUpEvents:function(){var e=this.el.ownerDocument;pt(e,"mouseup",this._onDrop),pt(e,"touchend",this._onDrop),pt(e,"pointerup",this._onDrop),pt(e,"touchcancel",this._onDrop),pt(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;tn=Ot(Yt),on=Ot(Yt,n.draggable),qt("drop",this,{evt:e}),zt=Yt&&Yt.parentNode,tn=Ot(Yt),on=Ot(Yt,n.draggable),jn.eventCanceled||(bn=!1,xn=!1,wn=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Hn(this.cloneId),Hn(this._dragStartId),this.nativeDraggable&&(pt(document,"drop",this),pt(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),st&&_t(document.body,"user-select",""),_t(Yt,"transform",""),e&&(pn&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),Wt&&Wt.parentNode&&Wt.parentNode.removeChild(Wt),(Gt===zt||an&&"clone"!==an.lastPutMode)&&Qt&&Qt.parentNode&&Qt.parentNode.removeChild(Qt),Yt&&(this.nativeDraggable&&pt(Yt,"dragend",this),Ln(Yt),Yt.style["will-change"]="",pn&&!bn&&yt(Yt,an?an.options.ghostClass:this.options.ghostClass,!1),yt(Yt,this.options.chosenClass,!1),Xt({sortable:this,name:"unchoose",toEl:zt,newIndex:null,newDraggableIndex:null,originalEvent:e}),Gt!==zt?(tn>=0&&(Xt({rootEl:zt,name:"add",toEl:zt,fromEl:Gt,originalEvent:e}),Xt({sortable:this,name:"remove",toEl:zt,originalEvent:e}),Xt({rootEl:zt,name:"sort",toEl:zt,fromEl:Gt,originalEvent:e}),Xt({sortable:this,name:"sort",toEl:zt,originalEvent:e})),an&&an.save()):tn!==en&&tn>=0&&(Xt({sortable:this,name:"update",toEl:zt,originalEvent:e}),Xt({sortable:this,name:"sort",toEl:zt,originalEvent:e})),jn.active&&(null!=tn&&-1!==tn||(tn=en,on=nn),Xt({sortable:this,name:"end",toEl:zt,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){qt("nulling",this),Gt=Yt=zt=Wt=Kt=Qt=Jt=Zt=ln=sn=pn=tn=on=en=nn=mn=vn=an=rn=jn.dragged=jn.ghost=jn.clone=jn.active=null,En.forEach(function(e){e.checked=!0}),En.length=cn=dn=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Yt&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move");e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,o=0,i=n.length,r=this.options;o<i;o++)ht(e=n[o],r.draggable,this.el,!1)&&t.push(e.getAttribute(r.dataIdAttr)||Fn(e));return t},sort:function(e,t){var n={},o=this.el;this.toArray().forEach(function(e,t){var i=o.children[t];ht(i,this.options.draggable,o,!1)&&(n[e]=i)},this),t&&this.captureAnimationState(),e.forEach(function(e){n[e]&&(o.removeChild(n[e]),o.appendChild(n[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return ht(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(void 0===t)return n[e];var o=Ft.modifyOption(this,e,t);n[e]=void 0!==o?o:t,"group"===e&&Pn(n)},destroy:function(){qt("destroy",this);var e=this.el;e[jt]=null,pt(e,"mousedown",this._onTapStart),pt(e,"touchstart",this._onTapStart),pt(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(pt(e,"dragover",this),pt(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),_n.splice(_n.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Zt){if(qt("hideClone",this),jn.eventCanceled)return;_t(Qt,"display","none"),this.options.removeCloneOnHide&&Qt.parentNode&&Qt.parentNode.removeChild(Qt),Zt=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(Zt){if(qt("showClone",this),jn.eventCanceled)return;Yt.parentNode!=Gt||this.options.group.revertClone?Kt?Gt.insertBefore(Qt,Kt):Gt.appendChild(Qt):Gt.insertBefore(Qt,Yt),this.options.group.revertClone&&this.animate(Yt,Qt),_t(Qt,"display",""),Zt=!1}}else this._hideClone()}},Cn&&ft(document,"touchmove",function(e){(jn.active||bn)&&e.cancelable&&e.preventDefault()}),jn.utils={on:ft,off:pt,css:_t,find:xt,is:function(e,t){return!!ht(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},throttle:Pt,closest:ht,toggleClass:yt,clone:Mt,index:Ot,nextTick:Bn,cancelNextTick:Hn,detectDirection:Rn,getChild:Ct},jn.get=function(e){return e[jt]},jn.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(jn.utils=Je(Je({},jn.utils),e.utils)),Ft.mount(e)})},jn.create=function(e,t){return new jn(e,t)},jn.version="1.14.0";var qn,Xn,Yn,zn,Wn,Gn,Kn=[],Jn=!1;function Qn(){Kn.forEach(function(e){clearInterval(e.pid)}),Kn=[]}function Zn(){clearInterval(Gn)}var eo,to=Pt(function(e,t,n,o){if(t.scroll){var i,r=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,l=t.scrollSensitivity,s=t.scrollSpeed,c=St(),d=!1;Xn!==n&&(Xn=n,Qn(),qn=t.scroll,i=t.scrollFn,!0===qn&&(qn=It(n,!0)));var u=0,f=qn;do{var p=f,m=kt(p),v=m.top,h=m.bottom,g=m.left,b=m.right,y=m.width,_=m.height,w=void 0,x=void 0,S=p.scrollWidth,k=p.scrollHeight,E=_t(p),C=p.scrollLeft,A=p.scrollTop;p===c?(w=y<S&&("auto"===E.overflowX||"scroll"===E.overflowX||"visible"===E.overflowX),x=_<k&&("auto"===E.overflowY||"scroll"===E.overflowY||"visible"===E.overflowY)):(w=y<S&&("auto"===E.overflowX||"scroll"===E.overflowX),x=_<k&&("auto"===E.overflowY||"scroll"===E.overflowY));var O=w&&(Math.abs(b-r)<=l&&C+y<S)-(Math.abs(g-r)<=l&&!!C),D=x&&(Math.abs(h-a)<=l&&A+_<k)-(Math.abs(v-a)<=l&&!!A);if(!Kn[u])for(var I=0;I<=u;I++)Kn[I]||(Kn[I]={});Kn[u].vx==O&&Kn[u].vy==D&&Kn[u].el===p||(Kn[u].el=p,Kn[u].vx=O,Kn[u].vy=D,clearInterval(Kn[u].pid),0==O&&0==D||(d=!0,Kn[u].pid=setInterval(function(){o&&0===this.layer&&jn.active._onTouchMove(Wn);var t=Kn[this.layer].vy?Kn[this.layer].vy*s:0,n=Kn[this.layer].vx?Kn[this.layer].vx*s:0;"function"==typeof i&&"continue"!==i.call(jn.dragged.parentNode[jt],n,t,e,Wn,Kn[this.layer].el)||Tt(Kn[this.layer].el,n,t)}.bind({layer:u}),24))),u++}while(t.bubbleScroll&&f!==c&&(f=It(f,!1)));Jn=d}},30),no=function(e){var t=e.originalEvent,n=e.putSortable,o=e.dragEl,i=e.activeSortable,r=e.dispatchSortableEvent,a=e.hideGhostForTarget,l=e.unhideGhostForTarget;if(t){var s=n||i;a();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,d=document.elementFromPoint(c.clientX,c.clientY);l(),s&&!s.el.contains(d)&&(r("spill"),this.onSpill({dragEl:o,putSortable:n}))}};function oo(){}function io(){}oo.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var o=Ct(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(t,o):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:no},et(oo,{pluginName:"revertOnSpill"}),io.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:no},et(io,{pluginName:"removeOnSpill"});var ro,ao,lo,so,co,uo=[],fo=[],po=!1,mo=!1,vo=!1;function ho(e,t){fo.forEach(function(n,o){var i=t.children[n.sortableIndex+(e?Number(o):0)];i?t.insertBefore(n,i):t.appendChild(n)})}function go(){uo.forEach(function(e){e!==lo&&e.parentNode&&e.parentNode.removeChild(e)})}jn.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?ft(document,"dragover",this._handleAutoScroll):this.options.supportPointer?ft(document,"pointermove",this._handleFallbackAutoScroll):t.touches?ft(document,"touchmove",this._handleFallbackAutoScroll):ft(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?pt(document,"dragover",this._handleAutoScroll):(pt(document,"pointermove",this._handleFallbackAutoScroll),pt(document,"touchmove",this._handleFallbackAutoScroll),pt(document,"mousemove",this._handleFallbackAutoScroll)),Zn(),Qn(),clearTimeout(gt),gt=void 0},nulling:function(){Wn=Xn=qn=Jn=Gn=Yn=zn=null,Kn.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,o=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,r=document.elementFromPoint(o,i);if(Wn=e,t||this.options.forceAutoScrollFallback||at||rt||st){to(e,this.options,r,t);var a=It(r,!0);!Jn||Gn&&o===Yn&&i===zn||(Gn&&Zn(),Gn=setInterval(function(){var r=It(document.elementFromPoint(o,i),!0);r!==a&&(a=r,Qn()),to(e,n.options,r,t)},10),Yn=o,zn=i)}else{if(!this.options.bubbleScroll||It(r,!0)===St())return void Qn();to(e,this.options,It(r,!1),!1)}}},et(e,{pluginName:"scroll",initializeByDefault:!0})}),jn.mount(io,oo);var bo,yo=Object.freeze({__proto__:null,MultiDrag:function(){function e(e){for(var t in this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this));e.options.supportPointer?ft(document,"pointerup",this._deselectMultiDrag):(ft(document,"mouseup",this._deselectMultiDrag),ft(document,"touchend",this._deselectMultiDrag)),ft(document,"keydown",this._checkKeyDown),ft(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,setData:function(t,n){var o="";uo.length&&ao===e?uo.forEach(function(e,t){o+=(t?", ":"")+e.textContent}):o=n.textContent,t.setData("Text",o)}}}return e.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(e){var t=e.dragEl;lo=t},delayEnded:function(){this.isMultiDrag=~uo.indexOf(lo)},setupClone:function(e){var t=e.sortable,n=e.cancel;if(this.isMultiDrag){for(var o=0;o<uo.length;o++)fo.push(Mt(uo[o])),fo[o].sortableIndex=uo[o].sortableIndex,fo[o].draggable=!1,fo[o].style["will-change"]="",yt(fo[o],this.options.selectedClass,!1),uo[o]===lo&&yt(fo[o],this.options.chosenClass,!1);t._hideClone(),n()}},clone:function(e){var t=e.sortable,n=e.rootEl,o=e.dispatchSortableEvent,i=e.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||uo.length&&ao===t&&(ho(!0,n),o("clone"),i()))},showClone:function(e){var t=e.cloneNowShown,n=e.rootEl,o=e.cancel;this.isMultiDrag&&(ho(!1,n),fo.forEach(function(e){_t(e,"display","")}),t(),co=!1,o())},hideClone:function(e){var t=this;e.sortable;var n=e.cloneNowHidden,o=e.cancel;this.isMultiDrag&&(fo.forEach(function(e){_t(e,"display","none"),t.options.removeCloneOnHide&&e.parentNode&&e.parentNode.removeChild(e)}),n(),co=!0,o())},dragStartGlobal:function(e){e.sortable,!this.isMultiDrag&&ao&&ao.multiDrag._deselectMultiDrag(),uo.forEach(function(e){e.sortableIndex=Ot(e)}),uo=uo.sort(function(e,t){return e.sortableIndex-t.sortableIndex}),vo=!0},dragStarted:function(e){var t=this,n=e.sortable;if(this.isMultiDrag){if(this.options.sort&&(n.captureAnimationState(),this.options.animation)){uo.forEach(function(e){e!==lo&&_t(e,"position","absolute")});var o=kt(lo,!1,!0,!0);uo.forEach(function(e){e!==lo&&Vt(e,o)}),mo=!0,po=!0}n.animateAll(function(){mo=!1,po=!1,t.options.animation&&uo.forEach(function(e){Ut(e)}),t.options.sort&&go()})}},dragOver:function(e){var t=e.target,n=e.completed,o=e.cancel;mo&&~uo.indexOf(t)&&(n(!1),o())},revert:function(e){var t=e.fromSortable,n=e.rootEl,o=e.sortable,i=e.dragRect;uo.length>1&&(uo.forEach(function(e){o.addAnimationState({target:e,rect:mo?kt(e):i}),Ut(e),e.fromRect=i,t.removeAnimationState(e)}),mo=!1,function(e,t){uo.forEach(function(n,o){var i=t.children[n.sortableIndex+(e?Number(o):0)];i?t.insertBefore(n,i):t.appendChild(n)})}(!this.options.removeCloneOnHide,n))},dragOverCompleted:function(e){var t=e.sortable,n=e.isOwner,o=e.insertion,i=e.activeSortable,r=e.parentEl,a=e.putSortable,l=this.options;if(o){if(n&&i._hideClone(),po=!1,l.animation&&uo.length>1&&(mo||!n&&!i.options.sort&&!a)){var s=kt(lo,!1,!0,!0);uo.forEach(function(e){e!==lo&&(Vt(e,s),r.appendChild(e))}),mo=!0}if(!n)if(mo||go(),uo.length>1){var c=co;i._showClone(t),i.options.animation&&!co&&c&&fo.forEach(function(e){i.addAnimationState({target:e,rect:so}),e.fromRect=so,e.thisAnimationDuration=null})}else i._showClone(t)}},dragOverAnimationCapture:function(e){var t=e.dragRect,n=e.isOwner,o=e.activeSortable;if(uo.forEach(function(e){e.thisAnimationDuration=null}),o.options.animation&&!n&&o.multiDrag.isMultiDrag){so=et({},t);var i=wt(lo,!0);so.top-=i.f,so.left-=i.e}},dragOverAnimationComplete:function(){mo&&(mo=!1,go())},drop:function(e){var t=e.originalEvent,n=e.rootEl,o=e.parentEl,i=e.sortable,r=e.dispatchSortableEvent,a=e.oldIndex,l=e.putSortable,s=l||this.sortable;if(t){var c=this.options,d=o.children;if(!vo)if(c.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),yt(lo,c.selectedClass,!~uo.indexOf(lo)),~uo.indexOf(lo))uo.splice(uo.indexOf(lo),1),ro=null,Bt({sortable:i,rootEl:n,name:"deselect",targetEl:lo});else{if(uo.push(lo),Bt({sortable:i,rootEl:n,name:"select",targetEl:lo}),t.shiftKey&&ro&&i.el.contains(ro)){var u,f,p=Ot(ro),m=Ot(lo);if(~p&&~m&&p!==m)for(m>p?(f=p,u=m):(f=m,u=p+1);f<u;f++)~uo.indexOf(d[f])||(yt(d[f],c.selectedClass,!0),uo.push(d[f]),Bt({sortable:i,rootEl:n,name:"select",targetEl:d[f]}))}else ro=lo;ao=s}if(vo&&this.isMultiDrag){if(mo=!1,(o[jt].options.sort||o!==n)&&uo.length>1){var v=kt(lo),h=Ot(lo,":not(."+this.options.selectedClass+")");if(!po&&c.animation&&(lo.thisAnimationDuration=null),s.captureAnimationState(),!po&&(c.animation&&(lo.fromRect=v,uo.forEach(function(e){if(e.thisAnimationDuration=null,e!==lo){var t=mo?kt(e):v;e.fromRect=t,s.addAnimationState({target:e,rect:t})}})),go(),uo.forEach(function(e){d[h]?o.insertBefore(e,d[h]):o.appendChild(e),h++}),a===Ot(lo))){var g=!1;uo.forEach(function(e){e.sortableIndex===Ot(e)||(g=!0)}),g&&r("update")}uo.forEach(function(e){Ut(e)}),s.animateAll()}ao=s}(n===o||l&&"clone"!==l.lastPutMode)&&fo.forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)})}},nullingGlobal:function(){this.isMultiDrag=vo=!1,fo.length=0},destroyGlobal:function(){this._deselectMultiDrag(),pt(document,"pointerup",this._deselectMultiDrag),pt(document,"mouseup",this._deselectMultiDrag),pt(document,"touchend",this._deselectMultiDrag),pt(document,"keydown",this._checkKeyDown),pt(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(void 0!==vo&&vo||ao!==this.sortable||e&&ht(e.target,this.options.draggable,this.sortable.el,!1)||e&&0!==e.button))for(;uo.length;){var t=uo[0];yt(t,this.options.selectedClass,!1),uo.shift(),Bt({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:t})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},et(e,{pluginName:"multiDrag",utils:{select:function(e){var t=e.parentNode[jt];t&&t.options.multiDrag&&!~uo.indexOf(e)&&(ao&&ao!==t&&(ao.multiDrag._deselectMultiDrag(),ao=t),yt(e,t.options.selectedClass,!0),uo.push(e))},deselect:function(e){var t=e.parentNode[jt],n=uo.indexOf(e);t&&t.options.multiDrag&&~n&&(yt(e,t.options.selectedClass,!1),uo.splice(n,1))}},eventProperties:function(){var e=this,t=[],n=[];return uo.forEach(function(o){var i;t.push({multiDragElement:o,index:o.sortableIndex}),i=mo&&o!==lo?-1:mo?Ot(o,":not(."+e.options.selectedClass+")"):Ot(o),n.push({multiDragElement:o,index:i})}),{items:nt(uo),clones:[].concat(fo),oldIndicies:t,newIndicies:n}},optionListeners:{multiDragKey:function(e){return"ctrl"===(e=e.toLowerCase())?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})},Sortable:jn,Swap:function(){function e(){this.defaults={swapClass:"sortable-swap-highlight"}}return e.prototype={dragStart:function(e){var t=e.dragEl;eo=t},dragOverValid:function(e){var t=e.completed,n=e.target,o=e.onMove,i=e.activeSortable,r=e.changed,a=e.cancel;if(i.options.swap){var l=this.sortable.el,s=this.options;if(n&&n!==l){var c=eo;!1!==o(n)?(yt(n,s.swapClass,!0),eo=n):eo=null,c&&c!==eo&&yt(c,s.swapClass,!1)}r(),t(!0),a()}},drop:function(e){var t=e.activeSortable,n=e.putSortable,o=e.dragEl,i=n||this.sortable,r=this.options;eo&&yt(eo,r.swapClass,!1),eo&&(r.swap||n&&n.options.swap)&&o!==eo&&(i.captureAnimationState(),i!==t&&t.captureAnimationState(),function(e,t){var n,o,i=e.parentNode,r=t.parentNode;if(!i||!r||i.isEqualNode(t)||r.isEqualNode(e))return;n=Ot(e),o=Ot(t),i.isEqualNode(r)&&n<o&&o++;i.insertBefore(t,i.children[n]),r.insertBefore(e,r.children[o])}(o,eo),i.animateAll(),i!==t&&t.animateAll())},nulling:function(){eo=null}},et(e,{pluginName:"swap",eventProperties:function(){return{swapItem:eo}}})},default:jn});var _o,wo=bo?We.exports:(bo=1,"undefined"!=typeof self&&self,_o=function(e,t){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({"00ee":function(e,t,n){var o={};o[n("b622")("toStringTag")]="z",e.exports="[object z]"===String(o)},"0366":function(e,t,n){var o=n("1c0b");e.exports=function(e,t,n){if(o(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,o){return e.call(t,n,o)};case 3:return function(n,o,i){return e.call(t,n,o,i)}}return function(){return e.apply(t,arguments)}}},"057f":function(e,t,n){var o=n("fc6a"),i=n("241c").f,r={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==r.call(e)?function(e){try{return i(e)}catch(e){return a.slice()}}(e):i(o(e))}},"06cf":function(e,t,n){var o=n("83ab"),i=n("d1e7"),r=n("5c6c"),a=n("fc6a"),l=n("c04e"),s=n("5135"),c=n("0cfb"),d=Object.getOwnPropertyDescriptor;t.f=o?d:function(e,t){if(e=a(e),t=l(t,!0),c)try{return d(e,t)}catch(e){}if(s(e,t))return r(!i.f.call(e,t),e[t])}},"0cfb":function(e,t,n){var o=n("83ab"),i=n("d039"),r=n("cc12");e.exports=!o&&!i(function(){return 7!=Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a})},"13d5":function(e,t,n){var o=n("23e7"),i=n("d58f").left,r=n("a640"),a=n("ae40"),l=r("reduce"),s=a("reduce",{1:0});o({target:"Array",proto:!0,forced:!l||!s},{reduce:function(e){return i(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},"14c3":function(e,t,n){var o=n("c6b6"),i=n("9263");e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==o(e))throw TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)}},"159b":function(e,t,n){var o=n("da84"),i=n("fdbc"),r=n("17c2"),a=n("9112");for(var l in i){var s=o[l],c=s&&s.prototype;if(c&&c.forEach!==r)try{a(c,"forEach",r)}catch(e){c.forEach=r}}},"17c2":function(e,t,n){var o=n("b727").forEach,i=n("a640"),r=n("ae40"),a=i("forEach"),l=r("forEach");e.exports=a&&l?[].forEach:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}},"1be4":function(e,t,n){var o=n("d066");e.exports=o("document","documentElement")},"1c0b":function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},"1c7e":function(e,t,n){var o=n("b622")("iterator"),i=!1;try{var r=0,a={next:function(){return{done:!!r++}},return:function(){i=!0}};a[o]=function(){return this},Array.from(a,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var r={};r[o]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n}},"1d80":function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},"1dde":function(e,t,n){var o=n("d039"),i=n("b622"),r=n("2d00"),a=i("species");e.exports=function(e){return r>=51||!o(function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo})}},"23cb":function(e,t,n){var o=n("a691"),i=Math.max,r=Math.min;e.exports=function(e,t){var n=o(e);return n<0?i(n+t,0):r(n,t)}},"23e7":function(e,t,n){var o=n("da84"),i=n("06cf").f,r=n("9112"),a=n("6eeb"),l=n("ce4e"),s=n("e893"),c=n("94ca");e.exports=function(e,t){var n,d,u,f,p,m=e.target,v=e.global,h=e.stat;if(n=v?o:h?o[m]||l(m,{}):(o[m]||{}).prototype)for(d in t){if(f=t[d],u=e.noTargetGet?(p=i(n,d))&&p.value:n[d],!c(v?d:m+(h?".":"#")+d,e.forced)&&void 0!==u){if(typeof f==typeof u)continue;s(f,u)}(e.sham||u&&u.sham)&&r(f,"sham",!0),a(n,d,f,e)}}},"241c":function(e,t,n){var o=n("ca84"),i=n("7839").concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return o(e,i)}},"25f0":function(e,t,n){var o=n("6eeb"),i=n("825a"),r=n("d039"),a=n("ad6d"),l="toString",s=RegExp.prototype,c=s[l],d=r(function(){return"/a/b"!=c.call({source:"a",flags:"b"})}),u=c.name!=l;(d||u)&&o(RegExp.prototype,l,function(){var e=i(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in s)?a.call(e):n)},{unsafe:!0})},"2ca0":function(e,t,n){var o,i=n("23e7"),r=n("06cf").f,a=n("50c4"),l=n("5a34"),s=n("1d80"),c=n("ab13"),d=n("c430"),u="".startsWith,f=Math.min,p=c("startsWith");i({target:"String",proto:!0,forced:!(!d&&!p&&(o=r(String.prototype,"startsWith"),o&&!o.writable)||p)},{startsWith:function(e){var t=String(s(this));l(e);var n=a(f(arguments.length>1?arguments[1]:void 0,t.length)),o=String(e);return u?u.call(t,o,n):t.slice(n,n+o.length)===o}})},"2d00":function(e,t,n){var o,i,r=n("da84"),a=n("342f"),l=r.process,s=l&&l.versions,c=s&&s.v8;c?i=(o=c.split("."))[0]+o[1]:a&&(!(o=a.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=a.match(/Chrome\/(\d+)/))&&(i=o[1]),e.exports=i&&+i},"342f":function(e,t,n){var o=n("d066");e.exports=o("navigator","userAgent")||""},"35a1":function(e,t,n){var o=n("f5df"),i=n("3f8c"),r=n("b622")("iterator");e.exports=function(e){if(null!=e)return e[r]||e["@@iterator"]||i[o(e)]}},"37e8":function(e,t,n){var o=n("83ab"),i=n("9bf2"),r=n("825a"),a=n("df75");e.exports=o?Object.defineProperties:function(e,t){r(e);for(var n,o=a(t),l=o.length,s=0;l>s;)i.f(e,n=o[s++],t[n]);return e}},"3bbe":function(e,t,n){var o=n("861d");e.exports=function(e){if(!o(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},"3ca3":function(e,t,n){var o=n("6547").charAt,i=n("69f3"),r=n("7dd0"),a="String Iterator",l=i.set,s=i.getterFor(a);r(String,"String",function(e){l(this,{type:a,string:String(e),index:0})},function(){var e,t=s(this),n=t.string,i=t.index;return i>=n.length?{value:void 0,done:!0}:(e=o(n,i),t.index+=e.length,{value:e,done:!1})})},"3f8c":function(e,t){e.exports={}},4160:function(e,t,n){var o=n("23e7"),i=n("17c2");o({target:"Array",proto:!0,forced:[].forEach!=i},{forEach:i})},"428f":function(e,t,n){var o=n("da84");e.exports=o},"44ad":function(e,t,n){var o=n("d039"),i=n("c6b6"),r="".split;e.exports=o(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==i(e)?r.call(e,""):Object(e)}:Object},"44d2":function(e,t,n){var o=n("b622"),i=n("7c73"),r=n("9bf2"),a=o("unscopables"),l=Array.prototype;null==l[a]&&r.f(l,a,{configurable:!0,value:i(null)}),e.exports=function(e){l[a][e]=!0}},"44e7":function(e,t,n){var o=n("861d"),i=n("c6b6"),r=n("b622")("match");e.exports=function(e){var t;return o(e)&&(void 0!==(t=e[r])?!!t:"RegExp"==i(e))}},4930:function(e,t,n){var o=n("d039");e.exports=!!Object.getOwnPropertySymbols&&!o(function(){return!String(Symbol())})},"4d64":function(e,t,n){var o=n("fc6a"),i=n("50c4"),r=n("23cb"),a=function(e){return function(t,n,a){var l,s=o(t),c=i(s.length),d=r(a,c);if(e&&n!=n){for(;c>d;)if((l=s[d++])!=l)return!0}else for(;c>d;d++)if((e||d in s)&&s[d]===n)return e||d||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},"4de4":function(e,t,n){var o=n("23e7"),i=n("b727").filter,r=n("1dde"),a=n("ae40"),l=r("filter"),s=a("filter");o({target:"Array",proto:!0,forced:!l||!s},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},"4df4":function(e,t,n){var o=n("0366"),i=n("7b0b"),r=n("9bdd"),a=n("e95a"),l=n("50c4"),s=n("8418"),c=n("35a1");e.exports=function(e){var t,n,d,u,f,p,m=i(e),v="function"==typeof this?this:Array,h=arguments.length,g=h>1?arguments[1]:void 0,b=void 0!==g,y=c(m),_=0;if(b&&(g=o(g,h>2?arguments[2]:void 0,2)),null==y||v==Array&&a(y))for(n=new v(t=l(m.length));t>_;_++)p=b?g(m[_],_):m[_],s(n,_,p);else for(f=(u=y.call(m)).next,n=new v;!(d=f.call(u)).done;_++)p=b?r(u,g,[d.value,_],!0):d.value,s(n,_,p);return n.length=_,n}},"4fad":function(e,t,n){var o=n("23e7"),i=n("6f53").entries;o({target:"Object",stat:!0},{entries:function(e){return i(e)}})},"50c4":function(e,t,n){var o=n("a691"),i=Math.min;e.exports=function(e){return e>0?i(o(e),9007199254740991):0}},5135:function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},5319:function(e,t,n){var o=n("d784"),i=n("825a"),r=n("7b0b"),a=n("50c4"),l=n("a691"),s=n("1d80"),c=n("8aa5"),d=n("14c3"),u=Math.max,f=Math.min,p=Math.floor,m=/\$([$&'`]|\d\d?|<[^>]*>)/g,v=/\$([$&'`]|\d\d?)/g,h=function(e){return void 0===e?e:String(e)};o("replace",2,function(e,t,n,o){var g=o.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,b=o.REPLACE_KEEPS_$0,y=g?"$":"$0";return[function(n,o){var i=s(this),r=null==n?void 0:n[e];return void 0!==r?r.call(n,i,o):t.call(String(i),n,o)},function(e,o){if(!g&&b||"string"==typeof o&&-1===o.indexOf(y)){var r=n(t,e,this,o);if(r.done)return r.value}var s=i(e),p=String(this),m="function"==typeof o;m||(o=String(o));var v=s.global;if(v){var w=s.unicode;s.lastIndex=0}for(var x=[];;){var S=d(s,p);if(null===S)break;if(x.push(S),!v)break;""===String(S[0])&&(s.lastIndex=c(p,a(s.lastIndex),w))}for(var k="",E=0,C=0;C<x.length;C++){S=x[C];for(var A=String(S[0]),O=u(f(l(S.index),p.length),0),D=[],I=1;I<S.length;I++)D.push(h(S[I]));var R=S.groups;if(m){var P=[A].concat(D,O,p);void 0!==R&&P.push(R);var T=String(o.apply(void 0,P))}else T=_(A,p,O,D,R,o);O>=E&&(k+=p.slice(E,O)+T,E=O+A.length)}return k+p.slice(E)}];function _(e,n,o,i,a,l){var s=o+e.length,c=i.length,d=v;return void 0!==a&&(a=r(a),d=m),t.call(l,d,function(t,r){var l;switch(r.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,o);case"'":return n.slice(s);case"<":l=a[r.slice(1,-1)];break;default:var d=+r;if(0===d)return t;if(d>c){var u=p(d/10);return 0===u?t:u<=c?void 0===i[u-1]?r.charAt(1):i[u-1]+r.charAt(1):t}l=i[d-1]}return void 0===l?"":l})}})},5692:function(e,t,n){var o=n("c430"),i=n("c6cd");(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:o?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},"56ef":function(e,t,n){var o=n("d066"),i=n("241c"),r=n("7418"),a=n("825a");e.exports=o("Reflect","ownKeys")||function(e){var t=i.f(a(e)),n=r.f;return n?t.concat(n(e)):t}},"5a34":function(e,t,n){var o=n("44e7");e.exports=function(e){if(o(e))throw TypeError("The method doesn't accept regular expressions");return e}},"5c6c":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"5db7":function(e,t,n){var o=n("23e7"),i=n("a2bf"),r=n("7b0b"),a=n("50c4"),l=n("1c0b"),s=n("65f0");o({target:"Array",proto:!0},{flatMap:function(e){var t,n=r(this),o=a(n.length);return l(e),(t=s(n,0)).length=i(t,n,n,o,0,1,e,arguments.length>1?arguments[1]:void 0),t}})},6547:function(e,t,n){var o=n("a691"),i=n("1d80"),r=function(e){return function(t,n){var r,a,l=String(i(t)),s=o(n),c=l.length;return s<0||s>=c?e?"":void 0:(r=l.charCodeAt(s))<55296||r>56319||s+1===c||(a=l.charCodeAt(s+1))<56320||a>57343?e?l.charAt(s):r:e?l.slice(s,s+2):a-56320+(r-55296<<10)+65536}};e.exports={codeAt:r(!1),charAt:r(!0)}},"65f0":function(e,t,n){var o=n("861d"),i=n("e8b5"),r=n("b622")("species");e.exports=function(e,t){var n;return i(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!i(n.prototype)?o(n)&&null===(n=n[r])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)}},"69f3":function(e,t,n){var o,i,r,a=n("7f9a"),l=n("da84"),s=n("861d"),c=n("9112"),d=n("5135"),u=n("f772"),f=n("d012"),p=l.WeakMap;if(a){var m=new p,v=m.get,h=m.has,g=m.set;o=function(e,t){return g.call(m,e,t),t},i=function(e){return v.call(m,e)||{}},r=function(e){return h.call(m,e)}}else{var b=u("state");f[b]=!0,o=function(e,t){return c(e,b,t),t},i=function(e){return d(e,b)?e[b]:{}},r=function(e){return d(e,b)}}e.exports={set:o,get:i,has:r,enforce:function(e){return r(e)?i(e):o(e,{})},getterFor:function(e){return function(t){var n;if(!s(t)||(n=i(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},"6eeb":function(e,t,n){var o=n("da84"),i=n("9112"),r=n("5135"),a=n("ce4e"),l=n("8925"),s=n("69f3"),c=s.get,d=s.enforce,u=String(String).split("String");(e.exports=function(e,t,n,l){var s=!!l&&!!l.unsafe,c=!!l&&!!l.enumerable,f=!!l&&!!l.noTargetGet;"function"==typeof n&&("string"!=typeof t||r(n,"name")||i(n,"name",t),d(n).source=u.join("string"==typeof t?t:"")),e!==o?(s?!f&&e[t]&&(c=!0):delete e[t],c?e[t]=n:i(e,t,n)):c?e[t]=n:a(t,n)})(Function.prototype,"toString",function(){return"function"==typeof this&&c(this).source||l(this)})},"6f53":function(e,t,n){var o=n("83ab"),i=n("df75"),r=n("fc6a"),a=n("d1e7").f,l=function(e){return function(t){for(var n,l=r(t),s=i(l),c=s.length,d=0,u=[];c>d;)n=s[d++],o&&!a.call(l,n)||u.push(e?[n,l[n]]:l[n]);return u}};e.exports={entries:l(!0),values:l(!1)}},"73d9":function(e,t,n){n("44d2")("flatMap")},7418:function(e,t){t.f=Object.getOwnPropertySymbols},"746f":function(e,t,n){var o=n("428f"),i=n("5135"),r=n("e538"),a=n("9bf2").f;e.exports=function(e){var t=o.Symbol||(o.Symbol={});i(t,e)||a(t,e,{value:r.f(e)})}},7839:function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(e,t,n){var o=n("1d80");e.exports=function(e){return Object(o(e))}},"7c73":function(e,t,n){var o,i=n("825a"),r=n("37e8"),a=n("7839"),l=n("d012"),s=n("1be4"),c=n("cc12"),d=n("f772"),u="prototype",f="script",p=d("IE_PROTO"),m=function(){},v=function(e){return"<"+f+">"+e+"</"+f+">"},h=function(){try{o=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t,n;h=o?function(e){e.write(v("")),e.close();var t=e.parentWindow.Object;return e=null,t}(o):(t=c("iframe"),n="java"+f+":",t.style.display="none",s.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(v("document.F=Object")),e.close(),e.F);for(var i=a.length;i--;)delete h[u][a[i]];return h()};l[p]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(m[u]=i(e),n=new m,m[u]=null,n[p]=e):n=h(),void 0===t?n:r(n,t)}},"7dd0":function(e,t,n){var o=n("23e7"),i=n("9ed3"),r=n("e163"),a=n("d2bb"),l=n("d44e"),s=n("9112"),c=n("6eeb"),d=n("b622"),u=n("c430"),f=n("3f8c"),p=n("ae93"),m=p.IteratorPrototype,v=p.BUGGY_SAFARI_ITERATORS,h=d("iterator"),g="keys",b="values",y="entries",_=function(){return this};e.exports=function(e,t,n,d,p,w,x){i(n,t,d);var S,k,E,C=function(e){if(e===p&&R)return R;if(!v&&e in D)return D[e];switch(e){case g:case b:case y:return function(){return new n(this,e)}}return function(){return new n(this)}},A=t+" Iterator",O=!1,D=e.prototype,I=D[h]||D["@@iterator"]||p&&D[p],R=!v&&I||C(p),P="Array"==t&&D.entries||I;if(P&&(S=r(P.call(new e)),m!==Object.prototype&&S.next&&(u||r(S)===m||(a?a(S,m):"function"!=typeof S[h]&&s(S,h,_)),l(S,A,!0,!0),u&&(f[A]=_))),p==b&&I&&I.name!==b&&(O=!0,R=function(){return I.call(this)}),u&&!x||D[h]===R||s(D,h,R),f[t]=R,p)if(k={values:C(b),keys:w?R:C(g),entries:C(y)},x)for(E in k)(v||O||!(E in D))&&c(D,E,k[E]);else o({target:t,proto:!0,forced:v||O},k);return k}},"7f9a":function(e,t,n){var o=n("da84"),i=n("8925"),r=o.WeakMap;e.exports="function"==typeof r&&/native code/.test(i(r))},"825a":function(e,t,n){var o=n("861d");e.exports=function(e){if(!o(e))throw TypeError(String(e)+" is not an object");return e}},"83ab":function(e,t,n){var o=n("d039");e.exports=!o(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},8418:function(e,t,n){var o=n("c04e"),i=n("9bf2"),r=n("5c6c");e.exports=function(e,t,n){var a=o(t);a in e?i.f(e,a,r(0,n)):e[a]=n}},"861d":function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},8875:function(e,t,n){var o,i,r;"undefined"!=typeof self&&self,i=[],void 0===(r="function"==typeof(o=function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(e){var n,o,i,r=/@([^@]*):(\d+):(\d+)\s*$/gi,a=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(e.stack)||r.exec(e.stack),l=a&&a[1]||!1,s=a&&a[2]||!1,c=document.location.href.replace(document.location.hash,""),d=document.getElementsByTagName("script");l===c&&(n=document.documentElement.outerHTML,o=new RegExp("(?:[^\\n]+?\\n){0,"+(s-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),i=n.replace(o,"$1").trim());for(var u=0;u<d.length;u++){if("interactive"===d[u].readyState)return d[u];if(d[u].src===l)return d[u];if(l===c&&d[u].innerHTML&&d[u].innerHTML.trim()===i)return d[u]}return null}}return e})?o.apply(t,i):o)||(e.exports=r)},8925:function(e,t,n){var o=n("c6cd"),i=Function.toString;"function"!=typeof o.inspectSource&&(o.inspectSource=function(e){return i.call(e)}),e.exports=o.inspectSource},"8aa5":function(e,t,n){var o=n("6547").charAt;e.exports=function(e,t,n){return t+(n?o(e,t).length:1)}},"8bbf":function(t,n){t.exports=e},"90e3":function(e,t){var n=0,o=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+o).toString(36)}},9112:function(e,t,n){var o=n("83ab"),i=n("9bf2"),r=n("5c6c");e.exports=o?function(e,t,n){return i.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},9263:function(e,t,n){var o,i,r=n("ad6d"),a=n("9f7f"),l=RegExp.prototype.exec,s=String.prototype.replace,c=l,d=(o=/a/,i=/b*/g,l.call(o,"a"),l.call(i,"a"),0!==o.lastIndex||0!==i.lastIndex),u=a.UNSUPPORTED_Y||a.BROKEN_CARET,f=void 0!==/()??/.exec("")[1];(d||f||u)&&(c=function(e){var t,n,o,i,a=this,c=u&&a.sticky,p=r.call(a),m=a.source,v=0,h=e;return c&&(-1===(p=p.replace("y","")).indexOf("g")&&(p+="g"),h=String(e).slice(a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==e[a.lastIndex-1])&&(m="(?: "+m+")",h=" "+h,v++),n=new RegExp("^(?:"+m+")",p)),f&&(n=new RegExp("^"+m+"$(?!\\s)",p)),d&&(t=a.lastIndex),o=l.call(c?n:a,h),c?o?(o.input=o.input.slice(v),o[0]=o[0].slice(v),o.index=a.lastIndex,a.lastIndex+=o[0].length):a.lastIndex=0:d&&o&&(a.lastIndex=a.global?o.index+o[0].length:t),f&&o&&o.length>1&&s.call(o[0],n,function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(o[i]=void 0)}),o}),e.exports=c},"94ca":function(e,t,n){var o=n("d039"),i=/#|\.prototype\./,r=function(e,t){var n=l[a(e)];return n==c||n!=s&&("function"==typeof t?o(t):!!t)},a=r.normalize=function(e){return String(e).replace(i,".").toLowerCase()},l=r.data={},s=r.NATIVE="N",c=r.POLYFILL="P";e.exports=r},"99af":function(e,t,n){var o=n("23e7"),i=n("d039"),r=n("e8b5"),a=n("861d"),l=n("7b0b"),s=n("50c4"),c=n("8418"),d=n("65f0"),u=n("1dde"),f=n("b622"),p=n("2d00"),m=f("isConcatSpreadable"),v=9007199254740991,h="Maximum allowed index exceeded",g=p>=51||!i(function(){var e=[];return e[m]=!1,e.concat()[0]!==e}),b=u("concat"),y=function(e){if(!a(e))return!1;var t=e[m];return void 0!==t?!!t:r(e)};o({target:"Array",proto:!0,forced:!g||!b},{concat:function(e){var t,n,o,i,r,a=l(this),u=d(a,0),f=0;for(t=-1,o=arguments.length;t<o;t++)if(y(r=-1===t?a:arguments[t])){if(f+(i=s(r.length))>v)throw TypeError(h);for(n=0;n<i;n++,f++)n in r&&c(u,f,r[n])}else{if(f>=v)throw TypeError(h);c(u,f++,r)}return u.length=f,u}})},"9bdd":function(e,t,n){var o=n("825a");e.exports=function(e,t,n,i){try{return i?t(o(n)[0],n[1]):t(n)}catch(t){var r=e.return;throw void 0!==r&&o(r.call(e)),t}}},"9bf2":function(e,t,n){var o=n("83ab"),i=n("0cfb"),r=n("825a"),a=n("c04e"),l=Object.defineProperty;t.f=o?l:function(e,t,n){if(r(e),t=a(t,!0),r(n),i)try{return l(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},"9ed3":function(e,t,n){var o=n("ae93").IteratorPrototype,i=n("7c73"),r=n("5c6c"),a=n("d44e"),l=n("3f8c"),s=function(){return this};e.exports=function(e,t,n){var c=t+" Iterator";return e.prototype=i(o,{next:r(1,n)}),a(e,c,!1,!0),l[c]=s,e}},"9f7f":function(e,t,n){var o=n("d039");function i(e,t){return RegExp(e,t)}t.UNSUPPORTED_Y=o(function(){var e=i("a","y");return e.lastIndex=2,null!=e.exec("abcd")}),t.BROKEN_CARET=o(function(){var e=i("^r","gy");return e.lastIndex=2,null!=e.exec("str")})},a2bf:function(e,t,n){var o=n("e8b5"),i=n("50c4"),r=n("0366"),a=function(e,t,n,l,s,c,d,u){for(var f,p=s,m=0,v=!!d&&r(d,u,3);m<l;){if(m in n){if(f=v?v(n[m],m,t):n[m],c>0&&o(f))p=a(e,t,f,i(f.length),p,c-1)-1;else{if(p>=9007199254740991)throw TypeError("Exceed the acceptable array length");e[p]=f}p++}m++}return p};e.exports=a},a352:function(e,n){e.exports=t},a434:function(e,t,n){var o=n("23e7"),i=n("23cb"),r=n("a691"),a=n("50c4"),l=n("7b0b"),s=n("65f0"),c=n("8418"),d=n("1dde"),u=n("ae40"),f=d("splice"),p=u("splice",{ACCESSORS:!0,0:0,1:2}),m=Math.max,v=Math.min;o({target:"Array",proto:!0,forced:!f||!p},{splice:function(e,t){var n,o,d,u,f,p,h=l(this),g=a(h.length),b=i(e,g),y=arguments.length;if(0===y?n=o=0:1===y?(n=0,o=g-b):(n=y-2,o=v(m(r(t),0),g-b)),g+n-o>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(d=s(h,o),u=0;u<o;u++)(f=b+u)in h&&c(d,u,h[f]);if(d.length=o,n<o){for(u=b;u<g-o;u++)p=u+n,(f=u+o)in h?h[p]=h[f]:delete h[p];for(u=g;u>g-o+n;u--)delete h[u-1]}else if(n>o)for(u=g-o;u>b;u--)p=u+n-1,(f=u+o-1)in h?h[p]=h[f]:delete h[p];for(u=0;u<n;u++)h[u+b]=arguments[u+2];return h.length=g-o+n,d}})},a4d3:function(e,t,n){var o=n("23e7"),i=n("da84"),r=n("d066"),a=n("c430"),l=n("83ab"),s=n("4930"),c=n("fdbf"),d=n("d039"),u=n("5135"),f=n("e8b5"),p=n("861d"),m=n("825a"),v=n("7b0b"),h=n("fc6a"),g=n("c04e"),b=n("5c6c"),y=n("7c73"),_=n("df75"),w=n("241c"),x=n("057f"),S=n("7418"),k=n("06cf"),E=n("9bf2"),C=n("d1e7"),A=n("9112"),O=n("6eeb"),D=n("5692"),I=n("f772"),R=n("d012"),P=n("90e3"),T=n("b622"),M=n("e538"),V=n("746f"),U=n("d44e"),j=n("69f3"),N=n("b727").forEach,L=I("hidden"),$="Symbol",F="prototype",B=T("toPrimitive"),H=j.set,q=j.getterFor($),X=Object[F],Y=i.Symbol,z=r("JSON","stringify"),W=k.f,G=E.f,K=x.f,J=C.f,Q=D("symbols"),Z=D("op-symbols"),ee=D("string-to-symbol-registry"),te=D("symbol-to-string-registry"),ne=D("wks"),oe=i.QObject,ie=!oe||!oe[F]||!oe[F].findChild,re=l&&d(function(){return 7!=y(G({},"a",{get:function(){return G(this,"a",{value:7}).a}})).a})?function(e,t,n){var o=W(X,t);o&&delete X[t],G(e,t,n),o&&e!==X&&G(X,t,o)}:G,ae=function(e,t){var n=Q[e]=y(Y[F]);return H(n,{type:$,tag:e,description:t}),l||(n.description=t),n},le=c?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof Y},se=function(e,t,n){e===X&&se(Z,t,n),m(e);var o=g(t,!0);return m(n),u(Q,o)?(n.enumerable?(u(e,L)&&e[L][o]&&(e[L][o]=!1),n=y(n,{enumerable:b(0,!1)})):(u(e,L)||G(e,L,b(1,{})),e[L][o]=!0),re(e,o,n)):G(e,o,n)},ce=function(e,t){m(e);var n=h(t),o=_(n).concat(pe(n));return N(o,function(t){l&&!de.call(n,t)||se(e,t,n[t])}),e},de=function(e){var t=g(e,!0),n=J.call(this,t);return!(this===X&&u(Q,t)&&!u(Z,t))&&(!(n||!u(this,t)||!u(Q,t)||u(this,L)&&this[L][t])||n)},ue=function(e,t){var n=h(e),o=g(t,!0);if(n!==X||!u(Q,o)||u(Z,o)){var i=W(n,o);return!i||!u(Q,o)||u(n,L)&&n[L][o]||(i.enumerable=!0),i}},fe=function(e){var t=K(h(e)),n=[];return N(t,function(e){u(Q,e)||u(R,e)||n.push(e)}),n},pe=function(e){var t=e===X,n=K(t?Z:h(e)),o=[];return N(n,function(e){!u(Q,e)||t&&!u(X,e)||o.push(Q[e])}),o};s||(Y=function(){if(this instanceof Y)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=P(e),n=function(e){this===X&&n.call(Z,e),u(this,L)&&u(this[L],t)&&(this[L][t]=!1),re(this,t,b(1,e))};return l&&ie&&re(X,t,{configurable:!0,set:n}),ae(t,e)},O(Y[F],"toString",function(){return q(this).tag}),O(Y,"withoutSetter",function(e){return ae(P(e),e)}),C.f=de,E.f=se,k.f=ue,w.f=x.f=fe,S.f=pe,M.f=function(e){return ae(T(e),e)},l&&(G(Y[F],"description",{configurable:!0,get:function(){return q(this).description}}),a||O(X,"propertyIsEnumerable",de,{unsafe:!0}))),o({global:!0,wrap:!0,forced:!s,sham:!s},{Symbol:Y}),N(_(ne),function(e){V(e)}),o({target:$,stat:!0,forced:!s},{for:function(e){var t=String(e);if(u(ee,t))return ee[t];var n=Y(t);return ee[t]=n,te[n]=t,n},keyFor:function(e){if(!le(e))throw TypeError(e+" is not a symbol");if(u(te,e))return te[e]},useSetter:function(){ie=!0},useSimple:function(){ie=!1}}),o({target:"Object",stat:!0,forced:!s,sham:!l},{create:function(e,t){return void 0===t?y(e):ce(y(e),t)},defineProperty:se,defineProperties:ce,getOwnPropertyDescriptor:ue}),o({target:"Object",stat:!0,forced:!s},{getOwnPropertyNames:fe,getOwnPropertySymbols:pe}),o({target:"Object",stat:!0,forced:d(function(){S.f(1)})},{getOwnPropertySymbols:function(e){return S.f(v(e))}}),z&&o({target:"JSON",stat:!0,forced:!s||d(function(){var e=Y();return"[null]"!=z([e])||"{}"!=z({a:e})||"{}"!=z(Object(e))})},{stringify:function(e,t,n){for(var o,i=[e],r=1;arguments.length>r;)i.push(arguments[r++]);if(o=t,(p(t)||void 0!==e)&&!le(e))return f(t)||(t=function(e,t){if("function"==typeof o&&(t=o.call(this,e,t)),!le(t))return t}),i[1]=t,z.apply(null,i)}}),Y[F][B]||A(Y[F],B,Y[F].valueOf),U(Y,$),R[L]=!0},a630:function(e,t,n){var o=n("23e7"),i=n("4df4");o({target:"Array",stat:!0,forced:!n("1c7e")(function(e){Array.from(e)})},{from:i})},a640:function(e,t,n){var o=n("d039");e.exports=function(e,t){var n=[][e];return!!n&&o(function(){n.call(null,t||function(){throw 1},1)})}},a691:function(e,t){var n=Math.ceil,o=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?o:n)(e)}},ab13:function(e,t,n){var o=n("b622")("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[o]=!1,"/./"[e](t)}catch(e){}}return!1}},ac1f:function(e,t,n){var o=n("23e7"),i=n("9263");o({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},ad6d:function(e,t,n){var o=n("825a");e.exports=function(){var e=o(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},ae40:function(e,t,n){var o=n("83ab"),i=n("d039"),r=n("5135"),a=Object.defineProperty,l={},s=function(e){throw e};e.exports=function(e,t){if(r(l,e))return l[e];t||(t={});var n=[][e],c=!!r(t,"ACCESSORS")&&t.ACCESSORS,d=r(t,0)?t[0]:s,u=r(t,1)?t[1]:void 0;return l[e]=!!n&&!i(function(){if(c&&!o)return!0;var e={length:-1};c?a(e,1,{enumerable:!0,get:s}):e[1]=1,n.call(e,d,u)})}},ae93:function(e,t,n){var o,i,r,a=n("e163"),l=n("9112"),s=n("5135"),c=n("b622"),d=n("c430"),u=c("iterator"),f=!1;[].keys&&("next"in(r=[].keys())?(i=a(a(r)))!==Object.prototype&&(o=i):f=!0),null==o&&(o={}),d||s(o,u)||l(o,u,function(){return this}),e.exports={IteratorPrototype:o,BUGGY_SAFARI_ITERATORS:f}},b041:function(e,t,n){var o=n("00ee"),i=n("f5df");e.exports=o?{}.toString:function(){return"[object "+i(this)+"]"}},b0c0:function(e,t,n){var o=n("83ab"),i=n("9bf2").f,r=Function.prototype,a=r.toString,l=/^\s*function ([^ (]*)/,s="name";o&&!(s in r)&&i(r,s,{configurable:!0,get:function(){try{return a.call(this).match(l)[1]}catch(e){return""}}})},b622:function(e,t,n){var o=n("da84"),i=n("5692"),r=n("5135"),a=n("90e3"),l=n("4930"),s=n("fdbf"),c=i("wks"),d=o.Symbol,u=s?d:d&&d.withoutSetter||a;e.exports=function(e){return r(c,e)||(l&&r(d,e)?c[e]=d[e]:c[e]=u("Symbol."+e)),c[e]}},b64b:function(e,t,n){var o=n("23e7"),i=n("7b0b"),r=n("df75");o({target:"Object",stat:!0,forced:n("d039")(function(){r(1)})},{keys:function(e){return r(i(e))}})},b727:function(e,t,n){var o=n("0366"),i=n("44ad"),r=n("7b0b"),a=n("50c4"),l=n("65f0"),s=[].push,c=function(e){var t=1==e,n=2==e,c=3==e,d=4==e,u=6==e,f=5==e||u;return function(p,m,v,h){for(var g,b,y=r(p),_=i(y),w=o(m,v,3),x=a(_.length),S=0,k=h||l,E=t?k(p,x):n?k(p,0):void 0;x>S;S++)if((f||S in _)&&(b=w(g=_[S],S,y),e))if(t)E[S]=b;else if(b)switch(e){case 3:return!0;case 5:return g;case 6:return S;case 2:s.call(E,g)}else if(d)return!1;return u?-1:c||d?d:E}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6)}},c04e:function(e,t,n){var o=n("861d");e.exports=function(e,t){if(!o(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!o(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!o(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!o(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},c430:function(e,t){e.exports=!1},c6b6:function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},c6cd:function(e,t,n){var o=n("da84"),i=n("ce4e"),r="__core-js_shared__",a=o[r]||i(r,{});e.exports=a},c740:function(e,t,n){var o=n("23e7"),i=n("b727").findIndex,r=n("44d2"),a=n("ae40"),l="findIndex",s=!0,c=a(l);l in[]&&Array(1)[l](function(){s=!1}),o({target:"Array",proto:!0,forced:s||!c},{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),r(l)},c8ba:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},c975:function(e,t,n){var o=n("23e7"),i=n("4d64").indexOf,r=n("a640"),a=n("ae40"),l=[].indexOf,s=!!l&&1/[1].indexOf(1,-0)<0,c=r("indexOf"),d=a("indexOf",{ACCESSORS:!0,1:0});o({target:"Array",proto:!0,forced:s||!c||!d},{indexOf:function(e){return s?l.apply(this,arguments)||0:i(this,e,arguments.length>1?arguments[1]:void 0)}})},ca84:function(e,t,n){var o=n("5135"),i=n("fc6a"),r=n("4d64").indexOf,a=n("d012");e.exports=function(e,t){var n,l=i(e),s=0,c=[];for(n in l)!o(a,n)&&o(l,n)&&c.push(n);for(;t.length>s;)o(l,n=t[s++])&&(~r(c,n)||c.push(n));return c}},caad:function(e,t,n){var o=n("23e7"),i=n("4d64").includes,r=n("44d2");o({target:"Array",proto:!0,forced:!n("ae40")("indexOf",{ACCESSORS:!0,1:0})},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),r("includes")},cc12:function(e,t,n){var o=n("da84"),i=n("861d"),r=o.document,a=i(r)&&i(r.createElement);e.exports=function(e){return a?r.createElement(e):{}}},ce4e:function(e,t,n){var o=n("da84"),i=n("9112");e.exports=function(e,t){try{i(o,e,t)}catch(n){o[e]=t}return t}},d012:function(e,t){e.exports={}},d039:function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},d066:function(e,t,n){var o=n("428f"),i=n("da84"),r=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?r(o[e])||r(i[e]):o[e]&&o[e][t]||i[e]&&i[e][t]}},d1e7:function(e,t,n){var o={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,r=i&&!o.call({1:2},1);t.f=r?function(e){var t=i(this,e);return!!t&&t.enumerable}:o},d28b:function(e,t,n){n("746f")("iterator")},d2bb:function(e,t,n){var o=n("825a"),i=n("3bbe");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return o(n),i(r),t?e.call(n,r):n.__proto__=r,n}}():void 0)},d3b7:function(e,t,n){var o=n("00ee"),i=n("6eeb"),r=n("b041");o||i(Object.prototype,"toString",r,{unsafe:!0})},d44e:function(e,t,n){var o=n("9bf2").f,i=n("5135"),r=n("b622")("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,r)&&o(e,r,{configurable:!0,value:t})}},d58f:function(e,t,n){var o=n("1c0b"),i=n("7b0b"),r=n("44ad"),a=n("50c4"),l=function(e){return function(t,n,l,s){o(n);var c=i(t),d=r(c),u=a(c.length),f=e?u-1:0,p=e?-1:1;if(l<2)for(;;){if(f in d){s=d[f],f+=p;break}if(f+=p,e?f<0:u<=f)throw TypeError("Reduce of empty array with no initial value")}for(;e?f>=0:u>f;f+=p)f in d&&(s=n(s,d[f],f,c));return s}};e.exports={left:l(!1),right:l(!0)}},d784:function(e,t,n){n("ac1f");var o=n("6eeb"),i=n("d039"),r=n("b622"),a=n("9263"),l=n("9112"),s=r("species"),c=!i(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),d="$0"==="a".replace(/./,"$0"),u=r("replace"),f=!!/./[u]&&""===/./[u]("a","$0"),p=!i(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]});e.exports=function(e,t,n,u){var m=r(e),v=!i(function(){var t={};return t[m]=function(){return 7},7!=""[e](t)}),h=v&&!i(function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[s]=function(){return n},n.flags="",n[m]=/./[m]),n.exec=function(){return t=!0,null},n[m](""),!t});if(!v||!h||"replace"===e&&(!c||!d||f)||"split"===e&&!p){var g=/./[m],b=n(m,""[e],function(e,t,n,o,i){return t.exec===a?v&&!i?{done:!0,value:g.call(t,n,o)}:{done:!0,value:e.call(n,t,o)}:{done:!1}},{REPLACE_KEEPS_$0:d,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:f}),y=b[0],_=b[1];o(String.prototype,e,y),o(RegExp.prototype,m,2==t?function(e,t){return _.call(e,this,t)}:function(e){return _.call(e,this)})}u&&l(RegExp.prototype[m],"sham",!0)}},d81d:function(e,t,n){var o=n("23e7"),i=n("b727").map,r=n("1dde"),a=n("ae40"),l=r("map"),s=a("map");o({target:"Array",proto:!0,forced:!l||!s},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},da84:function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||Function("return this")()}).call(this,n("c8ba"))},dbb4:function(e,t,n){var o=n("23e7"),i=n("83ab"),r=n("56ef"),a=n("fc6a"),l=n("06cf"),s=n("8418");o({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t,n,o=a(e),i=l.f,c=r(o),d={},u=0;c.length>u;)void 0!==(n=i(o,t=c[u++]))&&s(d,t,n);return d}})},dbf1:function(e,t,n){(function(e){n.d(t,"a",function(){return o});var o="undefined"!=typeof window?window.console:e.console}).call(this,n("c8ba"))},ddb0:function(e,t,n){var o=n("da84"),i=n("fdbc"),r=n("e260"),a=n("9112"),l=n("b622"),s=l("iterator"),c=l("toStringTag"),d=r.values;for(var u in i){var f=o[u],p=f&&f.prototype;if(p){if(p[s]!==d)try{a(p,s,d)}catch(e){p[s]=d}if(p[c]||a(p,c,u),i[u])for(var m in r)if(p[m]!==r[m])try{a(p,m,r[m])}catch(e){p[m]=r[m]}}}},df75:function(e,t,n){var o=n("ca84"),i=n("7839");e.exports=Object.keys||function(e){return o(e,i)}},e01a:function(e,t,n){var o=n("23e7"),i=n("83ab"),r=n("da84"),a=n("5135"),l=n("861d"),s=n("9bf2").f,c=n("e893"),d=r.Symbol;if(i&&"function"==typeof d&&(!("description"in d.prototype)||void 0!==d().description)){var u={},f=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof f?new d(e):void 0===e?d():d(e);return""===e&&(u[t]=!0),t};c(f,d);var p=f.prototype=d.prototype;p.constructor=f;var m=p.toString,v="Symbol(test)"==String(d("test")),h=/^Symbol\((.*)\)[^)]+$/;s(p,"description",{configurable:!0,get:function(){var e=l(this)?this.valueOf():this,t=m.call(e);if(a(u,e))return"";var n=v?t.slice(7,-1):t.replace(h,"$1");return""===n?void 0:n}}),o({global:!0,forced:!0},{Symbol:f})}},e163:function(e,t,n){var o=n("5135"),i=n("7b0b"),r=n("f772"),a=n("e177"),l=r("IE_PROTO"),s=Object.prototype;e.exports=a?Object.getPrototypeOf:function(e){return e=i(e),o(e,l)?e[l]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},e177:function(e,t,n){var o=n("d039");e.exports=!o(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},e260:function(e,t,n){var o=n("fc6a"),i=n("44d2"),r=n("3f8c"),a=n("69f3"),l=n("7dd0"),s="Array Iterator",c=a.set,d=a.getterFor(s);e.exports=l(Array,"Array",function(e,t){c(this,{type:s,target:o(e),index:0,kind:t})},function(){var e=d(this),t=e.target,n=e.kind,o=e.index++;return!t||o>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:o,done:!1}:"values"==n?{value:t[o],done:!1}:{value:[o,t[o]],done:!1}},"values"),r.Arguments=r.Array,i("keys"),i("values"),i("entries")},e439:function(e,t,n){var o=n("23e7"),i=n("d039"),r=n("fc6a"),a=n("06cf").f,l=n("83ab"),s=i(function(){a(1)});o({target:"Object",stat:!0,forced:!l||s,sham:!l},{getOwnPropertyDescriptor:function(e,t){return a(r(e),t)}})},e538:function(e,t,n){var o=n("b622");t.f=o},e893:function(e,t,n){var o=n("5135"),i=n("56ef"),r=n("06cf"),a=n("9bf2");e.exports=function(e,t){for(var n=i(t),l=a.f,s=r.f,c=0;c<n.length;c++){var d=n[c];o(e,d)||l(e,d,s(t,d))}}},e8b5:function(e,t,n){var o=n("c6b6");e.exports=Array.isArray||function(e){return"Array"==o(e)}},e95a:function(e,t,n){var o=n("b622"),i=n("3f8c"),r=o("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||a[r]===e)}},f5df:function(e,t,n){var o=n("00ee"),i=n("c6b6"),r=n("b622")("toStringTag"),a="Arguments"==i(function(){return arguments}());e.exports=o?i:function(e){var t,n,o;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),r))?n:a?i(t):"Object"==(o=i(t))&&"function"==typeof t.callee?"Arguments":o}},f772:function(e,t,n){var o=n("5692"),i=n("90e3"),r=o("keys");e.exports=function(e){return r[e]||(r[e]=i(e))}},fb15:function(e,t,n){if(n.r(t),"undefined"!=typeof window){var o=window.document.currentScript,i=n("8875");o=i(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:i});var r=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function d(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],o=!0,i=!1,r=void 0;try{for(var a,l=e[Symbol.iterator]();!(o=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);o=!0);}catch(e){i=!0,r=e}finally{try{o||null==l.return||l.return()}finally{if(i)throw r}}return n}}(e,t)||d(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n("99af"),n("4de4"),n("4160"),n("c975"),n("d81d"),n("a434"),n("159b"),n("a4d3"),n("e439"),n("dbb4"),n("b64b"),n("e01a"),n("d28b"),n("e260"),n("d3b7"),n("3ca3"),n("ddb0"),n("a630"),n("fb6a"),n("b0c0"),n("25f0");var p=n("a352"),m=n.n(p);function v(e){null!==e.parentElement&&e.parentElement.removeChild(e)}function h(e,t,n){var o=0===n?e.children[0]:e.children[n-1].nextSibling;e.insertBefore(t,o)}var g=n("dbf1");n("13d5"),n("4fad"),n("ac1f"),n("5319");var b,y,_=/-(\w)/g,w=(b=function(e){return e.replace(_,function(e,t){return t.toUpperCase()})},y=Object.create(null),function(e){return y[e]||(y[e]=b(e))});n("5db7"),n("73d9");var x=["Start","Add","Remove","Update","End"],S=["Choose","Unchoose","Sort","Filter","Clone"],k=["Move"],E=[k,x,S].flatMap(function(e){return e}).map(function(e){return"on".concat(e)}),C={manage:k,manageAndEmit:x,emit:S};n("caad"),n("2ca0");var A=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"];function O(e){return["id","class","role","style"].includes(e)||e.startsWith("data-")||e.startsWith("aria-")||e.startsWith("on")}function D(e){return e.reduce(function(e,t){var n=u(t,2),o=n[0],i=n[1];return e[o]=i,e},{})}function I(e){return Object.entries(e).filter(function(e){var t=u(e,2),n=t[0];return t[1],!O(n)}).map(function(e){var t=u(e,2),n=t[0],o=t[1];return[w(n),o]}).filter(function(e){var t,n=u(e,2),o=n[0];return n[1],t=o,!(-1!==E.indexOf(t))})}function R(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(e.prototype,t),e}n("c740");var P=function(e){return e.el},T=function(e){return e.__draggable_context},M=function(){function e(t){var n=t.nodes,o=n.header,i=n.default,r=n.footer,a=t.root,l=t.realList;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.defaultNodes=i,this.children=[].concat(f(o),f(i),f(r)),this.externalComponent=a.externalComponent,this.rootTransition=a.transition,this.tag=a.tag,this.realList=l}return R(e,[{key:"render",value:function(e,t){var n=this.tag,o=this.children;return e(n,t,this._isRootComponent?{default:function(){return o}}:o)}},{key:"updated",value:function(){var e=this.defaultNodes,t=this.realList;e.forEach(function(e,n){var o,i;o=P(e),i={element:t[n],index:n},o.__draggable_context=i})}},{key:"getUnderlyingVm",value:function(e){return T(e)}},{key:"getVmIndexFromDomIndex",value:function(e,t){var n=this.defaultNodes,o=n.length,i=t.children,r=i.item(e);if(null===r)return o;var a=T(r);if(a)return a.index;if(0===o)return 0;var l=P(n[0]),s=f(i).findIndex(function(e){return e===l});return e<s?0:o}},{key:"_isRootComponent",get:function(){return this.externalComponent||this.rootTransition}}]),e}(),V=n("8bbf");function U(e){var t=["transition-group","TransitionGroup"].includes(e),n=!function(e){return A.includes(e)}(e)&&!t;return{transition:t,externalComponent:n,tag:n?Object(V.resolveComponent)(e):t?V.TransitionGroup:e}}function j(e){var t=e.$slots,n=e.tag,o=e.realList,i=function(e){var t=e.$slots,n=e.realList,o=e.getKey,i=n||[],r=u(["header","footer"].map(function(e){return(n=t[e])?n():[];var n}),2),a=r[0],l=r[1],c=t.item;if(!c)throw new Error("draggable element must have an item slot");var d=i.flatMap(function(e,t){return c({element:e,index:t}).map(function(t){return t.key=o(e),t.props=s(s({},t.props||{}),{},{"data-draggable":!0}),t})});if(d.length!==i.length)throw new Error("Item slot must have only one child");return{header:a,footer:l,default:d}}({$slots:t,realList:o,getKey:e.getKey}),r=U(n);return new M({nodes:i,root:r,realList:o})}function N(e,t){var n=this;Object(V.nextTick)(function(){return n.$emit(e.toLowerCase(),t)})}function L(e){var t=this;return function(n,o){if(null!==t.realList)return t["onDrag".concat(e)](n,o)}}function $(e){var t=this,n=L.call(this,e);return function(o,i){n.call(t,o,i),N.call(t,e,o)}}var F=null,B={list:{type:Array,required:!1,default:null},modelValue:{type:Array,required:!1,default:null},itemKey:{type:[String,Function],required:!0},clone:{type:Function,default:function(e){return e}},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},H=["update:modelValue","change"].concat(f([].concat(f(C.manageAndEmit),f(C.emit)).map(function(e){return e.toLowerCase()}))),q=Object(V.defineComponent)({name:"draggable",inheritAttrs:!1,props:B,emits:H,data:function(){return{error:!1}},render:function(){try{this.error=!1;var e=this.$slots,t=this.$attrs,n=this.tag,o=this.componentData,i=j({$slots:e,tag:n,realList:this.realList,getKey:this.getKey});this.componentStructure=i;var r=function(e){var t=e.$attrs,n=e.componentData,o=void 0===n?{}:n;return s(s({},D(Object.entries(t).filter(function(e){var t=u(e,2),n=t[0];return t[1],O(n)}))),o)}({$attrs:t,componentData:o});return i.render(V.h,r)}catch(e){return this.error=!0,Object(V.h)("pre",{style:{color:"red"}},e.stack)}},created:function(){null!==this.list&&null!==this.modelValue&&g.a.error("modelValue and list props are mutually exclusive! Please set one or another.")},mounted:function(){var e=this;if(!this.error){var t=this.$attrs,n=this.$el;this.componentStructure.updated();var o=function(e){var t=e.$attrs,n=e.callBackBuilder,o=D(I(t));Object.entries(n).forEach(function(e){var t=u(e,2),n=t[0],i=t[1];C[n].forEach(function(e){o["on".concat(e)]=i(e)})});var i="[data-draggable]".concat(o.draggable||"");return s(s({},o),{},{draggable:i})}({$attrs:t,callBackBuilder:{manageAndEmit:function(t){return $.call(e,t)},emit:function(t){return N.bind(e,t)},manage:function(t){return L.call(e,t)}}}),i=1===n.nodeType?n:n.parentElement;this._sortable=new m.a(i,o),this.targetDomElement=i,i.__draggable_component__=this}},updated:function(){this.componentStructure.updated()},beforeUnmount:function(){void 0!==this._sortable&&this._sortable.destroy()},computed:{realList:function(){var e=this.list;return e||this.modelValue},getKey:function(){var e=this.itemKey;return"function"==typeof e?e:function(t){return t[e]}}},watch:{$attrs:{handler:function(e){var t=this._sortable;t&&I(e).forEach(function(e){var n=u(e,2),o=n[0],i=n[1];t.option(o,i)})},deep:!0}},methods:{getUnderlyingVm:function(e){return this.componentStructure.getUnderlyingVm(e)||null},getUnderlyingPotencialDraggableComponent:function(e){return e.__draggable_component__},emitChanges:function(e){var t=this;Object(V.nextTick)(function(){return t.$emit("change",e)})},alterList:function(e){if(this.list)e(this.list);else{var t=f(this.modelValue);e(t),this.$emit("update:modelValue",t)}},spliceList:function(){var e=arguments,t=function(t){return t.splice.apply(t,f(e))};this.alterList(t)},updatePosition:function(e,t){var n=function(n){return n.splice(t,0,n.splice(e,1)[0])};this.alterList(n)},getRelatedContextFromMoveEvent:function(e){var t=e.to,n=e.related,o=this.getUnderlyingPotencialDraggableComponent(t);if(!o)return{component:o};var i=o.realList,r={list:i,component:o};return t!==n&&i?s(s({},o.getUnderlyingVm(n)||{}),r):r},getVmIndexFromDomIndex:function(e){return this.componentStructure.getVmIndexFromDomIndex(e,this.targetDomElement)},onDragStart:function(e){this.context=this.getUnderlyingVm(e.item),e.item._underlying_vm_=this.clone(this.context.element),F=e.item},onDragAdd:function(e){var t=e.item._underlying_vm_;if(void 0!==t){v(e.item);var n=this.getVmIndexFromDomIndex(e.newIndex);this.spliceList(n,0,t);var o={element:t,newIndex:n};this.emitChanges({added:o})}},onDragRemove:function(e){if(h(this.$el,e.item,e.oldIndex),"clone"!==e.pullMode){var t=this.context,n=t.index,o=t.element;this.spliceList(n,1);var i={element:o,oldIndex:n};this.emitChanges({removed:i})}else v(e.clone)},onDragUpdate:function(e){v(e.item),h(e.from,e.item,e.oldIndex);var t=this.context.index,n=this.getVmIndexFromDomIndex(e.newIndex);this.updatePosition(t,n);var o={element:this.context.element,oldIndex:t,newIndex:n};this.emitChanges({moved:o})},computeFutureIndex:function(e,t){if(!e.element)return 0;var n=f(t.to.children).filter(function(e){return"none"!==e.style.display}),o=n.indexOf(t.related),i=e.component.getVmIndexFromDomIndex(o);return-1===n.indexOf(F)&&t.willInsertAfter?i+1:i},onDragMove:function(e,t){var n=this.move,o=this.realList;if(!n||!o)return!0;var i=this.getRelatedContextFromMoveEvent(e),r=this.computeFutureIndex(i,e),a=s(s({},this.context),{},{futureIndex:r});return n(s(s({},e),{},{relatedContext:i,draggedContext:a}),t)},onDragEnd:function(){F=null}}}),X=q;t.default=X},fb6a:function(e,t,n){var o=n("23e7"),i=n("861d"),r=n("e8b5"),a=n("23cb"),l=n("50c4"),s=n("fc6a"),c=n("8418"),d=n("b622"),u=n("1dde"),f=n("ae40"),p=u("slice"),m=f("slice",{ACCESSORS:!0,0:0,1:2}),v=d("species"),h=[].slice,g=Math.max;o({target:"Array",proto:!0,forced:!p||!m},{slice:function(e,t){var n,o,d,u=s(this),f=l(u.length),p=a(e,f),m=a(void 0===t?f:t,f);if(r(u)&&("function"!=typeof(n=u.constructor)||n!==Array&&!r(n.prototype)?i(n)&&null===(n=n[v])&&(n=void 0):n=void 0,n===Array||void 0===n))return h.call(u,p,m);for(o=new(void 0===n?Array:n)(g(m-p,0)),d=0;p<m;p++,d++)p in u&&c(o,d,u[p]);return o.length=d,o}})},fc6a:function(e,t,n){var o=n("44ad"),i=n("1d80");e.exports=function(e){return o(i(e))}},fdbc:function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},fdbf:function(e,t,n){var o=n("4930");e.exports=o&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}}).default},We.exports=_o(Ge,ze(yo))),xo=Ye(wo);const So={key:0,class:"loading"},ko={class:"info"},Eo={class:"name"},Co={class:"to"},Ao={class:"info"},Oo={class:"to"},Do={key:0,class:"drawer-content"},Io={class:"field"},Ro={class:"field"},Po={class:"field"},To={key:0,class:"drawer-content"},Mo={class:"field"},Vo={class:"field"},Uo={class:"field"},jo={class:"field checkbox-field"},No={key:0,class:"drawer-content"},Lo={class:"field"},$o={class:"field"},Fo={class:"field"};var Bo=a({__name:"modules-view",setup(e){const t=Ee(),{loading:n,saving:o,hasEdits:i,previewItems:r,roleOptions:a,policyOptions:y,linkEditing:C,linkValues:A,linkSaveDisabled:O,ruleEditingId:D,ruleDraft:I,hasRule:R,ruleSummary:P,toggleEnabled:T,editLink:M,closeLinkEditor:V,onLinkDrawerToggle:U,saveLink:j,removeLink:N,openRuleEditor:L,closeRuleEditor:$,onRuleDrawerToggle:F,saveRule:B,clearRule:H,hideNavItems:q,hideNavEditing:X,hideNavDraft:Y,hideNavSaveDisabled:z,moduleSelectOptions:W,hideNavSummary:G,editHideNav:K,closeHideNavEditor:J,onHideNavDrawerToggle:Q,saveHideNav:Z,removeHideNav:ee,ensureLoaded:te,save:ne}=Se();return f(()=>{te()}),(e,f)=>{const te=l("v-breadcrumb"),oe=l("v-icon"),ie=l("v-button"),re=l("sidebar-detail"),ae=l("v-progress-circular"),le=l("v-divider"),se=l("v-chip"),ce=l("v-checkbox"),de=l("v-list-item"),ue=l("v-input"),fe=l("v-drawer"),pe=l("v-select"),me=l("private-view"),ve=p("tooltip");return s(),c(me,{title:"Modules",icon:"view_sidebar"},{headline:d(()=>[u(te,{items:[{name:"Module Permissions",to:"/module-permissions/modules"}]})]),navigation:d(()=>[u(Re)]),actions:d(()=>[k((s(),c(ie,{disabled:!h(i),loading:h(o),icon:"",rounded:"",onClick:h(ne)},{default:d(()=>[u(oe,{name:"check"})]),_:1},8,["disabled","loading","onClick"])),[[ve,"Save",void 0,{bottom:!0}]])]),sidebar:d(()=>[u(re,{icon:"info",title:"About",close:""},{default:d(()=>[...f[18]||(f[18]=[m("p",{class:"sidebar-text"}," Configure the left module bar and optionally hide the middle Module Navigation panel for matched roles/policies. Admins are never affected. Deep links are blocked when a rule disables a module (unless “Block deep links” is turned off). ",-1)])]),_:1})]),default:d(()=>[m("div",{class:v(h(t))},[h(n)?(s(),g("div",So,[u(ae,{indeterminate:""})])):(s(),g(b,{key:1},[u(le,{class:"section-divider",large:"",style:{"--v-divider-color":"var(--theme--border-color-subdued)"}},{icon:d(()=>[u(oe,{name:"view_sidebar",class:"icon-flip-x"})]),default:d(()=>[f[19]||(f[19]=_(" "+w("Module Bar"),-1))]),_:1}),f[24]||(f[24]=m("p",{class:"page-intro"}," Reorder the left module bar, enable or disable entries, and add custom links — the same controls as Project Settings → Modules. Open an item to assign roles or policies that hide or show it for non-admin users. ",-1)),u(h(xo),{modelValue:h(r),"onUpdate:modelValue":f[2]||(f[2]=e=>E(r)?r.value=e:null),"item-key":"id",handle:".drag-handle",animation:150,class:"list"},{item:d(({element:e})=>[u(de,{block:"",dense:"",clickable:"",class:v(["module-row",{enabled:e.enabled}]),onClick:t=>h(L)(e)},{default:d(()=>[u(oe,{class:"drag-handle",name:"drag_handle",onClick:f[0]||(f[0]=S(()=>{},["stop"]))}),u(oe,{class:"icon",name:e.icon},null,8,["name"]),m("div",ko,[m("div",Eo,[_(w(e.name)+" ",1),h(R)(e.id)?(s(),c(se,{key:0,"x-small":"",class:"rule-chip"},{default:d(()=>[_(w(h(P)(e.id)),1)]),_:2},1024)):x("v-if",!0)]),m("div",Co,w(e.to),1)]),m("div",{class:"row-actions",onClick:f[1]||(f[1]=S(()=>{},["stop"]))},[k((s(),c(ie,{icon:"","x-small":"",secondary:"",onClick:t=>h(L)(e)},{default:d(()=>[u(oe,{name:"policy"})]),_:1},8,["onClick"])),[[ve,"Visibility rules"]]),"module"===e.type?(s(),g(b,{key:0},[e.locked?k((s(),c(oe,{key:0,name:"lock"},null,512)),[[ve,"Locked"]]):(s(),c(ce,{key:1,"model-value":e.enabled,"onUpdate:modelValue":t=>h(T)(e,t)},null,8,["model-value","onUpdate:modelValue"]))],64)):(s(),g(b,{key:1},[u(ie,{icon:"","x-small":"",secondary:"",onClick:t=>h(M)(e.id)},{default:d(()=>[u(oe,{name:"edit"})]),_:1},8,["onClick"]),u(ie,{icon:"","x-small":"",secondary:"",onClick:t=>h(N)(e.id)},{default:d(()=>[u(oe,{name:"close"})]),_:1},8,["onClick"])],64))])]),_:2},1032,["class","onClick"])]),_:1},8,["modelValue"]),u(ie,{class:"add-link",onClick:f[3]||(f[3]=e=>h(M)("+"))},{default:d(()=>[...f[20]||(f[20]=[_("Add Link",-1)])]),_:1}),u(le,{class:"section-divider add-margin-top",large:"",style:{"--v-divider-color":"var(--theme--border-color-subdued)"}},{icon:d(()=>[u(oe,{name:"menu"})]),default:d(()=>[f[21]||(f[21]=_(" "+w("Hide Module Navigation"),-1))]),_:1}),f[25]||(f[25]=m("p",{class:"section-intro"}," Hide the middle Module Navigation column for selected modules when the user matches. First matching rule’s modules are merged for the user. Empty roles and policies = catch-all. ",-1)),u(h(xo),{modelValue:h(q),"onUpdate:modelValue":f[6]||(f[6]=e=>E(q)?q.value=e:null),"item-key":"id",handle:".drag-handle",animation:150,class:"list"},{item:d(({element:e})=>[u(de,{block:"",dense:"",clickable:"",class:"module-row enabled",onClick:t=>h(K)(e.id)},{default:d(()=>[u(oe,{class:"drag-handle",name:"drag_handle",onClick:f[4]||(f[4]=S(()=>{},["stop"]))}),u(oe,{class:"icon",name:"menu"}),m("div",Ao,[f[22]||(f[22]=m("div",{class:"name"},"Hide navigation",-1)),m("div",Oo,w(h(G)(e)),1)]),m("div",{class:"row-actions",onClick:f[5]||(f[5]=S(()=>{},["stop"]))},[u(ie,{icon:"","x-small":"",secondary:"",onClick:t=>h(K)(e.id)},{default:d(()=>[u(oe,{name:"edit"})]),_:1},8,["onClick"]),u(ie,{icon:"","x-small":"",secondary:"",onClick:t=>h(ee)(e.id)},{default:d(()=>[u(oe,{name:"close"})]),_:1},8,["onClick"])])]),_:2},1032,["onClick"])]),_:1},8,["modelValue"]),u(ie,{class:"add-link",onClick:f[7]||(f[7]=e=>h(K)("+"))},{default:d(()=>[...f[23]||(f[23]=[_("Add Hide-Navigation Rule",-1)])]),_:1})],64))],2),u(fe,{"model-value":null!==h(C),title:"Link",icon:"link","onUpdate:modelValue":h(U),onCancel:h(V)},{actions:d(()=>[k((s(),c(ie,{disabled:h(O),icon:"",rounded:"",onClick:h(j)},{default:d(()=>[u(oe,{name:"check"})]),_:1},8,["disabled","onClick"])),[[ve,"Save",void 0,{bottom:!0}]])]),default:d(()=>[h(A)?(s(),g("div",Do,[m("div",Io,[f[26]||(f[26]=m("label",null,"Name",-1)),u(ue,{modelValue:h(A).name,"onUpdate:modelValue":f[8]||(f[8]=e=>h(A).name=e),placeholder:"Enter a name"},null,8,["modelValue"])]),m("div",Ro,[f[27]||(f[27]=m("label",null,"Icon",-1)),u(ue,{modelValue:h(A).icon,"onUpdate:modelValue":f[9]||(f[9]=e=>h(A).icon=e),placeholder:"link"},null,8,["modelValue"])]),m("div",Po,[f[28]||(f[28]=m("label",null,"URL",-1)),u(ue,{modelValue:h(A).url,"onUpdate:modelValue":f[10]||(f[10]=e=>h(A).url=e),placeholder:"https://example.com"},null,8,["modelValue"])])])):x("v-if",!0)]),_:1},8,["model-value","onUpdate:modelValue","onCancel"]),u(fe,{"model-value":null!==h(D),title:"Module Visibility",icon:"policy","onUpdate:modelValue":h(F),onCancel:h($)},{actions:d(()=>[k((s(),c(ie,{icon:"",rounded:"",onClick:h(B)},{default:d(()=>[u(oe,{name:"check"})]),_:1},8,["onClick"])),[[ve,"Apply",void 0,{bottom:!0}]])]),default:d(()=>[h(I)?(s(),g("div",To,[f[33]||(f[33]=m("p",{class:"hint"}," Leave roles and policies empty to use only the global enable toggle (no ACL override). ",-1)),m("div",Mo,[f[29]||(f[29]=m("label",null,"Visibility",-1)),u(pe,{modelValue:h(I).visibility,"onUpdate:modelValue":f[11]||(f[11]=e=>h(I).visibility=e),items:[{text:"Hide for matched roles/policies",value:"hide"},{text:"Show only for matched roles/policies",value:"show"}]},null,8,["modelValue"])]),m("div",Vo,[f[30]||(f[30]=m("label",null,"Roles",-1)),u(pe,{modelValue:h(I).roles,"onUpdate:modelValue":f[12]||(f[12]=e=>h(I).roles=e),multiple:"",items:h(a),"item-text":"text","item-value":"value",placeholder:"Select roles"},null,8,["modelValue","items"])]),m("div",Uo,[f[31]||(f[31]=m("label",null,"Policies",-1)),u(pe,{modelValue:h(I).policies,"onUpdate:modelValue":f[13]||(f[13]=e=>h(I).policies=e),multiple:"",items:h(y),"item-text":"text","item-value":"value",placeholder:"Select policies"},null,8,["modelValue","items"])]),m("div",jo,[u(ce,{modelValue:h(I).block_routes,"onUpdate:modelValue":f[14]||(f[14]=e=>h(I).block_routes=e),label:"Block deep links when this rule hides the module"},null,8,["modelValue"])]),h(R)(h(D))?(s(),c(ie,{key:0,secondary:"",onClick:h(H)},{default:d(()=>[...f[32]||(f[32]=[_("Clear rule",-1)])]),_:1},8,["onClick"])):x("v-if",!0)])):x("v-if",!0)]),_:1},8,["model-value","onUpdate:modelValue","onCancel"]),u(fe,{"model-value":null!==h(X),title:"Hide Module Navigation",icon:"menu","onUpdate:modelValue":h(Q),onCancel:h(J)},{actions:d(()=>[k((s(),c(ie,{disabled:h(z),icon:"",rounded:"",onClick:h(Z)},{default:d(()=>[u(oe,{name:"check"})]),_:1},8,["disabled","onClick"])),[[ve,"Apply",void 0,{bottom:!0}]])]),default:d(()=>[h(Y)?(s(),g("div",No,[f[37]||(f[37]=m("p",{class:"hint"}," Select modules whose middle navigation panel should be hidden. Empty roles and policies = catch-all. ",-1)),m("div",Lo,[f[34]||(f[34]=m("label",null,"Modules",-1)),u(pe,{modelValue:h(Y).modules,"onUpdate:modelValue":f[15]||(f[15]=e=>h(Y).modules=e),multiple:"",items:h(W),"item-text":"text","item-value":"value",placeholder:"Select modules"},null,8,["modelValue","items"])]),m("div",$o,[f[35]||(f[35]=m("label",null,"Roles",-1)),u(pe,{modelValue:h(Y).roles,"onUpdate:modelValue":f[16]||(f[16]=e=>h(Y).roles=e),multiple:"",items:h(a),"item-text":"text","item-value":"value",placeholder:"Select roles (optional)"},null,8,["modelValue","items"])]),m("div",Fo,[f[36]||(f[36]=m("label",null,"Policies",-1)),u(pe,{modelValue:h(Y).policies,"onUpdate:modelValue":f[17]||(f[17]=e=>h(Y).policies=e),multiple:"",items:h(y),"item-text":"text","item-value":"value",placeholder:"Select policies (optional)"},null,8,["modelValue","items"])])])):x("v-if",!0)]),_:1},8,["model-value","onUpdate:modelValue","onCancel"])]),_:1})}}});De("\n.page[data-v-85eae6a4] {\n\tpadding-inline: var(--content-padding);\n\tpadding-block-start: 0;\n\tpadding-block-end: var(--content-padding-bottom);\n\tmax-width: 720px;\n}\n.page--padded-top[data-v-85eae6a4] {\n\tpadding-block-start: var(--content-padding);\n}\n\n/* Mirror sidebar icon → left rail (module bar), matching the Modules nav item */\n[data-v-85eae6a4] i[data-icon='view_sidebar'] {\n\tdisplay: inline-block;\n\ttransform: scaleX(-1);\n}\n.loading[data-v-85eae6a4] {\n\tdisplay: flex;\n\tjustify-content: center;\n\tpadding: 4rem;\n}\n.page-intro[data-v-85eae6a4] {\n\tmargin: 0 0 24px;\n\tline-height: 1.55;\n\tcolor: var(--theme--foreground);\n}\n.section-intro[data-v-85eae6a4] {\n\tmargin: 0 0 16px;\n\tline-height: 1.55;\n\tcolor: var(--theme--foreground);\n}\n.section-divider[data-v-85eae6a4] {\n\tmargin-bottom: 12px;\n}\n.section-divider.add-margin-top[data-v-85eae6a4] {\n\tmargin-top: 40px;\n}\n.icon-flip-x[data-v-85eae6a4] {\n\ttransform: scaleX(-1);\n}\n.list[data-v-85eae6a4] {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tmargin-bottom: 12px;\n\tpadding: 0;\n}\n.module-row[data-v-85eae6a4] {\n\t--v-list-item-color: var(--theme--foreground-subdued);\n}\n.module-row.enabled[data-v-85eae6a4] {\n\t--v-list-item-color: var(--theme--foreground);\n}\n.drag-handle[data-v-85eae6a4] {\n\tcursor: grab;\n\tmargin-inline-end: 4px;\n\tcolor: var(--theme--foreground-subdued);\n}\n.icon[data-v-85eae6a4] {\n\tmargin: 0 0.6875rem;\n}\n.info[data-v-85eae6a4] {\n\tflex: 1;\n\tmin-width: 0;\n}\n.name[data-v-85eae6a4] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tfont-weight: 600;\n}\n.to[data-v-85eae6a4] {\n\tfont-family: var(--theme--fonts--monospace--font-family, monospace);\n\tfont-size: 12px;\n\topacity: 0.75;\n}\n.rule-chip[data-v-85eae6a4] {\n\tmargin-inline-start: 4px;\n}\n.row-actions[data-v-85eae6a4] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n}\n.add-link[data-v-85eae6a4] {\n\tmargin-top: 4px;\n}\n.drawer-content[data-v-85eae6a4] {\n\tpadding: var(--content-padding);\n\tpadding-block-end: var(--content-padding-bottom);\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 20px;\n}\n.field label[data-v-85eae6a4] {\n\tdisplay: block;\n\tmargin-bottom: 8px;\n\tfont-weight: 600;\n}\n.hint[data-v-85eae6a4],\n.sidebar-text[data-v-85eae6a4] {\n\tmargin: 0;\n\tline-height: 1.5;\n\tcolor: var(--theme--foreground);\n}\n.checkbox-field[data-v-85eae6a4] {\n\tpadding-top: 4px;\n}\n",{});var Ho=Ie(Bo,[["__scopeId","data-v-85eae6a4"]]);const qo={class:"actions"},Xo={key:0,class:"result"},Yo={key:1,class:"result"},zo={key:2,class:"result"};var Wo=a({__name:"settings-view",setup(e){const t=Ee(),{loading:n,cleaning:o,ensureLoaded:r,cleanupExtensionData:a,exportPermissionsConfig:p,importPermissionsConfig:y}=Se(),S=i(!1),k=i(null),E=i(null),C=i(!1),A=i(null),O=i(null);function D(){A.value=null,p()}function I(){A.value=null,O.value?.click()}async function R(e){const t=e.target,n=t.files?.[0];if(t.value="",n){C.value=!0,A.value=null;try{const e=await n.text(),t=JSON.parse(e);await y(t),A.value={type:"success",text:"Config imported and saved to settings."}}catch(e){A.value={type:"danger",text:e?.response?.data?.errors?.[0]?.message||e?.message||"Import failed"}}finally{C.value=!1}}}async function P(){k.value=null,E.value=null,A.value=null;try{E.value=await a(),S.value=!1}catch(e){k.value=e?.response?.data?.errors?.[0]?.message||e?.message||"Cleanup failed"}}return f(()=>{r()}),(e,i)=>{const r=l("v-breadcrumb"),a=l("sidebar-detail"),f=l("v-icon"),p=l("v-divider"),y=l("v-button"),T=l("v-notice"),M=l("v-card-title"),V=l("v-card-text"),U=l("v-card-actions"),j=l("v-card"),N=l("v-dialog"),L=l("private-view");return s(),c(L,{title:"Settings",icon:"settings"},{headline:d(()=>[u(r,{items:[{name:"Module Permissions",to:"/module-permissions/modules"}]})]),navigation:d(()=>[u(Re)]),sidebar:d(()=>[u(a,{icon:"info",title:"About",close:""},{default:d(()=>[...i[4]||(i[4]=[m("p",{class:"sidebar-text"}," Export or import this extension’s JSON config, or remove the dedicated settings field before uninstalling. ",-1)])]),_:1})]),default:d(()=>[m("div",{class:v(h(t))},[i[12]||(i[12]=m("p",{class:"page-intro"},[_(" Back up or restore this extension’s visibility config (module rules, content, users, start pages, sidebar) as JSON, or remove the dedicated "),m("code",null,"module_permissions"),_(" settings field before uninstalling. Native "),m("code",null,"module_bar"),_(" order/enable and all other project settings are left untouched. ")],-1)),u(p,{class:"section-divider",large:"",style:{"--v-divider-color":"var(--theme--border-color-subdued)"}},{icon:d(()=>[u(f,{name:"import_export"})]),default:d(()=>[i[5]||(i[5]=_(" Export / Import ",-1))]),_:1}),i[13]||(i[13]=m("p",{class:"explain"},[_(" Download or restore "),m("code",null,"directus_settings.module_permissions"),_(" only (module rules, content, users/nav, start pages, sidebar panels/modes). Does not include native "),m("code",null,"module_bar"),_(" — manage that in Modules or Project Settings → Modules. ")],-1)),m("div",qo,[u(y,{secondary:"",disabled:h(n)||h(o),onClick:D},{default:d(()=>[...i[6]||(i[6]=[_("Export JSON",-1)])]),_:1},8,["disabled"]),u(y,{secondary:"",disabled:h(n)||h(o)||C.value,loading:C.value,onClick:I},{default:d(()=>[...i[7]||(i[7]=[_(" Import JSON ",-1)])]),_:1},8,["disabled","loading"]),m("input",{ref_key:"fileInput",ref:O,type:"file",accept:"application/json,.json",class:"file-input",onChange:R},null,544)]),A.value?(s(),g("div",Xo,[u(T,{type:A.value.type},{default:d(()=>[_(w(A.value.text),1)]),_:1},8,["type"])])):x("v-if",!0),u(p,{class:"section-divider add-margin-top",large:"",style:{"--v-divider-color":"var(--theme--border-color-subdued)"}},{icon:d(()=>[u(f,{name:"delete"})]),default:d(()=>[i[8]||(i[8]=_(" Remove extension data ",-1))]),_:1}),i[14]||(i[14]=m("p",{class:"explain"},[_(" Visibility rules and start pages live in a dedicated JSON field "),m("code",null,"directus_settings.module_permissions"),_(". It is not mixed into another settings JSON blob, so cleanup can safely remove only that field. Module bar order/enable ("),m("code",null,"module_bar"),_(") and all other project settings are kept. If the extension stays installed, the next Directus restart may recreate an empty "),m("code",null,"module_permissions"),_(" field. ")],-1)),u(T,{type:"warning",class:"notice"},{default:d(()=>[...i[9]||(i[9]=[_(" Deleting extension data cannot be undone. Export first if you might need the config again. ",-1)])]),_:1}),E.value?(s(),g("div",Yo,[u(T,{type:"success"},{default:d(()=>[i[10]||(i[10]=_(" Cleanup finished. ",-1)),E.value.clearedValue?(s(),g(b,{key:0},[_(" Value cleared.")],64)):x("v-if",!0),E.value.deletedField?(s(),g(b,{key:1},[_(" Field removed.")],64)):x("v-if",!0)]),_:1})])):x("v-if",!0),k.value?(s(),g("div",zo,[u(T,{type:"danger"},{default:d(()=>[_(w(k.value),1)]),_:1})])):x("v-if",!0),u(y,{kind:"danger",loading:h(o),disabled:h(o),onClick:i[0]||(i[0]=e=>S.value=!0)},{default:d(()=>[...i[11]||(i[11]=[_(" Delete module_permissions data ",-1)])]),_:1},8,["loading","disabled"])],2),u(N,{modelValue:S.value,"onUpdate:modelValue":i[2]||(i[2]=e=>S.value=e),onEsc:i[3]||(i[3]=e=>S.value=!1)},{default:d(()=>[u(j,null,{default:d(()=>[u(M,null,{default:d(()=>[...i[15]||(i[15]=[_("Delete module_permissions?",-1)])]),_:1}),u(V,null,{default:d(()=>[...i[16]||(i[16]=[_(" This removes only ",-1),m("code",null,"directus_settings.module_permissions",-1),_(" (the extension’s own JSON field). Module bar order/enable and all other settings stay as they are. ",-1)])]),_:1}),u(U,null,{default:d(()=>[u(y,{secondary:"",onClick:i[1]||(i[1]=e=>S.value=!1)},{default:d(()=>[...i[17]||(i[17]=[_("Cancel",-1)])]),_:1}),u(y,{kind:"danger",loading:h(o),onClick:P},{default:d(()=>[...i[18]||(i[18]=[_("Delete",-1)])]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1})}}});De("\n.page[data-v-864793b0] {\n\tpadding-inline: var(--content-padding);\n\tpadding-block-start: 0;\n\tpadding-block-end: var(--content-padding-bottom);\n\tmax-width: 720px;\n}\n.page--padded-top[data-v-864793b0] {\n\tpadding-block-start: var(--content-padding);\n}\n.section-divider[data-v-864793b0] {\n\tmargin-bottom: 12px;\n}\n.section-divider.add-margin-top[data-v-864793b0] {\n\tmargin-top: 40px;\n}\n.page-intro[data-v-864793b0] {\n\tmargin: 0 0 24px;\n\tline-height: 1.55;\n\tcolor: var(--theme--foreground);\n}\n.page-intro code[data-v-864793b0] {\n\tfont-family: var(--theme--fonts--monospace--font-family, monospace);\n\tfont-size: 0.9em;\n}\n.explain[data-v-864793b0],\n.sidebar-text[data-v-864793b0] {\n\tmargin: 0 0 16px;\n\tline-height: 1.55;\n\tcolor: var(--theme--foreground);\n}\n.explain code[data-v-864793b0],\n.sidebar-text code[data-v-864793b0],\n.v-card-text code[data-v-864793b0] {\n\tfont-family: var(--theme--fonts--monospace--font-family, monospace);\n\tfont-size: 0.9em;\n}\n.actions[data-v-864793b0] {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n\tmargin-bottom: 16px;\n}\n.file-input[data-v-864793b0] {\n\tdisplay: none;\n}\n.notice[data-v-864793b0],\n.result[data-v-864793b0] {\n\tmargin-bottom: 16px;\n}\n",{});var Go=Ie(Wo,[["__scopeId","data-v-864793b0"]]);const Ko={key:0,class:"loading"},Jo={class:"list"},Qo={class:"info"},Zo={class:"name"},ei={class:"to"},ti={class:"info"},ni={class:"name"},oi={class:"to"},ii={key:0,class:"drawer-content"},ri={class:"field"},ai={class:"field"},li={class:"field"},si={key:0,class:"drawer-content"},ci={class:"field"},di={class:"field"},ui={class:"field"};var fi=a({__name:"sidebar-view",setup(e){const t=Ee(),{loading:n,saving:o,hasEdits:i,roleOptions:r,policyOptions:a,sidebarPanelCatalog:C,sidebarPanelEditingId:A,sidebarPanelDraft:O,sidebarModeItems:D,sidebarModeEditing:I,sidebarModeDraft:R,hasSidebarPanelRule:P,sidebarPanelRuleSummary:T,sidebarModeSummary:M,openSidebarPanelEditor:V,closeSidebarPanelEditor:U,onSidebarPanelDrawerToggle:j,saveSidebarPanelRule:N,clearSidebarPanelRule:L,editSidebarMode:$,closeSidebarModeEditor:F,onSidebarModeDrawerToggle:B,saveSidebarMode:H,removeSidebarMode:q,ensureLoaded:X,save:Y}=Se();return f(()=>{X()}),(e,f)=>{const X=l("v-breadcrumb"),z=l("v-icon"),W=l("v-button"),G=l("sidebar-detail"),K=l("v-progress-circular"),J=l("v-divider"),Q=l("v-chip"),Z=l("v-list-item"),ee=l("v-select"),te=l("v-drawer"),ne=l("private-view"),oe=p("tooltip");return s(),c(ne,{title:"Sidebar",icon:"view_sidebar"},{headline:d(()=>[u(X,{items:[{name:"Module Permissions",to:"/module-permissions/modules"}]})]),navigation:d(()=>[u(Re)]),actions:d(()=>[k((s(),c(W,{disabled:!h(i),loading:h(o),icon:"",rounded:"",onClick:h(Y)},{default:d(()=>[u(z,{name:"check"})]),_:1},8,["disabled","loading","onClick"])),[[oe,"Save",void 0,{bottom:!0}]])]),sidebar:d(()=>[u(G,{icon:"info",title:"About",close:""},{default:d(()=>[...f[11]||(f[11]=[m("p",{class:"sidebar-text"}," Hide individual right-sidebar panels (Layout, Revisions, Comments, …) or force the whole sidebar collapsed/hidden for matched roles and policies. Admins are never affected. This is UI-only — not a security boundary. ",-1)])]),_:1})]),default:d(()=>[m("div",{class:v(h(t))},[h(n)?(s(),g("div",Ko,[u(K,{indeterminate:""})])):(s(),g(b,{key:1},[u(J,{class:"section-divider",large:"",style:{"--v-divider-color":"var(--theme--border-color-subdued)"}},{icon:d(()=>[u(z,{name:"widgets"})]),default:d(()=>[f[12]||(f[12]=_(" Panels ",-1))]),_:1}),f[15]||(f[15]=m("p",{class:"page-intro"}," Hide or show known Data Studio sidebar panels for matched roles/policies. Collection browse panels (Layout, Archive, …) and item panels (Revisions, Comments, …) only appear on the relevant pages. Activity Log is the footer control at the bottom of the sidebar (Directus 11; replaced by AI Assistant on newer versions when AI is enabled). ",-1)),m("div",Jo,[(s(!0),g(b,null,y(h(C),e=>(s(),c(Z,{key:e.id,block:"",dense:"",clickable:"",class:"module-row enabled",onClick:t=>h(V)(e.id)},{default:d(()=>{return[u(z,{class:"icon",name:e.icon},null,8,["name"]),m("div",Qo,[m("div",Zo,[_(w(e.name)+" ",1),h(P)(e.id)?(s(),c(Q,{key:0,"x-small":"",class:"rule-chip"},{default:d(()=>[_(w(h(T)(e.id)),1)]),_:2},1024)):x("v-if",!0)]),m("div",ei,w(e.id)+" · "+w((t=e.context,"collection"===t?"collection browse":"item"===t?"item detail":"collection & item")),1)]),m("div",{class:"row-actions",onClick:f[0]||(f[0]=S(()=>{},["stop"]))},[k((s(),c(W,{icon:"","x-small":"",secondary:"",onClick:t=>h(V)(e.id)},{default:d(()=>[u(z,{name:"policy"})]),_:1},8,["onClick"])),[[oe,"Visibility rules"]])])];var t}),_:2},1032,["onClick"]))),128))]),u(J,{class:"section-divider add-margin-top",large:"",style:{"--v-divider-color":"var(--theme--border-color-subdued)"}},{icon:d(()=>[u(z,{name:"keyboard_tab"})]),default:d(()=>[f[13]||(f[13]=_(" Sidebar mode ",-1))]),_:1}),f[16]||(f[16]=m("p",{class:"page-intro"}," Force the whole right sidebar collapsed or hidden. First match wins (drag to reorder); leave roles and policies empty for a catch-all. Default behavior applies when nothing matches. ",-1)),u(h(xo),{modelValue:h(D),"onUpdate:modelValue":f[3]||(f[3]=e=>E(D)?D.value=e:null),"item-key":"id",handle:".drag-handle",animation:150,class:"list"},{item:d(({element:e})=>[u(Z,{block:"",dense:"",clickable:"",class:"module-row enabled",onClick:t=>h($)(e.id)},{default:d(()=>[u(z,{class:"drag-handle",name:"drag_handle",onClick:f[1]||(f[1]=S(()=>{},["stop"]))}),u(z,{class:"icon",name:"hidden"===e.mode?"visibility_off":"keyboard_tab"},null,8,["name"]),m("div",ti,[m("div",ni,w("hidden"===e.mode?"Force hidden":"Force collapsed"),1),m("div",oi,w(h(M)(e)),1)]),m("div",{class:"row-actions",onClick:f[2]||(f[2]=S(()=>{},["stop"]))},[u(W,{icon:"","x-small":"",secondary:"",onClick:t=>h($)(e.id)},{default:d(()=>[u(z,{name:"edit"})]),_:1},8,["onClick"]),u(W,{icon:"","x-small":"",secondary:"",onClick:t=>h(q)(e.id)},{default:d(()=>[u(z,{name:"close"})]),_:1},8,["onClick"])])]),_:2},1032,["onClick"])]),_:1},8,["modelValue"]),u(W,{class:"add-link",onClick:f[4]||(f[4]=e=>h($)("+"))},{default:d(()=>[...f[14]||(f[14]=[_("Add Sidebar Mode",-1)])]),_:1})],64))],2),u(te,{"model-value":null!==h(A),title:"Sidebar Panel",icon:"policy","onUpdate:modelValue":h(j),onCancel:h(U)},{actions:d(()=>[k((s(),c(W,{icon:"",rounded:"",onClick:h(N)},{default:d(()=>[u(z,{name:"check"})]),_:1},8,["onClick"])),[[oe,"Apply",void 0,{bottom:!0}]])]),default:d(()=>[h(O)?(s(),g("div",ii,[f[21]||(f[21]=m("p",{class:"hint"}," Leave roles and policies empty to clear the rule. Hiding is client-side only — API access is unchanged. ",-1)),m("div",ri,[f[17]||(f[17]=m("label",null,"Visibility",-1)),u(ee,{modelValue:h(O).visibility,"onUpdate:modelValue":f[5]||(f[5]=e=>h(O).visibility=e),items:[{text:"Hide for matched roles/policies",value:"hide"},{text:"Show only for matched roles/policies",value:"show"}]},null,8,["modelValue"])]),m("div",ai,[f[18]||(f[18]=m("label",null,"Roles",-1)),u(ee,{modelValue:h(O).roles,"onUpdate:modelValue":f[6]||(f[6]=e=>h(O).roles=e),multiple:"",items:h(r),"item-text":"text","item-value":"value",placeholder:"Select roles"},null,8,["modelValue","items"])]),m("div",li,[f[19]||(f[19]=m("label",null,"Policies",-1)),u(ee,{modelValue:h(O).policies,"onUpdate:modelValue":f[7]||(f[7]=e=>h(O).policies=e),multiple:"",items:h(a),"item-text":"text","item-value":"value",placeholder:"Select policies"},null,8,["modelValue","items"])]),h(P)(h(A))?(s(),c(W,{key:0,secondary:"",onClick:h(L)},{default:d(()=>[...f[20]||(f[20]=[_(" Clear rule ",-1)])]),_:1},8,["onClick"])):x("v-if",!0)])):x("v-if",!0)]),_:1},8,["model-value","onUpdate:modelValue","onCancel"]),u(te,{"model-value":null!==h(I),title:"Sidebar Mode",icon:"view_sidebar","onUpdate:modelValue":h(B),onCancel:h(F)},{actions:d(()=>[k((s(),c(W,{icon:"",rounded:"",onClick:h(H)},{default:d(()=>[u(z,{name:"check"})]),_:1},8,["onClick"])),[[oe,"Apply",void 0,{bottom:!0}]])]),default:d(()=>[h(R)?(s(),g("div",si,[f[25]||(f[25]=m("p",{class:"hint"}," Collapsed keeps the icon rail (Directus compact sidebar). Hidden removes the sidebar chrome entirely. Empty roles and policies = catch-all (place last). ",-1)),m("div",ci,[f[22]||(f[22]=m("label",null,"Mode",-1)),u(ee,{modelValue:h(R).mode,"onUpdate:modelValue":f[8]||(f[8]=e=>h(R).mode=e),items:[{text:"Force collapsed",value:"collapsed"},{text:"Force hidden",value:"hidden"}]},null,8,["modelValue"])]),m("div",di,[f[23]||(f[23]=m("label",null,"Roles",-1)),u(ee,{modelValue:h(R).roles,"onUpdate:modelValue":f[9]||(f[9]=e=>h(R).roles=e),multiple:"",items:h(r),"item-text":"text","item-value":"value",placeholder:"Select roles (optional)"},null,8,["modelValue","items"])]),m("div",ui,[f[24]||(f[24]=m("label",null,"Policies",-1)),u(ee,{modelValue:h(R).policies,"onUpdate:modelValue":f[10]||(f[10]=e=>h(R).policies=e),multiple:"",items:h(a),"item-text":"text","item-value":"value",placeholder:"Select policies (optional)"},null,8,["modelValue","items"])])])):x("v-if",!0)]),_:1},8,["model-value","onUpdate:modelValue","onCancel"])]),_:1})}}});De("\n.page[data-v-a2f48c10] {\n\tpadding-inline: var(--content-padding);\n\tpadding-block-start: 0;\n\tpadding-block-end: var(--content-padding-bottom);\n\tmax-width: 720px;\n}\n.page--padded-top[data-v-a2f48c10] {\n\tpadding-block-start: var(--content-padding);\n}\n.loading[data-v-a2f48c10] {\n\tdisplay: flex;\n\tjustify-content: center;\n\tpadding: 4rem;\n}\n.section-divider[data-v-a2f48c10] {\n\tmargin-bottom: 12px;\n}\n.section-divider.add-margin-top[data-v-a2f48c10] {\n\tmargin-top: 40px;\n}\n.page-intro[data-v-a2f48c10] {\n\tmargin: 0 0 24px;\n\tline-height: 1.55;\n\tcolor: var(--theme--foreground);\n}\n.list[data-v-a2f48c10] {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tmargin-bottom: 12px;\n\tpadding: 0;\n}\n.module-row.enabled[data-v-a2f48c10] {\n\t--v-list-item-color: var(--theme--foreground);\n}\n.drag-handle[data-v-a2f48c10] {\n\tcursor: grab;\n\tmargin-inline-end: 4px;\n\tcolor: var(--theme--foreground-subdued);\n}\n.icon[data-v-a2f48c10] {\n\tmargin: 0 0.6875rem;\n}\n.info[data-v-a2f48c10] {\n\tflex: 1;\n\tmin-width: 0;\n}\n.name[data-v-a2f48c10] {\n\tfont-weight: 600;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tflex-wrap: wrap;\n}\n.to[data-v-a2f48c10] {\n\tfont-family: var(--theme--fonts--monospace--font-family, monospace);\n\tfont-size: 12px;\n\topacity: 0.75;\n}\n.rule-chip[data-v-a2f48c10] {\n\tfont-weight: 500;\n}\n.row-actions[data-v-a2f48c10] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n}\n.add-link[data-v-a2f48c10] {\n\tmargin-top: 4px;\n}\n.drawer-content[data-v-a2f48c10] {\n\tpadding: var(--content-padding);\n\tpadding-block-end: var(--content-padding-bottom);\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 20px;\n}\n.field label[data-v-a2f48c10] {\n\tdisplay: block;\n\tmargin-bottom: 8px;\n\tfont-weight: 600;\n}\n.hint[data-v-a2f48c10],\n.sidebar-text[data-v-a2f48c10] {\n\tmargin: 0;\n\tline-height: 1.55;\n\tcolor: var(--theme--foreground);\n}\n.hint code[data-v-a2f48c10],\n.sidebar-text code[data-v-a2f48c10] {\n\tfont-family: var(--theme--fonts--monospace--font-family, monospace);\n\tfont-size: 0.9em;\n}\n",{});var pi=Ie(fi,[["__scopeId","data-v-a2f48c10"]]);const mi={key:0,class:"loading"},vi={class:"info"},hi={class:"name"},gi={class:"to"},bi={key:0,class:"drawer-content"},yi={class:"field"},_i={class:"field checkbox-field"},wi={class:"field"},xi={class:"field"};var Si=a({__name:"start-page-view",setup(e){const t=Ee(),{loading:n,saving:o,hasEdits:i,homeItems:r,roleOptions:a,policyOptions:y,homeEditing:C,homeDraft:A,homeSaveDisabled:O,homeSummary:D,editHome:I,closeHomeEditor:R,onHomeDrawerToggle:P,saveHome:T,removeHome:M,ensureLoaded:V,save:U}=Se();return f(()=>{V()}),(e,f)=>{const V=l("v-breadcrumb"),j=l("v-icon"),N=l("v-button"),L=l("sidebar-detail"),$=l("v-progress-circular"),F=l("v-list-item"),B=l("v-input"),H=l("v-checkbox"),q=l("v-select"),X=l("v-drawer"),Y=l("private-view"),z=p("tooltip");return s(),c(Y,{title:"Start Page",icon:"home"},{headline:d(()=>[u(V,{items:[{name:"Module Permissions",to:"/module-permissions/modules"}]})]),navigation:d(()=>[u(Re)]),actions:d(()=>[k((s(),c(N,{disabled:!h(i),loading:h(o),icon:"",rounded:"",onClick:h(U)},{default:d(()=>[u(j,{name:"check"})]),_:1},8,["disabled","loading","onClick"])),[[z,"Save",void 0,{bottom:!0}]])]),sidebar:d(()=>[u(L,{icon:"info",title:"About",close:""},{default:d(()=>[...f[8]||(f[8]=[m("p",{class:"sidebar-text"},[_(" Start pages define where matched users land after login. By default they only apply when Directus has no last page. Enable "),m("strong",null,"Force Redirect"),_(" to ignore "),m("code",null,"last_page"),_(". Explicit "),m("code",null,"?redirect="),_(" links still win. ")],-1)])]),_:1})]),default:d(()=>[m("div",{class:v(h(t))},[h(n)?(s(),g("div",mi,[u($,{indeterminate:""})])):(s(),g(b,{key:1},[f[10]||(f[10]=m("p",{class:"page-intro"},[_(" Define where users land after login, and prefer that path for safe redirects away from blocked modules. First match wins (drag to reorder); leave roles and policies empty for a catch-all default. Without force, this does not override a user’s "),m("code",null,"last_page"),_(". Enable force to redirect even when a last page exists. Explicit "),m("code",null,"?redirect="),_(" always wins. ")],-1)),u(h(xo),{modelValue:h(r),"onUpdate:modelValue":f[2]||(f[2]=e=>E(r)?r.value=e:null),"item-key":"id",handle:".drag-handle",animation:150,class:"list"},{item:d(({element:e})=>[u(F,{block:"",dense:"",clickable:"",class:"module-row enabled",onClick:t=>h(I)(e.id)},{default:d(()=>[u(j,{class:"drag-handle",name:"drag_handle",onClick:f[0]||(f[0]=S(()=>{},["stop"]))}),u(j,{class:"icon",name:"home"}),m("div",vi,[m("div",hi,w(e.path),1),m("div",gi,w(h(D)(e)),1)]),m("div",{class:"row-actions",onClick:f[1]||(f[1]=S(()=>{},["stop"]))},[u(N,{icon:"","x-small":"",secondary:"",onClick:t=>h(I)(e.id)},{default:d(()=>[u(j,{name:"edit"})]),_:1},8,["onClick"]),u(N,{icon:"","x-small":"",secondary:"",onClick:t=>h(M)(e.id)},{default:d(()=>[u(j,{name:"close"})]),_:1},8,["onClick"])])]),_:2},1032,["onClick"])]),_:1},8,["modelValue"]),u(N,{class:"add-link",onClick:f[3]||(f[3]=e=>h(I)("+"))},{default:d(()=>[...f[9]||(f[9]=[_("Add Start Page",-1)])]),_:1})],64))],2),u(X,{"model-value":null!==h(C),title:"Start Page",icon:"home","onUpdate:modelValue":h(P),onCancel:h(R)},{actions:d(()=>[k((s(),c(N,{disabled:h(O),icon:"",rounded:"",onClick:h(T)},{default:d(()=>[u(j,{name:"check"})]),_:1},8,["disabled","onClick"])),[[z,"Apply",void 0,{bottom:!0}]])]),default:d(()=>[h(A)?(s(),g("div",bi,[f[14]||(f[14]=m("p",{class:"hint"},[_(" Use an in-app path such as "),m("code",null,"/files"),_(" or "),m("code",null,"/content"),_(". External URLs are rejected. ")],-1)),m("div",yi,[f[11]||(f[11]=m("label",null,"Path",-1)),u(B,{modelValue:h(A).path,"onUpdate:modelValue":f[4]||(f[4]=e=>h(A).path=e),placeholder:"/content"},null,8,["modelValue"])]),m("div",_i,[u(H,{modelValue:h(A).force,"onUpdate:modelValue":f[5]||(f[5]=e=>h(A).force=e),label:"Force Redirect (ignore users last page prop)"},null,8,["modelValue"])]),m("div",wi,[f[12]||(f[12]=m("label",null,"Roles",-1)),u(q,{modelValue:h(A).roles,"onUpdate:modelValue":f[6]||(f[6]=e=>h(A).roles=e),multiple:"",items:h(a),"item-text":"text","item-value":"value",placeholder:"Select roles (optional)"},null,8,["modelValue","items"])]),m("div",xi,[f[13]||(f[13]=m("label",null,"Policies",-1)),u(q,{modelValue:h(A).policies,"onUpdate:modelValue":f[7]||(f[7]=e=>h(A).policies=e),multiple:"",items:h(y),"item-text":"text","item-value":"value",placeholder:"Select policies (optional)"},null,8,["modelValue","items"])])])):x("v-if",!0)]),_:1},8,["model-value","onUpdate:modelValue","onCancel"])]),_:1})}}});De("\n.page[data-v-87af3354] {\n\tpadding-inline: var(--content-padding);\n\tpadding-block-start: 0;\n\tpadding-block-end: var(--content-padding-bottom);\n\tmax-width: 720px;\n}\n.page--padded-top[data-v-87af3354] {\n\tpadding-block-start: var(--content-padding);\n}\n.loading[data-v-87af3354] {\n\tdisplay: flex;\n\tjustify-content: center;\n\tpadding: 4rem;\n}\n.page-intro[data-v-87af3354] {\n\tmargin: 0 0 24px;\n\tline-height: 1.55;\n\tcolor: var(--theme--foreground);\n}\n.page-intro code[data-v-87af3354] {\n\tfont-family: var(--theme--fonts--monospace--font-family, monospace);\n\tfont-size: 0.9em;\n}\n.section-hint[data-v-87af3354] {\n\tmargin-bottom: 24px;\n}\n.section-hint code[data-v-87af3354],\n.hint code[data-v-87af3354] {\n\tfont-family: var(--theme--fonts--monospace--font-family, monospace);\n\tfont-size: 0.9em;\n}\n.list[data-v-87af3354] {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tmargin-bottom: 12px;\n\tpadding: 0;\n}\n.module-row.enabled[data-v-87af3354] {\n\t--v-list-item-color: var(--theme--foreground);\n}\n.drag-handle[data-v-87af3354] {\n\tcursor: grab;\n\tmargin-inline-end: 4px;\n\tcolor: var(--theme--foreground-subdued);\n}\n.icon[data-v-87af3354] {\n\tmargin: 0 0.6875rem;\n}\n.info[data-v-87af3354] {\n\tflex: 1;\n\tmin-width: 0;\n}\n.name[data-v-87af3354] {\n\tfont-weight: 600;\n}\n.to[data-v-87af3354] {\n\tfont-family: var(--theme--fonts--monospace--font-family, monospace);\n\tfont-size: 12px;\n\topacity: 0.75;\n}\n.row-actions[data-v-87af3354] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n}\n.add-link[data-v-87af3354] {\n\tmargin-top: 4px;\n}\n.drawer-content[data-v-87af3354] {\n\tpadding: var(--content-padding);\n\tpadding-block-end: var(--content-padding-bottom);\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 20px;\n}\n.field label[data-v-87af3354] {\n\tdisplay: block;\n\tmargin-bottom: 8px;\n\tfont-weight: 600;\n}\n.checkbox-field[data-v-87af3354] {\n\tmargin-top: -4px;\n}\n.hint[data-v-87af3354],\n.sidebar-text[data-v-87af3354] {\n\tmargin: 0;\n\tline-height: 1.5;\n\tcolor: var(--theme--foreground);\n}\n.sidebar-text code[data-v-87af3354] {\n\tfont-family: var(--theme--fonts--monospace--font-family, monospace);\n\tfont-size: 0.9em;\n}\n",{});var ki=Ie(Si,[["__scopeId","data-v-87af3354"]]);const Ei={key:0,class:"loading"},Ci={class:"info"},Ai={class:"to"},Oi={key:0,class:"empty"},Di={key:1,class:"list"},Ii={class:"info"},Ri={class:"name"},Pi={class:"to"},Ti={key:0,class:"drawer-content"},Mi={class:"field"},Vi={class:"field"},Ui={key:0,class:"drawer-content"},ji={class:"field"},Ni={class:"field"},Li={class:"field"},$i={class:"field"},Fi={class:"field checkbox-field"};var Bi=a({__name:"users-view",setup(e){const t=Ee(),{loading:n,saving:o,hasEdits:i,roleOptions:r,policyOptions:a,usersOwnRoleItems:C,usersOwnRoleEditing:A,usersOwnRoleDraft:O,configuredUsersRoles:D,availableUsersRoleOptions:I,usersRoleEditingId:R,usersRoleDraft:P,usersRoleSaveDisabled:T,usersOwnRoleSummary:M,hasUsersRoleRule:V,usersRoleRuleSummary:U,editUsersOwnRole:j,closeUsersOwnRoleEditor:N,onUsersOwnRoleDrawerToggle:L,saveUsersOwnRole:$,removeUsersOwnRole:F,openUsersRoleEditor:B,closeUsersRoleEditor:H,onUsersRoleDrawerToggle:q,saveUsersRoleRule:X,clearUsersRoleRule:Y,removeUsersRoleRule:z,ensureLoaded:W,save:G}=Se();return f(()=>{W()}),(e,f)=>{const W=l("v-breadcrumb"),K=l("v-icon"),J=l("v-button"),Q=l("sidebar-detail"),Z=l("v-progress-circular"),ee=l("v-divider"),te=l("v-list-item"),ne=l("v-chip"),oe=l("v-select"),ie=l("v-drawer"),re=l("v-checkbox"),ae=l("private-view"),le=p("tooltip");return s(),c(ae,{title:"Users",icon:"people_alt"},{headline:d(()=>[u(W,{items:[{name:"Module Permissions",to:"/module-permissions/modules"}]})]),navigation:d(()=>[u(Re)]),actions:d(()=>[k((s(),c(J,{disabled:!h(i),loading:h(o),icon:"",rounded:"",onClick:h(G)},{default:d(()=>[u(K,{name:"check"})]),_:1},8,["disabled","loading","onClick"])),[[le,"Save",void 0,{bottom:!0}]])]),sidebar:d(()=>[u(Q,{icon:"info",title:"About",close:""},{default:d(()=>[...f[13]||(f[13]=[m("p",{class:"sidebar-text"}," Control the Users module’s role tree in Module Navigation. Admins are never affected. UI-only — not a security boundary. ",-1)])]),_:1})]),default:d(()=>[m("div",{class:v(h(t))},[h(n)?(s(),g("div",Ei,[u(Z,{indeterminate:""})])):(s(),g(b,{key:1},[f[19]||(f[19]=m("p",{class:"page-intro"}," Filter which roles appear in Users Module Navigation for matched roles/policies. ",-1)),u(ee,{class:"section-divider",large:"",style:{"--v-divider-color":"var(--theme--border-color-subdued)"}},{icon:d(()=>[u(K,{name:"person"})]),default:d(()=>[f[14]||(f[14]=_(" "+w("Own Role Only"),-1))]),_:1}),f[20]||(f[20]=m("p",{class:"section-intro"}," Matched users only see their own role (and parent roles) in the Users nav tree. First match wins; empty roles and policies = catch-all. ",-1)),u(h(xo),{modelValue:h(C),"onUpdate:modelValue":f[2]||(f[2]=e=>E(C)?C.value=e:null),"item-key":"id",handle:".drag-handle",animation:150,class:"list"},{item:d(({element:e})=>[u(te,{block:"",dense:"",clickable:"",class:"module-row enabled",onClick:t=>h(j)(e.id)},{default:d(()=>[u(K,{class:"drag-handle",name:"drag_handle",onClick:f[0]||(f[0]=S(()=>{},["stop"]))}),u(K,{class:"icon",name:"person"}),m("div",Ci,[f[15]||(f[15]=m("div",{class:"name"},"Own role only",-1)),m("div",Ai,w(h(M)(e)),1)]),m("div",{class:"row-actions",onClick:f[1]||(f[1]=S(()=>{},["stop"]))},[u(J,{icon:"","x-small":"",secondary:"",onClick:t=>h(j)(e.id)},{default:d(()=>[u(K,{name:"edit"})]),_:1},8,["onClick"]),u(J,{icon:"","x-small":"",secondary:"",onClick:t=>h(F)(e.id)},{default:d(()=>[u(K,{name:"close"})]),_:1},8,["onClick"])])]),_:2},1032,["onClick"])]),_:1},8,["modelValue"]),u(J,{class:"add-link",onClick:f[3]||(f[3]=e=>h(j)("+"))},{default:d(()=>[...f[16]||(f[16]=[_("Add Own-Role Rule",-1)])]),_:1}),u(ee,{class:"section-divider add-margin-top",large:"",style:{"--v-divider-color":"var(--theme--border-color-subdued)"}},{icon:d(()=>[u(K,{name:"badge"})]),default:d(()=>[f[17]||(f[17]=_(" "+w("Role Visibility"),-1))]),_:1}),f[21]||(f[21]=m("p",{class:"section-intro"},[_(" Hide or show specific roles in the Users nav tree for matched roles/policies. Applied after own-role filtering. Optional deep-link blocking covers "),m("code",null,"/users/roles/<id>"),_(". ")],-1)),0===h(D).length?(s(),g("div",Oi,"No role visibility rules yet.")):(s(),g("div",Di,[(s(!0),g(b,null,y(h(D),e=>(s(),c(te,{key:e.id,block:"",dense:"",clickable:"",class:"module-row enabled",onClick:t=>h(B)(e.id)},{default:d(()=>[u(K,{class:"icon",name:"badge"}),m("div",Ii,[m("div",Ri,[_(w(e.name)+" ",1),h(V)(e.id)?(s(),c(ne,{key:0,"x-small":"",class:"rule-chip"},{default:d(()=>[_(w(h(U)(e.id)),1)]),_:2},1024)):x("v-if",!0)]),m("div",Pi,"/users/roles/"+w(e.id),1)]),m("div",{class:"row-actions",onClick:f[4]||(f[4]=S(()=>{},["stop"]))},[u(J,{icon:"","x-small":"",secondary:"",onClick:t=>h(B)(e.id)},{default:d(()=>[u(K,{name:"policy"})]),_:1},8,["onClick"]),u(J,{icon:"","x-small":"",secondary:"",onClick:t=>h(z)(e.id)},{default:d(()=>[u(K,{name:"close"})]),_:1},8,["onClick"])])]),_:2},1032,["onClick"]))),128))])),u(J,{class:"add-link",onClick:f[5]||(f[5]=e=>h(B)("+"))},{default:d(()=>[...f[18]||(f[18]=[_("Add Role Rule",-1)])]),_:1})],64))],2),u(ie,{"model-value":null!==h(A),title:"Own Role Only",icon:"person","onUpdate:modelValue":h(L),onCancel:h(N)},{actions:d(()=>[k((s(),c(J,{icon:"",rounded:"",onClick:h($)},{default:d(()=>[u(K,{name:"check"})]),_:1},8,["onClick"])),[[le,"Apply",void 0,{bottom:!0}]])]),default:d(()=>[h(O)?(s(),g("div",Ti,[f[24]||(f[24]=m("p",{class:"hint"},"Leave roles and policies empty for a catch-all (place last).",-1)),m("div",Mi,[f[22]||(f[22]=m("label",null,"Roles",-1)),u(oe,{modelValue:h(O).roles,"onUpdate:modelValue":f[6]||(f[6]=e=>h(O).roles=e),multiple:"",items:h(r),"item-text":"text","item-value":"value",placeholder:"Select roles (optional)"},null,8,["modelValue","items"])]),m("div",Vi,[f[23]||(f[23]=m("label",null,"Policies",-1)),u(oe,{modelValue:h(O).policies,"onUpdate:modelValue":f[7]||(f[7]=e=>h(O).policies=e),multiple:"",items:h(a),"item-text":"text","item-value":"value",placeholder:"Select policies (optional)"},null,8,["modelValue","items"])])])):x("v-if",!0)]),_:1},8,["model-value","onUpdate:modelValue","onCancel"]),u(ie,{"model-value":null!==h(R),title:"+"===h(R)?"Add Role Rule":"Role Visibility",icon:"policy","onUpdate:modelValue":h(q),onCancel:h(H)},{actions:d(()=>[k((s(),c(J,{disabled:h(T),icon:"",rounded:"",onClick:h(X)},{default:d(()=>[u(K,{name:"check"})]),_:1},8,["disabled","onClick"])),[[le,"Apply",void 0,{bottom:!0}]])]),default:d(()=>[h(P)?(s(),g("div",Ui,[f[30]||(f[30]=m("p",{class:"hint"},"Pick a role and at least one matching role or policy.",-1)),m("div",ji,[f[25]||(f[25]=m("label",null,"Role to control",-1)),u(oe,{modelValue:h(P).id,"onUpdate:modelValue":f[8]||(f[8]=e=>h(P).id=e),items:h(I),"item-text":"text","item-value":"value",disabled:"+"!==h(R),placeholder:"Select role"},null,8,["modelValue","items","disabled"])]),m("div",Ni,[f[26]||(f[26]=m("label",null,"Visibility",-1)),u(oe,{modelValue:h(P).visibility,"onUpdate:modelValue":f[9]||(f[9]=e=>h(P).visibility=e),items:[{text:"Hide for matched roles/policies",value:"hide"},{text:"Show only for matched roles/policies",value:"show"}]},null,8,["modelValue"])]),m("div",Li,[f[27]||(f[27]=m("label",null,"Roles",-1)),u(oe,{modelValue:h(P).roles,"onUpdate:modelValue":f[10]||(f[10]=e=>h(P).roles=e),multiple:"",items:h(r),"item-text":"text","item-value":"value",placeholder:"Select roles"},null,8,["modelValue","items"])]),m("div",$i,[f[28]||(f[28]=m("label",null,"Policies",-1)),u(oe,{modelValue:h(P).policies,"onUpdate:modelValue":f[11]||(f[11]=e=>h(P).policies=e),multiple:"",items:h(a),"item-text":"text","item-value":"value",placeholder:"Select policies"},null,8,["modelValue","items"])]),m("div",Fi,[u(re,{modelValue:h(P).block_routes,"onUpdate:modelValue":f[12]||(f[12]=e=>h(P).block_routes=e),label:"Block deep links to /users/roles/<id> when this rule hides it"},null,8,["modelValue"])]),h(R)&&"+"!==h(R)&&h(V)(h(R))?(s(),c(J,{key:0,secondary:"",onClick:h(Y)},{default:d(()=>[...f[29]||(f[29]=[_(" Remove rule ",-1)])]),_:1},8,["onClick"])):x("v-if",!0)])):x("v-if",!0)]),_:1},8,["model-value","title","onUpdate:modelValue","onCancel"])]),_:1})}}});De("\n.page[data-v-12ad5f1c] {\n\tpadding-inline: var(--content-padding);\n\tpadding-block-start: 0;\n\tpadding-block-end: var(--content-padding-bottom);\n\tmax-width: 720px;\n}\n.page--padded-top[data-v-12ad5f1c] {\n\tpadding-block-start: var(--content-padding);\n}\n.loading[data-v-12ad5f1c] {\n\tdisplay: flex;\n\tjustify-content: center;\n\tpadding: 4rem;\n}\n.page-intro[data-v-12ad5f1c],\n.section-intro[data-v-12ad5f1c] {\n\tmargin: 0 0 24px;\n\tline-height: 1.55;\n\tcolor: var(--theme--foreground);\n}\n.section-intro[data-v-12ad5f1c] {\n\tmargin-bottom: 16px;\n}\n.section-divider[data-v-12ad5f1c] {\n\tmargin-bottom: 12px;\n}\n.section-divider.add-margin-top[data-v-12ad5f1c] {\n\tmargin-top: 40px;\n}\n.list[data-v-12ad5f1c] {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tmargin-bottom: 12px;\n\tpadding: 0;\n}\n.module-row.enabled[data-v-12ad5f1c] {\n\t--v-list-item-color: var(--theme--foreground);\n}\n.drag-handle[data-v-12ad5f1c] {\n\tcursor: grab;\n\tmargin-inline-end: 4px;\n\tcolor: var(--theme--foreground-subdued);\n}\n.icon[data-v-12ad5f1c] {\n\tmargin: 0 0.6875rem;\n}\n.info[data-v-12ad5f1c] {\n\tflex: 1;\n\tmin-width: 0;\n}\n.name[data-v-12ad5f1c] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tfont-weight: 600;\n}\n.to[data-v-12ad5f1c] {\n\tfont-family: var(--theme--fonts--monospace--font-family, monospace);\n\tfont-size: 12px;\n\topacity: 0.75;\n}\n.rule-chip[data-v-12ad5f1c] {\n\tmargin-inline-start: 4px;\n}\n.row-actions[data-v-12ad5f1c] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n}\n.add-link[data-v-12ad5f1c] {\n\tmargin-top: 4px;\n}\n.empty[data-v-12ad5f1c] {\n\tmargin-bottom: 12px;\n\tcolor: var(--theme--foreground);\n}\n.drawer-content[data-v-12ad5f1c] {\n\tpadding: var(--content-padding);\n\tpadding-block-end: var(--content-padding-bottom);\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 20px;\n}\n.field label[data-v-12ad5f1c] {\n\tdisplay: block;\n\tmargin-bottom: 8px;\n\tfont-weight: 600;\n}\n.checkbox-field[data-v-12ad5f1c] {\n\tpadding-top: 4px;\n}\n.hint[data-v-12ad5f1c],\n.sidebar-text[data-v-12ad5f1c] {\n\tmargin: 0;\n\tline-height: 1.5;\n\tcolor: var(--theme--foreground);\n}\n.hint code[data-v-12ad5f1c],\n.sidebar-text code[data-v-12ad5f1c],\n.section-intro code[data-v-12ad5f1c] {\n\tfont-family: var(--theme--fonts--monospace--font-family, monospace);\n\tfont-size: 0.9em;\n}\n",{});var Hi=Ie(Bi,[["__scopeId","data-v-12ad5f1c"]]);const qi="__modulePermissionsRouteGuardInstalled",Xi="mp_home_applied";function Yi(e,t){try{const n=e?._s?.get?.(t);return n||null}catch{return null}}function zi(e){const t=Yi(e,"userStore");return!0===t?.currentUser?.admin_access}function Wi(e){const t=Yi(e,"settingsStore");return M(t?.settings?.[A])}function Gi(){try{"undefined"!=typeof sessionStorage&&sessionStorage.removeItem(Xi)}catch{}}function Ki(){try{"undefined"!=typeof sessionStorage&&sessionStorage.setItem(Xi,"1")}catch{}}function Ji(e){const t=Yi(e,"settingsStore"),n=t?.settings;if(!n)return new Set;const o=M(n[A]);if(Array.isArray(o.blocked_ids)&&o.blocked_ids.length>0)return new Set(o.blocked_ids.map(String));const i=n.module_bar,r=Yi(e,"userStore"),a=r?.currentUser?.role,l="string"==typeof a?a:a?.id,s=l?[String(l)]:[];return new Set(function(e,t,n){if(!Array.isArray(e))return[];const o=M(t).rules,i=new Map(o.map(e=>[e.id,e])),r=[];for(const t of e){const e=i.get(t.id);U(e,n)&&(e&&!1===e.block_routes||r.push(t.id))}return r}(i,o,{roleIds:s,policyIds:[]}))}function Qi(e){const t=Wi(e);return"string"==typeof t.home_path?R(t.home_path):(t.home_path,null)}function Zi(e,t,n,o){const i=Yi(e,"settingsStore"),r=i?.settings?.module_bar,a=function(e){const t=e.blocked instanceof Set?e.blocked:new Set(e.blocked),n=e.blockedCollections instanceof Set?e.blockedCollections:new Set(e.blockedCollections||[]),o=R(e.fromPath),i=o?N(o):null,r=new Set,a=[],l=e=>{const l=R(e);if(!l)return;if(r.has(l))return;if(o&&l===o)return;if(j(l,t))return;const s=L(l);if(s&&n.has(s))return;const c=N(l);i&&c&&c===i&&t.has(i)||(r.add(l),a.push(l))};if(l(e.homePath),Array.isArray(e.moduleBar))for(const n of e.moduleBar)"module"===n.type&&n.enabled&&"module-permissions"!==n.id&&(t.has(n.id)||l(`/${n.id}`));return r.has("/")||a.push("/"),a}({homePath:Qi(e),moduleBar:r,blocked:t,blockedCollections:n,fromPath:o});return a[0]||"/"}function er(e,t,n,o,i){if(function(){try{return"undefined"!=typeof sessionStorage&&"1"===sessionStorage.getItem(Xi)}catch{return!1}}())return!1;if(zi(t))return!1;const r=Yi(t,"userStore"),a=r?.currentUser;if(!a)return!1;const l=Qi(t),s=function(e){return!0===Wi(e).home_force}(t),c=R(a.last_page),d=R(e.path);if(!l)return!1;if(function(e){const t=e?.query?.redirect;return!("string"!=typeof t||!t.trim())||!(!Array.isArray(t)||!t.some(e=>"string"==typeof e&&e.trim()))}(e))return Ki(),!1;if(!s){if(c)return Ki(),!1;if(!function(e){const t=R(e);return"/"===t||"/content"===t}(e.path))return!1}const u=l;if(!u||u===d)return Ki(),!1;if(j(u,n))return Ki(),!1;const f=L(u);return f&&o.has(f)?(Ki(),!1):(Ki(),i(u),!0)}function tr(e,t,n,o,i,r){if(i.value>=4)return i.value=0,void("/"===R(e)?r():r("/"));const a=Zi(t,n,o,e),l=R(e),s=R(a);return s&&s!==l?"/"===s&&"/"===l?(i.value=0,void r()):(i.value+=1,void r(s)):(i.value=0,void("/"===l?r():r("/")))}const nr="__modulePermissionsSidebarEnforcerInstalled",or="mp-sidebar-enforcer-styles",ir="mp-sidebar-hidden",rr="data-mp-sidebar-panel-hidden",ar=new Map(O.map(e=>[e.id,e.icon]));function lr(e,t){try{const n=e?._s?.get?.(t);return n||null}catch{return null}}function sr(e){const t=lr(e,"userStore");return!0===t?.currentUser?.admin_access}function cr(e){const t=lr(e,"settingsStore");return M(t?.settings?.[A])}function dr(e){const t=cr(e);return"collapsed"===t.sidebar_mode||"hidden"===t.sidebar_mode?t.sidebar_mode:"default"}function ur(){let e=document.getElementById(or);return e||(e=document.createElement("style"),e.id=or,document.head.appendChild(e),e)}function fr(e,t){e&&e instanceof HTMLElement&&(e.setAttribute(rr,t),e.style.display="none")}function pr(e){const t=e.querySelector?.(".material-icons, .material-symbols-outlined, .material-symbols-rounded");if(t?.textContent){const e=t.textContent.trim();if(e)return e}const n=e.querySelector?.("[data-icon], [aria-label]"),o=n?.getAttribute("data-icon")||n?.getAttribute("aria-label");if(o)return o.trim();const i=e.classList?.contains("v-icon")?e:e.querySelector?.(".v-icon");if(i?.textContent){const e=i.textContent.trim();if(e&&e.length<64&&!e.includes("\n"))return e}return null}function mr(e,t){const n=document.querySelector("#sidebar");if(!n)return;n.querySelectorAll(".toggle, button.accordion-trigger, .sidebar-detail > button").forEach(n=>{if(pr(n)!==t)return;fr(n,e);let o=n.nextElementSibling;for(;o&&!(o.classList.contains("toggle")||o.classList.contains("accordion-item")||o.classList.contains("accordion-trigger"));)(o.classList.contains("content")||o.classList.contains("scroll-container")||o.classList.contains("accordion-content")||o instanceof HTMLElement&&o.getAttribute("data-state"))&&fr(o,e),o=o.nextElementSibling;const i=n.closest(".sidebar-detail");i&&i!==n&&fr(i,e)})}function vr(e){"activity"===e&&(document.querySelectorAll("#sidebar .notifications-preview").forEach(t=>{fr(t,e)}),document.querySelectorAll("#sidebar .sidebar-button, #sidebar button.sidebar-button").forEach(t=>{if("pending_actions"!==pr(t))return;fr(t.closest(".notifications-preview")||t,e)}))}function hr(e){if(sr(e))return ur().textContent="",document.documentElement.classList.remove(ir),void document.querySelectorAll(`[${rr}]`).forEach(e=>{e.removeAttribute(rr),e.style.removeProperty("display")});const t=function(e){const t=cr(e);return Array.isArray(t.sidebar_hidden_panels)?t.sidebar_hidden_panels.map(String):[]}(e),n=dr(e);ur().textContent=`${function(e){if(!e.length)return"";const t=[];for(const n of e){const e=CSS.escape(n);t.push(`.accordion-item:has(#${e}) { display: none !important; }`),t.push(`.accordion-item[data-value="${e}"] { display: none !important; }`),t.push(`.accordion-section:has(#${e}) { display: none !important; }`),t.push(`.v-list-group:has(#${e}) { display: none !important; }`),t.push(`[${rr}="${e}"] { display: none !important; }`),"activity"===n&&t.push("#sidebar .notifications-preview { display: none !important; }")}return t.join("\n")}(t)}\n${function(e){return"hidden"!==e?"":`\nhtml.${ir} #sidebar {\n\tdisplay: none !important;\n\twidth: 0 !important;\n\tmin-width: 0 !important;\n\toverflow: hidden !important;\n\tpointer-events: none !important;\n}\nhtml.${ir} .sidebar-button,\nhtml.${ir} button.sidebar-toggle,\nhtml.${ir} .header-bar .sidebar-toggle,\nhtml.${ir} [data-sidebar-toggle] {\n\tdisplay: none !important;\n}\n`.trim()}(n)}`,function(e){const t=new Set(e);document.querySelectorAll(`[${rr}]`).forEach(e=>{const n=e.getAttribute(rr);n&&t.has(n)||(e.removeAttribute(rr),e.style.removeProperty("display"))});for(const t of e){const e=document.getElementById(t)||document.querySelector(`.accordion-item[data-value="${CSS.escape(t)}"]`);e&&fr(e.closest(".accordion-item")||e.closest(".accordion-section")||e.closest(".v-list-group")||(e.classList?.contains("accordion-item")?e:null)||e.parentElement,t);const n=ar.get(t)||null;n&&mr(t,n),vr(t)}}(t),function(e,t){const n=document.documentElement;if("hidden"!==t){if(n.classList.remove(ir),"collapsed"===t){const t=lr(e,"sidebar-store");try{t?.collapse?.()}catch{}const n=lr(e,"appStore");try{n&&"sidebarOpen"in n&&(n.sidebarOpen=!1)}catch{}}}else n.classList.add(ir)}(e,n)}const gr="__modulePermissionsUsersNavEnforcerInstalled",br="mp-users-nav-enforcer-styles",yr="data-mp-module-nav-hidden",_r="data-mp-users-role-hidden",wr=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function xr(e,t){try{const n=e?._s?.get?.(t);return n||null}catch{return null}}function Sr(e){const t=xr(e,"userStore");return!0===t?.currentUser?.admin_access}function kr(e){const t=xr(e,"settingsStore");return M(t?.settings?.[A])}function Er(){let e=document.getElementById(br);return e||(e=document.createElement("style"),e.id=br,document.head.appendChild(e),e)}function Cr(){document.documentElement.classList.remove("mp-module-nav-hidden"),document.querySelectorAll(`[${yr}]`).forEach(e=>{e.removeAttribute(yr)})}function Ar(e,t){const n=kr(e),o=!0===n.users_own_role_only,i=new Set((n.users_allowed_role_ids||[]).map(String)),r=new Set((n.users_hidden_role_ids||[]).map(String));if(document.querySelectorAll(`[${_r}]`).forEach(e=>{e.removeAttribute(_r),e.style.removeProperty("display")}),!o&&0===r.size)return;const a=document.querySelector("#module-navigation")||document.querySelector("#navigation .module-nav-content")||document.querySelector("aside.module-nav .module-nav-content")||document.querySelector(".module-nav-content")||document.querySelector("aside.module-nav");if(!a)return;const l=new Set,s=(e,t)=>{e&&t&&!l.has(t)&&function(e,t,n,o){return!!o.has(e)||!(!t||n.has(e))}(e,o,i,r)&&(!function(e,t){e.setAttribute(_r,t),e.style.display="none"}(t,e),l.add(t))};a.querySelectorAll('a[href*="/users/roles/"]').forEach(e=>{const t=function(e){if(!e)return null;try{const t=(new URL(e,window.location.origin).pathname.replace(/^\/admin/,"")||"/").split("/").filter(Boolean);return"users"!==t[0]||"roles"!==t[1]?null:t[2]&&"+"!==t[2]?t[2]:null}catch{const t=e.match(/\/users\/roles\/([^/?#]+)/);return t?.[1]&&"+"!==t[1]?t[1]:null}}(e.getAttribute("href")),n=e.closest(".v-list-item")||e.closest(".v-list-group")||e;s(t,n)}),a.querySelectorAll("[data-value], [data-role], [data-role-id], [data-id]").forEach(e=>{const t=e,n=[t.getAttribute("data-value"),t.getAttribute("data-role"),t.getAttribute("data-role-id"),t.getAttribute("data-id")];for(const e of n){if(!e||!wr.test(e))continue;const n=t.closest(".v-list-group")||t.closest(".v-list-item")||t;s(e,n);break}});const c=(String(t||"").replace(/^\/admin/,"")||"/").match(/^\/users\/roles\/([^/?#]+)/),d=c?.[1]&&"+"!==c[1]?c[1]:null;if(r.size>0||o&&i.size>0){a.querySelectorAll(".v-list-group > .v-list-item.clickable, .v-list-item.clickable, .v-list-group.clickable").forEach(e=>{const t=e;if(l.has(t)||t.hasAttribute(_r))return;const n=(t.textContent||"").trim().toLowerCase();if("active users"===n||"suspended users"===n||"invited users"===n||"all users"===n||n.startsWith("active users")||n.startsWith("suspended")||n.startsWith("invited")||n.startsWith("all users"))return;(t.classList.contains("active")||"page"===t.getAttribute("aria-current"))&&d&&s(d,t)})}}function Or(e,t){const n=kr(e),o=new Set((n.navigation_hidden_modules||[]).map(String)),i=N(t);Er().textContent=`\n[${yr}] {\n\tdisplay: none !important;\n\twidth: 0 !important;\n\tmin-width: 0 !important;\n\tmax-width: 0 !important;\n\tflex: 0 0 0 !important;\n\toverflow: hidden !important;\n\tpointer-events: none !important;\n\tborder: none !important;\n}\n`.trim(),Cr();if(Boolean(i&&o.has(i)))for(const e of function(){const e=[],t=t=>{t instanceof HTMLElement&&!e.includes(t)&&e.push(t)};document.querySelectorAll("aside.module-nav, #module-navigation, .mobile-nav.module-nav").forEach(e=>{"navigation"===e.id&&e.querySelector(":scope > .module-bar, :scope > .resize-wrapper")||t(e)});const n=document.querySelector("#navigation");if(n){const e=n.querySelector(":scope > .resize-wrapper")||n.querySelector(":scope > .v-resizeable");e instanceof HTMLElement&&e.querySelector(".module-nav")?t(e):n.querySelectorAll(".module-nav").forEach(e=>{if(!(e instanceof HTMLElement))return;if(e.closest(".module-bar"))return;const n=e.parentElement;n?.classList.contains("resize-wrapper")?t(n):t(e)})}return e}())e.setAttribute(yr,"")}function Dr(e){if(window.__mpRolesClientFilterInstalled)return;window.__mpRolesClientFilterInstalled=!0;const t=XMLHttpRequest.prototype,n=t.open,o=t.send,i=Object.getOwnPropertyDescriptor(t,"responseText"),r=Object.getOwnPropertyDescriptor(t,"response"),a=i?.get,l=r?.get;a&&(t.open=function(e,t,...o){return this.__mpRolesUrl="string"==typeof t?t:String(t),this.__mpRolesMethod=e,n.call(this,e,t,...o)},t.send=function(...t){const n=String(this.__mpRolesUrl||"");if("GET"===String(this.__mpRolesMethod||"GET").toUpperCase()&&function(e){try{const t=new URL(e,window.location.origin).pathname.replace(/\/$/,"");return/\/roles$/.test(t)&&!/\/roles\//.test(t)}catch{return/\/roles(\?|$)/.test(e)&&!/\/roles\//.test(e)}}(n)){let t=null;Object.defineProperty(this,"responseText",{configurable:!0,enumerable:!0,get:()=>{const n=a.call(this);if(4!==this.readyState)return n;if(null!=t)return t;if(this.status<200||this.status>=300||!n)return t=n,n;try{const o=JSON.parse(n),i=function(e,t){if(Sr(t))return e;if(!e||!Array.isArray(e.data))return e;const n=kr(t),o=!0===n.users_own_role_only,i=new Set((n.users_allowed_role_ids||[]).map(String)),r=new Set((n.users_hidden_role_ids||[]).map(String));if(!o&&0===r.size)return e;const a=e.data.filter(e=>{const t=null!=e?.id?String(e.id):"";return!t||!r.has(t)&&!(o&&!i.has(t))}),l=new Set(a.map(e=>String(e.id)));return{...e,data:a.map(e=>{const t=e?.parent;return null==t||""===t||l.has(String(t))?e:{...e,parent:null}})}}(o,e);t=i===o?n:JSON.stringify(i)}catch{t=n}return t}}),l&&Object.defineProperty(this,"response",{configurable:!0,enumerable:!0,get:()=>{const e=this.responseType;return e&&"text"!==e&&""!==e?l.call(this):this.responseText}})}return o.apply(this,t)})}!function(){if("undefined"==typeof window)return;if(window[qi])return;const e=Date.now(),t={value:0},n=window.setInterval(()=>{const o=document.querySelector("#app"),i=o?.__vue_app__,r=i?.config?.globalProperties?.$router,a=function(e){return e?.config?.globalProperties?.$pinia||null}(i);i&&r&&a?(window.clearInterval(n),window[qi]=!0,r.beforeEach((e,n,o)=>{try{if(function(e){const t=R(e)||"";return"/login"===t||t.startsWith("/login/")}(e.path))return Gi(),t.value=0,void o();if(zi(a))return t.value=0,void o();const n=Yi(a,"userStore");if(!n?.currentUser)return Gi(),t.value=0,void o();const i=Ji(a),r=function(e){const t=Wi(e);return Array.isArray(t.blocked_collection_ids)?new Set(t.blocked_collection_ids.map(String)):new Set}(a),l=function(e){const t=Wi(e),n=new Set;if(Array.isArray(t.users_blocked_role_ids))for(const e of t.users_blocked_role_ids)n.add(String(e));if(!0===t.users_own_role_only){const n=new Set((t.users_allowed_role_ids||[]).map(String));e.__mpUsersAllowedRoles=n}else e.__mpUsersAllowedRoles=null;return n}(a);if(er(e,a,i,r,o))return void(t.value=0);const s=L(e.path);if(s&&r.has(s))return void tr(e.path,a,i,r,t,o);const c=function(e){const t=R(e);if(!t)return null;const n=t.split("/").filter(Boolean);return"users"!==n[0]||"roles"!==n[1]?null:n[2]&&"+"!==n[2]?n[2]:null}(e.path);if(c&&function(e,t,n){if(n.has(t))return!0;const o=e.__mpUsersAllowedRoles;return!(!o||o.has(t))}(a,c,l))return void tr(e.path,a,i,r,t,o);const d=N(e.path);if(!d)return t.value=0,void o();if("module-permissions"===d)return t.value=0,void o();if(!i.has(d))return t.value=0,void o();tr(e.path,a,i,r,t,o)}catch{t.value=0,o()}}),r.afterEach(()=>{t.value=0})):Date.now()-e>45e3&&window.clearInterval(n)},150)}(),function(){if("undefined"==typeof window)return;if(window[nr])return;const e=Date.now(),t=window.setInterval(()=>{const n=document.querySelector("#app"),o=n?.__vue_app__,i=o?.config?.globalProperties?.$router,r=function(e){return e?.config?.globalProperties?.$pinia||null}(o);if(!o||!i||!r)return void(Date.now()-e>45e3&&window.clearInterval(t));window.clearInterval(t),window[nr]=!0;let a=!1;const l=()=>{a||(a=!0,window.requestAnimationFrame(()=>{a=!1;try{hr(r)}catch{}}))};l(),i.afterEach(()=>{window.setTimeout(l,0),window.setTimeout(l,120),window.setTimeout(l,400)});const s=new MutationObserver(()=>{l()}),c=()=>{const e=document.querySelector("#sidebar")||document.body;s.observe(e,{childList:!0,subtree:!0})};c(),window.setInterval(c,5e3),window.setInterval(()=>{try{if(sr(r))return;if("collapsed"!==dr(r))return;const e=lr(r,"sidebar-store");e&&!1===e.collapsed&&e.collapse?.();const t=lr(r,"appStore");t&&!0===t.sidebarOpen&&(t.sidebarOpen=!1)}catch{}},400)},150)}(),function(){if("undefined"==typeof window)return;if(window[gr])return;const e=Date.now(),t=window.setInterval(()=>{const n=document.querySelector("#app"),o=n?.__vue_app__,i=o?.config?.globalProperties?.$router,r=function(e){return e?.config?.globalProperties?.$pinia||null}(o);if(!o||!i||!r)return void(Date.now()-e>45e3&&window.clearInterval(t));window.clearInterval(t),window[gr]=!0,Dr(r);let a=!1;const l=e=>{a||(a=!0,window.requestAnimationFrame(()=>{a=!1;try{const t=e||i.currentRoute?.value?.path||i.currentRoute?.path||window.location.pathname;!function(e,t){if(Sr(e))return Cr(),document.querySelectorAll(`[${_r}]`).forEach(e=>{e.removeAttribute(_r),e.style.removeProperty("display")}),void(Er().textContent="");Or(e,t),"users"===N(t)&&Ar(e,t)}(r,String(t||"/"))}catch{}}))};l(),i.afterEach(e=>{window.setTimeout(()=>l(e.path),0),window.setTimeout(()=>l(e.path),120),window.setTimeout(()=>l(e.path),400)});const s=new MutationObserver(()=>l()),c=()=>{const e=document.querySelector("#module-navigation")||document.querySelector("aside.module-nav")||document.querySelector("#navigation .module-nav")||document.querySelector("#navigation")||document.body;s.observe(e,{childList:!0,subtree:!0})};c(),window.setInterval(c,5e3)},150)}();const Ir=[],Rr=[],Pr=[],Tr=[n({id:"module-permissions",name:"Module Permissions",icon:"security",routes:[{path:"",redirect:"/module-permissions/modules"},{path:"modules",component:Ho},{path:"navigation",redirect:"/module-permissions/modules"},{path:"sidebar",component:pi},{path:"content",component:Xe},{path:"collections",redirect:"/module-permissions/content"},{path:"users",component:Hi},{path:"start-page",component:ki},{path:"home-paths",redirect:"/module-permissions/start-page"},{path:"settings",component:Go},{path:"cleanup",redirect:"/module-permissions/settings"}],preRegisterCheck:e=>!0===e?.admin_access})],Mr=[],Vr=[],Ur=[];export{Rr as displays,Ir as interfaces,Pr as layouts,Tr as modules,Ur as operations,Mr as panels,Vr as themes};
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "directus-extension-module-permissions",
|
|
3
|
+
"description": "Control Studio UI visibility for the module bar, Module Navigation, Content nav, Users role tree, Sidebar, and Start Page by role and policy",
|
|
4
|
+
"icon": "security",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"directus",
|
|
9
|
+
"directus-extension",
|
|
10
|
+
"directus-extension-bundle",
|
|
11
|
+
"module-permissions",
|
|
12
|
+
"modules",
|
|
13
|
+
"permissions",
|
|
14
|
+
"content",
|
|
15
|
+
"users",
|
|
16
|
+
"sidebar",
|
|
17
|
+
"start-page",
|
|
18
|
+
"roles",
|
|
19
|
+
"policies"
|
|
20
|
+
],
|
|
21
|
+
"type": "module",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"LICENSE",
|
|
25
|
+
"README.md"
|
|
26
|
+
],
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/domdus/directus-extension-module-permissions.git"
|
|
30
|
+
},
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/domdus/directus-extension-module-permissions/issues"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://github.com/domdus/directus-extension-module-permissions#readme",
|
|
35
|
+
"directus:extension": {
|
|
36
|
+
"type": "bundle",
|
|
37
|
+
"path": {
|
|
38
|
+
"app": "dist/app.js",
|
|
39
|
+
"api": "dist/api.js"
|
|
40
|
+
},
|
|
41
|
+
"entries": [
|
|
42
|
+
{
|
|
43
|
+
"type": "module",
|
|
44
|
+
"name": "module-permissions",
|
|
45
|
+
"source": "src/module/index.ts"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"type": "hook",
|
|
49
|
+
"name": "module-permissions-hook",
|
|
50
|
+
"source": "src/hook/index.ts"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"host": ">=11.0.0 <13.0.0"
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "directus-extension build",
|
|
57
|
+
"dev": "directus-extension build -w --no-minify",
|
|
58
|
+
"link": "directus-extension link",
|
|
59
|
+
"add": "directus-extension add"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@directus/extensions-sdk": "^17.0.0",
|
|
63
|
+
"@directus/types": "^13.0.0",
|
|
64
|
+
"typescript": "^5.0.0",
|
|
65
|
+
"vue": "^3.3.7",
|
|
66
|
+
"vuedraggable": "^4.1.0"
|
|
67
|
+
}
|
|
68
|
+
}
|