@oktis-works/admin 0.9.0 → 0.11.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/dist/client/_astro/{ActivityWidget.l4_oR6gt.js → ActivityWidget.D9s4FOLp.js} +2 -2
- package/dist/client/_astro/{AdminBar.DbabNkmU.js → AdminBar.D8078Gqs.js} +2 -2
- package/dist/client/_astro/ApiKeysManager.BjyxI6JT.js +1 -0
- package/dist/client/_astro/{AtGlanceWidget.C7QyOZnc.js → AtGlanceWidget.DBA3mEnF.js} +3 -3
- package/dist/client/_astro/BaseLayout.DAkzjMTq.css +1 -0
- package/dist/client/_astro/{ContentEditor.BCy7gbzZ.js → ContentEditor.BZ8aLcGz.js} +2 -2
- package/dist/client/_astro/ContentEditor.CfQqsa6r.js +1 -0
- package/dist/client/_astro/ContentTypeWorkspace.BhHFc6WZ.js +1 -0
- package/dist/client/_astro/DashboardHome.BXIUgb4u.js +1 -0
- package/dist/client/_astro/DashboardLayout.DM3iZCrw.css +1 -0
- package/dist/client/_astro/{DashboardLayout.astro_astro_type_script_index_0_lang.PXk2X2qN.js → DashboardLayout.astro_astro_type_script_index_0_lang.Cc0PvXrs.js} +1 -1
- package/dist/client/_astro/FbIcon.CUNS6rpP.js +1 -0
- package/dist/client/_astro/FieldGroupEditor.CVoPJ2v-.js +69 -0
- package/dist/client/_astro/{FieldGroupList.DrhO-iww.js → FieldGroupList.BG2ET5gZ.js} +1 -1
- package/dist/client/_astro/FloatingPanel.BeCEt_JP.js +1 -0
- package/dist/client/_astro/{Footer.Uc7SesWM.js → Footer.Chcu8yzV.js} +2 -2
- package/dist/client/_astro/GeneralSettings.CefkBcVj.js +1 -0
- package/dist/client/_astro/LogsManager.ya0kmAUm.js +1 -0
- package/dist/client/_astro/MediaLibrary.Bod2Afk4.js +1 -0
- package/dist/client/_astro/{MenuManager.Cy7xyr2l.js → MenuManager.d6_0hgNg.js} +1 -1
- package/dist/client/_astro/Modal.DR905gyF.js +1 -0
- package/dist/client/_astro/{PluginManager.3qXWwYBV.js → PluginManager.BHvKQlj2.js} +2 -2
- package/dist/client/_astro/PostTypesManager.DMUxfOp9.js +1 -0
- package/dist/client/_astro/{QuickDraftWidget.ux_yGWpX.js → QuickDraftWidget.DyX_bJ1p.js} +2 -2
- package/dist/client/_astro/ResourceHubs.BwxYHeE5.js +1 -0
- package/dist/client/_astro/TaxonomiesManager.DlVS4Ujm.js +1 -0
- package/dist/client/_astro/TaxonomyTermsManager.B_ZDFU-K.js +1 -0
- package/dist/client/_astro/ThemeManager.DuHgcKyn.js +176 -0
- package/dist/client/_astro/UserCreateForm.1KIa3Aa2.js +1 -0
- package/dist/client/_astro/UsersManager.v24y8OSk.js +1 -0
- package/dist/client/_astro/WebhooksManager.DPkFhoVr.js +1 -0
- package/dist/client/_astro/api.CYg1SW2X.js +1 -0
- package/dist/client/_astro/client.DU9Dc2oe.js +1 -0
- package/dist/client/_astro/extensions.Brl6zAPA.js +1 -0
- package/dist/client/_astro/i18n.AbBpo2WD.js +1 -0
- package/dist/client/_astro/{login.astro_astro_type_script_index_0_lang.Dni6a5dD.js → login.astro_astro_type_script_index_0_lang.F2J3xZhK.js} +1 -1
- package/dist/client/_astro/{pt-BR.B-uijFlj.js → pt-BR.B0jeLTb0.js} +1 -1
- package/dist/client/_astro/solid.D49dPDCT.js +1 -0
- package/dist/client/_astro/{src.DksrLolD.js → src.DXVWCoHp.js} +1 -1
- package/dist/client/_astro/web.Bqbl_1YR.js +1 -0
- package/dist/server/chunks/{404_DIfrzRRM.mjs → 404_Bj-sYqJF.mjs} +1 -1
- package/dist/server/chunks/{BaseLayout_CmMnXoh2.mjs → BaseLayout_BlxsDTAd.mjs} +3 -3
- package/dist/server/chunks/{ContentEditor_CrP88U9K.mjs → ContentEditor_BLL0Q9aT.mjs} +2 -2
- package/dist/server/chunks/{DashboardLayout_C6I2H2jO.mjs → DashboardLayout_D-AI4SdO.mjs} +7 -2
- package/dist/server/chunks/FloatingPanel_DI2CdUZK.mjs +57 -0
- package/dist/server/chunks/{MediaLibrary_c4bl4fTY.mjs → MediaLibrary_BPSHokdn.mjs} +2 -2
- package/dist/server/chunks/Modal_vHjkS4i2.mjs +33 -0
- package/dist/server/chunks/{_id__C2MAQ-Pj.mjs → _id__CvxvSegw.mjs} +21 -10
- package/dist/server/chunks/{_slug__CR0j3J9V.mjs → _slug__B3m1GWZj.mjs} +1 -1
- package/dist/server/chunks/access_t-YgohBR.mjs +389 -0
- package/dist/server/chunks/api-keys_DvIgJEw-.mjs +283 -0
- package/dist/server/chunks/{custom-fields_BPduH9VI.mjs → custom-fields_Yq-7YaBk.mjs} +2 -2
- package/dist/server/chunks/{edit_CJdKxNhx.mjs → edit_7AfeGLnP.mjs} +2 -2
- package/dist/server/chunks/{general_eI-sNsQl.mjs → general_4IEF4sYI.mjs} +31 -27
- package/dist/server/chunks/{i18n_BqZ4e24O.mjs → i18n_CItvcX64.mjs} +86 -5
- package/dist/server/chunks/{index_XRE0Vjch.mjs → index_B0LWYIKC.mjs} +2 -2
- package/dist/server/chunks/{index_CyKyYL4y.mjs → index_BoAt_7s4.mjs} +2 -2
- package/dist/server/chunks/{index_Om0n2OAr.mjs → index_CG0xJrh0.mjs} +3 -3
- package/dist/server/chunks/{index_CA70i3-b.mjs → index_CUe8civB.mjs} +2 -2
- package/dist/server/chunks/{index_BKzgF5qF.mjs → index_CkJtZm1g.mjs} +2 -2
- package/dist/server/chunks/{login_0iFVtfgV.mjs → login_CWnr9s7S.mjs} +1 -1
- package/dist/server/chunks/{logs_D-h53LJu.mjs → logs_jSHdYZQ7.mjs} +2 -2
- package/dist/server/chunks/{menus_CcCZvv6r.mjs → menus_DSIld5hj.mjs} +2 -2
- package/dist/server/chunks/{new_DSopKVB7.mjs → new_DMbeF6_n.mjs} +2 -2
- package/dist/server/chunks/{new_BmimSObH.mjs → new_NQMhsp8J.mjs} +2 -2
- package/dist/server/chunks/{plugins_MF0XTr5R.mjs → plugins_ChSk7C1I.mjs} +2 -2
- package/dist/server/chunks/{post-types_D5ajDp3x.mjs → post-types_Y8dhnrtw.mjs} +100 -47
- package/dist/server/chunks/{pt-BR_CQndzpOT.mjs → pt-BR_DpWzkRv5.mjs} +74 -4
- package/dist/server/chunks/{taxonomies_CfvbHc_y.mjs → taxonomies_Bg6steYg.mjs} +2 -2
- package/dist/server/chunks/{taxonomy_DdWpf9lk.mjs → taxonomy_Bk7DHF9d.mjs} +2 -2
- package/dist/server/chunks/{themes_DQE1-WCF.mjs → themes_JFxY7m2_.mjs} +2 -2
- package/dist/server/chunks/{upload_DjkuLTrW.mjs → upload_CrHx55UT.mjs} +2 -2
- package/dist/server/chunks/{webhooks_NO5wRHnZ.mjs → webhooks_Du4Tv0yn.mjs} +2 -2
- package/dist/server/entry.mjs +68 -37
- package/dist/server/virtual_astro_middleware.mjs +1 -1
- package/package.json +3 -3
- package/dist/client/_astro/BaseLayout.CgLTOe_a.css +0 -1
- package/dist/client/_astro/ContentEditor.BlRm9ezb.js +0 -1
- package/dist/client/_astro/ContentTypeWorkspace.BF8WjCDy.js +0 -1
- package/dist/client/_astro/DashboardHome.C2TVw1TO.js +0 -1
- package/dist/client/_astro/DashboardLayout.C1hUraeX.css +0 -1
- package/dist/client/_astro/FbIcon.DFmK-EWG.js +0 -1
- package/dist/client/_astro/FieldGroupEditor.CcxZuz0o.js +0 -69
- package/dist/client/_astro/GeneralSettings.Bxn673WF.js +0 -1
- package/dist/client/_astro/LogsManager.DF_3DQlY.js +0 -1
- package/dist/client/_astro/MediaLibrary._7sCWvNs.js +0 -1
- package/dist/client/_astro/PostTypesManager.BAXkf__Y.js +0 -1
- package/dist/client/_astro/ResourceHubs.Dhx1kbfj.js +0 -1
- package/dist/client/_astro/TaxonomiesManager.BYTDEeNU.js +0 -1
- package/dist/client/_astro/TaxonomyTermsManager.DBb5gB5l.js +0 -1
- package/dist/client/_astro/ThemeManager.DVBYapuE.js +0 -176
- package/dist/client/_astro/UserCreateForm.CTr8bSlL.js +0 -1
- package/dist/client/_astro/UsersManager.BfPqZNy7.js +0 -1
- package/dist/client/_astro/WebhooksManager.DPAWAObu.js +0 -1
- package/dist/client/_astro/api.CNp-a9Z3.js +0 -1
- package/dist/client/_astro/client.m5rScAmr.js +0 -1
- package/dist/client/_astro/extensions.CenNQy0u.js +0 -1
- package/dist/client/_astro/i18n.CXvd48vy.js +0 -1
- package/dist/client/_astro/solid.8gBSxpeo.js +0 -1
- package/dist/client/_astro/web.DB4MaPY9.js +0 -1
- package/dist/server/chunks/access_bpmBW03n.mjs +0 -138
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e,i as t,p as n,r,s as i,v as a}from"./solid.8gBSxpeo.js";import{a as o,c as s,f as c,h as l,i as u,r as d,s as f,u as p}from"./web.DB4MaPY9.js";import{n as m}from"./i18n.CXvd48vy.js";import{n as h}from"./api.CNp-a9Z3.js";var g=l(`<div class="notice notice--error">`),_=l(`<button class=btn type=button>`),v=l(`<form class="card term-form"><h3></h3><label><!$><!/><input class=input required></label><label><!$><!/><input class=input></label><label><!$><!/><textarea class=input rows=3></textarea></label><div class=form-actions><button class="btn btn-primary"type=submit></button><!$><!/>`),y=l(`<table class=table><thead><tr><th></th><th></th><th></th></tr></thead><tbody>`),b=l(`<div class=card><div class=card-header><div><h3></h3><p class=muted></p></div><span class=badge></span></div><!$><!/>`),x=l(`<div class=terms-panel><!$><!/><!$><!/><!$><!/>`),S=l(`<p class=muted>`),C=l(`<tr><td></td><td></td><td><button class="btn btn-secondary btn-sm"type=button></button> <button class="btn btn-danger btn-sm"type=button>`);function w(l){let{t:d}=m(),[w,T]=n(null),[E,D]=n([]),[O,k]=n(``),[A,j]=n(``),[M,N]=n(``),[P,F]=n(null),[I,L]=n(``),[R,z]=n(!1),B=async()=>{if(l.taxonomySlug)try{let[e,t]=await Promise.all([h.getTaxonomies(),h.getTaxonomyTerms(l.taxonomySlug)]);T(e.find(e=>e.slug===l.taxonomySlug)??null),D(t)}catch(e){L(e instanceof Error?e.message:String(e))}};a(B);let V=()=>{F(null),k(``),j(``),N(``)},H=e=>{F(e.id??null),k(e.name),j(e.slug),N(e.description??``),L(``)},U=async e=>{e.preventDefault(),L(``),z(!0);try{let e={name:O(),slug:A()||void 0,description:M()||void 0};P()?await h.updateTaxonomyTerm(l.taxonomySlug,P(),e):await h.createTaxonomyTerm(l.taxonomySlug,e),V(),await B()}catch(e){L(e instanceof Error?e.message:String(e))}finally{z(!1)}},W=async e=>{if(e.id&&confirm(d(`content.taxonomy.confirmDelete`,{name:e.name})))try{await h.deleteTaxonomyTerm(l.taxonomySlug,e.id),await B()}catch(e){L(e instanceof Error?e.message:String(e))}};return(()=>{var n=u(x),a=n.firstChild,[m,h]=o(a.nextSibling),T=m.nextSibling,[D,F]=o(T.nextSibling),L=D.nextSibling,[z,B]=o(L.nextSibling);return f(n,i(t,{get when(){return I()},get children(){var e=u(g);return f(e,I),e}}),m,h),f(n,i(t,{get when(){return s(()=>!w())()&&l.taxonomySlug},get children(){var e=u(g);return f(e,()=>d(`content.taxonomy.notFound`)),e}}),D,F),f(n,i(t,{get when(){return w()},get children(){return[(()=>{var n=u(v),r=n.firstChild,a=r.nextSibling,l=a.firstChild,[m,h]=o(l.nextSibling),g=m.nextSibling,y=a.nextSibling,b=y.firstChild,[x,S]=o(b.nextSibling),C=x.nextSibling,w=y.nextSibling,T=w.firstChild,[E,D]=o(T.nextSibling),F=E.nextSibling,I=w.nextSibling,L=I.firstChild,z=L.nextSibling,[B,H]=o(z.nextSibling);return n.addEventListener(`submit`,U),f(r,(()=>{var e=s(()=>!!P());return()=>e()?d(`content.taxonomy.editTerm`):d(`content.taxonomy.addTerm`)})()),f(a,()=>d(`content.taxonomy.name`),m,h),g.$$input=e=>k(e.currentTarget.value),f(y,()=>d(`content.taxonomy.slug`),x,S),C.$$input=e=>j(e.currentTarget.value),f(w,()=>d(`content.taxonomy.description`),E,D),F.$$input=e=>N(e.currentTarget.value),f(L,(()=>{var e=s(()=>!!P());return()=>e()?d(`common.save`):d(`content.taxonomy.add`)})()),f(I,i(t,{get when(){return P()},get children(){var e=u(_);return e.$$click=V,f(e,()=>d(`common.cancel`)),p(),e}}),B,H),e(()=>c(L,`disabled`,R())),e(()=>c(g,`value`,O())),e(()=>c(C,`value`,A())),e(()=>c(F,`value`,M())),p(),n})(),(()=>{var e=u(b),n=e.firstChild,a=n.firstChild,c=a.firstChild,m=c.nextSibling,h=a.nextSibling,g=n.nextSibling,[_,v]=o(g.nextSibling);return f(c,()=>w().name),f(m,(()=>{var e=s(()=>!!l.contentType);return()=>e()?`${d(`content.taxonomy.attachedTo`)}: ${l.contentType}`:d(`content.taxonomy.descriptionHint`)})()),f(h,()=>E().length),f(e,i(t,{get when(){return E().length>0},get fallback(){return(()=>{var e=u(S);return f(e,()=>d(`content.taxonomy.empty`)),e})()},get children(){var e=u(y),t=e.firstChild,n=t.firstChild.firstChild,a=n.nextSibling,o=t.nextSibling;return f(n,()=>d(`content.taxonomy.name`)),f(a,()=>d(`content.taxonomy.slug`)),f(o,i(r,{get each(){return E()},children:e=>(()=>{var t=u(C),n=t.firstChild,r=n.nextSibling,i=r.nextSibling.firstChild,a=i.nextSibling.nextSibling;return f(n,()=>e.name),f(r,()=>e.slug),i.$$click=()=>H(e),f(i,()=>d(`common.edit`)),a.$$click=()=>void W(e),f(a,()=>d(`content.taxonomy.delete`)),p(),t})()})),e}}),_,v),e})()]}}),z,B),n})()}d([`input`,`click`]);export{w as TaxonomyTermsManager};
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import{d as e,i as t,p as n,r,s as i,v as a}from"./solid.8gBSxpeo.js";import{a as o,c as s,d as c,f as l,h as u,i as d,n as f,r as p,s as m,u as h}from"./web.DB4MaPY9.js";import{n as g}from"./i18n.CXvd48vy.js";import{n as _}from"./api.CNp-a9Z3.js";var v=u(`<div class=theme-manager><div class=theme-toolbar><p class=page-hint></p><button class="btn btn-refresh"></button></div><!$><!/><!$><!/><!$><!/><style>
|
|
2
|
-
.theme-toolbar {
|
|
3
|
-
display: flex;
|
|
4
|
-
align-items: flex-start;
|
|
5
|
-
justify-content: space-between;
|
|
6
|
-
gap: 1rem;
|
|
7
|
-
margin-bottom: 1.25rem;
|
|
8
|
-
}
|
|
9
|
-
.page-hint {
|
|
10
|
-
margin: 0;
|
|
11
|
-
color: var(--color-muted);
|
|
12
|
-
font-size: 0.8125rem;
|
|
13
|
-
}
|
|
14
|
-
.btn-refresh {
|
|
15
|
-
flex-shrink: 0;
|
|
16
|
-
}
|
|
17
|
-
.themes-grid {
|
|
18
|
-
display: grid;
|
|
19
|
-
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
|
20
|
-
gap: 1.5rem;
|
|
21
|
-
}
|
|
22
|
-
.theme-card {
|
|
23
|
-
background: var(--color-surface);
|
|
24
|
-
border: 1px solid var(--color-border);
|
|
25
|
-
border-radius: var(--radius-lg);
|
|
26
|
-
padding: 1.5rem;
|
|
27
|
-
display: flex;
|
|
28
|
-
flex-direction: column;
|
|
29
|
-
gap: 1rem;
|
|
30
|
-
transition: all 0.2s;
|
|
31
|
-
}
|
|
32
|
-
.theme-card:hover {
|
|
33
|
-
border-color: var(--color-primary);
|
|
34
|
-
box-shadow: var(--shadow-md);
|
|
35
|
-
}
|
|
36
|
-
.theme-card.active {
|
|
37
|
-
border-color: var(--color-primary);
|
|
38
|
-
box-shadow: 0 0 0 1px var(--color-primary), var(--shadow-md);
|
|
39
|
-
}
|
|
40
|
-
.theme-preview {
|
|
41
|
-
position: relative;
|
|
42
|
-
}
|
|
43
|
-
.theme-preview__img {
|
|
44
|
-
display: block;
|
|
45
|
-
width: 100%;
|
|
46
|
-
border-radius: var(--radius-md);
|
|
47
|
-
border: 1px solid var(--color-border);
|
|
48
|
-
}
|
|
49
|
-
.theme-badge {
|
|
50
|
-
position: absolute;
|
|
51
|
-
top: 0.5rem;
|
|
52
|
-
right: 0.5rem;
|
|
53
|
-
background: var(--color-primary);
|
|
54
|
-
color: var(--color-primary-contrast);
|
|
55
|
-
padding: 0.25rem 0.5rem;
|
|
56
|
-
border-radius: var(--radius-full);
|
|
57
|
-
font-size: 0.625rem;
|
|
58
|
-
font-weight: 700;
|
|
59
|
-
text-transform: uppercase;
|
|
60
|
-
}
|
|
61
|
-
.theme-info {
|
|
62
|
-
display: flex;
|
|
63
|
-
flex-direction: column;
|
|
64
|
-
gap: 0.5rem;
|
|
65
|
-
}
|
|
66
|
-
.theme-info h3 {
|
|
67
|
-
margin: 0;
|
|
68
|
-
font-size: 1.125rem;
|
|
69
|
-
font-weight: 600;
|
|
70
|
-
}
|
|
71
|
-
.theme-version {
|
|
72
|
-
margin: 0;
|
|
73
|
-
font-size: 0.75rem;
|
|
74
|
-
color: var(--color-muted);
|
|
75
|
-
}
|
|
76
|
-
.theme-desc {
|
|
77
|
-
margin: 0;
|
|
78
|
-
font-size: 0.8125rem;
|
|
79
|
-
color: var(--color-text);
|
|
80
|
-
line-height: 1.5;
|
|
81
|
-
}
|
|
82
|
-
.theme-status {
|
|
83
|
-
display: flex;
|
|
84
|
-
align-items: center;
|
|
85
|
-
gap: 0.5rem;
|
|
86
|
-
}
|
|
87
|
-
.status-badge {
|
|
88
|
-
display: inline-flex;
|
|
89
|
-
align-items: center;
|
|
90
|
-
padding: 0.25rem 0.5rem;
|
|
91
|
-
border-radius: var(--radius-full);
|
|
92
|
-
font-size: 0.625rem;
|
|
93
|
-
font-weight: 600;
|
|
94
|
-
text-transform: uppercase;
|
|
95
|
-
}
|
|
96
|
-
.status-active {
|
|
97
|
-
background: var(--color-success-soft);
|
|
98
|
-
color: var(--color-success);
|
|
99
|
-
}
|
|
100
|
-
.status-installed {
|
|
101
|
-
background: var(--color-primary-soft);
|
|
102
|
-
color: var(--color-primary);
|
|
103
|
-
}
|
|
104
|
-
.status-inactive {
|
|
105
|
-
background: var(--color-muted-soft);
|
|
106
|
-
color: var(--color-muted);
|
|
107
|
-
}
|
|
108
|
-
.config-panel {
|
|
109
|
-
display: flex;
|
|
110
|
-
flex-direction: column;
|
|
111
|
-
gap: 0.75rem;
|
|
112
|
-
padding: 1rem;
|
|
113
|
-
background: var(--color-muted-soft, rgba(0, 0, 0, 0.03));
|
|
114
|
-
border-radius: var(--radius-md);
|
|
115
|
-
}
|
|
116
|
-
.config-field {
|
|
117
|
-
display: flex;
|
|
118
|
-
flex-direction: column;
|
|
119
|
-
gap: 0.25rem;
|
|
120
|
-
}
|
|
121
|
-
.config-label {
|
|
122
|
-
font-size: 0.75rem;
|
|
123
|
-
font-weight: 600;
|
|
124
|
-
color: var(--color-text);
|
|
125
|
-
}
|
|
126
|
-
.config-color {
|
|
127
|
-
height: 2.25rem;
|
|
128
|
-
padding: 0.15rem;
|
|
129
|
-
}
|
|
130
|
-
.config-actions {
|
|
131
|
-
display: flex;
|
|
132
|
-
align-items: center;
|
|
133
|
-
gap: 0.75rem;
|
|
134
|
-
}
|
|
135
|
-
.config-saved {
|
|
136
|
-
font-size: 0.75rem;
|
|
137
|
-
color: var(--color-success);
|
|
138
|
-
}
|
|
139
|
-
.theme-actions {
|
|
140
|
-
margin-top: 0.5rem;
|
|
141
|
-
display: flex;
|
|
142
|
-
flex-wrap: wrap;
|
|
143
|
-
gap: 0.5rem;
|
|
144
|
-
}
|
|
145
|
-
.btn-secondary {
|
|
146
|
-
background: transparent;
|
|
147
|
-
color: var(--color-text);
|
|
148
|
-
border: 1px solid var(--color-border);
|
|
149
|
-
}
|
|
150
|
-
.btn-danger {
|
|
151
|
-
background: transparent;
|
|
152
|
-
color: var(--color-error);
|
|
153
|
-
border: 1px solid var(--color-error);
|
|
154
|
-
}
|
|
155
|
-
.empty-state {
|
|
156
|
-
grid-column: 1 / -1;
|
|
157
|
-
padding: 3rem;
|
|
158
|
-
text-align: center;
|
|
159
|
-
color: var(--color-muted);
|
|
160
|
-
}
|
|
161
|
-
.alert {
|
|
162
|
-
padding: 0.75rem 1rem;
|
|
163
|
-
border-radius: var(--radius-md);
|
|
164
|
-
margin-bottom: 1rem;
|
|
165
|
-
}
|
|
166
|
-
.alert-error {
|
|
167
|
-
background: var(--color-error-soft);
|
|
168
|
-
color: var(--color-error);
|
|
169
|
-
border: 1px solid var(--color-error);
|
|
170
|
-
}
|
|
171
|
-
.skeleton {
|
|
172
|
-
padding: 2rem;
|
|
173
|
-
text-align: center;
|
|
174
|
-
color: var(--color-muted);
|
|
175
|
-
}
|
|
176
|
-
`),y=u(`<div class="alert alert-error">`),b=u(`<div class=skeleton>Loading...`),x=u(`<div class=themes-grid><!$><!/><!$><!/>`),S=u(`<img class=theme-preview__img alt loading=lazy>`,!0,!1,!1),ee=u(`<span class=config-saved>`),te=u(`<div class=config-panel><!$><!/><div class=config-actions><button class=btn></button><!$><!/>`),C=u(`<button class="btn btn-secondary">`),ne=u(`<div><div class=theme-preview><!$><!/><!$><!/></div><div class=theme-info><h3></h3><p class=theme-version><!$><!/>: <!$><!/></p><p class=theme-status><span></span></p><!$><!/></div><!$><!/><div class=theme-actions><button></button><!$><!/><button class="btn btn-danger">`),w=u(`<div class="theme-badge active-badge">`),T=u(`<p class=theme-desc>`),E=u(`<div class=config-field><label class=config-label></label><!$><!/>`),re=u(`<textarea class=input rows=3>`),ie=u(`<select class=input>`),ae=u(`<option>`),oe=u(`<input type=checkbox>`),se=u(`<input type=color class="input config-color">`),ce=u(`<input class=input>`),D=u(`<div class=empty-state>`);function O(){let{t:u}=g(),[p,O]=n([]),[k,A]=n(!0),[j,M]=n(null),[N,P]=n(null),[F,I]=n(null),[L,R]=n({}),[z,B]=n(!1),[V,H]=n(!1);a(async()=>{await U()});async function U(){M(null);try{A(!0);let e;try{e=await _.syncThemes()}catch{e=await _.getThemes()}O(e)}catch{M(u(`themes.loadError`))}finally{A(!1)}}async function W(e){let t=e.status===`ACTIVE`;M(null),P(e.id);try{let n=t?await _.deactivateTheme(e.id):await _.activateTheme(e.id);O(p().map(t=>t.id===e.id?n:t.status===`ACTIVE`&&n.status===`ACTIVE`?{...t,status:`INACTIVE`}:t))}catch{M(u(t?`themes.deactivateError`:`themes.activateError`))}finally{P(null)}}async function le(e){if(window.confirm(u(`themes.confirmUninstall`,{name:e.name}))){M(null),P(e.id);try{await _.uninstallTheme(e.id),O(p().filter(t=>t.id!==e.id))}catch{M(u(`themes.uninstallError`))}finally{P(null)}}}function G(e){let t=e.manifest?.preview??e.manifest?.screenshots?.[0];return!t||typeof t!=`string`?null:/^(https?:)?\/\//.test(t)||t.startsWith(`/`)?t:`/themes/${encodeURIComponent(e.name)}/${t}`}function K(e){return(e.manifest?.settings??[]).filter(e=>!!e&&typeof e.name==`string`)}function q(e){return e.default===void 0?e.type===`checkbox`?!1:e.type===`number`?0:``:e.default}function ue(e){return typeof e==`string`?e:e.value}function de(e){return typeof e==`string`?e:e.label??e.value}function fe(e){if(F()===e.id){I(null);return}let t={};for(let n of K(e)){let r=e.config?.[n.name];t[n.name]=r===void 0?q(n):r}R(t),H(!1),I(e.id)}function J(e,t){R({...L(),[e]:t})}async function pe(e){M(null),H(!1),B(!0);try{let t=await _.updateThemeConfig(e.id,L());O(p().map(n=>n.id===e.id?t:n)),H(!0)}catch{M(u(`themes.configError`))}finally{B(!1)}}let me=e=>{switch(e){case`ACTIVE`:return u(`themes.status.active`);case`INSTALLED`:return u(`themes.status.installed`);case`INACTIVE`:return u(`themes.status.inactive`);default:return e}},he=e=>{switch(e){case`ACTIVE`:return`status-active`;case`INSTALLED`:return`status-installed`;case`INACTIVE`:return`status-inactive`;default:return``}};return(()=>{var n=d(v),a=n.firstChild,g=a.firstChild,_=g.nextSibling,O=a.nextSibling,[A,M]=o(O.nextSibling),P=A.nextSibling,[I,R]=o(P.nextSibling),B=I.nextSibling,[H,q]=o(B.nextSibling);return H.nextSibling,m(g,()=>u(`themes.directoryHint`)),_.$$click=U,m(_,()=>u(`themes.reload`)),m(n,(()=>{var e=s(()=>!!j());return()=>e()&&(()=>{var e=d(y);return m(e,j),e})()})(),A,M),m(n,(()=>{var e=s(()=>!!k());return()=>e()&&d(b)})(),I,R),m(n,(()=>{var n=s(()=>!k());return()=>n()&&(()=>{var n=d(x),a=n.firstChild,[g,_]=o(a.nextSibling),v=g.nextSibling,[y,b]=o(v.nextSibling);return m(n,i(r,{get each(){return p()},children:n=>{let a=K(n),p=G(n);return(()=>{var g=d(ne),_=g.firstChild,v=_.firstChild,[y,b]=o(v.nextSibling),x=y.nextSibling,[D,O]=o(x.nextSibling),k=_.nextSibling,A=k.firstChild,j=A.nextSibling,M=j.firstChild,[P,I]=o(M.nextSibling),R=P.nextSibling.nextSibling,[B,H]=o(R.nextSibling),U=j.nextSibling,G=U.firstChild,K=U.nextSibling,[q,ge]=o(K.nextSibling),_e=k.nextSibling,[Y,ve]=o(_e.nextSibling),X=Y.nextSibling,Z=X.firstChild,ye=Z.nextSibling,[Q,be]=o(ye.nextSibling),$=Q.nextSibling;return m(_,i(t,{when:p,get children(){var e=d(S);return e.addEventListener(`error`,e=>{e.currentTarget.style.display=`none`}),c(e,`src`,p),e}}),y,b),m(_,(()=>{var e=s(()=>n.status===`ACTIVE`);return()=>e()&&(()=>{var e=d(w);return m(e,()=>u(`themes.active`)),e})()})(),D,O),m(A,()=>n.name),m(j,()=>u(`themes.version`),P,I),m(j,()=>n.version,B,H),m(G,()=>me(n.status)),m(k,(()=>{var e=s(()=>!!n.manifest?.description);return()=>e()&&(()=>{var e=d(T);return m(e,()=>n.manifest.description),e})()})(),q,ge),m(g,i(t,{get when(){return s(()=>F()===n.id)()&&a.length>0},get children(){var f=d(te),p=f.firstChild,[g,_]=o(p.nextSibling),v=g.nextSibling,y=v.firstChild,b=y.nextSibling,[x,S]=o(b.nextSibling);return m(f,i(r,{each:a,children:t=>(()=>{var a=d(E),u=a.firstChild,f=u.nextSibling,[p,g]=o(f.nextSibling);return m(u,()=>t.label||t.name),m(a,(()=>{var a=s(()=>t.type===`textarea`);return()=>a()?(()=>{var r=d(re);return r.$$input=e=>J(t.name,e.currentTarget.value),e(()=>c(r,`id`,`cfg-${n.id}-${t.name}`)),e(()=>l(r,`value`,String(L()[t.name]??``))),h(),r})():s(()=>t.type===`select`)()?(()=>{var a=d(ie);return a.addEventListener(`change`,e=>J(t.name,e.currentTarget.value)),m(a,i(r,{get each(){return t.options??[]},children:t=>(()=>{var n=d(ae);return m(n,()=>de(t)),e(()=>l(n,`value`,ue(t))),n})()})),e(()=>c(a,`id`,`cfg-${n.id}-${t.name}`)),e(()=>l(a,`value`,String(L()[t.name]??``))),a})():s(()=>t.type===`checkbox`)()?(()=>{var r=d(oe);return r.addEventListener(`change`,e=>J(t.name,e.currentTarget.checked)),e(()=>c(r,`id`,`cfg-${n.id}-${t.name}`)),e(()=>l(r,`checked`,!!L()[t.name])),r})():s(()=>t.type===`color`)()?(()=>{var r=d(se);return r.$$input=e=>J(t.name,e.currentTarget.value),e(()=>c(r,`id`,`cfg-${n.id}-${t.name}`)),e(()=>l(r,`value`,String(L()[t.name]??`#000000`))),h(),r})():(()=>{var r=d(ce);return r.$$input=e=>J(t.name,t.type===`number`?Number(e.currentTarget.value):e.currentTarget.value),e(e=>{var i=`cfg-${n.id}-${t.name}`,a=t.type===`number`?`number`:`text`;return i!==e.e&&c(r,`id`,e.e=i),a!==e.t&&c(r,`type`,e.t=a),e},{e:void 0,t:void 0}),e(()=>l(r,`value`,String(L()[t.name]??``))),h(),r})()})(),p,g),e(()=>c(u,`for`,`cfg-${n.id}-${t.name}`)),a})()}),g,_),y.$$click=()=>pe(n),m(y,()=>u(`themes.configSave`)),m(v,i(t,{get when(){return V()},get children(){var e=d(ee);return m(e,()=>u(`themes.configSaved`)),e}}),x,S),e(()=>l(y,`disabled`,z())),h(),f}}),Y,ve),Z.$$click=()=>W(n),m(Z,(()=>{var e=s(()=>n.status===`ACTIVE`);return()=>e()?u(`themes.deactivate`):u(`themes.activate`)})()),m(X,i(t,{get when(){return a.length>0},get children(){var t=d(C);return t.$$click=()=>fe(n),m(t,(()=>{var e=s(()=>F()===n.id);return()=>e()?u(`themes.configClose`):u(`themes.configTitle`)})()),e(()=>l(t,`disabled`,N()!==null)),h(),t}}),Q,be),$.$$click=()=>le(n),m($,()=>u(`themes.uninstall`)),e(e=>{var t=`theme-card ${n.status===`ACTIVE`?`active`:``}`,r=`status-badge ${he(n.status)}`,i=`btn ${N()===n.id?`btn-loading`:``}`,a=N()!==null,o=N()!==null;return t!==e.e&&f(g,e.e=t),r!==e.t&&f(G,e.t=r),i!==e.a&&f(Z,e.a=i),a!==e.o&&l(Z,`disabled`,e.o=a),o!==e.i&&l($,`disabled`,e.i=o),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),h(),g})()}}),g,_),m(n,(()=>{var e=s(()=>p().length===0);return()=>e()&&(()=>{var e=d(D);return m(e,()=>u(`themes.empty`)),e})()})(),y,b),n})()})(),H,q),e(()=>l(_,`disabled`,k())),h(),n})()}p([`click`,`input`]);export{O as ThemeManager};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e,i as t,p as n,r,s as i,v as a}from"./solid.8gBSxpeo.js";import{a as o,c as s,f as c,h as l,i as u,r as d,s as f,u as ee}from"./web.DB4MaPY9.js";import{n as p}from"./i18n.CXvd48vy.js";import{n as m}from"./api.CNp-a9Z3.js";var h=l(`<div class="notice notice--error">`),te=l(`<div class=user-create><!$><!/><form class=card><h3></h3><div class=form-grid><label><!$><!/><input class=input required></label><label><!$><!/><input class=input type=email required></label><label><!$><!/><span class=muted></span><input class=input type=password required minlength=8></label><label><!$><!/><select class=input><option value></option><!$><!/></select></label></div><p class=muted><!$><!/> <!$><!/> — <!$><!/> <!$><!/>.</p><div class=media-details__actions><button class="btn btn-primary"type=submit></button><a class="btn btn-secondary"href=/users>`),g=l(`<option><!$><!/> (<!$><!/>)`);function _(){let{t:l}=p(),[d,_]=n(``),[v,y]=n(``),[b,ne]=n(``),[x,S]=n(``),[C,w]=n([]),[T,E]=n(``),[D,O]=n(!1);a(async()=>{try{let e=await m.listRoles();w(e),S(e.find(e=>e.slug===`EDITOR`)?.id??e[0]?.id??``)}catch{}});let re=async e=>{if(e.preventDefault(),E(``),b().length<8){E(l(`users.detail.passwordError`));return}O(!0);try{await m.createUser({name:d(),email:v(),password:b(),roleId:x()||void 0}),window.location.href=`/users`}catch(e){E(e instanceof Error?e.message:String(e)),O(!1)}};return(()=>{var n=u(te),a=n.firstChild,[p,m]=o(a.nextSibling),w=p.nextSibling,E=w.firstChild,O=E.nextSibling,k=O.firstChild,ie=k.firstChild,[A,j]=o(ie.nextSibling),M=A.nextSibling,N=k.nextSibling,P=N.firstChild,[F,ae]=o(P.nextSibling),I=F.nextSibling,L=N.nextSibling,oe=L.firstChild,[R,z]=o(oe.nextSibling),B=R.nextSibling,V=B.nextSibling,H=L.nextSibling,U=H.firstChild,[W,G]=o(U.nextSibling),K=W.nextSibling,q=K.firstChild,se=q.nextSibling,[ce,le]=o(se.nextSibling),J=O.nextSibling,ue=J.firstChild,[Y,de]=o(ue.nextSibling),fe=Y.nextSibling.nextSibling,[X,pe]=o(fe.nextSibling),me=X.nextSibling.nextSibling,[Z,he]=o(me.nextSibling),ge=Z.nextSibling.nextSibling,[Q,_e]=o(ge.nextSibling);Q.nextSibling;var $=J.nextSibling.firstChild,ve=$.nextSibling;return f(n,i(t,{get when(){return T()},get children(){var e=u(h);return f(e,T),e}}),p,m),w.addEventListener(`submit`,re),f(E,()=>l(`users.new`)),f(k,()=>l(`users.detail.fields.name`),A,j),M.$$input=e=>_(e.currentTarget.value),f(N,()=>l(`users.detail.fields.email`),F,ae),I.$$input=e=>y(e.currentTarget.value),f(L,()=>l(`users.detail.fields.password`),R,z),f(B,()=>l(`users.detail.passwordPrompt`,{email:``})),V.$$input=e=>ne(e.currentTarget.value),f(H,()=>l(`users.detail.fields.role`),W,G),K.addEventListener(`change`,e=>S(e.currentTarget.value)),f(q,()=>l(`users.detail.rolePlaceholder`)),f(K,i(r,{get each(){return C()},children:t=>(()=>{var n=u(g),r=n.firstChild,[i,a]=o(r.nextSibling),s=i.nextSibling.nextSibling,[l,d]=o(s.nextSibling);return l.nextSibling,f(n,()=>t.name,i,a),f(n,()=>t.slug,l,d),e(()=>c(n,`value`,t.id)),n})()}),ce,le),f(J,()=>l(`common.save`),Y,de),f(J,()=>l(`users.new`).toLowerCase(),X,pe),f(J,()=>l(`users.detail.fields.role`),Z,he),f(J,()=>l(`users.toolbar.newBtn`).toLowerCase(),Q,_e),f($,(()=>{var e=s(()=>!!D());return()=>e()?l(`common.loading`):l(`common.create`)})()),f(ve,()=>l(`common.back`)),e(()=>c($,`disabled`,D())),e(()=>c(M,`value`,d())),e(()=>c(I,`value`,v())),e(()=>c(V,`value`,b())),e(()=>c(K,`value`,x())),ee(),n})()}d([`input`]);export{_ as UserCreateForm};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e,i as t,p as n,r,s as i,v as a}from"./solid.8gBSxpeo.js";import{a as o,f as s,h as c,i as l,r as u,s as d,u as f}from"./web.DB4MaPY9.js";import{n as p}from"./i18n.CXvd48vy.js";import{n as m}from"./api.CNp-a9Z3.js";import{i as h,n as g,o as _,s as v,t as y}from"./src.DksrLolD.js";var b=c(`<div class="notice notice--error">`),x=c(`<div class=notice>`),S=c(`<table class=users-table><thead><tr><th></th><th></th><th></th><th></th><th></th><th></th></tr></thead><tbody>`),C=c(`<div class=users-manager><!$><!/><!$><!/><div class=toolbar><!$><!/><!$><!/><a class="btn btn-primary"href=/users/new></a><!$><!/></div><!$><!/><!$><!/><!$><!/>`),w=c(`<p class=muted>`),T=c(`<tr><td></td><td class=muted></td><td></td><td><span class=status-dot></span><!$><!/></td><td class=muted></td><td class=users-table__actions><!$><!/><!$><!/>`),E=c(`<span class=muted>`),D=c(`<div class="card user-details"><h3></h3><div class=form-grid><label><!$><!/><input class=input></label><label><!$><!/><input class=input type=email></label><label><!$><!/><select class=input><option value=ACTIVE></option><option value=INACTIVE></option></select></label><label><!$><!/><select class=input><option value></option><!$><!/></select></label></div><p class=muted></p><div class=media-details__actions><!$><!/><!$><!/><!$><!/>`),O=c(`<option><!$><!/> (<!$><!/>)`);function k(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?`—`:t.toLocaleString(`pt-BR`)}function A(){let{t:c}=p(),[u,A]=n([]),[j,M]=n([]),[N,P]=n(0),[F,I]=n(1),[L,R]=n(``),[z,B]=n(``),[V,H]=n(``),[U,W]=n(``),[G,K]=n(null),[q,J]=n(!1),Y=async()=>{try{let e=await m.listUsers({page:F(),limit:20,search:L()||void 0,status:z()||void 0});A(e.data??[]),P(e.total??0)}catch(e){H(e instanceof Error?e.message:String(e))}};a(async()=>{await Y();try{M(await m.listRoles())}catch{}});let X=async()=>{I(1),await Y()},ee=async(e,t)=>{if(t){J(!0),H(``);try{let n=await m.assignRole(e.id,t);K({...e,roles:n.roles}),W(c(`users.detail.toasts.roleUpdated`,{name:e.name})),await Y()}catch(e){H(e instanceof Error?e.message:String(e))}finally{J(!1)}}},te=async e=>{let t=prompt(c(`users.detail.passwordPrompt`,{email:e.email}));if(t){if(t.length<8){H(c(`users.detail.passwordError`));return}J(!0),H(``);try{await m.setUserPassword(e.id,t),W(c(`users.detail.toasts.passwordChanged`,{name:e.name}))}catch(e){H(e instanceof Error?e.message:String(e))}finally{J(!1)}}},ne=async e=>{J(!0),H(``);try{await m.updateUser(e.id,{name:e.name,email:e.email,status:e.status}),W(c(`users.detail.toasts.saved`,{name:e.name})),K(null),await Y()}catch(e){H(e instanceof Error?e.message:String(e))}finally{J(!1)}},re=async e=>{if(confirm(c(`users.detail.confirmDelete`,{email:e.email}))){J(!0),H(``);try{await m.deleteUser(e.id),G()?.id===e.id&&K(null),W(c(`users.detail.toasts.deleted`,{name:e.name})),await Y()}catch(e){H(e instanceof Error?e.message:String(e))}finally{J(!1)}}},ie=e=>j().find(t=>t.slug===e.roles[0]);return(()=>{var n=l(C),a=n.firstChild,[p,m]=o(a.nextSibling),A=p.nextSibling,[M,P]=o(A.nextSibling),H=M.nextSibling,W=H.firstChild,[J,Z]=o(W.nextSibling),ae=J.nextSibling,[Q,oe]=o(ae.nextSibling),$=Q.nextSibling,se=$.nextSibling,[ce,le]=o(se.nextSibling),ue=H.nextSibling,[de,fe]=o(ue.nextSibling),pe=de.nextSibling,[me,he]=o(pe.nextSibling),ge=me.nextSibling,[_e,ve]=o(ge.nextSibling);return d(n,i(t,{get when(){return V()},get children(){var e=l(b);return d(e,V),e}}),p,m),d(n,i(t,{get when(){return U()},get children(){var e=l(x);return d(e,U),e}}),M,P),d(H,i(h,{name:`user-search`,get placeholder(){return c(`users.toolbar.search`)},get value(){return L()},onInput:e=>{R(e),X()}}),J,Z),d(H,i(v,{name:`user-status`,get placeholder(){return c(`users.toolbar.allStatus`)},get value(){return z()},get options(){return[{value:`ACTIVE`,label:c(`users.toolbar.active`)},{value:`INACTIVE`,label:c(`users.toolbar.inactive`)}]},onChange:e=>{B(e),X()}}),Q,oe),d($,()=>c(`users.toolbar.newBtn`)),d(H,i(g,{variant:`secondary`,onClick:()=>void X(),get children(){return c(`users.toolbar.searchBtn`)}}),ce,le),d(n,i(t,{get when(){return u().length>0},get fallback(){return(()=>{var e=l(w);return d(e,()=>c(`users.empty`)),e})()},get children(){var n=l(S),a=n.firstChild,s=a.firstChild.firstChild,f=s.nextSibling,p=f.nextSibling,m=p.nextSibling,h=m.nextSibling,_=a.nextSibling;return d(s,()=>c(`users.table.name`)),d(f,()=>c(`users.table.email`)),d(p,()=>c(`users.table.role`)),d(m,()=>c(`users.table.status`)),d(h,()=>c(`users.table.lastAccess`)),d(_,i(r,{get each(){return u()},children:n=>(()=>{var r=l(T),a=r.firstChild,s=a.nextSibling,u=s.nextSibling,f=u.nextSibling,p=f.firstChild,m=p.nextSibling,[h,_]=o(m.nextSibling),v=f.nextSibling,b=v.nextSibling,x=b.firstChild,[S,C]=o(x.nextSibling),w=S.nextSibling,[D,O]=o(w.nextSibling);return d(a,()=>n.name),d(s,()=>n.email),d(u,i(t,{get when(){return n.roles.length>0},get fallback(){return(()=>{var e=l(E);return d(e,()=>c(`users.noRole`)),e})()},get children(){return i(y,{get children(){return n.roles.join(`, `)}})}})),d(f,()=>c(`common.status.`+n.status.toLowerCase()),h,_),d(v,()=>k(n.last_login_at)),d(b,i(g,{variant:`secondary`,size:`sm`,onClick:()=>K(n),get children(){return c(`users.table.actions.manage`)}}),S,C),d(b,i(g,{variant:`danger`,size:`sm`,onClick:()=>void re(n),get children(){return c(`users.table.actions.delete`)}}),D,O),e(e=>{var t=G()?.id===n.id,i=n.status===`ACTIVE`;return t!==e.e&&r.classList.toggle(`users-table__row--selected`,e.e=t),i!==e.t&&p.classList.toggle(`status-dot--active`,e.t=i),e},{e:void 0,t:void 0}),r})()})),n}}),de,fe),d(n,i(_,{get page(){return F()},limit:20,get total(){return N()},onPageChange:e=>{I(e),Y()}}),me,he),d(n,i(t,{get when(){return G()},children:t=>(()=>{var n=l(D),a=n.firstChild,u=a.nextSibling,p=u.firstChild,m=p.firstChild,[h,_]=o(m.nextSibling),v=h.nextSibling,y=p.nextSibling,b=y.firstChild,[x,S]=o(b.nextSibling),C=x.nextSibling,w=y.nextSibling,T=w.firstChild,[E,A]=o(T.nextSibling),M=E.nextSibling,N=M.firstChild,P=N.nextSibling,F=w.nextSibling,I=F.firstChild,[L,R]=o(I.nextSibling),z=L.nextSibling,B=z.firstChild,V=B.nextSibling,[H,U]=o(V.nextSibling),W=u.nextSibling,G=W.nextSibling,J=G.firstChild,[Y,X]=o(J.nextSibling),re=Y.nextSibling,[Z,ae]=o(re.nextSibling),Q=Z.nextSibling,[oe,$]=o(Q.nextSibling);return d(a,()=>c(`users.detail.title`)),d(p,()=>c(`users.detail.fields.name`),h,_),v.$$input=e=>K({...t(),name:e.currentTarget.value}),d(y,()=>c(`users.detail.fields.email`),x,S),C.$$input=e=>K({...t(),email:e.currentTarget.value}),d(w,()=>c(`users.detail.fields.status`),E,A),M.addEventListener(`change`,e=>K({...t(),status:e.currentTarget.value})),d(N,()=>c(`users.detail.statusOptions.active`)),d(P,()=>c(`users.detail.statusOptions.inactive`)),d(F,()=>c(`users.detail.fields.role`),L,R),z.addEventListener(`change`,e=>void ee(t(),e.currentTarget.value)),d(B,()=>c(`users.detail.rolePlaceholder`)),d(z,i(r,{get each(){return j()},children:t=>(()=>{var n=l(O),r=n.firstChild,[i,a]=o(r.nextSibling),c=i.nextSibling.nextSibling,[u,f]=o(c.nextSibling);return u.nextSibling,d(n,()=>t.name,i,a),d(n,()=>t.slug,u,f),e(()=>s(n,`value`,t.id)),n})()}),H,U),d(W,()=>c(`users.detail.meta`,{created:k(t().created_at),lastAccess:k(t().last_login_at)})),d(G,i(g,{variant:`primary`,get disabled(){return q()},get loading(){return q()},onClick:()=>void ne(t()),get children(){return c(`users.detail.actions.save`)}}),Y,X),d(G,i(g,{variant:`secondary`,get disabled(){return q()},onClick:()=>void te(t()),get children(){return c(`users.detail.actions.resetPassword`)}}),Z,ae),d(G,i(g,{variant:`secondary`,onClick:()=>K(null),get children(){return c(`users.detail.actions.close`)}}),oe,$),e(()=>s(z,`disabled`,q())),e(()=>s(v,`value`,t().name)),e(()=>s(C,`value`,t().email)),e(()=>s(M,`value`,t().status)),e(()=>s(z,`value`,ie(t())?.id??``)),f(),n})()}),_e,ve),n})()}u([`input`]);export{A as UsersManager};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,d as t,i as n,p as r,r as i,s as a,v as o}from"./solid.8gBSxpeo.js";import{a as s,c,d as l,f as u,g as d,h as f,i as p,r as m,s as h,u as g}from"./web.DB4MaPY9.js";import{n as _}from"./i18n.CXvd48vy.js";import{n as v}from"./api.CNp-a9Z3.js";var y=f(`<div class=webhook-event-select__dropdown role=listbox><input class=input><div class=webhook-event-select__options>`),b=f(`<div class=webhook-event-select><button type=button class="input webhook-event-select__trigger"aria-haspopup=listbox><span></span><span aria-hidden=true>⌄</span></button><!$><!/><div class=webhook-event-select__chips>`),x=f(`<span class=muted>`),S=f(`<label class=webhook-event-option><input type=checkbox><span><!$><!/><small>`),C=f(`<button type=button class=webhook-event-chip><!$><!/> ×`),w=f(`<div class="notice notice--error">`),T=f(`<div class=table-scroll><table class=table><thead><tr><th></th><th></th><th></th><th></th><th></th></tr></thead><tbody>`),E=f(`<div class="resource-hub webhooks-manager"><!$><!/><div class=card-header-row><div><h3></h3></div><button class="btn btn-primary"type=button></button></div><!$><!/><section class=card></section><style>.webhook-event-select{position:relative}.webhook-event-select__trigger{width:100%;display:flex;justify-content:space-between;align-items:center;text-align:left;cursor:pointer}.webhook-event-select__dropdown{position:absolute;z-index:20;top:calc(100% + .25rem);left:0;right:0;background:var(--color-surface,#fff);border:1px solid var(--color-border,#dcdcde);box-shadow:0 8px 22px rgba(0,0,0,.14);padding:.6rem}.webhook-event-select__options{max-height:240px;overflow:auto;margin-top:.5rem;display:grid;gap:.2rem}.webhook-event-option{display:flex!important;align-items:flex-start;gap:.5rem!important;padding:.45rem;border-radius:4px;cursor:pointer}.webhook-event-option:hover{background:var(--color-surface-muted,#f5f5f5)}.webhook-event-option span{display:grid;gap:.12rem}.webhook-event-option small{color:var(--color-muted);font-size:.75rem}.webhook-event-select__chips{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:.4rem}.webhook-event-chip{border:1px solid var(--color-border,#dcdcde);background:var(--color-surface-muted,#f5f5f5);border-radius:999px;padding:.2rem .55rem;cursor:pointer;font-size:.78rem}`),D=f(`<label><!$><!/><input class=input type=password>`),O=f(`<div class=form-grid><label><!$><!/><input class=input></label><label><!$><!/><input class=input type=password>`),k=f(`<div class=form-grid><label><!$><!/><input class=input type=password></label><label><!$><!/><input class=input>`),A=f(`<section class=card><h3></h3><form class=resource-form><label><!$><!/><input class=input required type=url></label><label><!$><!/><!$><!/></label><label><!$><!/><select class=input><option value=none></option><option value=bearer></option><option value=basic></option><option value=api_key></option><option value=hmac_sha256></option></select></label><!$><!/><!$><!/><!$><!/><!$><!/><label class=checkbox-label><input type=checkbox> <!$><!/></label><div><button class="btn btn-primary"type=submit></button> <button class=btn type=button>`),j=f(`<p>`),M=f(`<tr><td></td><td></td><td></td><td></td><td><button class=btn type=button></button> <button class="btn btn-danger"type=button>`),N=()=>({url:``,events:[],active:!0,auth_type:`hmac_sha256`,auth_config:{signatureHeader:`X-Webhook-Signature`}});function ee(f){let[m,_]=r(!1),[v,w]=r(``),T;o(()=>{let t=e=>{T&&!T.contains(e.target)&&_(!1)};document.addEventListener(`mousedown`,t),e(()=>document.removeEventListener(`mousedown`,t))});let E=()=>f.options.filter(e=>`${e.label} ${e.value}`.toLowerCase().includes(v().toLowerCase())),D=e=>f.onChange(f.value.includes(e)?f.value.filter(t=>t!==e):[...f.value,e]);return(()=>{var e=p(b),r=e.firstChild,o=r.firstChild,O=r.nextSibling,[k,A]=s(O.nextSibling),j=k.nextSibling,M=T;return typeof M==`function`?d(M,e):T=e,r.$$click=()=>_(!m()),h(o,(()=>{var e=c(()=>f.value.length>0);return()=>e()?`${f.value.length} selecionado(s)`:f.placeholder})()),h(e,a(n,{get when(){return m()},get children(){var e=p(y),r=e.firstChild,o=r.nextSibling;return r.$$input=e=>w(e.currentTarget.value),h(o,a(n,{get when(){return E().length>0},get fallback(){return(()=>{var e=p(x);return h(e,()=>f.empty),e})()},get children(){return a(i,{get each(){return E()},children:e=>(()=>{var n=p(S),r=n.firstChild,i=r.nextSibling,a=i.firstChild,[o,c]=s(a.nextSibling),l=o.nextSibling;return r.addEventListener(`change`,()=>D(e.value)),h(i,()=>e.label,o,c),h(l,()=>e.value),t(()=>u(r,`checked`,f.value.includes(e.value))),n})()})}})),t(()=>l(r,`placeholder`,f.searchPlaceholder)),t(()=>u(r,`value`,v())),g(),e}}),k,A),h(j,a(i,{get each(){return f.value},children:e=>(()=>{var t=p(C),n=t.firstChild,[r,i]=s(n.nextSibling);return r.nextSibling,t.$$click=()=>D(e),h(t,()=>f.options.find(t=>t.value===e)?.label??e,r,i),g(),t})()})),t(()=>l(r,`aria-expanded`,m())),g(),e})()}function P(){let{t:e}=_(),[d,f]=r([]),[m,y]=r([]),[b,x]=r(null),[S,C]=r(``),[P,F]=r(!0),I=async()=>{F(!0);try{let[e,t]=await Promise.all([v.getWebhooks(),v.getWebhookEvents()]);f(e),y(t)}catch(e){C(e instanceof Error?e.message:String(e))}finally{F(!1)}};o(I);let L=e=>{if(!e){x(N());return}x({...e,events:[...e.events??[]],auth_type:e.auth_type??`hmac_sha256`,auth_config:{...e.auth_config??{}}})},R=(t,n)=>{let r=b();if(r){if(!r.events||r.events.length===0){C(e(`webhooks.eventsRequired`));return}x({...r,auth_config:{...r.auth_config,[t]:n}})}},te=async e=>{e.preventDefault();let t=b();if(!t)return;let n=Object.fromEntries(Object.entries(t.auth_config).filter(([,e])=>e));try{t.id?await v.updateWebhook(t.id,{...t,auth_config:n}):await v.createWebhook({...t,auth_config:n}),x(null),await I()}catch(e){C(e instanceof Error?e.message:String(e))}};return(()=>{var r=p(E),o=r.firstChild,[f,_]=s(o.nextSibling),y=f.nextSibling,C=y.firstChild,N=C.firstChild,F=C.nextSibling,z=y.nextSibling,[B,V]=s(z.nextSibling),H=B.nextSibling;return h(r,a(n,{get when(){return S()},get children(){var e=p(w);return h(e,S),e}}),f,_),h(N,()=>e(`webhooks.listTitle`)),F.$$click=()=>L(),h(F,()=>e(`webhooks.new`)),h(r,a(n,{get when(){return b()},children:r=>(()=>{var i=p(A),o=i.firstChild,d=o.nextSibling,f=d.firstChild,_=f.firstChild,[v,y]=s(_.nextSibling),b=v.nextSibling,S=f.nextSibling,C=S.firstChild,[w,T]=s(C.nextSibling),E=w.nextSibling,[j,M]=s(E.nextSibling),N=S.nextSibling,P=N.firstChild,[F,I]=s(P.nextSibling),L=F.nextSibling,z=L.firstChild,B=z.nextSibling,V=B.nextSibling,H=V.nextSibling,U=H.nextSibling,ne=N.nextSibling,[W,re]=s(ne.nextSibling),ie=W.nextSibling,[G,ae]=s(ie.nextSibling),K=G.nextSibling,[q,oe]=s(K.nextSibling),se=q.nextSibling,[J,ce]=s(se.nextSibling),Y=J.nextSibling,X=Y.firstChild,Z=X.nextSibling.nextSibling,[le,ue]=s(Z.nextSibling),Q=Y.nextSibling.firstChild,$=Q.nextSibling.nextSibling;return h(o,(()=>{var t=c(()=>!!r().id);return()=>t()?e(`webhooks.edit`):e(`webhooks.create`)})()),d.addEventListener(`submit`,te),h(f,()=>e(`webhooks.url`),v,y),b.$$input=e=>x({...r(),url:e.currentTarget.value}),h(S,()=>e(`webhooks.events`),w,T),h(S,a(ee,{get options(){return m()},get value(){return r().events??[]},onChange:e=>x({...r(),events:e}),get placeholder(){return e(`webhooks.selectEvents`)},get searchPlaceholder(){return e(`webhooks.searchEvents`)},get empty(){return e(`webhooks.noEvents`)}}),j,M),h(N,()=>e(`webhooks.authentication`),F,I),L.addEventListener(`change`,e=>x({...r(),auth_type:e.currentTarget.value,auth_config:{}})),h(z,()=>e(`webhooks.auth.none`)),h(B,()=>e(`webhooks.auth.bearer`)),h(V,()=>e(`webhooks.auth.basic`)),h(H,()=>e(`webhooks.auth.apiKey`)),h(U,()=>e(`webhooks.auth.hmac_sha256`)),h(d,a(n,{get when(){return r().auth_type===`bearer`},get children(){var n=p(D),i=n.firstChild,[a,o]=s(i.nextSibling),c=a.nextSibling;return h(n,()=>e(`webhooks.token`),a,o),c.$$input=e=>R(`token`,e.currentTarget.value),t(()=>l(c,`placeholder`,r().id?e(`webhooks.keepExisting`):``)),t(()=>u(c,`value`,r().auth_config.token??``)),g(),n}}),W,re),h(d,a(n,{get when(){return r().auth_type===`basic`},get children(){var n=p(O),i=n.firstChild,a=i.firstChild,[o,c]=s(a.nextSibling),d=o.nextSibling,f=i.nextSibling,m=f.firstChild,[_,v]=s(m.nextSibling),y=_.nextSibling;return h(i,()=>e(`webhooks.username`),o,c),d.$$input=e=>R(`username`,e.currentTarget.value),h(f,()=>e(`webhooks.password`),_,v),y.$$input=e=>R(`password`,e.currentTarget.value),t(()=>l(y,`placeholder`,r().id?e(`webhooks.keepExisting`):``)),t(()=>u(d,`value`,r().auth_config.username??``)),t(()=>u(y,`value`,r().auth_config.password??``)),g(),n}}),G,ae),h(d,a(n,{get when(){return r().auth_type===`api_key`},get children(){var n=p(O),i=n.firstChild,a=i.firstChild,[o,c]=s(a.nextSibling),d=o.nextSibling,f=i.nextSibling,m=f.firstChild,[_,v]=s(m.nextSibling),y=_.nextSibling;return h(i,()=>e(`webhooks.headerName`),o,c),d.$$input=e=>R(`headerName`,e.currentTarget.value),h(f,()=>e(`webhooks.apiKeyValue`),_,v),y.$$input=e=>R(`value`,e.currentTarget.value),t(()=>l(y,`placeholder`,r().id?e(`webhooks.keepExisting`):``)),t(()=>u(d,`value`,r().auth_config.headerName??``)),t(()=>u(y,`value`,r().auth_config.value??``)),g(),n}}),q,oe),h(d,a(n,{get when(){return r().auth_type===`hmac_sha256`},get children(){var n=p(k),i=n.firstChild,a=i.firstChild,[o,c]=s(a.nextSibling),d=o.nextSibling,f=i.nextSibling,m=f.firstChild,[_,v]=s(m.nextSibling),y=_.nextSibling;return h(i,()=>e(`webhooks.secret`),o,c),d.$$input=e=>R(`secret`,e.currentTarget.value),h(f,()=>e(`webhooks.signatureHeader`),_,v),y.$$input=e=>R(`signatureHeader`,e.currentTarget.value),t(t=>{var n=!r().id,i=r().id?e(`webhooks.keepExisting`):``;return n!==t.e&&u(d,`required`,t.e=n),i!==t.t&&l(d,`placeholder`,t.t=i),t},{e:void 0,t:void 0}),t(()=>u(d,`value`,r().auth_config.secret??``)),t(()=>u(y,`value`,r().auth_config.signatureHeader??`X-Webhook-Signature`)),g(),n}}),J,ce),X.addEventListener(`change`,e=>x({...r(),active:e.currentTarget.checked})),h(Y,()=>e(`webhooks.active`),le,ue),h(Q,()=>e(`common.save`)),$.$$click=()=>x(null),h($,()=>e(`common.cancel`)),t(()=>u(b,`value`,r().url??``)),t(()=>u(L,`value`,r().auth_type)),t(()=>u(X,`checked`,r().active??!0)),g(),i})()}),B,V),h(H,a(n,{get when(){return!P()},get fallback(){return(()=>{var t=p(j);return h(t,()=>e(`webhooks.loading`)),t})()},get children(){return a(n,{get when(){return d().length>0},get fallback(){return(()=>{var t=p(j);return h(t,()=>e(`webhooks.empty`)),t})()},get children(){var t=p(T),n=t.firstChild.firstChild,r=n.firstChild.firstChild,o=r.nextSibling,s=o.nextSibling,l=s.nextSibling,u=l.nextSibling,f=n.nextSibling;return h(r,()=>e(`webhooks.url`)),h(o,()=>e(`webhooks.events`)),h(s,()=>e(`webhooks.authentication`)),h(l,()=>e(`webhooks.active`)),h(u,()=>e(`common.actions`)),h(f,a(i,{get each(){return d()},children:t=>(()=>{var n=p(M),r=n.firstChild,i=r.nextSibling,a=i.nextSibling,o=a.nextSibling,s=o.nextSibling.firstChild,l=s.nextSibling.nextSibling;return h(r,()=>t.url),h(i,()=>(t.events??[]).join(`, `)),h(a,()=>e(`webhooks.auth.${t.auth_type??`hmac_sha256`}`)),h(o,(()=>{var n=c(()=>!!t.active);return()=>n()?e(`common.yes`):e(`common.no`)})()),s.$$click=()=>L(t),h(s,()=>e(`common.edit`)),l.$$click=()=>t.id&&void v.deleteWebhook(t.id).then(I),h(l,()=>e(`common.delete`)),g(),n})()})),t}})}})),g(),r})()}m([`click`,`input`]);export{P as WebhooksManager};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,t){return e&&t.startsWith(`/api/`)&&/\/api\/?$/.test(e)?`${e.replace(/\/$/,``)}${t.replace(/^\/api/,``)}`:`${e}${t}`}var t=class e extends Error{status;code;retryAfter;constructor(e,t,n,r){super(n??t),this.name=`ApiError`,this.status=e,this.code=t,this.retryAfter=r}static async fromResponse(t){let n=t.headers?.get?.(`Retry-After`)??``,r=Number(n),i=await t.json().catch(()=>null);return new e(t.status,i?.error??`Request failed`,i?.message??(i?.error?void 0:`Request failed: ${t.status}`),n&&Number.isFinite(r)?r:void 0)}},n=`okcms:rate-limited`,r=2e3,i=3e5,a=6e4,o=3e3;function s(e){typeof window<`u`&&typeof CustomEvent<`u`&&window.dispatchEvent(new CustomEvent(n,{detail:{retryAfter:e??null}}))}function c(e){return new Promise(t=>setTimeout(t,e))}function l(){if(typeof document<`u`){let e=document.querySelector(`meta[name="okcms-api-url"]`)?.getAttribute(`content`)?.trim();if(e)return e.startsWith(`/`),e.replace(/\/$/,``)}return``}var u=l(),d=new class{baseUrl;csrfToken=null;refreshPromise=null;proactiveRefreshBound=!1;csrfFetchedAt=0;refreshOwner=typeof globalThis.crypto?.randomUUID==`function`?globalThis.crypto.randomUUID():Math.random().toString(36).slice(2);refreshLockKey=`okcms:auth:refresh-lock`;constructor(e=u){this.baseUrl=e}mediaUrl(e){if(/^(?:https?:)?\/\//i.test(e)||!this.baseUrl)return e;try{return new URL(e,`${this.baseUrl.replace(/\/$/,``)}/`).toString()}catch{return e}}async init(){try{await this.ensureCsrfToken()}catch{}}async checkSession(){try{return await this.request(`GET`,`/api/v1/auth/me`,void 0,void 0,{skipRateLimitRetry:!0}),`authenticated`}catch(e){return e instanceof t&&e.status===401?`unauthenticated`:`unavailable`}}async isLoggedIn(){return await this.checkSession()===`authenticated`}async ensureFreshSession(){let e=this.readSessionExpiry();if(!(!e||e-Date.now()>i))try{await this.refreshTokens()}catch{}}installProactiveRefresh(){typeof document>`u`||this.proactiveRefreshBound||(this.proactiveRefreshBound=!0,document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&this.ensureFreshSession()}))}readSessionExpiry(){if(typeof document>`u`)return null;let e=document.cookie.match(/(?:^|;\s*)session_expires_at=([^;]+)/);if(!e?.[1])return null;let t=Date.parse(decodeURIComponent(e[1]));return Number.isNaN(t)?null:t}async getTenantId(){try{return(await this.request(`GET`,`/api/v1/auth/me`)).tenantId??null}catch{return null}}async getUserLocale(){try{return(await this.request(`GET`,`/api/v1/users/me/locale`)).locale??`pt-BR`}catch{return`pt-BR`}}async setUserLocale(e){await this.request(`PUT`,`/api/v1/users/me/locale`,{locale:e})}async getMe(){return this.request(`GET`,`/api/v1/auth/me`)}async getAuditLogs(e=8){return this.request(`GET`,`/api/v1/audit-logs?limit=${e}`)}async getAuditLogConfig(){return this.request(`GET`,`/api/v1/audit-logs/config`)}async updateAuditLogConfig(e){return this.request(`PUT`,`/api/v1/audit-logs/config`,{retentionDays:e})}async listAuditLogs(e){let t=new URLSearchParams;return e?.limit&&t.set(`limit`,String(e.limit)),e?.action&&t.set(`action`,e.action),e?.resourceType&&t.set(`resourceType`,e.resourceType),this.request(`GET`,`/api/v1/audit-logs?${t.toString()}`)}async login(e){return await this.ensureCsrfToken(),await this.request(`POST`,`/api/v1/auth/login`,e)}async logout(){await this.request(`POST`,`/api/v1/auth/logout`,{}),this.csrfToken=null}async refreshTokens(){return this.refreshPromise||=this.refreshWithCrossTabLock().finally(()=>{this.refreshPromise=null}),this.refreshPromise}async refreshWithCrossTabLock(){if(typeof window>`u`||typeof localStorage>`u`){await this.request(`POST`,`/api/v1/auth/refresh`,{},void 0,{skipRefresh:!0});return}let e=this.readRefreshLock();if(e?.owner&&e.owner!==this.refreshOwner&&Number(e.expiresAt)>Date.now()){await this.waitForOtherTabRefresh(Number(e.expiresAt));return}if(!this.acquireRefreshLock()){await this.waitForOtherTabRefresh(Date.now()+o);return}try{await this.request(`POST`,`/api/v1/auth/refresh`,{},void 0,{skipRefresh:!0})}finally{this.releaseRefreshLock()}}readRefreshLock(){try{return JSON.parse(localStorage.getItem(this.refreshLockKey)??`null`)}catch{return null}}acquireRefreshLock(){try{return localStorage.setItem(this.refreshLockKey,JSON.stringify({owner:this.refreshOwner,expiresAt:Date.now()+o})),!0}catch{return!1}}releaseRefreshLock(){try{this.readRefreshLock()?.owner===this.refreshOwner&&localStorage.removeItem(this.refreshLockKey)}catch{}}async waitForOtherTabRefresh(e){let t=Math.max(0,Math.min(e,Date.now()+o)-Date.now());await new Promise(e=>{let n=!1,r=()=>{n||(n=!0,window.removeEventListener(`storage`,i),clearTimeout(a),e())},i=e=>{e.key===this.refreshLockKey&&r()};window.addEventListener(`storage`,i);let a=setTimeout(r,t)})}async sendWithRecovery(t,n,i,a,o){let l=e(this.baseUrl,n),u=async()=>{let e={...a};if((o?.bodyInit!==void 0||i!==void 0)&&(e[`Content-Type`]=`application/json`),![`GET`,`HEAD`,`OPTIONS`].includes(t.toUpperCase())){let t=await this.ensureCsrfToken();t&&(e[`x-csrf-token`]=t)}return fetch(l,{method:t,headers:e,credentials:`include`,body:o?.bodyInit??(i===void 0?void 0:JSON.stringify(i))})},d=await u();if(d.status===401&&!o?.skipRefresh&&!n.includes(`/auth/refresh`)&&!n.includes(`/auth/logout`)&&(await this.refreshTokens(),d=await u()),d.status===403&&!o?.skipCsrfRecovery){let e=``;try{e=(await(typeof d.clone==`function`?d.clone():d).json()).error??``}catch{}e===`CSRF_TOKEN_INVALID`&&(await this.ensureCsrfToken(!0),d=await u())}if(d.status===429&&!o?.skipRateLimitRetry){let e=d.headers?.get?.(`Retry-After`)??``,t=Number(e),n=(Number.isFinite(t)&&t>0?t:1)*1e3;s(Number.isFinite(t)&&t>0?t:1),n<=r&&(await c(n+50),d=await u())}return d}async request(e,n,r,i,a){let o=await this.sendWithRecovery(e,n,r,i,a);if(!o.ok)throw await t.fromResponse(o);return o.json()}async requestRaw(e,t,n,r,i){return this.sendWithRecovery(e,t,n,r,i)}async ensureCsrfToken(t=!1){let n=this.readCsrfCookie();if(!t&&n)return this.csrfToken=n,n;if(!t&&this.csrfToken&&Date.now()-this.csrfFetchedAt<a)return this.csrfToken;try{let t=await fetch(e(this.baseUrl,`/api/v1/auth/csrf`),{credentials:`include`,headers:{Accept:`application/json`}});if(!t.ok)return this.csrfToken;let n=await t.json();this.csrfToken=n.csrfToken??this.readCsrfCookie(),this.csrfFetchedAt=Date.now()}catch{}return this.csrfToken}readCsrfCookie(){if(typeof document<`u`){let e=document.cookie.match(/(?:^|;\s*)csrf_token=([^;]+)/);if(e?.[1])return e[1]}return this.csrfToken}async getContent(e){let t=new URLSearchParams;return e?.page&&t.set(`page`,String(e.page)),e?.limit&&t.set(`limit`,String(e.limit)),e?.type&&t.set(`type`,e.type),e?.status&&t.set(`status`,e.status),e?.search&&t.set(`search`,e.search),e?.includeAuthor&&t.set(`include`,`author`),this.request(`GET`,`/api/v1/content?${t.toString()}`)}async getContentById(e){return this.request(`GET`,`/api/v1/content/${e}`)}async getSingletonContent(e){let t=await this.request(`GET`,`/api/v1/content/singleton/${encodeURIComponent(e)}`);return`content`in t?t.content:t}async createContent(e){return this.request(`POST`,`/api/v1/content`,e)}async updateContent(e,t){return this.request(`PUT`,`/api/v1/content/${e}`,t)}async deleteContent(e){await this.request(`DELETE`,`/api/v1/content/${e}`)}async publishContent(e){let t=await this.request(`POST`,`/api/v1/content/${e}/publish`);return`content`in t?t.content:t}async unpublishContent(e){let t=await this.request(`POST`,`/api/v1/content/${e}/unpublish`);return`content`in t?t.content:t}async publishToggle(e,t){return t?this.unpublishContent(e):this.publishContent(e)}async getContentTypes(){return this.request(`GET`,`/api/v1/content-types`)}async createContentType(e){return this.request(`POST`,`/api/v1/content-types`,e)}async updateContentType(e,t){return this.request(`PUT`,`/api/v1/content-types/${e}`,t)}async deleteContentType(e){await this.request(`DELETE`,`/api/v1/content-types/${e}`)}async getTaxonomies(){return this.request(`GET`,`/api/v1/taxonomies`)}async createTaxonomy(e){return this.request(`POST`,`/api/v1/taxonomies`,e)}async attachTaxonomy(e,t){await this.request(`POST`,`/api/v1/taxonomies/${e}/attach`,{contentType:t})}async detachTaxonomy(e,t){await this.request(`POST`,`/api/v1/taxonomies/${e}/detach`,{contentType:t})}async deleteTaxonomy(e){await this.request(`DELETE`,`/api/v1/taxonomies/${e}`)}async getTaxonomyTerms(e){return this.request(`GET`,`/api/v1/taxonomies/${encodeURIComponent(e)}/terms`)}async createTaxonomyTerm(e,t){return this.request(`POST`,`/api/v1/taxonomies/${encodeURIComponent(e)}/terms`,t)}async updateTaxonomyTerm(e,t,n){return this.request(`PUT`,`/api/v1/taxonomies/${encodeURIComponent(e)}/terms/${t}`,n)}async deleteTaxonomyTerm(e,t){await this.request(`DELETE`,`/api/v1/taxonomies/${encodeURIComponent(e)}/terms/${t}`)}async getCategories(){return this.request(`GET`,`/api/v1/categories`)}async createCategory(e){return this.request(`POST`,`/api/v1/categories`,e)}async updateCategory(e,t){return this.request(`PUT`,`/api/v1/categories/${e}`,t)}async deleteCategory(e){await this.request(`DELETE`,`/api/v1/categories/${e}`)}async getTags(){return this.request(`GET`,`/api/v1/tags`)}async createTag(e){return this.request(`POST`,`/api/v1/tags`,e)}async updateTag(e,t){return this.request(`PUT`,`/api/v1/tags/${e}`,t)}async deleteTag(e){await this.request(`DELETE`,`/api/v1/tags/${e}`)}async getMenus(){return this.request(`GET`,`/api/v1/menus`)}async createMenu(e){return this.request(`POST`,`/api/v1/menus`,e)}async updateMenu(e,t){return this.request(`PUT`,`/api/v1/menus/${e}`,t)}async deleteMenu(e){await this.request(`DELETE`,`/api/v1/menus/${e}`)}async getFieldGroups(e){if(e?.type){let t=new URLSearchParams({type:e.type});for(let[n,r]of Object.entries(e))n!==`type`&&r&&t.set(n,r);return this.request(`GET`,`/api/v1/field-groups?${t.toString()}`)}return this.request(`GET`,`/api/v1/field-groups`)}async getFieldGroup(e){return this.request(`GET`,`/api/v1/field-groups/${e}`)}async exportFieldGroup(e){let t=await this.requestRaw(`GET`,`/api/v1/field-groups/${e}/export`);if(!t.ok)throw Error(await t.text());return t.blob()}async importFieldGroups(e){return this.request(`POST`,`/api/v1/field-groups/import`,e)}async createFieldGroup(e){return this.request(`POST`,`/api/v1/field-groups`,e)}async updateFieldGroup(e,t){return this.request(`PUT`,`/api/v1/field-groups/${e}`,t)}async deleteFieldGroup(e){await this.request(`DELETE`,`/api/v1/field-groups/${e}`)}async getFieldTypes(e){let t=e?`?category=${encodeURIComponent(e)}`:``;return this.request(`GET`,`/api/v1/field-types${t}`)}async getWebhooks(){return this.request(`GET`,`/api/v1/webhooks`)}async getWebhookEvents(){return(await this.request(`GET`,`/api/v1/webhooks/events`)).data}async createWebhook(e){return this.request(`POST`,`/api/v1/webhooks`,e)}async updateWebhook(e,t){return this.request(`PUT`,`/api/v1/webhooks/${e}`,t)}async deleteWebhook(e){await this.request(`DELETE`,`/api/v1/webhooks/${e}`)}async listMedia(e){let t=new URLSearchParams;return e?.page&&t.set(`page`,String(e.page)),e?.limit&&t.set(`limit`,String(e.limit)),e?.mimeType&&t.set(`mimeType`,e.mimeType),e?.search&&t.set(`search`,e.search),this.request(`GET`,`/api/v1/media?${t.toString()}`)}async getMedia(e){return this.request(`GET`,`/api/v1/media/${e}`)}async uploadMedia(e,n){let r=new FormData;r.append(`file`,e),n?.alt&&r.append(`alt`,n.alt),n?.caption&&r.append(`caption`,n.caption);let i=await this.sendWithRecovery(`POST`,`/api/v1/media/upload`,void 0,{},{bodyInit:r});if(!i.ok)throw await t.fromResponse(i);return i.json()}async updateMedia(e,t){return this.request(`PUT`,`/api/v1/media/${e}`,t)}async replaceMediaFile(e,n){let r=new FormData;r.append(`file`,n);let i=await this.sendWithRecovery(`PUT`,`/api/v1/media/${e}/file`,void 0,{},{bodyInit:r});if(!i.ok)throw await t.fromResponse(i);return i.json()}async deleteMedia(e){await this.request(`DELETE`,`/api/v1/media/${e}`)}async listUsers(e){let t=new URLSearchParams;return e?.page&&t.set(`page`,String(e.page)),e?.limit&&t.set(`limit`,String(e.limit)),e?.search&&t.set(`search`,e.search),e?.status&&t.set(`status`,e.status),this.request(`GET`,`/api/v1/users?${t.toString()}`)}async getUser(e){return this.request(`GET`,`/api/v1/users/${e}`)}async createUser(e){return this.request(`POST`,`/api/v1/users`,e)}async updateUser(e,t){return this.request(`PUT`,`/api/v1/users/${e}`,t)}async deleteUser(e){await this.request(`DELETE`,`/api/v1/users/${e}`)}async setUserPassword(e,t){await this.request(`PUT`,`/api/v1/users/${e}/password`,{password:t})}async assignRole(e,t){return this.request(`POST`,`/api/v1/users/${e}/roles`,{roleId:t})}async removeRole(e,t){return this.request(`DELETE`,`/api/v1/users/${e}/roles/${t}`)}async listRoles(){return this.request(`GET`,`/api/v1/roles`)}async createRole(e){return this.request(`POST`,`/api/v1/roles`,e)}async updateRole(e,t){return this.request(`PUT`,`/api/v1/roles/${e}`,t)}async deleteRole(e){await this.request(`DELETE`,`/api/v1/roles/${e}`)}async listTenants(e){let t=new URLSearchParams;return e?.page&&t.set(`page`,String(e.page)),e?.limit&&t.set(`limit`,String(e.limit)),e?.search&&t.set(`search`,e.search),this.request(`GET`,`/api/v1/tenants?${t.toString()}`)}async createTenant(e){return this.request(`POST`,`/api/v1/tenants`,e)}async updateTenant(e,t){return this.request(`PUT`,`/api/v1/tenants/${e}`,t)}async deleteTenant(e){await this.request(`DELETE`,`/api/v1/tenants/${e}`)}async getSettings(e){let t=e?`?group=${encodeURIComponent(e)}`:``;return this.request(`GET`,`/api/v1/settings${t}`)}async updateSettings(e){await this.request(`PUT`,`/api/v1/settings`,e)}async healthCheck(){return this.request(`GET`,`/health`)}async getThemes(){return(await this.request(`GET`,`/api/v1/themes`)).map(e=>({id:String(e.id??``),name:String(e.name??``),version:e.version?String(e.version):void 0,status:String(e.status??`INSTALLED`),config:e.config??{},manifest:e.manifest??null}))}async syncThemes(){return(await this.request(`POST`,`/api/v1/themes/sync`)).map(e=>({id:String(e.id??``),name:String(e.name??``),version:e.version?String(e.version):void 0,status:String(e.status??`INSTALLED`),config:e.config??{},manifest:e.manifest??null}))}async activateTheme(e){return this.request(`POST`,`/api/v1/themes/${e}/activate`)}async deactivateTheme(e){return this.request(`POST`,`/api/v1/themes/${e}/deactivate`)}async updateThemeConfig(e,t){return this.request(`PATCH`,`/api/v1/themes/${e}/config`,{config:t})}async installTheme(e){return this.request(`POST`,`/api/v1/themes/install`,e)}async uninstallTheme(e){await this.request(`DELETE`,`/api/v1/themes/${e}`)}async getPlugins(){return(await this.request(`GET`,`/api/v1/plugins`)).map(e=>({id:String(e.id??``),name:String(e.name??``),version:String(e.version??``),status:String(e.status??`INSTALLED`),enabled:e.enabled===!0,manifest:e.manifest??null}))}async activatePlugin(e,t){return this.request(`POST`,`/api/v1/plugins/${e}/activate`,{tenantId:t})}async deactivatePlugin(e,t){return this.request(`POST`,`/api/v1/plugins/${e}/deactivate`,{tenantId:t})}async uninstallPlugin(e){await this.request(`DELETE`,`/api/v1/plugins/${e}`)}async getPluginsRuntime(){return this.request(`GET`,`/api/v1/plugins/runtime`)}};export{d as n,n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,h as t,n,o as r,p as i,s as a,t as o}from"./solid.8gBSxpeo.js";import{l as s,o as c}from"./web.DB4MaPY9.js";var l=Symbol(`store-raw`),u=Symbol(`store-node`),d=Symbol(`store-has`),f=Symbol(`store-self`);function p(e){let t=e[o];if(!t&&(Object.defineProperty(e,o,{value:t=new Proxy(e,x)}),!Array.isArray(e))){let n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e),i=Object.getPrototypeOf(e),a=i!==null&&typeof e==`object`&&!!e&&!Array.isArray(e)&&i!==Object.prototype;if(a){let e=Object.getOwnPropertyDescriptors(i);n.push(...Object.keys(e)),Object.assign(r,e)}for(let i=0,o=n.length;i<o;i++){let o=n[i];a&&o===`constructor`||r[o].get&&Object.defineProperty(e,o,{configurable:!0,enumerable:r[o].enumerable,get:r[o].get.bind(t)})}}return t}function m(e){let t;return typeof e==`object`&&!!e&&(e[o]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function h(e,t=new Set){let n,r,i,a;if(n=e!=null&&e[l])return n;if(!m(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,a=e.length;n<a;n++)i=e[n],(r=h(i,t))!==i&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let n=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let s=0,c=n.length;s<c;s++)a=n[s],!o[a].get&&(i=e[a],(r=h(i,t))!==i&&(e[a]=r))}return e}function g(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function _(e,t,n){if(e[t])return e[t];let[r,a]=i(n,{equals:!1,internal:!0});return r.$=a,e[t]=r}function v(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===o||t===u?n:(delete n.value,delete n.writable,n.get=()=>e[o][t],n)}function y(e){t()&&_(g(e,u),f)()}function b(e){return y(e),Reflect.ownKeys(e)}var x={get(e,r,i){if(r===l)return e;if(r===o)return i;if(r===n)return y(e),i;let a=g(e,u),s=a[r],c=s?s():e[r];if(r===u||r===d||r===`__proto__`)return c;if(!s){let n=Object.getOwnPropertyDescriptor(e,r);t()&&(typeof c!=`function`||Object.prototype.hasOwnProperty.call(e,r))&&!(n&&n.get)&&(c=_(a,r,c)())}return m(c)?p(c):c},has(e,r){return r===l||r===o||r===n||r===u||r===d||r===`__proto__`||(t()&&_(g(e,d),r)(),r in e)},set(){return!0},deleteProperty(){return!0},ownKeys:b,getOwnPropertyDescriptor:v};function S(e,t,n,r=!1){if(t===`__proto__`||!r&&e[t]===n)return;let i=e[t],a=e.length;n===void 0?(delete e[t],e[d]&&e[d][t]&&i!==void 0&&e[d][t].$()):(e[t]=n,e[d]&&e[d][t]&&i===void 0&&e[d][t].$());let o=g(e,u),s;if((s=_(o,t,i))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let t=e.length;t<a;t++)(s=o[t])&&s.$();(s=_(o,`length`,a))&&s.$(e.length)}(s=o[f])&&s.$()}function C(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];w(i)||S(e,i,t[i])}}function w(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function T(e,t){if(typeof t==`function`&&(t=t(e)),t=h(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){let r=t[n];e[n]!==r&&S(e,n,r)}S(e,`length`,r)}else C(e,t)}function E(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();let a=typeof r,o=Array.isArray(e);if(a===`string`&&(r===`__proto__`||t.length>1&&w(r)))return;if(Array.isArray(r)){for(let i=0;i<r.length;i++)E(e,[r[i]].concat(t),n);return}if(o&&a===`function`){for(let i=0;i<e.length;i++)r(e[i],i)&&E(e,[i].concat(t),n);return}if(o&&a===`object`){let{from:i=0,to:a=e.length-1,by:o=1}=r;for(let r=i;r<=a;r+=o)E(e,[r].concat(t),n);return}if(t.length>1){E(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let a=t[0];typeof a==`function`&&(a=a(i,n),a===i)||(r!==void 0||a!=null)&&(a=h(a),r===void 0||m(i)&&m(a)&&!Array.isArray(a)?C(i,a):S(e,r,a))}function D(...[e,t]){let n=h(e||{}),i=Array.isArray(n),a=p(n);function o(...e){r(()=>{i&&e.length===1?T(n,e[0]):E(n,e)})}return[a,o]}var O=Symbol(`store-root`);function k(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function A(e,t,n,r,i){if(k(n))return;let a=t[n];if(e===a)return;let o=Array.isArray(e);if(n!==O&&(!m(e)||!m(a)||o!==Array.isArray(a)||i&&e[i]!==a[i])){S(t,n,e);return}if(o){if(e.length&&a.length&&(!r||i&&e[0]&&e[0][i]!=null)){let t,n,o,s,c,l,u,d;for(o=0,s=Math.min(a.length,e.length);o<s&&(a[o]===e[o]||i&&a[o]&&e[o]&&a[o][i]&&a[o][i]===e[o][i]);o++)A(e[o],a,o,r,i);let f=Array(e.length),p=new Map;for(s=a.length-1,c=e.length-1;s>=o&&c>=o&&(a[s]===e[c]||i&&a[s]&&e[c]&&a[s][i]&&a[s][i]===e[c][i]);s--,c--)f[c]=a[s];if(o>c||o>s){for(n=o;n<=c;n++)S(a,n,e[n]);for(;n<e.length;n++)S(a,n,f[n]),A(e[n],a,n,r,i);a.length>e.length&&S(a,`length`,e.length);return}for(u=Array(c+1),n=c;n>=o;n--)l=e[n],d=i&&l?l[i]:l,t=p.get(d),u[n]=t===void 0?-1:t,p.set(d,n);for(t=o;t<=s;t++)l=a[t],d=i&&l?l[i]:l,n=p.get(d),n!==void 0&&n!==-1&&(f[n]=a[t],n=u[n],p.set(d,n));for(n=o;n<e.length;n++)n in f?(S(a,n,f[n]),A(e[n],a,n,r,i)):S(a,n,e[n])}else for(let t=0,n=e.length;t<n;t++)A(e[t],a,t,r,i);a.length>e.length&&S(a,`length`,e.length);return}let s=Object.keys(e);for(let t=0,n=s.length;t<n;t++)k(s[t])||A(e[s[t]],a,s[t],r,i);let c=Object.keys(a);for(let t=0,n=c.length;t<n;t++)e[c[t]]===void 0&&S(a,c[t],void 0)}function j(e,t={}){let{merge:n,key:r=`id`}=t,i=h(e);return e=>{if(!m(e)||!m(i))return i;let t=A(i,{[O]:e},O,n,r);return t===void 0?e:t}}var M=new WeakMap,N=t=>(n,r,i,{client:o})=>{if(!t.hasAttribute(`ssr`))return;let l=o!==`only`,u,d={};if(Object.keys(i).length>0){if(o!==`only`){let e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,e=>e===t?NodeFilter.FILTER_SKIP:e.nodeName===`ASTRO-SLOT`?NodeFilter.FILTER_ACCEPT:e.nodeName===`ASTRO-ISLAND`?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP);for(;u=e.nextNode();)d[u.getAttribute(`name`)||`default`]=u}for(let[e,t]of Object.entries(i))d[e]||(d[e]=document.createElement(`astro-slot`),e!=="default"&&d[e].setAttribute(`name`,e),d[e].innerHTML=t)}let{default:f,...p}=d,m=t.dataset.solidRenderId;if(M.has(t))M.get(t)(j({...r,...p,children:f}));else{let[i,o]=D({...r,...p,children:f});M.set(t,o);let u=()=>{let t=()=>a(n,i);return l?a(e,{get children(){return t()}}):t()},d;l?d=c(u,t,{renderId:m}):(t.innerHTML=``,d=s(u,t)),t.addEventListener(`astro:unmount`,()=>d(),{once:!0})}};export{N as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e,i as t,p as n,r,s as i,v as a}from"./solid.8gBSxpeo.js";import{a as o,c as s,d as c,h as l,i as u,n as d,r as f,s as p}from"./web.DB4MaPY9.js";import{n as m}from"./api.CNp-a9Z3.js";import"./src.DksrLolD.js";var h=l(`<a class=sidebar__link><!$><!/> <!$><!/>`),g=l(`<span aria-hidden=true>`);function _(t){let n=()=>t.extensions.menuPages.filter(e=>t.can(e.capability??`read`));return i(r,{get each(){return n()},children:t=>(()=>{var n=u(h),r=n.firstChild,[i,a]=o(r.nextSibling),l=i.nextSibling.nextSibling,[d,f]=o(l.nextSibling);return p(n,(()=>{var e=s(()=>!!t.icon);return()=>e()?(()=>{var e=u(g);return p(e,()=>t.icon),e})():null})(),i,a),p(n,()=>t.label,d,f),e(()=>c(n,`href`,`/plugins/${t.slug}`)),n})()})}f([`click`]);var v=l(`<div class=sidebar-plugins data-extensions=sidebar><!$><!/><!$><!/>`),y=l(`<div><span>`);function b(){return{menuPages:[],submenuPages:[],dashboardWidgets:[],metaBoxes:[],notices:[],columns:{},columnRenderers:{},actionLinks:[]}}function x(e){let t=b();for(let n of e){if(n.status!==`ACTIVE`&&n.status!==`ACTIVATED`)continue;let e=n.manifest?.admin;if(!e)continue;let r=n.slug??n.name;t.menuPages.push(...e.menuPages?.map(e=>({...e,slug:e.slug.startsWith(`${r}/`)?e.slug:`${r}/${e.slug}`}))??[]),t.dashboardWidgets.push(...e.dashboardWidgets?.map(e=>({...e,id:e.id.includes(`:`)?e.id:`${r}:${e.id}`,componentId:e.componentId.includes(`:`)?e.componentId:`${r}:${e.componentId}`}))??[]),t.notices.push(...e.notices?.map(e=>({...e,id:e.id.includes(`:`)?e.id:`${r}:${e.id}`}))??[])}return t}function S(){let[s,l]=n(b());a(async()=>{try{let e=await m.getPlugins();l(x(e))}catch{}});let f=()=>!0;return i(t,{get when(){return s().menuPages.length>0},get children(){var t=u(v),n=t.firstChild,[a,l]=o(n.nextSibling),m=a.nextSibling,[h,g]=o(m.nextSibling);return p(t,i(r,{get each(){return s().notices},children:t=>(()=>{var n=u(y),r=n.firstChild;return p(r,()=>t.message),e(e=>{var r=`notice notice--${t.level}`,i=t.id.split(`:`)[0];return r!==e.e&&d(n,e.e=r),i!==e.t&&c(n,`data-plugin`,e.t=i),e},{e:void 0,t:void 0}),n})()}),a,l),p(t,i(_,{get extensions(){return s()},can:f}),h,g),t}})}export{S as PluginExtensionsSlot,b as emptyExtensionsState,x as extensionsFromPlugins};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime.BpQH8Ho1.js";import{p as t,v as n}from"./solid.8gBSxpeo.js";import{n as r}from"./api.CNp-a9Z3.js";var i=[`pt-BR`,`en`,`es-ES`,`ru`,`uk`,`tr`,`he`,`it`,`pl`,`zh-CN`,`ja`,`ar`,`sw`,`yo`,`zu`,`am`,`ha`,`ig`],a={"pt-BR":`Português (Brasil)`,en:`English`,"es-ES":`Español`,ru:`Русский`,uk:`Українська`,tr:`Türkçe`,he:`עברית`,it:`Italiano`,pl:`Polski`,"zh-CN":`中文 (简体)`,ja:`日本語`,ar:`العربية`,sw:`Kiswahili`,yo:`Yorùbá`,zu:`isiZulu`,am:`አማርኛ`,ha:`Hausa`,ig:`Igbo`},o={"pt-BR":`🇧🇷`,en:`🇺🇸`,"es-ES":`🇪🇸`,ru:`🇷🇺`,uk:`🇺🇦`,tr:`🇹🇷`,he:`🇮🇱`,it:`🇮🇹`,pl:`🇵🇱`,"zh-CN":`🇨🇳`,ja:`🇯🇵`,ar:`🇸🇦`,sw:`🇹🇿`,yo:`🇳🇬`,zu:`🇿🇦`,am:`🇪🇹`,ha:`🇳🇬`,ig:`🇳🇬`};function s(e){return i.includes(e)}var ee=(e,t,n)=>{let r=t.lastIndexOf(`?`),i=e[r===-1||r<t.lastIndexOf(`/`)?t:t.slice(0,r)];return i?typeof i==`function`?i():Promise.resolve(i):new Promise((e,r)=>{(typeof queueMicrotask==`function`?queueMicrotask:setTimeout)(r.bind(null,Error(`Unknown variable dynamic import: `+t+(t.split(`/`).length===n?``:`. Note that variables only represent file names one level deep.`))))})},te=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),ne=function(e){return`/`+e},c={},re=function(e){return e.pathname.endsWith(`.css`)},l=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=ne(t,n);let r=s(t);if(r.href in c)return;c[r.href]=!0;let i=re(r);if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:te,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),i)return new Promise((e,t)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${r}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},u=new Map;async function d(e){if(u.has(e))return u.get(e);try{let t=await ee(Object.assign({"./locales/ar.json":()=>l(()=>import(`./ar.BeEmOTlL.js`),[]),"./locales/en.json":()=>l(()=>Promise.resolve().then(()=>ae),void 0),"./locales/es-ES.json":()=>l(()=>import(`./es-ES.C0DI0CK6.js`),[]),"./locales/he.json":()=>l(()=>import(`./he.RF4swhtn.js`),[]),"./locales/it.json":()=>l(()=>import(`./it.DhCR9YsW.js`),[]),"./locales/ja.json":()=>l(()=>import(`./ja.DPrxHQvU.js`),[]),"./locales/pl.json":()=>l(()=>import(`./pl.6VCoPa7y.js`),[]),"./locales/pt-BR.json":()=>l(()=>import(`./pt-BR.B-uijFlj.js`),[]),"./locales/ru.json":()=>l(()=>import(`./ru.Cv0Z6X2y.js`),[]),"./locales/sw.json":()=>l(()=>import(`./sw.BBMIgY-Y.js`),[]),"./locales/tr.json":()=>l(()=>import(`./tr.BWEmWhCE.js`),[]),"./locales/uk.json":()=>l(()=>import(`./uk.DDXJXOmn.js`),[]),"./locales/yo.json":()=>l(()=>import(`./yo.DNoEBLJd.js`),[]),"./locales/zh-CN.json":()=>l(()=>import(`./zh-CN.CVKBB6Ky.js`),[])}),`./locales/${e}.json`,3),n=t.default??t;return u.set(e,n),n}catch{return e===`en`?{}:d(`en`)}}var f=`admin_locale`;function p(){if(typeof document>`u`)return null;let e=document.cookie.match(RegExp(`(?:^|; )${f}=([^;]+)`));return e?.[1]&&i.includes(e[1])?e[1]:null}function m(e){typeof document<`u`&&(document.cookie=`${f}=${e}; path=/; max-age=31536000; SameSite=Lax`)}function h(){if(typeof navigator>`u`)return`en`;let e=navigator.language?.split(`-`)[0]?.toLowerCase(),t=navigator.language?.toLowerCase();for(let n of i)if(n.toLowerCase()===t||n.split(`-`)[0]===e)return n;return`en`}async function g(){try{let e=await r.getUserLocale();if(e&&i.includes(e))return e}catch{}return null}async function _(e){await r.setUserLocale(e)}async function v(){return p()||await g()||h()||`en`}async function ie(e){m(e);try{await _(e)}catch{}}var ae=e({access:()=>D,activity:()=>I,adminBar:()=>L,common:()=>F,content:()=>x,dashboard:()=>b,default:()=>V,footer:()=>R,helpTabs:()=>z,layout:()=>y,login:()=>P,logs:()=>O,media:()=>S,menus:()=>T,notFound:()=>M,plugins:()=>A,rateLimit:()=>N,resources:()=>E,screenOptions:()=>B,settings:()=>w,themes:()=>j,users:()=>C,webhooks:()=>k}),y={appName:`OkCMS`,admin:`Admin`,nav:{dashboard:`Dashboard`,content:`Content`,media:`Media`,users:`Users`,menus:`Menus`,settings:`Settings`,plugins:`Plugins`,themes:`Themes`},actions:{logout:`Logout`,newPost:`New Post`,uploadMedia:`Upload Media`,addUser:`Add User`,openSettings:`Settings`}},b={title:`Dashboard`,stats:{totalContent:`Total Content`,published:`Published`,drafts:`Drafts`,mediaFiles:`Media Files`,users:`Users`},recent:{title:`Recent Content`,viewAll:`View All`,empty:`No content yet — create your first!`,columns:{title:`Title`,type:`Type`,status:`Status`,updated:`Updated`}},widgets:{atGlance:`At a Glance`,posts:`Posts`,postsDesc:`Published / Drafts / Trash`,pages:`Pages`,pagesDesc:`Published / Drafts / Trash`,media:`Media`,mediaDesc:`Files in the library`,users:`Users`,usersDesc:`Total / Active / Inactive`,storage:`Storage`,quickDraft:{title:`Quick Draft`,heading:`Title`,headingPlaceholder:`Give your draft a title`,content:`Content`,contentPlaceholder:`What's on your mind?`,save:`Save Draft`,yourDrafts:`Your Drafts`,noDrafts:`No drafts yet.`},activity:{title:`Activity`,empty:`No activity yet.`}}},x={list:{title:`Content`,description:`Search, filter, edit and publish your content.`,typeNotFound:`This content type was not found.`,columns:{title:`Title`,type:`Type`,status:`Status`,updated:`Updated`},actions:{edit:`Edit`,publish:`Publish`,unpublish:`Unpublish`,delete:`Delete`},filters:{search:`Search content…`,allTypes:`All types`,allStatus:`All status`},buttons:{new:`+ New content`,addNew:`+ Add new`,search:`Search`},all:`All content`,empty:`No content found.`,statuses:{draft:`Draft`,published:`Published`,archived:`Archived`},confirmDelete:`Delete "{title}"?`,toasts:{published:`Content published ✓`,unpublished:`Content unpublished ✓`}},editor:{type:`Type`,adding:`Add new`,editing:`Edit`,backToList:`Back to list`,saving:`Saving…`,title:`Title`,titlePlaceholder:`Add title`,slug:`Slug`,slugPlaceholder:`auto-generated-from-title`,toolbar:`Editor toolbar`,bodyPlaceholder:`Start writing…`,linkPrompt:`Enter the URL:`,excerpt:`Excerpt`,featuredImage:`Featured Image (media ID)`,mediaIdPlaceholder:`Media ID`,featuredImageHint:`Choose a media item from the Media library.`,pageAttributes:`Page attributes`,publishPanel:`Publish`,status:`Status`,statusOptions:{draft:`Draft`,published:`Published`,archived:`Archived`},layout:`Layout`,layoutAuto:`Automatic (theme hierarchy)`,customFields:`Custom Fields`,inspectTypes:`Inspect available types`,save:`Save`,saved:`Content saved successfully.`},taxonomy:{title:`Taxonomy terms`,back:`← Back to content`,choose:`Choose a taxonomy from the content menu.`,notFound:`Taxonomy not found.`,addTerm:`Add new term`,editTerm:`Edit term`,name:`Name`,slug:`Slug`,description:`Description`,descriptionHint:`Manage the terms used by this content type.`,attachedTo:`Attached to`,add:`Add term`,delete:`Delete`,empty:`No terms yet.`,confirmDelete:`Delete "{name}"?`}},S={title:`Media Library`,description:"Upload and manage images, videos and documents. Files are stored in `uploads/` and served publicly.",upload:{dropzone:`Drop files here or`,select:`Select files`,uploading:`Uploading…`,hint:`Images, videos, audio and documents · up to 25MB per file`},toolbar:{search:`Search by name or alt…`,allTypes:`All types`,searchBtn:`Search`},mimeTypes:{png:`PNG`,jpeg:`JPEG`,gif:`GIF`,webp:`WebP`,svg:`SVG`,pdf:`PDF`,mp4:`MP4`,mp3:`MP3`},empty:`No files yet. Upload the first one!`,details:{title:`Details`,titleField:`Title`,file:`File`,type:`Type`,size:`Size`,dimensions:`Dimensions`,uploaded:`Uploaded`,url:`URL`,copy:`Copy`,alt:`Alt text`,caption:`Caption`,description:`Description`,save:`Save details`,replace:`Replace file`,replacing:`Replacing…`,replaceHint:`Keeps this attachment and its metadata.`,delete:`Delete`,close:`Close`,confirmDelete:`Delete "{filename}"? The file will be removed from disk.`,saved:`Details saved ✓`,copied:`URL copied ✓`,copyError:`Could not copy URL`,replaced:`File replaced ✓`},toasts:{uploaded:`{count} file(s) uploaded ✓`}},C={title:`Users`,description:`Manage accounts, roles and project access.`,new:`New User`,toolbar:{search:`Search by name or email…`,allStatus:`All status`,active:`Active`,inactive:`Inactive`,newBtn:`+ New user`,searchBtn:`Search`},table:{name:`Name`,email:`Email`,role:`Role`,status:`Status`,lastAccess:`Last access`,actions:{manage:`Manage`,delete:`Delete`}},empty:`No users found.`,noRole:`No role`,detail:{title:`Manage user`,fields:{name:`Name`,email:`Email`,status:`Status`,role:`Role`,password:`Password`},statusOptions:{active:`Active`,inactive:`Inactive`},rolePlaceholder:`— no role —`,meta:`Created on {created} · last access {lastAccess}`,actions:{save:`Save`,resetPassword:`Reset password`,close:`Close`},passwordPrompt:`New password for {email} (minimum 8 chars):`,passwordError:`Password must be at least 8 characters`,toasts:{roleUpdated:`Role for {name} updated ✓`,passwordChanged:`Password for {name} changed ✓`,saved:`User {name} saved ✓`,deleted:`User {name} deleted ✓`},confirmDelete:`Delete user {email}?`}},w=JSON.parse(`{"general":{"title":"General","description":"Basic information displayed on the site.","back":"← All settings","fields":{"siteTitle":"Site Title","siteTitlePlaceholder":"My Site","siteDescription":"Description","siteDescriptionPlaceholder":"A new site built with OkCMS","language":"Language","timezone":"Timezone","timezonePlaceholder":"America/Sao_Paulo"},"saved":"Settings saved ✓","loading":"Loading…","save":"Save"},"postTypes":{"title":"Content Types","description":"Create custom content types (CPTs) beyond Posts and Pages.","form":{"title":"Create Content Type","slug":"Slug (singular, e.g.: portfolio)","slugHint":"Only lowercase letters, numbers and underscore","singular":"Singular name","plural":"Plural name","supports":"Supports","supportsOptions":{"title":"Title","editor":"Editor","thumbnail":"Featured Image","excerpt":"Excerpt","revisions":"Revisions"},"hasArchive":"Has public archive (/slug)","singleton":"Singleton (only one content entry)","icon":"Sidebar menu icon","iconHint":"Pick a Lucide icon — its name is what shows in the admin sidebar","iconSearchPlaceholder":"Search icons…","iconEmpty":"No icons found.","iconCount":"{count} icons available","editTitle":"Edit Content Type","update":"Update","cancel":"Cancel","create":"Create"},"table":{"slug":"Slug","singular":"Singular","plural":"Plural","source":"Source","supports":"Supports","archive":"Archive","mode":"Mode","singleton":"Singleton","collection":"Collection","icon":"Icon","actions":{"edit":"Edit","remove":"Remove"}},"sources":{"admin":"Admin","core":"Core"}},"taxonomies":{"title":"Taxonomies","description":"Create custom taxonomies and link them to content types.","form":{"title":"Create Taxonomy","name":"Name (e.g.: Genre)","slug":"Slug (optional, generated from name)","slugHint":"Only lowercase letters, numbers and underscore","hierarchical":"Hierarchical (allows parent/child terms)","attachTo":"Link to content types","create":"Create"},"table":{"taxonomy":"Taxonomy","hierarchical":"Hierarchical","attachedTypes":"Linked content types","actions":{"remove":"Remove"}}},"customFields":{"title":"Custom Fields","description":"Create field groups, arrange fields and choose which standard fields are visible for each content type.","contentType":"Content type","location":{"title":"Location rules","description":"Choose where this field group appears. Rules in the same group use AND; groups use OR.","parameter":"Location parameter","operator":"Operator","chooseValue":"Choose a value","valuePlaceholder":"Enter a value or slug","showIf":"Show if","removeRule":"Remove rule","required":"Add a value to every location rule.","addRule":"Add condition","addGroup":"Add OR group","remove":"Remove","and":"AND","or":"OR","params":{"content_type":"Post type","content_slug":"Post slug","taxonomy":"Taxonomy","term":"Term slug","user_role":"User role","page_template":"Page template","post_status":"Post status"},"operators":{"eq":"is","neq":"is not"}},"standard":{"title":"Standard fields","description":"Title and slug are required. The other standard fields can be enabled or disabled.","enabled":"Enabled","locked":"Required","fields":{"title":"Title","slug":"Slug","content":"Content","excerpt":"Excerpt","featured_image":"Featured image","seo_title":"SEO title","seo_description":"SEO description","status":"Status","author":"Author"}},"groups":{"title":"Field groups","new":"New field group","empty":"No custom field groups yet.","emptyHint":"Create your first group to start modelling your content.","search":"Search groups…","groupName":"Group","status":"Status","fields":"fields","appliesTo":"Applies to","allContentTypes":"All content types","edit":"Edit","active":"Active","inactive":"Inactive"},"form":{"createTitle":"Create field group","editTitle":"Edit field group","title":"Group name","titlePlaceholder":"Example: Product details","displayTitle":"Display title","active":"Active","backToGroups":"Back to groups","editorEyebrow":"Field builder","groupTitleHint":"This name identifies the field set inside the content editor.","fieldsTitle":"Fields","fieldsDescription":"Add, configure and order fields. Use the six-dot handle to drag without losing their position.","noFields":"This group has no fields yet.","settingsTitle":"Group settings","settingsDescription":"Presentation and panel visibility options for this panel.","description":"Description","labelPlacement":"Label placement","instructionPlacement":"Instruction placement","menuOrder":"Menu order","hideOnScreen":"Hide on edit screen","hide":{"permalink":"Permalink","content":"Content editor","excerpt":"Excerpt","featured_image":"Featured image","author":"Author","revisions":"Revisions","comments":"Comments"},"assignTitle":"Location","assignDescription":"Choose the content type where this field group will be available.","contentType":"Content type","position":"Position","positions":{"normal":"Normal","side":"Sidebar","after_title":"After title"},"displayStyle":"Display style","displayStyles":{"standard":"Standard","seamless":"Seamless","grouped":"Grouped"},"field":"Field","fieldName":"Name/key","fieldNamePlaceholder":"product_code","fieldLabel":"Label","fieldLabelPlaceholder":"Product code","fieldType":"Type","instructions":"Instructions","instructionsPlaceholder":"Optional help text for editors","required":"Required","options":"Options","optionsHint":"One option per line: value|Label","addField":"Add field","removeField":"Remove","dragHint":"Drag to reorder","editField":"Edit","duplicateField":"Duplicate","copySuffix":"(copy)","selectFieldType":"Select field type","searchFieldTypes":"Search field types…","popularFields":"Popular","noMatchingFieldTypes":"No field types found.","fieldTypeHint":"Choose the type that best represents the value editors will enter in this field.","selectField":"Select field","save":"Save group","cancel":"Cancel","newFieldDefault":"New field","saved":"Field group saved.","deleted":"Field group deleted."},"listEyebrow":"Content structure","validation":{"titleRequired":"Group name is required."},"tabs":{"locationRules":"Location rules","presentation":"Presentation","groupSettings":"Group settings"},"fieldSettings":{"general":"General","fieldLabel":"Field label","fieldName":"Field name","instructions":"Instructions","required":"Required","defaultValue":"Default value","placeholder":"Placeholder","presentation":"Presentation","wrapperWidth":"Wrapper width (%)","labelPlacement":"Label","instructionPlacement":"Instructions","top":"Above","left":"Left","above":"Before field","below":"After field","textSettings":"Text","prepend":"Prepend","append":"Append","minLength":"Minimum length","maxLength":"Maximum length","rows":"Rows","newLines":"New lines","wpautop":"Automatic paragraphs","none":"None","numberSettings":"Number","min":"Minimum","max":"Maximum","step":"Step","choiceSettings":"Choices","choices":"Choices","layout":"Layout","vertical":"Vertical","horizontal":"Horizontal","multiple":"Multiple choice","allowNull":"Allow empty","mediaSettings":"Media","returnFormat":"Return format","array":"Array","id":"ID","previewSize":"Preview size","library":"Library","all":"All","uploadedToPost":"Uploaded to this post","allowedTypes":"Allowed types","minWidth":"Minimum width","maxWidth":"Maximum width","minHeight":"Minimum height","maxHeight":"Maximum height","wysiwygSettings":"WYSIWYG","tabs":"Tabs","toolbar":"Toolbar","mediaUpload":"Allow media upload","dateSettings":"Date and time","displayFormat":"Display format","firstDay":"First day","colorSettings":"Color","enableOpacity":"Allow opacity","mapSettings":"Map","center":"Center","zoom":"Zoom","height":"Height","relationSettings":"Relationship","postType":"Post type","taxonomy":"Taxonomy","booleanSettings":"True/False","message":"Message","defaultChecked":"Checked by default","linkSettings":"Link","cloneSettings":"Clone","cloneFields":"Fields to clone","cloneHint":"One field name per line","containerSettings":"Structure","buttonLabel":"Button label","collapsed":"Collapsed row title field","subFields":"Subfields","layouts":"Layouts","addLayout":"Add layout","newLayout":"New layout","layoutName":"Layout name","layoutLabel":"Layout label","layoutDisplay":"Layout display","conditionalLogic":"Conditional logic","conditionalHint":"Show this field only when the rules match.","chooseField":"Choose a field","conditionValue":"Value","addCondition":"Add condition","addConditionGroup":"Add OR group","conditionsAnd":"Conditions in this group use AND.","choicesHint":"One choice per line in the format value|Label.","cloneSource":"Source group or field","cloneSourceHint":"Field group key or field name to copy fields from.","requiredOn":"Required","requiredOff":"Not required","libraryAll":"All","libraryUploaded":"Uploaded to this post","ui":"Enhanced UI","uiHint":"Use enhanced styling for the dropdown.","wrapperClass":"Wrapper class","wrapperWidthHint":"CSS width of the field wrapper, e.g. 50%.","collapsedHint":"Name of the sub-field used as the row title.","conditionalActive":"Active","showIf":"Show if","removeRule":"Remove rule","and":"AND","or":"OR","noLayouts":"No layouts yet.","validation":"Validation","advanced":"Advanced","fieldType":"Type","fieldNameHint":"Letters, numbers and underscores only.","ariaLabel":"Field settings","operators":{"eq":"equals","neq":"does not equal","gt":"is greater than","lt":"is less than","contains":"contains","hasAny":"has any value","hasNone":"is empty"}},"actions":{"delete":"Delete","confirmDelete":"Delete this field group?","edit":"Edit","duplicate":"Duplicate","activate":"Activate","deactivate":"Deactivate","export":"Export","import":"Import"},"import":{"description":"Import field groups from a JSON file. The file must contain a field group object or an array of field group objects. Existing groups with the same key will be updated; new groups will be created.","dropzone":"Click to select a .json file, or drag and drop here","hint":"File selected. Click Import to proceed."},"loading":"Loading custom fields…","loadError":"Could not load custom fields."}}`),T={title:`Menus`,description:`Create and manage the navigation menus used by your site.`,hint:`Menus are independent from content types and can be rendered by your theme.`,new:`New menu`,create:`Create menu`,edit:`Edit menu`,name:`Name`,slug:`Slug`,items:`Items`,back:`Back to menus`,nameRequired:`Enter a menu name.`,editor:{eyebrow:`Navigation structure`,addItems:`Add menu items`,search:`Search…`,addSelected:`Add selected`,addToMenu:`Add to menu`,structure:`Menu structure`,structureHint:`Drag items to reorder. Use the arrows to create nested submenus.`,empty:`Add items from the panels on the left.`,emptyLevel:`No submenu items.`,drag:`Drag to reorder`,untitled:`Untitled item`,noUrl:`No URL`,up:`Move up`,down:`Move down`,indent:`Make submenu`,outdent:`Move to parent level`,itemSettings:`Item settings`,navigationLabel:`Navigation label`,url:`URL`,titleAttribute:`Title attribute`,cssClasses:`CSS classes`,target:`Open link in`,sameWindow:`Same window`,newWindow:`New window`,xfn:`Link relationship (XFN)`,description:`Description`,remove:`Remove`,settings:`Menu settings`,autoAddPages:`Automatically add new top-level pages to this menu`,autoAddPagesHint:`This setting is saved with the menu and can be used by the active theme.`},sources:{pages:`Pages`,posts:`Posts`,custom:`Custom Links`,customHint:`Add any internal or external URL.`,home:`Home`,contentTypes:`Content type items`,archives:`Content type archives`,taxonomies:`Taxonomy terms`},saved:`Menu saved.`,deleted:`Menu deleted.`,empty:`No menus yet.`,confirmDelete:`Delete menu "{name}"?`},E={title:`Content Resources`,description:`Description`,tabs:{category:`Categories`,tag:`Tags`,menu:`Menus`},new:`New resource`,name:`Name`,slug:`Slug`,items:`Menu items (JSON)`,saved:`Resource saved.`,confirmDelete:`Delete this resource?`,form:{new:`Create resource`,edit:`Edit resource`},terms:{title:`Taxonomy terms`,choose:`Choose a taxonomy`,new:`New term`}},D={title:`Access`,description:`Manage roles, permissions and tenants.`,roles:`Roles`,tenants:`Tenants`,permissions:`Permissions (comma separated)`,domain:`Domain`},O={title:`Logs`,description:`Complete audit history of actions performed in the CMS.`,retentionTitle:`Log retention`,retentionDescription:`Logs older than this period are removed automatically.`,retentionDays:`Keep logs for (days)`,retentionSaved:`Log retention updated.`,historyTitle:`Audit history`,actionFilter:`Filter by action`,resourceFilter:`Filter by resource`,loading:`Loading logs…`,empty:`No actions recorded yet.`,system:`System`,columns:{date:`Date`,action:`Action`,resource:`Resource`,user:`User`,status:`Status`,ip:`IP`}},k={title:`Webhooks`,description:`Send CMS events to external services with configurable authentication.`,listTitle:`Configured webhooks`,new:`New webhook`,create:`Create webhook`,edit:`Edit webhook`,url:`Endpoint URL`,events:`Events`,selectEvents:`Select one or more events`,searchEvents:`Search events…`,noEvents:`No events found.`,eventsRequired:`Select at least one event.`,authentication:`Authentication`,active:`Active`,token:`Bearer token`,username:`Username`,password:`Password`,headerName:`Header name`,apiKeyValue:`API key value`,secret:`HMAC secret`,signatureHeader:`Signature header`,keepExisting:`Leave blank to keep current value`,loading:`Loading webhooks…`,empty:`No webhooks configured.`,auth:{none:`None`,bearer:`Bearer token`,basic:`Basic authentication`,apiKey:`API key`,hmac_sha256:`HMAC SHA-256`}},A={title:`Plugins`,description:`Manage installed plugins.`,directoryHint:`Detected automatically from the project's plugins/ directory. Use the CLI or deploy files to add extensions.`,columns:{name:`Name`,version:`Version`,status:`Status`,enabled:`Enabled for tenant`,actions:`Actions`},status:{active:`Active`,installed:`Installed`,inactive:`Inactive`,quarantined:`Quarantined`,missing:`Missing`,loadFailed:`Load failed`},activate:`Activate`,deactivate:`Deactivate`,install:`Install plugin`,uninstall:`Uninstall`,confirmUninstall:`Uninstall {name}?`,name:`Plugin name`,version:`Version`,manifest:`Manifest (JSON)`,loadError:`Could not load plugins.`,activateError:`Could not activate the plugin.`,deactivateError:`Could not deactivate the plugin.`,installError:`Could not install the plugin.`,uninstallError:`Could not uninstall the plugin.`,empty:`No plugins installed.`,selectTenant:`Select tenant`,selectTenantPlaceholder:`Choose a tenant to activate/deactivate for`,hideSelector:`Hide selector`,enabledForTenant:`Active for this tenant`,enabledYes:`Yes`,enabledNo:`No`},j={title:`Themes`,description:`Manage installed themes.`,directoryHint:`Detected automatically from the project's themes/ directory. Use the CLI or deploy files to add themes.`,version:`Version`,active:`Active`,status:{active:`Active`,installed:`Installed`,inactive:`Inactive`},activate:`Activate`,deactivate:`Deactivate`,install:`Install theme`,uninstall:`Uninstall`,confirmUninstall:`Uninstall {name}?`,name:`Theme name`,manifest:`Manifest (JSON)`,loadError:`Could not load themes.`,activateError:`Could not activate the theme.`,deactivateError:`Could not deactivate the theme.`,installError:`Could not install the theme.`,uninstallError:`Could not uninstall the theme.`,reload:`Reload`,configTitle:`Settings`,configClose:`Hide settings`,configSave:`Save settings`,configSaved:`Settings saved.`,configError:`Could not save the theme settings.`,empty:`No themes installed.`},M={title:`Page not found`,description:`The address may be out of date or the page may have moved. Check the URL or pick one of the sections below.`,requestedPath:`You tried to open`,suggestionsLabel:`Or visit one of these`,goHome:`Back to home`,goBack:`Go back`},N={notice:`Request limit reached — wait a few seconds and try again.`,noticeRetry:`Request limit reached — retrying automatically in {seconds}s.`},P={title:`Login`,subtitle:`Sign in to your account`,email:`Email`,password:`Password`,submit:`Sign In`,failed:`Invalid email or password`},F={save:`Save`,cancel:`Cancel`,delete:`Delete`,edit:`Edit`,close:`Close`,confirm:`Confirm`,loading:`Loading…`,yes:`Yes`,no:`No`,search:`Search`,filter:`Filter`,create:`Create`,update:`Update`,remove:`Remove`,viewAll:`View All`,back:`Back`,next:`Next`,previous:`Previous`,page:`Page`,of:`of`,items:`items`,item:`item`,empty:`No {items} found.`,toast:{success:`✓`,error:`Error: {message}`},status:{active:`Active`,inactive:`Inactive`,draft:`Draft`,published:`Published`,archived:`Archived`,locked:`Locked`},language:`Language`,refresh:`Refresh`,actions:`Actions`},I={justNow:`just now`,minAgo:`minutes ago`,ago:`ago`,published:`Published`,updated:`Updated`,newUser:`New user: {name}`},L={mainMenu:`Main menu`,notifications:`Notifications`,notificationsEmpty:`No recent activity`,settings:`Settings`,toggleSidebar:`Toggle sidebar`,userMenu:`User menu`},R={copyright:`© 2026 OkCMS. All rights reserved.`,links:`Links`,website:`Website`,github:`GitHub`,docs:`Documentation`,community:`Community`,poweredBy:`Powered by Oktis Works`},z={title:`Help`,label:`Help`,tabs:`Help topics`,topics:{overview:{label:`Overview`,content:`<h4>Welcome to the OkCMS Dashboard</h4><p>This dashboard gives you an overview of your site's content and activity.</p><h4>Available Widgets</h4><ul><li><strong>At a Glance:</strong> overview of posts, pages, media, and users</li><li><strong>Quick Draft:</strong> save drafts quickly from the dashboard</li><li><strong>Activity:</strong> recent site activity and updates</li></ul>`},content:{label:`Content Management`,content:`<h4>Managing Content</h4><p>Create, edit, and publish content from the Content section.</p><h4>Quick Actions</h4><ul><li>Click "New Content" to create a new post or page</li><li>Use filters to find specific content</li><li>Bulk actions available for multiple items</li></ul>`},media:{label:`Media Library`,content:`<h4>Managing Media</h4><p>Upload and manage images, videos, and documents.</p><h4>Tips</h4><ul><li>Drag and drop files to upload</li><li>Add alt text for accessibility</li><li>Organize with folders (coming soon)</li></ul>`}}},B={title:`Screen Options`,label:`Screen Options`,showOnScreen:`Show on screen`},V={layout:y,dashboard:b,content:x,media:S,users:C,settings:w,menus:T,resources:E,access:D,logs:O,webhooks:k,plugins:A,themes:j,notFound:M,rateLimit:N,login:P,common:F,activity:I,adminBar:L,footer:R,helpTabs:z,screenOptions:B},H=new Map,U=V,[W,G]=t(0),K=null;function q(e){return(e.split(`.`).at(-1)??e).replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/[-_]+/g,` `).replace(/\s+/g,` `).trim().replace(/^\w/,e=>e.toUpperCase())}function J(e,t){return function(n,r){let i=n.split(`.`),a=e;for(let e of i)if(a&&typeof a==`object`&&e in a)a=a[e];else{a=t;for(let e of i)if(a&&typeof a==`object`&&e in a)a=a[e];else return q(n);break}return typeof a==`string`?r?a.replace(/\{(\w+)\}/g,(e,t)=>String(r[t]??``)):a:q(n)}}async function Y(e){if(H.has(e))return H.get(e);let[t,n]=await Promise.all([d(e),d(`en`)]),r=J(t,n);return H.set(e,r),r}var X=J(U,U),Z=`en`,Q=!0,oe=`okcms:locale-changed`;function $(){typeof window<`u`&&window.dispatchEvent(new CustomEvent(oe,{detail:{locale:Z}}))}function se(e){return n(async()=>{Q&&(K||=(async()=>{let t=e??await v();Z=t,X=await Y(t),Q=!1,G(e=>e+1),$()})(),await K)}),{t:(e,t)=>(W(),X(e,t)),locale:()=>(W(),Z),changeLocale:async e=>{Q=!0,Z=e,X=await Y(e),Q=!1,G(e=>e+1),$(),await ie(e)},get loading(){return Q}}}export{a,o as i,se as n,i as o,m as r,s,Y as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return t(this.context.count)},getNextContextId(){return t(this.context.count++)}};function t(t){let n=String(t),r=n.length-1;return e.context.id+(r?String.fromCharCode(96+r):``)+n}function n(t){e.context=t}function r(){return{...e.context,id:e.getNextContextId(),count:0}}var i=(e,t)=>e===t,a=Symbol(`solid-proxy`),o=typeof Proxy==`function`,s=Symbol(`solid-track`),c={equals:i},l=null,u=B,d=1,f=2,p={owned:null,cleanups:null,context:null,owner:null},m=null,h=null,g=null,_=null,v=null,y=0;function b(e,t){let n=g,r=m,i=e.length===0,a=t===void 0?r:t,o=i?p:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>T(()=>U(o)));m=o,g=null;try{return z(s,!0)}finally{g=n,m=r}}function x(e,t){t=t?Object.assign({},c,t):c;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[N.bind(n),e=>(typeof e==`function`&&(e=h&&h.running&&h.sources.has(n)?e(n.tValue):e(n.value)),P(n,e))]}function S(e,t,n){F(L(e,t,!1,d))}function C(e,t,n){u=ce;let r=L(e,t,!1,d),i=j&&A(j);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),v?v.push(r):F(r)}function w(e,t,n){n=n?Object.assign({},c,n):c;let r=L(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,F(r),N.bind(r)}function ee(e){return z(e,!1)}function T(e){if(g===null)return e();let t=g;g=null;try{return e()}finally{g=t}}function E(e,t,n){let r=Array.isArray(e),i,a=n&&n.defer;return n=>{let o;if(r){o=Array(e.length);for(let t=0;t<e.length;t++)o[t]=e[t]()}else o=e();if(a)return a=!1,n;let s=T(()=>t(o,i,n));return i=o,s}}function te(e){C(()=>T(e))}function D(e){return m===null||(m.cleanups===null?m.cleanups=[e]:m.cleanups.push(e)),e}function ne(){return g}function re(){return m}var[ie,O]=x(!1);function ae(e){v.push.apply(v,e),e.length=0}function k(e,t){let n=Symbol(`context`);return{id:n,Provider:le(n),defaultValue:e}}function A(e){let t;return m&&m.context&&(t=m.context[e.id])!==void 0?t:e.defaultValue}function oe(e){let t=w(e),n=w(()=>J(t()));return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}var j;function M(){return j||=k()}function N(){let e=h&&h.running;if(this.sources&&(e?this.tState:this.state)){if((e?this.tState:this.state)===d)F(this);else{let e=_;_=null,z(()=>V(this),!1),_=e}}if(g){let e=this.observers;if(!e||e[e.length-1]!==g){let t=e?e.length:0;g.sources?(g.sources.push(this),g.sourceSlots.push(t)):(g.sources=[this],g.sourceSlots=[t]),e?(e.push(g),this.observerSlots.push(g.sources.length-1)):(this.observers=[g],this.observerSlots=[g.sources.length-1])}}return e&&h.sources.has(this)?this.tValue:this.value}function P(e,t,n){let r=h&&h.running&&h.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(h){let r=h.running;(r||!n&&h.sources.has(e))&&(h.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&z(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=h&&h.running;r&&h.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?_.push(n):v.push(n),n.observers&&H(n)),r?n.tState=d:n.state=d)}if(_.length>1e6)throw _=[],Error()},!1)}return t}function F(e){if(!e.fn)return;U(e);let t=y;I(e,h&&h.running&&h.sources.has(e)?e.tValue:e.value,t),h&&!h.running&&h.sources.has(e)&&queueMicrotask(()=>{z(()=>{h&&(h.running=!0),g=m=e,I(e,e.tValue,t),g=m=null},!1)})}function I(e,t,n){let r,i=m,a=g;g=m=e;try{r=e.fn(t)}catch(t){return e.pure&&(h&&h.running?(e.tState=d,e.tOwned&&e.tOwned.forEach(U),e.tOwned=void 0):(e.state=d,e.owned&&e.owned.forEach(U),e.owned=null)),e.updatedAt=n+1,q(t)}finally{g=a,m=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?P(e,r,!0):h&&h.running&&e.pure?(h.sources.has(e)||(e.value=r),h.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function L(e,t,n,r=d,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:m,context:m?m.context:null,pure:n};return h&&h.running&&(a.state=0,a.tState=r),m===null||m!==p&&(h&&h.running&&m.pure?m.tOwned?m.tOwned.push(a):m.tOwned=[a]:m.owned?m.owned.push(a):m.owned=[a]),a}function R(e){let t=h&&h.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===f)return V(e);if(e.suspense&&T(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<y);){if(t&&h.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(h.disposed.has(t))return}if((t?e.tState:e.state)===d)F(e);else if((t?e.tState:e.state)===f){let t=_;_=null,z(()=>V(e,n[0]),!1),_=t}}}function z(e,t){if(_)return e();let n=!1;t||(_=[]),v?n=!0:v=[],y++;try{let t=e();return se(n),t}catch(e){n||(v=null),_=null,q(e)}}function se(e){if(_&&=(B(_),null),e)return;let t;if(h){if(!h.promises.size&&!h.queue.size){let e=h.sources,n=h.disposed;v.push.apply(v,h.effects),t=h.resolve;for(let e of v)`tState`in e&&(e.state=e.tState),delete e.tState;h=null,z(()=>{for(let e of n)U(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)U(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}O(!1)},!1)}else if(h.running){h.running=!1,h.effects.push.apply(h.effects,v),v=null,O(!0);return}}let n=v;v=null,n.length&&z(()=>u(n),!1),t&&t()}function B(e){for(let t=0;t<e.length;t++)R(e[t])}function ce(t){let r,i=0;for(r=0;r<t.length;r++){let e=t[r];e.user?t[i++]=e:R(e)}if(e.context){if(e.count){e.effects||=[],e.effects.push(...t.slice(0,i));return}n()}for(e.effects&&(e.done||!e.count)&&(t=[...e.effects,...t],i+=e.effects.length,delete e.effects),r=0;r<i;r++)R(t[r])}function V(e,t){let n=h&&h.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===d?i!==t&&(!i.updatedAt||i.updatedAt<y)&&R(i):e===f&&V(i,t)}}}function H(e){let t=h&&h.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=f:r.state=f,r.pure?_.push(r):v.push(r),r.observers&&H(r))}}function U(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)U(e.tOwned[t]);delete e.tOwned}if(h&&h.running&&e.pure)W(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)U(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}h&&h.running?e.tState=0:e.state=0}function W(e,t){if(t||(e.tState=0,h.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)W(e.owned[t])}function G(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function K(e,t,n){try{for(let n of t)n(e)}catch(e){q(e,n&&n.owner||null)}}function q(e,t=m){let n=l&&t&&t.context&&t.context[l],r=G(e);if(!n)throw r;v?v.push({fn(){K(r,n,t)},state:d}):K(r,n,t)}function J(e){if(typeof e==`function`&&!e.length)return J(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=J(e[n]);if(Array.isArray(r)){if(r.length<32768)t.push.apply(t,r);else for(let e=0;e<r.length;e++)t.push(r[e])}else t.push(r)}return t}return e}function le(e,t){return function(t){let n;return S(()=>n=T(()=>(m.context={...m.context,[e]:t.value},oe(()=>t.children))),void 0),n}}var ue=Symbol(`fallback`);function Y(e){for(let t=0;t<e.length;t++)e[t]()}function de(e,t,n={}){let r=[],i=[],a=[],o=0,c=t.length>1?[]:null;return D(()=>Y(a)),()=>{let l=e()||[],u=l.length,d,f;return l[s],T(()=>{let e,t,s,m,h,g,_,v,y;if(u===0)o!==0&&(Y(a),a=[],r=[],i=[],o=0,c&&=[]),n.fallback&&(r=[ue],i[0]=b(e=>(a[0]=e,n.fallback())),o=1);else if(o===0){for(i=Array(u),f=0;f<u;f++)r[f]=l[f],i[f]=b(p);o=u}else{for(s=Array(u),m=Array(u),c&&(h=Array(u)),g=0,_=Math.min(o,u);g<_&&r[g]===l[g];g++);for(_=o-1,v=u-1;_>=g&&v>=g&&r[_]===l[v];_--,v--)s[v]=i[_],m[v]=a[_],c&&(h[v]=c[_]);for(e=new Map,t=Array(v+1),f=v;f>=g;f--)y=l[f],d=e.get(y),t[f]=d===void 0?-1:d,e.set(y,f);for(d=g;d<=_;d++)y=r[d],f=e.get(y),f!==void 0&&f!==-1?(s[f]=i[d],m[f]=a[d],c&&(h[f]=c[d]),f=t[f],e.set(y,f)):a[d]();for(f=g;f<u;f++)f in s?(i[f]=s[f],a[f]=m[f],c&&(c[f]=h[f],c[f](f))):i[f]=b(p);i=i.slice(0,o=u),r=l.slice(0)}return i});function p(e){if(a[f]=e,c){let[e,n]=x(f);return c[f]=n,t(l[f],e)}return t(l[f])}}}var X=!1;function fe(){X=!0}function Z(t,i){if(X&&e.context){let a=e.context;n(r());let o=T(()=>t(i||{}));return n(a),o}return T(()=>t(i||{}))}function Q(){return!0}var $={get(e,t,n){return t===a?n:e.get(t)},has(e,t){return t===a||e.has(t)},set:Q,deleteProperty:Q,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Q,deleteProperty:Q}},ownKeys(e){return e.keys()}};function pe(e,...t){let n=t.length;if(o&&a in e){let r=n>1?t.flat():t[0],i=new Set,a=t.map(t=>{let n=t.filter(e=>!i.has(e)&&(i.add(e),!0));return new Proxy({get(t){return n.includes(t)?e[t]:void 0},has(t){return n.includes(t)&&t in e},keys(){return n.filter(t=>t in e)}},$)});return a.push(new Proxy({get(t){return r.includes(t)?void 0:e[t]},has(t){return!r.includes(t)&&t in e},keys(){return Object.keys(e).filter(e=>!r.includes(e))}},$)),a}let r=[];for(let e=0;e<=n;e++)r[e]={};for(let i of Object.getOwnPropertyNames(e)){let a=n;for(let e=0;e<t.length;e++)if(t[e].includes(i)){a=e;break}let o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}var me=e=>`Stale read from <${e}>.`;function he(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return w(de(()=>e.each,e.children,t||void 0))}function ge(e){let t=e.keyed,n=w(()=>e.when,void 0,void 0),r=t?n:w(n,void 0,{equals:(e,t)=>!e==!t});return w(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?T(()=>a(t?i:()=>{if(!T(r))throw me(`Show`);return n()})):a}return e.fallback},void 0,void 0)}var _e=k();function ve(t){let r=0,i,a,o,s,c,[l,u]=x(!1),d=M(),f={increment:()=>{++r===1&&u(!0)},decrement:()=>{--r===0&&u(!1)},inFallback:l,effects:[],resolved:!1},p=re();if(e.context&&e.load){let t=e.getContextId(),r=e.load(t);if(r&&(typeof r!=`object`||r.s!==1?o=r:e.gather(t)),o&&o!==`$$f`){let[r,i]=x(void 0,{equals:!1});s=r,o.then(()=>{if(e.done)return i();e.gather(t),n(a),i(),n()},e=>{c=e,i()})}}let m=A(_e);m&&(i=m.register(f.inFallback));let h;return D(()=>h&&h()),Z(d.Provider,{value:f,get children(){return w(()=>{if(c)throw c;if(a=e.context,s){s(),s=void 0;return}a&&o===`$$f`&&n();let r=w(()=>t.children);return w(e=>{let s=f.inFallback(),{showContent:c=!0,showFallback:l=!0}=i?i():{};if((!s||o&&o!==`$$f`)&&c)return f.resolved=!0,h&&h(),h=a=o=void 0,ae(f.effects),r();if(l)return h?e:b(e=>(h=e,a&&=(n({id:a.id+`F`,count:0}),void 0),t.fallback),p)})})}})}export{A as S,D as _,ve as a,pe as b,k as c,S as d,b as f,E as g,ne as h,ge as i,C as l,fe as m,s as n,ee as o,x as p,he as r,Z as s,a as t,w as u,te as v,T as x,e as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e,f as t,m as n,u as r,x as i,y as a}from"./solid.8gBSxpeo.js";var o=e=>r(()=>e());function s(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null){if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&(d=l.get(t[c]))!=null&&d===r+u;)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++}else t[o++].remove()}}}var c=`_$DX_DELEGATE`;function l(e,n,r,i={}){let a;return t(t=>{a=t,n===document?e():y(n,e(),n.firstChild?null:void 0,r)},i.owner),()=>{a(),n.textContent=``}}function u(e,t,n,r){let a,o=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},s=t?()=>i(()=>document.importNode(a||=o(),!0)):()=>(a||=o()).cloneNode(!0);return s.cloneNode=s,s}function d(e,t=window.document){let n=t[c]||(t[c]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,T))}}function f(e,t,n){w(e)||(e[t]=(t===`value`||t===`defaultValue`)&&(e.nodeName===`INPUT`||e.nodeName===`TEXTAREA`)?n??``:n)}function p(e,t,n){w(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function m(e,t){w(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function h(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function g(e,t,n){if(!t)return n?p(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function _(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function v(e,t,n){return i(()=>e(t,n))}function y(t,n,r,i){if(r!==void 0&&!i&&(i=[]),typeof n!=`function`)return E(t,n,i,r);e(e=>E(t,n(),e,r),i)}function b(e,t,n={}){if(globalThis._$HY.done)return l(e,t,[...t.childNodes],n);a.completed=globalThis._$HY.completed,a.events=globalThis._$HY.events,a.load=e=>globalThis._$HY.r[e],a.has=e=>e in globalThis._$HY.r,a.gather=e=>A(t,e),a.registry=new Map,a.context={id:n.renderId||``,count:0};try{return A(t,n.renderId),l(e,t,[...t.childNodes],n)}finally{a.context=null}}function x(e){let t,n;return!w()||!(t=a.registry.get(n=j()))?e():(a.completed&&a.completed.add(t),a.registry.delete(n),t)}function S(e){let t=e,n=0,r=[];if(w(e))for(;t;){if(t.nodeType===8){let e=t.nodeValue;if(e===`$`)n++;else if(e===`/`){if(n===0)return[t,r];n--}}r.push(t),t=t.nextSibling}return[t,r]}function C(){a.events&&!a.events.queued&&(queueMicrotask(()=>{let{completed:e,events:t}=a;if(t){for(t.queued=!1;t.length;){let[n,r]=t[0];if(!e.has(n))return;t.shift(),T(r)}a.done&&(a.events=_$HY.events=null,a.completed=_$HY.completed=null)}}),a.events.queued=!0)}function w(e){return!!a.context&&!a.done&&(!e||e.isConnected)}function T(e){if(a.registry&&a.events&&a.events.find(([t,n])=>n===e))return;let t=e.target,n=`$$${e.type}`,r=e.target,i=e.currentTarget,o=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),s=()=>{let r=t[n];if(r&&!t.disabled){let i=t[`${n}Data`];if(i===void 0?r.call(t,e):r.call(t,i,e),e.cancelBubble)return}return t.host&&typeof t.host!=`string`&&!t.host._$host&&t.contains(e.target)&&o(t.host),!0},c=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),a.registry&&!a.done&&(a.done=_$HY.done=!0),e.composedPath){let n=e.composedPath();o(n[0]);for(let e=0;e<n.length-2&&(t=n[e],s());e++){if(t._$host){t=t._$host,c();break}if(t.parentNode===i)break}}else c();o(r)}function E(t,n,r,i,a){let o=w(t);if(o){!r&&(r=[...t.childNodes]);let e=[];for(let t=0;t<r.length;t++){let n=r[t];n.nodeType===8&&n.data.slice(0,2)===`!$`?n.remove():e.push(n)}r=e}for(;typeof r==`function`;)r=r();if(n===r)return r;let c=typeof n,l=i!==void 0;if(t=l&&r[0]&&r[0].parentNode||t,c===`string`||c===`number`){if(o||c===`number`&&(n=n.toString(),n===r))return r;if(l){let e=r[0];e&&e.nodeType===3?e.data!==n&&(e.data=n):e=document.createTextNode(n),r=k(t,r,i,e)}else r=r!==``&&typeof r==`string`?t.firstChild.data=n:t.textContent=n}else if(n==null||c===`boolean`){if(o)return r;r=k(t,r,i)}else if(c===`function`)return e(()=>{let e=n();for(;typeof e==`function`;)e=e();r=E(t,e,r,i)}),()=>r;else if(Array.isArray(n)){let c=[],u=r&&Array.isArray(r);if(D(c,n,r,a))return e(()=>r=E(t,c,r,i,!0)),()=>r;if(o){if(!c.length)return r;if(i===void 0)return r=[...t.childNodes];let e=c[0];if(e.parentNode!==t)return r;let n=[e];for(;(e=e.nextSibling)!==i;)n.push(e);return r=n}if(c.length===0){if(r=k(t,r,i),l)return r}else u?r.length===0?O(t,c,i):s(t,r,c):(r&&k(t),O(t,c));r=c}else if(n.nodeType){if(o&&n.parentNode)return r=l?[n]:n;if(Array.isArray(r)){if(l)return r=k(t,r,i,n);k(t,r,null,n)}else r==null||r===``||!t.firstChild?t.appendChild(n):t.replaceChild(n,t.firstChild);r=n}return r}function D(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(o!=null&&o!==!0&&o!==!1){if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=D(e,o,s)||i;else if(c===`function`){if(r){for(;typeof o==`function`;)o=o();i=D(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0}else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}}return i}function O(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function k(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}function A(e,t){let n=e.querySelectorAll(`*[data-hk]`);for(let e=0;e<n.length;e++){let r=n[e],i=r.getAttribute(`data-hk`);(!t||i.startsWith(t))&&!a.registry.has(i)&&a.registry.set(i,r)}}function j(){return a.getNextContextId()}var M=(...e)=>(n(),b(...e));export{S as a,o as c,p as d,f,v as g,u as h,x as i,l,g as m,m as n,M as o,_ as p,d as r,y as s,h as t,C as u};
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
|
|
2
|
-
import { S as createAstro, i as renderComponent, u as renderTemplate } from "./server_B5N27szj.mjs";
|
|
3
|
-
import { t as createComponent$1 } from "./compiler_O7J1rlsi.mjs";
|
|
4
|
-
import { n as useTranslation, r as apiClient } from "./i18n_BqZ4e24O.mjs";
|
|
5
|
-
import { t as $$DashboardLayout } from "./DashboardLayout_C6I2H2jO.mjs";
|
|
6
|
-
import { t as PageHeader } from "./PageHeader_CBOioOjo.mjs";
|
|
7
|
-
import { createComponent, escape, ssr, ssrAttribute, ssrHydrationKey } from "solid-js/web";
|
|
8
|
-
import { For, Show, createSignal, onMount } from "solid-js";
|
|
9
|
-
//#region src/components/apps/settings/ResourceHubs.tsx
|
|
10
|
-
var _tmpl$ = [
|
|
11
|
-
"<div",
|
|
12
|
-
" class=\"notice notice--error\">",
|
|
13
|
-
"</div>"
|
|
14
|
-
];
|
|
15
|
-
var _tmpl$2 = [
|
|
16
|
-
"<div",
|
|
17
|
-
" class=\"resource-hub\"><!--$-->",
|
|
18
|
-
"<!--/--><div class=\"access-grid\"><section class=\"card\"><h3>",
|
|
19
|
-
"</h3><button class=\"btn btn-primary\" type=\"button\">+ <!--$-->",
|
|
20
|
-
"<!--/--></button><!--$-->",
|
|
21
|
-
"<!--/--><table class=\"table\"><tbody>",
|
|
22
|
-
"</tbody></table></section><section class=\"card\"><h3>",
|
|
23
|
-
"</h3><button class=\"btn btn-primary\" type=\"button\">+ <!--$-->",
|
|
24
|
-
"<!--/--></button><!--$-->",
|
|
25
|
-
"<!--/--><table class=\"table\"><tbody>",
|
|
26
|
-
"</tbody></table></section></div></div>"
|
|
27
|
-
];
|
|
28
|
-
var _tmpl$3 = [
|
|
29
|
-
"<form",
|
|
30
|
-
" class=\"resource-form\"><input class=\"input\" required",
|
|
31
|
-
"><input class=\"input\" required",
|
|
32
|
-
"><input class=\"input\"",
|
|
33
|
-
"><button class=\"btn btn-primary\" type=\"submit\">",
|
|
34
|
-
"</button></form>"
|
|
35
|
-
];
|
|
36
|
-
var _tmpl$4 = [
|
|
37
|
-
"<button",
|
|
38
|
-
" class=\"btn btn-danger\" type=\"button\">",
|
|
39
|
-
"</button>"
|
|
40
|
-
];
|
|
41
|
-
var _tmpl$5 = [
|
|
42
|
-
"<tr",
|
|
43
|
-
"><td>",
|
|
44
|
-
"</td><td>",
|
|
45
|
-
"</td><td><button class=\"btn\" type=\"button\">",
|
|
46
|
-
"</button><!--$-->",
|
|
47
|
-
"<!--/--></td></tr>"
|
|
48
|
-
];
|
|
49
|
-
var _tmpl$6 = [
|
|
50
|
-
"<tr",
|
|
51
|
-
"><td>",
|
|
52
|
-
"</td><td>",
|
|
53
|
-
"</td><td>",
|
|
54
|
-
"</td><td><button class=\"btn\" type=\"button\">",
|
|
55
|
-
"</button><button class=\"btn btn-danger\" type=\"button\">",
|
|
56
|
-
"</button></td></tr>"
|
|
57
|
-
];
|
|
58
|
-
function AccessManager() {
|
|
59
|
-
const { t } = useTranslation();
|
|
60
|
-
const [roles, setRoles] = createSignal([]);
|
|
61
|
-
const [tenants, setTenants] = createSignal([]);
|
|
62
|
-
const [editingRole, setEditingRole] = createSignal(null);
|
|
63
|
-
const [editingTenant, setEditingTenant] = createSignal(null);
|
|
64
|
-
const [error, setError] = createSignal("");
|
|
65
|
-
const load = async () => {
|
|
66
|
-
try {
|
|
67
|
-
setRoles(await apiClient.listRoles());
|
|
68
|
-
setTenants((await apiClient.listTenants({ limit: 100 })).data ?? []);
|
|
69
|
-
} catch (err) {
|
|
70
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
onMount(load);
|
|
74
|
-
return ssr(_tmpl$2, ssrHydrationKey(), escape(createComponent(Show, {
|
|
75
|
-
get when() {
|
|
76
|
-
return error();
|
|
77
|
-
},
|
|
78
|
-
get children() {
|
|
79
|
-
return ssr(_tmpl$, ssrHydrationKey(), escape(error()));
|
|
80
|
-
}
|
|
81
|
-
})), escape(t("access.roles")), escape(t("common.create")), escape(createComponent(Show, {
|
|
82
|
-
get when() {
|
|
83
|
-
return editingRole();
|
|
84
|
-
},
|
|
85
|
-
children: (role) => ssr(_tmpl$3, ssrHydrationKey(), ssrAttribute("placeholder", escape(t("resources.name"), true), false) + ssrAttribute("value", escape(role().name ?? "", true), false), ssrAttribute("placeholder", escape(t("resources.slug"), true), false) + ssrAttribute("value", escape(role().slug ?? "", true), false), ssrAttribute("placeholder", escape(t("access.permissions"), true), false) + ssrAttribute("value", escape((role().permissions ?? []).join(", "), true), false), escape(t("common.save")))
|
|
86
|
-
})), escape(createComponent(For, {
|
|
87
|
-
get each() {
|
|
88
|
-
return roles();
|
|
89
|
-
},
|
|
90
|
-
children: (role) => ssr(_tmpl$5, ssrHydrationKey(), escape(role.name), escape(role.slug), escape(t("common.edit")), escape(createComponent(Show, {
|
|
91
|
-
get when() {
|
|
92
|
-
return !role.is_system;
|
|
93
|
-
},
|
|
94
|
-
get children() {
|
|
95
|
-
return ssr(_tmpl$4, ssrHydrationKey(), escape(t("common.delete")));
|
|
96
|
-
}
|
|
97
|
-
})))
|
|
98
|
-
})), escape(t("access.tenants")), escape(t("common.create")), escape(createComponent(Show, {
|
|
99
|
-
get when() {
|
|
100
|
-
return editingTenant();
|
|
101
|
-
},
|
|
102
|
-
children: (tenant) => ssr(_tmpl$3, ssrHydrationKey(), ssrAttribute("placeholder", escape(t("resources.name"), true), false) + ssrAttribute("value", escape(tenant().name ?? "", true), false), ssrAttribute("placeholder", escape(t("resources.slug"), true), false) + ssrAttribute("value", escape(tenant().slug ?? "", true), false), ssrAttribute("placeholder", escape(t("access.domain"), true), false) + ssrAttribute("value", escape(tenant().domain ?? "", true), false), escape(t("common.save")))
|
|
103
|
-
})), escape(createComponent(For, {
|
|
104
|
-
get each() {
|
|
105
|
-
return tenants();
|
|
106
|
-
},
|
|
107
|
-
children: (tenant) => ssr(_tmpl$6, ssrHydrationKey(), escape(tenant.name), escape(tenant.slug), escape(tenant.status), escape(t("common.edit")), escape(t("common.delete")))
|
|
108
|
-
})));
|
|
109
|
-
}
|
|
110
|
-
//#endregion
|
|
111
|
-
//#region src/pages/settings/access.astro
|
|
112
|
-
var access_exports = /* @__PURE__ */ __exportAll({
|
|
113
|
-
default: () => $$Access,
|
|
114
|
-
file: () => $$file,
|
|
115
|
-
url: () => $$url
|
|
116
|
-
});
|
|
117
|
-
createAstro("https://astro.build");
|
|
118
|
-
var $$Access = createComponent$1(($$result, $$props, $$slots) => {
|
|
119
|
-
const Astro = $$result.createAstro($$props, $$slots);
|
|
120
|
-
Astro.self = $$Access;
|
|
121
|
-
const { t } = Astro.locals;
|
|
122
|
-
return renderTemplate`${renderComponent($$result, "DashboardLayout", $$DashboardLayout, { "title": t("access.title") }, { "default": ($$result) => renderTemplate`${renderComponent($$result, "PageHeader", PageHeader, {
|
|
123
|
-
"title": t("access.title"),
|
|
124
|
-
"description": t("access.description")
|
|
125
|
-
})}${renderComponent($$result, "AccessManager", AccessManager, {
|
|
126
|
-
"client:load": true,
|
|
127
|
-
"client:component-hydration": "load",
|
|
128
|
-
"client:component-path": "/home/runner/work/cms/cms/apps/admin/src/components/apps/settings/ResourceHubs.tsx",
|
|
129
|
-
"client:component-export": "AccessManager"
|
|
130
|
-
})}` })}`;
|
|
131
|
-
}, "/home/runner/work/cms/cms/apps/admin/src/pages/settings/access.astro", void 0);
|
|
132
|
-
var $$file = "/home/runner/work/cms/cms/apps/admin/src/pages/settings/access.astro";
|
|
133
|
-
var $$url = "/settings/access";
|
|
134
|
-
//#endregion
|
|
135
|
-
//#region \0virtual:astro:page:src/pages/settings/access@_@astro
|
|
136
|
-
var page = () => access_exports;
|
|
137
|
-
//#endregion
|
|
138
|
-
export { page };
|