@oktis-works/admin 0.4.25 → 0.4.27

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.
Files changed (81) hide show
  1. package/dist/client/_astro/{ActivityWidget.DaftIB1V.js → ActivityWidget.Di9qEuF1.js} +2 -2
  2. package/dist/client/_astro/AdminBar.DX6xBHtO.js +253 -0
  3. package/dist/client/_astro/{AtGlanceWidget.Bx6FJSG5.js → AtGlanceWidget.Buy1lfZh.js} +2 -2
  4. package/dist/client/_astro/ContentEditor.Bkm2ptVg.js +1 -0
  5. package/dist/client/_astro/ContentEditor.CaTPZkqZ.js +3 -0
  6. package/dist/client/_astro/{ContentTypeWorkspace.CFzwh3Rc.js → ContentTypeWorkspace.h-3BeCUg.js} +1 -1
  7. package/dist/client/_astro/CustomFieldsManager.CJ-l_Rhc.js +5 -0
  8. package/dist/client/_astro/DashboardHome.N13R6lSD.js +1 -0
  9. package/dist/client/_astro/{DashboardLayout.astro_astro_type_script_index_0_lang.sBNUxHjt.js → DashboardLayout.astro_astro_type_script_index_0_lang.CkaCqwSJ.js} +1 -1
  10. package/dist/client/_astro/{Footer.BdjbyxEj.js → Footer.CjZUc86f.js} +2 -2
  11. package/dist/client/_astro/GeneralSettings.BBp-NFgV.js +1 -0
  12. package/dist/client/_astro/LogsManager.Dkd8zzbn.js +1 -0
  13. package/dist/client/_astro/MediaLibrary.Dgo-v1WT.js +1 -0
  14. package/dist/client/_astro/{MenuManager.CfLmtMhF.js → MenuManager.CsclR9mh.js} +1 -1
  15. package/dist/client/_astro/{PluginManager.Ba2R7ZVx.js → PluginManager.DBx_6c-N.js} +2 -2
  16. package/dist/client/_astro/PostTypesManager.CIrsbzy8.js +1 -0
  17. package/dist/client/_astro/{QuickDraftWidget.D7GsK3YO.js → QuickDraftWidget.TBJWatfu.js} +2 -2
  18. package/dist/client/_astro/ResourceHubs.BBIQXhdV.js +1 -0
  19. package/dist/client/_astro/TaxonomiesManager.jy5cAbSF.js +1 -0
  20. package/dist/client/_astro/TaxonomyTermsManager.DBmTIPqu.js +1 -0
  21. package/dist/client/_astro/{ThemeManager.C4t-yZay.js → ThemeManager.BtHWshy7.js} +2 -2
  22. package/dist/client/_astro/UserCreateForm.Dm-zwJdM.js +1 -0
  23. package/dist/client/_astro/UsersManager.Dba4qeHD.js +1 -0
  24. package/dist/client/_astro/WebhooksManager.Bc3mp2PR.js +1 -0
  25. package/dist/client/_astro/client.BB1iDAO-.js +1 -0
  26. package/dist/client/_astro/custom-fields.3g1PTmGl.css +1 -0
  27. package/dist/client/_astro/{dist.BqeNZlzo.js → dist.D3896CDR.js} +1 -1
  28. package/dist/client/_astro/extensions.BpYLaw9Y.js +1 -0
  29. package/dist/client/_astro/{i18n.Tk18hqHh.js → i18n.BmX2Cv4K.js} +1 -1
  30. package/dist/client/_astro/pt-BR.D0RvDyZb.js +1 -0
  31. package/dist/client/_astro/{version.CebqHGW-.js → version.KwdsE3xt.js} +1 -1
  32. package/dist/client/_astro/web.D0f8iaHB.js +1 -0
  33. package/dist/server/chunks/{ContentEditor_CQk_6h1t.mjs → ContentEditor_BAd4nlv2.mjs} +2 -2
  34. package/dist/server/chunks/{DashboardLayout_CqvMjjYn.mjs → DashboardLayout_DAEE58ck.mjs} +3 -3
  35. package/dist/server/chunks/{MediaLibrary_B4keRybP.mjs → MediaLibrary_D_D6QsW6.mjs} +2 -2
  36. package/dist/server/chunks/{_slug__mIKEjvrh.mjs → _slug__BhflTdXU.mjs} +1 -1
  37. package/dist/server/chunks/{access_DvVP1tqA.mjs → access_C95-GXoF.mjs} +2 -2
  38. package/dist/server/chunks/{custom-fields_CmIcozzc.mjs → custom-fields_BQbAtZxM.mjs} +288 -115
  39. package/dist/server/chunks/{edit_DqC_Nps4.mjs → edit_6TixpjDF.mjs} +2 -2
  40. package/dist/server/chunks/{general_CZ7X7tdH.mjs → general_DUjjZ_-T.mjs} +2 -2
  41. package/dist/server/chunks/{i18n_BgHPm3Sm.mjs → i18n_kKFSn0qM.mjs} +10 -1
  42. package/dist/server/chunks/{index_CyHvS4pW.mjs → index_B50ZjjUk.mjs} +1 -1
  43. package/dist/server/chunks/{index_DDkEfSMI.mjs → index_BglwlzqY.mjs} +2 -2
  44. package/dist/server/chunks/{index_CP7KMELH.mjs → index_DNjJcOGC.mjs} +3 -3
  45. package/dist/server/chunks/{index_DgUcsUQA.mjs → index_DSZy16ce.mjs} +2 -2
  46. package/dist/server/chunks/{index_DolH3stf.mjs → index_DpN7QhGC.mjs} +2 -2
  47. package/dist/server/chunks/{logs_BFk6cplP.mjs → logs_Bp8d9_Px.mjs} +2 -2
  48. package/dist/server/chunks/{menus_BfYZk_F0.mjs → menus_6tx4Wb3O.mjs} +2 -2
  49. package/dist/server/chunks/{new_CYRfK7a7.mjs → new_Be61W4xo.mjs} +2 -2
  50. package/dist/server/chunks/{new_C_L_rBPW.mjs → new_Dg513gwZ.mjs} +2 -2
  51. package/dist/server/chunks/{plugins_DJ9Kf48n.mjs → plugins_BWiW4ORx.mjs} +2 -2
  52. package/dist/server/chunks/{post-types_CiJHVi2c.mjs → post-types_Bf7SKaTB.mjs} +2 -2
  53. package/dist/server/chunks/{pt-BR_CoM1872j.mjs → pt-BR_Bw9HDc48.mjs} +9 -0
  54. package/dist/server/chunks/{taxonomies_6uOLX1R8.mjs → taxonomies_CwJqz15G.mjs} +2 -2
  55. package/dist/server/chunks/{taxonomy_BQyx6c5F.mjs → taxonomy_DbPliXp3.mjs} +2 -2
  56. package/dist/server/chunks/{themes_DXYzDjvO.mjs → themes_C0BNk0Bp.mjs} +2 -2
  57. package/dist/server/chunks/{upload_CgSlFpr0.mjs → upload_njTIwS_V.mjs} +2 -2
  58. package/dist/server/chunks/{webhooks_O_n4uQYO.mjs → webhooks_B3aD5_Tg.mjs} +2 -2
  59. package/dist/server/entry.mjs +22 -22
  60. package/dist/server/virtual_astro_middleware.mjs +1 -1
  61. package/package.json +1 -1
  62. package/dist/client/_astro/AdminBar.B-diRxPt.js +0 -253
  63. package/dist/client/_astro/ContentEditor.B1b1Ixz0.js +0 -3
  64. package/dist/client/_astro/ContentEditor.DGTZ51kU.js +0 -1
  65. package/dist/client/_astro/CustomFieldsManager.DqCE6rSX.js +0 -5
  66. package/dist/client/_astro/DashboardHome.HrqKA0mK.js +0 -1
  67. package/dist/client/_astro/GeneralSettings.C5lXnnvB.js +0 -1
  68. package/dist/client/_astro/LogsManager.BSXD0gFG.js +0 -1
  69. package/dist/client/_astro/MediaLibrary.9tlXDGsx.js +0 -1
  70. package/dist/client/_astro/PostTypesManager.DqbyhhLF.js +0 -1
  71. package/dist/client/_astro/ResourceHubs.sI10AY3z.js +0 -1
  72. package/dist/client/_astro/TaxonomiesManager.BFd3zjNe.js +0 -1
  73. package/dist/client/_astro/TaxonomyTermsManager.C7ClYXtt.js +0 -1
  74. package/dist/client/_astro/UserCreateForm.B-7pKOO6.js +0 -1
  75. package/dist/client/_astro/UsersManager.aI6-3vtM.js +0 -1
  76. package/dist/client/_astro/WebhooksManager.C3E91U9V.js +0 -1
  77. package/dist/client/_astro/client.BDaUmf7m.js +0 -1
  78. package/dist/client/_astro/custom-fields.pl-GPt9A.css +0 -1
  79. package/dist/client/_astro/extensions.BD4YTWQq.js +0 -1
  80. package/dist/client/_astro/pt-BR.BvjbjXKW.js +0 -1
  81. package/dist/client/_astro/web.C8wWxyYF.js +0 -1
@@ -0,0 +1,5 @@
1
+ import{f as e,g as t,i as n,l as r,r as i,s as a,u as o}from"./solid.TEtyrbLc.js";import{a as s,c,d as l,f as u,i as d,m as f,r as p,s as m,t as h,u as g}from"./web.D0f8iaHB.js";import{n as _}from"./i18n.BmX2Cv4K.js";import{t as v}from"./api.DSIz0zxF.js";import{n as y,t as b}from"./lucide.DlU56wZ1.js";var x=f(`<div class=field-type-picker__panel role=listbox><input type=search class=field-type-picker__search placeholder="Buscar tipo de campo..."><!$><!/>`),S=f(`<div class=field-type-picker><button type=button class=field-type-picker__trigger><span class=field-type-picker__selected><i aria-hidden=true></i><!$><!/></span><span aria-hidden=true></span></button><!$><!/>`),C=f(`<div class=field-type-picker__group><div class=field-type-picker__group-label><i aria-hidden=true></i><!$><!/></div><!$><!/>`),w=f(`<span class=field-type-picker__hint>sem lógica condicional`),T=f(`<button type=button role=option class=field-type-picker__option><i aria-hidden=true></i><span></span><!$><!/>`);function E(r){let[c,f]=e(!1),[p,h]=e(``),_=()=>r.types.find(e=>e.type===r.value),v=()=>{let e=p().toLowerCase();return e?r.types.filter(t=>t.label.toLowerCase().includes(e)||t.type.includes(e)):r.types},E=()=>{queueMicrotask(()=>b({icons:y}))};return t(E),(()=>{var e=d(S),t=e.firstChild,y=t.firstChild,b=y.firstChild,D=b.nextSibling,[O,k]=s(D.nextSibling),A=y.nextSibling,j=t.nextSibling,[M,N]=s(j.nextSibling);return t.$$click=()=>{f(!c()),E()},m(y,()=>_()?.label??`Selecione o tipo`,O,k),m(A,()=>c()?`▴`:`▾`),m(e,a(n,{get when(){return c()},get children(){var e=d(x),t=e.firstChild,c=t.nextSibling,[_,y]=s(c.nextSibling);return t.$$input=e=>{h(e.currentTarget.value),E()},m(e,a(i,{get each(){return r.categories},children:e=>{let t=v().filter(t=>t.category===e.id);return a(n,{get when(){return t.length>0},get children(){var c=d(C),u=c.firstChild,p=u.firstChild,_=p.nextSibling,[v,y]=s(_.nextSibling),b=u.nextSibling,[x,S]=s(b.nextSibling);return m(u,()=>e.label,v,y),m(c,a(i,{each:t,children:e=>(()=>{var t=d(T),i=t.firstChild,c=i.nextSibling,u=c.nextSibling,[p,_]=s(u.nextSibling);return t.$$click=()=>{r.onChange(e.type),f(!1),h(``),E()},m(c,()=>e.label),m(t,a(n,{get when(){return!e.supportsConditions},get children(){return d(w)}}),p,_),o(n=>{var a=r.value===e.type,o=r.value===e.type,s=e.icon;return a!==n.e&&l(t,`aria-selected`,n.e=a),o!==n.t&&t.classList.toggle(`is-selected`,n.t=o),s!==n.a&&l(i,`data-lucide`,n.a=s),n},{e:void 0,t:void 0,a:void 0}),g(),t})()}),x,S),o(()=>l(p,`data-lucide`,e.icon)),c}})}}),_,y),o(()=>u(t,`value`,p())),g(),e}}),M,N),o(e=>{var n=c(),r=_()?.icon??`box`;return n!==e.e&&l(t,`aria-expanded`,e.e=n),r!==e.t&&l(b,`data-lucide`,e.t=r),e},{e:void 0,t:void 0}),g(),e})()}p([`click`,`input`]);var D=f(`<span class=muted>`),O=f(`<div class=acf-conditional><div class=acf-settings-heading><strong></strong><span class=muted></span></div><!$><!/><button type=button class="btn btn-secondary btn-sm">+ <!$><!/></button><!$><!/>`),k=f(`<div class=acf-condition-group><!$><!/><button type=button class="btn btn-secondary btn-sm">+ <!$><!/>`),A=f(`<input class=input>`),j=f(`<div class=acf-condition-row><select class=input><option value></option><!$><!/></select><select class=input><option value=eq></option><option value=neq></option><option value=gt></option><option value=lt></option><option value=contains></option><option value=has_any_value></option><option value=has_no_value></option></select><!$><!/><button type=button class="btn btn-danger btn-sm">×`),M=f(`<option>`),N=f(`<label><!$><!/><input class=input type=number min=1>`),P=f(`<label><!$><!/><select class=input><option value=br>&lt;br&gt;</option><option value=wpautop></option><option value=none>`),F=f(`<div class=acf-settings-section><h5></h5><div class=acf-settings-grid><label><!$><!/><input class=input></label><label><!$><!/><input class=input></label><label><!$><!/><input class=input type=number min=0></label><label><!$><!/><input class=input type=number min=0></label><!$><!/>`),I=f(`<div class=acf-settings-section><h5></h5><div class=acf-settings-grid><label><!$><!/><input class=input type=number></label><label><!$><!/><input class=input type=number></label><label><!$><!/><input class=input type=number step=any>`),L=f(`<div class=acf-settings-section><h5></h5><div class=acf-settings-grid><label class=acf-settings-wide><!$><!/><textarea class=input rows=5 placeholder=valor|Rótulo></textarea></label><label><!$><!/><select class=input><option value=vertical></option><option value=horizontal></option></select></label><label class=checkbox-label><input type=checkbox> <!$><!/></label><label class=checkbox-label><input type=checkbox> <!$><!/>`),ee=f(`<div class=acf-settings-section><h5></h5><div class=acf-settings-grid><label><!$><!/><select class=input><option value=array></option><option value=id></option><option value=url>URL</option></select></label><label><!$><!/><input class=input></label><label><!$><!/><select class=input><option value=all></option><option value=uploadedToPost></option></select></label><label><!$><!/><input class=input placeholder="jpg, png, pdf"></label><label><!$><!/><input class=input type=number></label><label><!$><!/><input class=input type=number></label><label><!$><!/><input class=input type=number></label><label><!$><!/><input class=input type=number>`),R=f(`<div class=acf-settings-section><h5></h5><div class=acf-settings-grid><label><!$><!/><select class=input><option value=all></option><option value=visual>Visual</option><option value=text>Text</option></select></label><label><!$><!/><select class=input><option value=full>Full</option><option value=basic>Basic</option></select></label><label class=checkbox-label><input type=checkbox> <!$><!/>`),z=f(`<div class=acf-settings-section><h5></h5><div class=acf-settings-grid><label><!$><!/><input class=input></label><label><!$><!/><input class=input></label><label><!$><!/><input class=input type=number min=0 max=6>`),B=f(`<div class=acf-settings-section><h5></h5><label class=checkbox-label><input type=checkbox> <!$><!/>`),V=f(`<div class=acf-settings-section><h5></h5><div class=acf-settings-grid><label><!$><!/><input class=input></label><label><!$><!/><input class=input type=number></label><label><!$><!/><input class=input>`),H=f(`<div class=acf-settings-section><h5></h5><div class=acf-settings-grid><label><!$><!/><input class=input></label><label><!$><!/><input class=input></label><label><!$><!/><select class=input><option value=id>ID</option><option value=object>Object</option><option value=array>Array</option></select></label><label class=checkbox-label><input type=checkbox> <!$><!/></label><label class=checkbox-label><input type=checkbox> <!$><!/>`),U=f(`<div class=acf-settings-section><h5></h5><div class=acf-settings-grid><label><!$><!/><input class=input></label><label class=checkbox-label><input type=checkbox> <!$><!/>`),W=f(`<div class=acf-settings-section><h5></h5><label><!$><!/><select class=input><option value=array>Array</option><option value=url>URL</option><option value=id>ID`),G=f(`<div class=acf-settings-section><h5></h5><label class=acf-settings-wide><!$><!/><textarea class=input rows=3>`),K=f(`<div class=acf-settings-section><h5></h5><div class=acf-settings-grid><label><!$><!/><select class=input><option value=block>Block</option><option value=table>Table</option><option value=row>Row</option></select></label><label><!$><!/><input class=input type=number min=0></label><label><!$><!/><input class=input type=number min=0></label><label><!$><!/><input class=input></label><label><!$><!/><input class=input placeholder=field_name>`),te=f(`<div class=acf-field-settings><div class=acf-settings-section><h5></h5><div class=acf-settings-grid><label><!$><!/><input class=input></label><label><!$><!/><input class=input pattern=[a-zA-Z0-9_-]+></label><label class=acf-settings-wide><!$><!/><textarea class=input rows=2></textarea></label><label class=checkbox-label><input type=checkbox> <!$><!/></label><label><!$><!/><input class=input></label><label><!$><!/><input class=input></label></div></div><div class=acf-settings-section><h5></h5><div class=acf-settings-grid><label><!$><!/><input class=input type=number min=0 max=100></label><label><!$><!/><select class=input><option value=top></option><option value=left></option></select></label><label><!$><!/><select class=input><option value=above></option><option value=below></option></select></label></div></div><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/>`),q=f(`<div class=acf-type-modal-backdrop role=presentation><section class=acf-type-modal role=dialog aria-modal=true aria-labelledby=acf-type-modal-title><header class=acf-type-modal__header><div><span class=acf-eyebrow></span><h3 id=acf-type-modal-title></h3></div><button type=button class=acf-icon-button>×</button></header><div class=acf-type-modal__toolbar><input class=input type=search></div><nav class=acf-type-tabs></nav><div class=acf-type-modal__body><div class=acf-type-grid></div><aside class=acf-type-preview><span class=acf-type-preview__icon aria-hidden=true></span><h4></h4><p class=muted></p></aside></div><footer class=acf-type-modal__footer><label><!$><!/><input class=input></label><div class=editor-actions><button type=button class="btn btn-secondary"></button><button type=button class="btn btn-primary">`),J=f(`<button type=button>`),ne=f(`<p class="muted acf-type-empty">`),re=f(`<button type=button class=acf-type-tile><span class=acf-type-tile__icon aria-hidden=true></span><strong></strong><small>`),ie=f(`<div class="acf-empty-fields acf-empty-fields--compact"><p>`),Y=f(`<div class=acf-fields-list><!$><!/><!$><!/><!$><!/><button type=button class=acf-add-field>+ <!$><!/>`),ae=f(`<div class=acf-nested-fields><div class=acf-nested-heading><h5></h5></div><!$><!/>`),X=f(`<div class=acf-field-body><div class=acf-field-type-row><label></label><!$><!/></div><!$><!/><!$><!/><!$><!/>`),Z=f(`<article class=acf-field-row><div class=acf-field-header><button type=button class=acf-drag-handle data-drag-handle=true draggable=true>⠿</button><button type=button class=acf-field-toggle><span class=acf-field-number></span><span class=acf-field-title><strong></strong><small><!$><!/> · <!$><!/></small></span><span class=acf-field-name></span><span class=acf-field-type></span><span class=acf-field-chevron></span></button><div class=acf-field-actions><button type=button class=acf-row-action></button><button type=button class=acf-row-action></button><button type=button class="acf-row-action is-danger"></button></div></div><!$><!/>`),Q=f(`<div class=acf-layouts><div class=acf-nested-heading><h5></h5><button type=button class="btn btn-secondary btn-sm">+ <!$><!/></button></div><!$><!/>`),oe=f(`<div class=acf-layout-card><div class=acf-settings-grid><label><!$><!/><input class=input></label><label><!$><!/><input class=input></label><label><!$><!/><select class=input><option value=block>Block</option><option value=table>Table</option><option value=row>Row</option></select></label><button type=button class="btn btn-danger btn-sm"></button></div><div class=acf-nested-fields><div class=acf-nested-heading><h5><!$><!/> · <!$><!/></h5></div><!$><!/>`),se=f(`<div class="notice notice--error">`),ce=f(`<div class=notice>`),le=f(`<div class=acf-list-header><div><span class=acf-eyebrow></span><h3></h3><p class=muted></p></div><button type=button class="btn btn-primary">+ <!$><!/>`),ue=f(`<div class=acf-list-toolbar><label><!$><!/><select class=input><option value></option><!$><!/></select></label><input class=input>`),de=f(`<div class=acf-groups-table><div class=acf-groups-table__head><span></span><span></span><span></span><span></span><span></span></div><!$><!/>`),fe=f(`<section class="card acf-groups-card">`),pe=f(`<details class="card standard-fields-card acf-disclosure"><summary><span><strong></strong><small></small></span><span class=acf-disclosure-chevron>⌄</span></summary><div class=acf-disclosure-content><div class=standard-fields-list>`),me=f(`<div class=custom-fields-manager><!$><!/><!$><!/><!$><!/>`),he=f(`<p class=muted>`),ge=f(`<form class=acf-builder><!$><!/><div class=acf-builder-header><div><button type=button class=acf-back-link>← <!$><!/></button><span class=acf-eyebrow></span><h3></h3></div><div class=editor-actions><button type=button class="btn btn-secondary"></button><button type=submit class="btn btn-primary"></button></div></div><section class="card acf-group-identity"><label><!$><!/><input class="input acf-group-title"required></label><p class=muted></p></section><section class="card acf-builder-section"><div class=acf-section-header><div><h4></h4><p class=muted></p></div><button type=button class="btn btn-primary"></button></div><!$><!/></section><details class="card acf-builder-section acf-disclosure"><summary><span><strong></strong><small></small></span><span class=acf-disclosure-chevron>⌄</span></summary><div class=acf-disclosure-content><div class=acf-section-header><div><h4></h4></div><button type=button class="btn btn-secondary">+ <!$><!/></button></div><div class=acf-assignment><label><!$><!/><select class=input></select></label></div><!$><!/></div></details><details class="card acf-builder-section acf-disclosure"><summary><span><strong></strong><small></small></span><span class=acf-disclosure-chevron>⌄</span></summary><div class=acf-disclosure-content><div class=acf-settings-grid><label class=acf-settings-wide><!$><!/><textarea class=input rows=3></textarea></label><label><!$><!/><select class=input><option value=normal></option><option value=side></option><option value=acf_after_title></option></select></label><label><!$><!/><select class=input><option value=standard></option><option value=seamless></option><option value=grouped></option></select></label><label><!$><!/><select class=input><option value=top></option><option value=left></option></select></label><label><!$><!/><select class=input><option value=above></option><option value=below></option></select></label><label><!$><!/><input class=input type=number></label><label class=checkbox-label><input type=checkbox> <!$><!/></label></div><div class=acf-hide-on-screen><strong></strong><!$><!/>`),_e=f(`<option><!$><!/> (<!$><!/>)`),ve=f(`<div class=rule-connector>`),ye=f(`<div class=location-rule-group><!$><!/><!$><!/><button type=button class="btn btn-secondary btn-sm">+ <!$><!/>`),be=f(`<select class=input required><option value></option><!$><!/>`),xe=f(`<div class=location-rule-row><select class=input></select><select class=input><option value=eq></option><option value=neq></option></select><!$><!/><button type=button class="btn btn-danger btn-sm">`),Se=f(`<input class=input required>`),Ce=f(`<label class=checkbox-label><input type=checkbox> <!$><!/>`),we=f(`<div class=acf-empty-groups><div class=acf-empty-icon>✣</div><h4></h4><p class=muted></p><button type=button class="btn btn-primary">`),Te=f(`<small>`),Ee=f(`<div class=acf-group-list-row><div><strong></strong><small></small><!$><!/></div><span></span><span></span><span class=badge></span><div class=acf-group-actions><button type=button class="btn btn-secondary btn-sm"></button><button type=button class="btn btn-danger btn-sm">`),De=f(`<span class="badge badge-secondary">`),Oe=f(`<label class=standard-field-row><span><strong></strong><small><!$><!/> · <!$><!/></small></span><span class=standard-field-control>`),ke=f(`<input type=checkbox>`),Ae=[`title`,`slug`,`content`,`excerpt`,`featured_image`,`seo_title`,`seo_description`,`status`,`author`],je=[`content_type`,`content_slug`,`taxonomy`,`term`,`user_role`,`page_template`,`post_status`],Me=new Set([`group`,`repeater`]),Ne=new Set([`select`,`checkbox`,`radio`]),Pe=new Set([`image`,`file`,`gallery`]),Fe=new Set([`post_object`,`relationship`,`page_link`,`taxonomy`,`user`]),Ie=0;function $(e){return Ie+=1,`${e}_${typeof globalThis.crypto?.randomUUID==`function`?globalThis.crypto.randomUUID():Math.random().toString(36).slice(2)}_${Ie}`}var Le=(e=``)=>({param:`content_type`,operator:`eq`,value:e});function Re(e,t,n=`text`){return{clientId:$(`field`),type:n,name:`field_${e+1}`,label:t,required:!1,config:{},subFields:[],layouts:[]}}function ze(e){return{...e,clientId:$(`field`),required:!!e.required,config:{...e.config??{}},subFields:(e.subFields??[]).map(ze),layouts:(e.layouts??[]).map(e=>({...e,clientId:$(`layout`),subFields:e.subFields.map(ze)}))}}function Be(e,t=``){if(Array.isArray(e)){let t=e.filter(Array.isArray).map(e=>e.filter(e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.param==`string`&&typeof t.value==`string`}).map(e=>({param:e.param,operator:e.operator===`neq`?`neq`:`eq`,value:e.value})));if(t.length>0)return t}if(e&&typeof e==`object`){let t=Object.entries(e).flatMap(([e,t])=>(Array.isArray(t)?t:[t]).map(t=>({param:e,operator:`eq`,value:String(t??``)})));if(t.length>0)return[t]}return[[Le(t)]]}function Ve(e,t,n){return e.map(e=>e.clientId===t?{...e,...n}:{...e,subFields:Ve(e.subFields,t,n),layouts:e.layouts.map(e=>({...e,subFields:Ve(e.subFields,t,n)}))})}function He(e,t){return{id:e.id,type:e.type,name:e.name.trim(),label:e.label.trim()||e.name.trim(),instructions:e.instructions?.trim()||void 0,required:e.required,config:e.config,conditionalLogic:e.conditionalLogic,sortOrder:t,subFields:e.subFields.map((e,t)=>He(e,t)),layouts:e.layouts.map((e,t)=>({name:e.name.trim(),label:e.label.trim()||e.name.trim(),display:e.display??`block`,min:e.min,max:e.max,sortOrder:t,subFields:e.subFields.map((e,t)=>He(e,t))}))}}function Ue(e){if(!e||typeof e!=`object`)return{match:`ANY`,groups:[{match:`ALL`,rules:[]}]};let t=e,n=Array.isArray(t.groups)?t.groups.filter(Boolean).map(e=>{let t=e,n=Array.isArray(t.rules)?t.rules.filter(Boolean).map(e=>{let t=e;return{field:String(t.field??``),operator:String(t.operator??`eq`),value:t.value===void 0?void 0:String(t.value)}}):[];return{match:t.match===`ANY`?`ANY`:`ALL`,rules:n}}):[];return{match:t.match===`ALL`?`ALL`:`ANY`,groups:n.length>0?n:[{match:`ALL`,rules:[]}]}}function We(e,t){return t.find(t=>t.type===e.type)?.label??e.type}function Ge(e){return Array.isArray(e)?e.map(e=>{if(!e||typeof e!=`object`)return String(e);let t=e;return`${String(t.value??``)}|${String(t.label??t.value??``)}`}).join(`
2
+ `):``}function Ke(e){return e.split(`
3
+ `).map(e=>e.trim()).filter(Boolean).map(e=>{let[t=``,...n]=e.split(`|`),r=t.trim();return{value:r,label:n.join(`|`).trim()||r}})}function qe(e){let t=()=>Ue(e.value),r=t=>e.onChange(t.groups.some(e=>e.rules.length>0)?t:null),c=(t,n,i)=>{let a=Ue(e.value);a.groups=a.groups.map((e,r)=>r===t?{...e,rules:e.rules.map((e,t)=>t===n?{...e,...i}:e)}:e),r(a)};return(()=>{var f=d(O),p=f.firstChild,h=p.firstChild,_=h.nextSibling,v=p.nextSibling,[y,b]=s(v.nextSibling),x=y.nextSibling,S=x.firstChild.nextSibling,[C,w]=s(S.nextSibling),T=x.nextSibling,[E,N]=s(T.nextSibling);return m(h,()=>e.t(`settings.customFields.fieldSettings.conditionalLogic`)),m(_,()=>e.t(`settings.customFields.fieldSettings.conditionalHint`)),m(f,a(i,{get each(){return t().groups},children:(f,p)=>(()=>{var h=d(k),_=h.firstChild,[v,y]=s(_.nextSibling),b=v.nextSibling,x=b.firstChild.nextSibling,[S,C]=s(x.nextSibling);return m(h,a(i,{get each(){return f.rules},children:(f,h)=>(()=>{var _=d(j),v=_.firstChild,y=v.firstChild,b=y.nextSibling,[x,S]=s(b.nextSibling),C=v.nextSibling,w=C.firstChild,T=w.nextSibling,E=T.nextSibling,D=E.nextSibling,O=D.nextSibling,k=O.nextSibling,N=k.nextSibling,P=C.nextSibling,[F,I]=s(P.nextSibling),L=F.nextSibling;return v.addEventListener(`change`,e=>c(p(),h(),{field:e.currentTarget.value})),m(y,()=>e.t(`settings.customFields.fieldSettings.chooseField`)),m(v,a(i,{get each(){return e.fields},children:e=>(()=>{var t=d(M);return m(t,()=>e.label),o(()=>u(t,`value`,e.value)),t})()}),x,S),C.addEventListener(`change`,e=>c(p(),h(),{operator:e.currentTarget.value})),m(w,()=>e.t(`settings.customFields.fieldSettings.operators.eq`)),m(T,()=>e.t(`settings.customFields.fieldSettings.operators.neq`)),m(E,()=>e.t(`settings.customFields.fieldSettings.operators.gt`)),m(D,()=>e.t(`settings.customFields.fieldSettings.operators.lt`)),m(O,()=>e.t(`settings.customFields.fieldSettings.operators.contains`)),m(k,()=>e.t(`settings.customFields.fieldSettings.operators.hasAny`)),m(N,()=>e.t(`settings.customFields.fieldSettings.operators.hasNone`)),m(_,a(n,{get when(){return![`has_any_value`,`has_no_value`].includes(f.operator)},get children(){var t=d(A);return t.$$input=e=>c(p(),h(),{value:e.currentTarget.value}),o(()=>l(t,`placeholder`,e.t(`settings.customFields.fieldSettings.conditionValue`))),o(()=>u(t,`value`,f.value??``)),g(),t}}),F,I),L.$$click=()=>r({...t(),groups:t().groups.map((e,t)=>t===p()?{...e,rules:e.rules.filter((e,t)=>t!==h())}:e)}),o(()=>u(v,`value`,f.field)),o(()=>u(C,`value`,f.operator)),g(),_})()}),v,y),b.$$click=()=>r({...t(),groups:t().groups.map((t,n)=>n===p()?{...t,rules:[...t.rules,{field:e.fields[0]?.value??``,operator:`eq`,value:``}]}:t)}),m(b,()=>e.t(`settings.customFields.fieldSettings.addCondition`),S,C),g(),h})()}),y,b),x.$$click=()=>r({...t(),groups:[...t().groups,{match:`ALL`,rules:[{field:e.fields[0]?.value??``,operator:`eq`,value:``}]}]}),m(x,()=>e.t(`settings.customFields.fieldSettings.addConditionGroup`),C,w),m(f,a(n,{get when(){return t().groups.some(e=>e.rules.length>1)},get children(){var t=d(D);return m(t,()=>e.t(`settings.customFields.fieldSettings.conditionsAnd`)),t}}),E,N),g(),f})()}function Je(e){let t=(t,n=``)=>String(e.field.config[t]??n),r=(t,n=!1)=>e.field.config[t]===void 0?n:e.field.config[t]===!0,i=(t,n)=>e.onChange({config:{...e.field.config,[t]:n}}),c=t=>e.t(`settings.customFields.fieldSettings.${t}`),f=()=>e.field.type;return(()=>{var p=d(te),h=p.firstChild,_=h.firstChild,v=_.nextSibling.firstChild,y=v.firstChild,[b,x]=s(y.nextSibling),S=b.nextSibling,C=v.nextSibling,w=C.firstChild,[T,E]=s(w.nextSibling),D=T.nextSibling,O=C.nextSibling,k=O.firstChild,[A,j]=s(k.nextSibling),M=A.nextSibling,q=O.nextSibling,J=q.firstChild,ne=J.nextSibling.nextSibling,[re,ie]=s(ne.nextSibling),Y=q.nextSibling,ae=Y.firstChild,[X,Z]=s(ae.nextSibling),Q=X.nextSibling,oe=Y.nextSibling,se=oe.firstChild,[ce,le]=s(se.nextSibling),ue=ce.nextSibling,de=h.nextSibling,fe=de.firstChild,pe=fe.nextSibling.firstChild,me=pe.firstChild,[he,ge]=s(me.nextSibling),_e=he.nextSibling,ve=pe.nextSibling,ye=ve.firstChild,[be,xe]=s(ye.nextSibling),Se=be.nextSibling,Ce=Se.firstChild,we=Ce.nextSibling,Te=ve.nextSibling,Ee=Te.firstChild,[De,Oe]=s(Ee.nextSibling),ke=De.nextSibling,Ae=ke.firstChild,je=Ae.nextSibling,Ie=de.nextSibling,[$,Le]=s(Ie.nextSibling),Re=$.nextSibling,[ze,Be]=s(Re.nextSibling),Ve=ze.nextSibling,[He,Ue]=s(Ve.nextSibling),We=He.nextSibling,[Je,Ye]=s(We.nextSibling),Xe=Je.nextSibling,[Ze,Qe]=s(Xe.nextSibling),$e=Ze.nextSibling,[et,tt]=s($e.nextSibling),nt=et.nextSibling,[rt,it]=s(nt.nextSibling),at=rt.nextSibling,[ot,st]=s(at.nextSibling),ct=ot.nextSibling,[lt,ut]=s(ct.nextSibling),dt=lt.nextSibling,[ft,pt]=s(dt.nextSibling),mt=ft.nextSibling,[ht,gt]=s(mt.nextSibling),_t=ht.nextSibling,[vt,yt]=s(_t.nextSibling),bt=vt.nextSibling,[xt,St]=s(bt.nextSibling),Ct=xt.nextSibling,[wt,Tt]=s(Ct.nextSibling);return m(_,()=>c(`general`)),m(v,()=>c(`fieldLabel`),b,x),S.$$input=t=>e.onChange({label:t.currentTarget.value}),m(C,()=>c(`fieldName`),T,E),D.$$input=t=>e.onChange({name:t.currentTarget.value}),m(O,()=>c(`instructions`),A,j),M.$$input=t=>e.onChange({instructions:t.currentTarget.value}),J.addEventListener(`change`,t=>e.onChange({required:t.currentTarget.checked})),m(q,()=>c(`required`),re,ie),m(Y,()=>c(`defaultValue`),X,Z),Q.$$input=e=>i(`defaultValue`,e.currentTarget.value),m(oe,()=>c(`placeholder`),ce,le),ue.$$input=e=>i(`placeholder`,e.currentTarget.value),m(fe,()=>c(`presentation`)),m(pe,()=>c(`wrapperWidth`),he,ge),_e.$$input=e=>i(`wrapperWidth`,e.currentTarget.value?Number(e.currentTarget.value):void 0),m(ve,()=>c(`labelPlacement`),be,xe),Se.addEventListener(`change`,e=>i(`labelPlacement`,e.currentTarget.value)),m(Ce,()=>c(`top`)),m(we,()=>c(`left`)),m(Te,()=>c(`instructionPlacement`),De,Oe),ke.addEventListener(`change`,e=>i(`instructionPlacement`,e.currentTarget.value)),m(Ae,()=>c(`above`)),m(je,()=>c(`below`)),m(p,a(n,{get when(){return[`text`,`textarea`,`email`,`url`,`password`].includes(f())},get children(){var e=d(F),r=e.firstChild,l=r.nextSibling,p=l.firstChild,h=p.firstChild,[_,v]=s(h.nextSibling),y=_.nextSibling,b=p.nextSibling,x=b.firstChild,[S,C]=s(x.nextSibling),w=S.nextSibling,T=b.nextSibling,E=T.firstChild,[D,O]=s(E.nextSibling),k=D.nextSibling,A=T.nextSibling,j=A.firstChild,[M,I]=s(j.nextSibling),L=M.nextSibling,ee=A.nextSibling,[R,z]=s(ee.nextSibling);return m(r,()=>c(`textSettings`)),m(p,()=>c(`prepend`),_,v),y.$$input=e=>i(`prepend`,e.currentTarget.value),m(b,()=>c(`append`),S,C),w.$$input=e=>i(`append`,e.currentTarget.value),m(T,()=>c(`minLength`),D,O),k.$$input=e=>i(`minLength`,e.currentTarget.value?Number(e.currentTarget.value):void 0),m(A,()=>c(`maxLength`),M,I),L.$$input=e=>i(`maxLength`,e.currentTarget.value?Number(e.currentTarget.value):void 0),m(l,a(n,{get when(){return f()===`textarea`},get children(){return[(()=>{var e=d(N),n=e.firstChild,[r,a]=s(n.nextSibling),l=r.nextSibling;return m(e,()=>c(`rows`),r,a),l.$$input=e=>i(`rows`,Number(e.currentTarget.value)||4),o(()=>u(l,`value`,t(`rows`,`4`))),g(),e})(),(()=>{var e=d(P),n=e.firstChild,[r,a]=s(n.nextSibling),l=r.nextSibling,f=l.firstChild.nextSibling,p=f.nextSibling;return m(e,()=>c(`newLines`),r,a),l.addEventListener(`change`,e=>i(`newLines`,e.currentTarget.value)),m(f,()=>c(`wpautop`)),m(p,()=>c(`none`)),o(()=>u(l,`value`,t(`newLines`,`br`))),e})()]}}),R,z),o(()=>u(y,`value`,t(`prepend`))),o(()=>u(w,`value`,t(`append`))),o(()=>u(k,`value`,t(`minLength`))),o(()=>u(L,`value`,t(`maxLength`))),g(),e}}),$,Le),m(p,a(n,{get when(){return[`number`,`range`].includes(f())},get children(){var e=d(I),n=e.firstChild,r=n.nextSibling.firstChild,a=r.firstChild,[l,f]=s(a.nextSibling),p=l.nextSibling,h=r.nextSibling,_=h.firstChild,[v,y]=s(_.nextSibling),b=v.nextSibling,x=h.nextSibling,S=x.firstChild,[C,w]=s(S.nextSibling),T=C.nextSibling;return m(n,()=>c(`numberSettings`)),m(r,()=>c(`min`),l,f),p.$$input=e=>i(`min`,e.currentTarget.value?Number(e.currentTarget.value):void 0),m(h,()=>c(`max`),v,y),b.$$input=e=>i(`max`,e.currentTarget.value?Number(e.currentTarget.value):void 0),m(x,()=>c(`step`),C,w),T.$$input=e=>i(`step`,Number(e.currentTarget.value)||1),o(()=>u(p,`value`,t(`min`))),o(()=>u(b,`value`,t(`max`))),o(()=>u(T,`value`,t(`step`,`1`))),g(),e}}),ze,Be),m(p,a(n,{get when(){return Ne.has(f())},get children(){var n=d(L),a=n.firstChild,l=a.nextSibling.firstChild,f=l.firstChild,[p,h]=s(f.nextSibling),_=p.nextSibling,v=l.nextSibling,y=v.firstChild,[b,x]=s(y.nextSibling),S=b.nextSibling,C=S.firstChild,w=C.nextSibling,T=v.nextSibling,E=T.firstChild,D=E.nextSibling.nextSibling,[O,k]=s(D.nextSibling),A=T.nextSibling,j=A.firstChild,M=j.nextSibling.nextSibling,[N,P]=s(M.nextSibling);return m(a,()=>c(`choiceSettings`)),m(l,()=>c(`choices`),p,h),_.$$input=e=>i(`choices`,Ke(e.currentTarget.value)),m(v,()=>c(`layout`),b,x),S.addEventListener(`change`,e=>i(`layout`,e.currentTarget.value)),m(C,()=>c(`vertical`)),m(w,()=>c(`horizontal`)),E.addEventListener(`change`,e=>i(`multiple`,e.currentTarget.checked)),m(T,()=>c(`multiple`),O,k),j.addEventListener(`change`,e=>i(`allowNull`,e.currentTarget.checked)),m(A,()=>c(`allowNull`),N,P),o(()=>u(_,`value`,Ge(e.field.config.choices??e.field.config.options))),o(()=>u(S,`value`,t(`layout`,`vertical`))),o(()=>u(E,`checked`,r(`multiple`))),o(()=>u(j,`checked`,r(`allowNull`))),g(),n}}),He,Ue),m(p,a(n,{get when(){return Pe.has(f())},get children(){var e=d(ee),n=e.firstChild,r=n.nextSibling.firstChild,a=r.firstChild,[l,p]=s(a.nextSibling),h=l.nextSibling,_=h.firstChild,v=_.nextSibling,y=r.nextSibling,b=y.firstChild,[x,S]=s(b.nextSibling),C=x.nextSibling,w=y.nextSibling,T=w.firstChild,[E,D]=s(T.nextSibling),O=E.nextSibling,k=O.firstChild,A=k.nextSibling,j=w.nextSibling,M=j.firstChild,[N,P]=s(M.nextSibling),F=N.nextSibling,I=j.nextSibling,L=I.firstChild,[R,z]=s(L.nextSibling),B=R.nextSibling,V=I.nextSibling,H=V.firstChild,[U,W]=s(H.nextSibling),G=U.nextSibling,K=V.nextSibling,te=K.firstChild,[q,J]=s(te.nextSibling),ne=q.nextSibling,re=K.nextSibling,ie=re.firstChild,[Y,ae]=s(ie.nextSibling),X=Y.nextSibling;return m(n,()=>c(`mediaSettings`)),m(r,()=>c(`returnFormat`),l,p),h.addEventListener(`change`,e=>i(`returnFormat`,e.currentTarget.value)),m(_,()=>c(`array`)),m(v,()=>c(`id`)),m(y,()=>c(`previewSize`),x,S),C.$$input=e=>i(`previewSize`,e.currentTarget.value),m(w,()=>c(`library`),E,D),O.addEventListener(`change`,e=>i(`library`,e.currentTarget.value)),m(k,()=>c(`all`)),m(A,()=>c(`uploadedToPost`)),m(j,()=>c(`allowedTypes`),N,P),F.$$input=e=>i(`mimeTypes`,e.currentTarget.value),m(I,()=>c(`minWidth`),R,z),B.$$input=e=>i(`minWidth`,e.currentTarget.value?Number(e.currentTarget.value):void 0),m(V,()=>c(`maxWidth`),U,W),G.$$input=e=>i(`maxWidth`,e.currentTarget.value?Number(e.currentTarget.value):void 0),m(K,()=>c(`minHeight`),q,J),ne.$$input=e=>i(`minHeight`,e.currentTarget.value?Number(e.currentTarget.value):void 0),m(re,()=>c(`maxHeight`),Y,ae),X.$$input=e=>i(`maxHeight`,e.currentTarget.value?Number(e.currentTarget.value):void 0),o(()=>u(h,`value`,t(`returnFormat`,(f(),`array`)))),o(()=>u(C,`value`,t(`previewSize`,`medium`))),o(()=>u(O,`value`,t(`library`,`all`))),o(()=>u(F,`value`,t(`mimeTypes`))),o(()=>u(B,`value`,t(`minWidth`))),o(()=>u(G,`value`,t(`maxWidth`))),o(()=>u(ne,`value`,t(`minHeight`))),o(()=>u(X,`value`,t(`maxHeight`))),g(),e}}),Je,Ye),m(p,a(n,{get when(){return f()===`wysiwyg`},get children(){var e=d(R),n=e.firstChild,a=n.nextSibling.firstChild,l=a.firstChild,[f,p]=s(l.nextSibling),h=f.nextSibling,g=h.firstChild,_=a.nextSibling,v=_.firstChild,[y,b]=s(v.nextSibling),x=y.nextSibling,S=_.nextSibling,C=S.firstChild,w=C.nextSibling.nextSibling,[T,E]=s(w.nextSibling);return m(n,()=>c(`wysiwygSettings`)),m(a,()=>c(`tabs`),f,p),h.addEventListener(`change`,e=>i(`tabs`,e.currentTarget.value)),m(g,()=>c(`all`)),m(_,()=>c(`toolbar`),y,b),x.addEventListener(`change`,e=>i(`toolbar`,e.currentTarget.value)),C.addEventListener(`change`,e=>i(`mediaUpload`,e.currentTarget.checked)),m(S,()=>c(`mediaUpload`),T,E),o(()=>u(h,`value`,t(`tabs`,`all`))),o(()=>u(x,`value`,t(`toolbar`,`full`))),o(()=>u(C,`checked`,r(`mediaUpload`,!0))),e}}),Ze,Qe),m(p,a(n,{get when(){return[`date_picker`,`date_time_picker`,`time_picker`].includes(f())},get children(){var e=d(z),n=e.firstChild,r=n.nextSibling.firstChild,a=r.firstChild,[l,p]=s(a.nextSibling),h=l.nextSibling,_=r.nextSibling,v=_.firstChild,[y,b]=s(v.nextSibling),x=y.nextSibling,S=_.nextSibling,C=S.firstChild,[w,T]=s(C.nextSibling),E=w.nextSibling;return m(n,()=>c(`dateSettings`)),m(r,()=>c(`displayFormat`),l,p),h.$$input=e=>i(`displayFormat`,e.currentTarget.value),m(_,()=>c(`returnFormat`),y,b),x.$$input=e=>i(`returnFormat`,e.currentTarget.value),m(S,()=>c(`firstDay`),w,T),E.$$input=e=>i(`firstDay`,Number(e.currentTarget.value)||0),o(()=>u(h,`value`,t(`displayFormat`,f()===`time_picker`?`H:i`:`d/m/Y`))),o(()=>u(x,`value`,t(`returnFormat`,`Y-m-d`))),o(()=>u(E,`value`,t(`firstDay`,`1`))),g(),e}}),et,tt),m(p,a(n,{get when(){return f()===`color_picker`},get children(){var e=d(B),t=e.firstChild,n=t.nextSibling,a=n.firstChild,l=a.nextSibling.nextSibling,[f,p]=s(l.nextSibling);return m(t,()=>c(`colorSettings`)),a.addEventListener(`change`,e=>i(`enableOpacity`,e.currentTarget.checked)),m(n,()=>c(`enableOpacity`),f,p),o(()=>u(a,`checked`,r(`enableOpacity`))),e}}),rt,it),m(p,a(n,{get when(){return f()===`google_map`},get children(){var e=d(V),n=e.firstChild,r=n.nextSibling.firstChild,a=r.firstChild,[l,f]=s(a.nextSibling),p=l.nextSibling,h=r.nextSibling,_=h.firstChild,[v,y]=s(_.nextSibling),b=v.nextSibling,x=h.nextSibling,S=x.firstChild,[C,w]=s(S.nextSibling),T=C.nextSibling;return m(n,()=>c(`mapSettings`)),m(r,()=>c(`center`),l,f),p.$$input=e=>i(`center`,e.currentTarget.value),m(h,()=>c(`zoom`),v,y),b.$$input=e=>i(`zoom`,Number(e.currentTarget.value)||14),m(x,()=>c(`height`),C,w),T.$$input=e=>i(`height`,Number(e.currentTarget.value)||400),o(()=>u(p,`value`,t(`center`))),o(()=>u(b,`value`,t(`zoom`,`14`))),o(()=>u(T,`value`,t(`height`,`400`))),g(),e}}),ot,st),m(p,a(n,{get when(){return Fe.has(f())},get children(){var e=d(H),n=e.firstChild,a=n.nextSibling.firstChild,l=a.firstChild,[p,h]=s(l.nextSibling),_=p.nextSibling,v=a.nextSibling,y=v.firstChild,[b,x]=s(y.nextSibling),S=b.nextSibling,C=v.nextSibling,w=C.firstChild,[T,E]=s(w.nextSibling),D=T.nextSibling,O=C.nextSibling,k=O.firstChild,A=k.nextSibling.nextSibling,[j,M]=s(A.nextSibling),N=O.nextSibling,P=N.firstChild,F=P.nextSibling.nextSibling,[I,L]=s(F.nextSibling);return m(n,()=>c(`relationSettings`)),m(a,()=>c(`postType`),p,h),_.$$input=e=>i(`postType`,e.currentTarget.value),m(v,()=>c(`taxonomy`),b,x),S.$$input=e=>i(`taxonomy`,e.currentTarget.value),m(C,()=>c(`returnFormat`),T,E),D.addEventListener(`change`,e=>i(`returnFormat`,e.currentTarget.value)),k.addEventListener(`change`,e=>i(`multiple`,e.currentTarget.checked)),m(O,()=>c(`multiple`),j,M),P.addEventListener(`change`,e=>i(`allowNull`,e.currentTarget.checked)),m(N,()=>c(`allowNull`),I,L),o(()=>u(_,`value`,t(`postType`))),o(()=>u(S,`value`,t(`taxonomy`))),o(()=>u(D,`value`,t(`returnFormat`,`id`))),o(()=>u(k,`checked`,r(`multiple`,f()!==`page_link`))),o(()=>u(P,`checked`,r(`allowNull`,!0))),g(),e}}),lt,ut),m(p,a(n,{get when(){return f()===`true_false`},get children(){var e=d(U),n=e.firstChild,a=n.nextSibling.firstChild,l=a.firstChild,[f,p]=s(l.nextSibling),h=f.nextSibling,_=a.nextSibling,v=_.firstChild,y=v.nextSibling.nextSibling,[b,x]=s(y.nextSibling);return m(n,()=>c(`booleanSettings`)),m(a,()=>c(`message`),f,p),h.$$input=e=>i(`message`,e.currentTarget.value),v.addEventListener(`change`,e=>i(`defaultValue`,e.currentTarget.checked)),m(_,()=>c(`defaultChecked`),b,x),o(()=>u(h,`value`,t(`message`))),o(()=>u(v,`checked`,r(`defaultValue`))),g(),e}}),ft,pt),m(p,a(n,{get when(){return f()===`link`},get children(){var e=d(W),n=e.firstChild,r=n.nextSibling,a=r.firstChild,[l,f]=s(a.nextSibling),p=l.nextSibling;return m(n,()=>c(`linkSettings`)),m(r,()=>c(`returnFormat`),l,f),p.addEventListener(`change`,e=>i(`returnFormat`,e.currentTarget.value)),o(()=>u(p,`value`,t(`returnFormat`,`array`))),e}}),ht,gt),m(p,a(n,{get when(){return f()===`clone`},get children(){var t=d(G),n=t.firstChild,r=n.nextSibling,a=r.firstChild,[f,p]=s(a.nextSibling),h=f.nextSibling;return m(n,()=>c(`cloneSettings`)),m(r,()=>c(`cloneFields`),f,p),h.$$input=e=>i(`clone`,e.currentTarget.value.split(`
4
+ `).map(e=>e.trim()).filter(Boolean)),o(()=>l(h,`placeholder`,c(`cloneHint`))),o(()=>u(h,`value`,Array.isArray(e.field.config.clone)?e.field.config.clone.join(`
5
+ `):``)),g(),t}}),vt,yt),m(p,a(n,{get when(){return Me.has(f())},get children(){var e=d(K),n=e.firstChild,r=n.nextSibling.firstChild,a=r.firstChild,[l,f]=s(a.nextSibling),p=l.nextSibling,h=r.nextSibling,_=h.firstChild,[v,y]=s(_.nextSibling),b=v.nextSibling,x=h.nextSibling,S=x.firstChild,[C,w]=s(S.nextSibling),T=C.nextSibling,E=x.nextSibling,D=E.firstChild,[O,k]=s(D.nextSibling),A=O.nextSibling,j=E.nextSibling,M=j.firstChild,[N,P]=s(M.nextSibling),F=N.nextSibling;return m(n,()=>c(`containerSettings`)),m(r,()=>c(`layout`),l,f),p.addEventListener(`change`,e=>i(`layout`,e.currentTarget.value)),m(h,()=>c(`min`),v,y),b.$$input=e=>i(`min`,e.currentTarget.value?Number(e.currentTarget.value):void 0),m(x,()=>c(`max`),C,w),T.$$input=e=>i(`max`,e.currentTarget.value?Number(e.currentTarget.value):void 0),m(E,()=>c(`buttonLabel`),O,k),A.$$input=e=>i(`buttonLabel`,e.currentTarget.value),m(j,()=>c(`collapsed`),N,P),F.$$input=e=>i(`collapsed`,e.currentTarget.value),o(()=>u(p,`value`,t(`layout`,`block`))),o(()=>u(b,`value`,t(`min`))),o(()=>u(T,`value`,t(`max`))),o(()=>u(A,`value`,t(`buttonLabel`,`Add Row`))),o(()=>u(F,`value`,t(`collapsed`))),g(),e}}),xt,St),m(p,a(qe,{get value(){return e.field.conditionalLogic},get fields(){return e.fields.filter(t=>t.value!==e.field.name)},onChange:t=>e.onChange({conditionalLogic:t}),get t(){return e.t}}),wt,Tt),o(()=>u(S,`value`,e.field.label)),o(()=>u(D,`value`,e.field.name)),o(()=>u(M,`value`,e.field.instructions??``)),o(()=>u(J,`checked`,e.field.required)),o(()=>u(Q,`value`,t(`defaultValue`))),o(()=>u(ue,`value`,t(`placeholder`))),o(()=>u(_e,`value`,t(`wrapperWidth`))),o(()=>u(Se,`value`,t(`labelPlacement`,`top`))),o(()=>u(ke,`value`,t(`instructionPlacement`,`below`))),g(),p})()}function Ye(t){let r=new Set([`text`,`textarea`,`email`,`url`,`image`,`file`,`select`,`true_false`,`link`,`post_object`,`relationship`,`repeater`,`flexible_content`,`gallery`,`clone`]),[c,f]=e(``),[p,_]=e(`popular`),[v,y]=e(`text`),[b,x]=e(``),S=()=>[{id:`popular`,label:t.t(`settings.customFields.form.popularFields`)},...t.categories.map(e=>({id:e.id,label:e.label}))],C=()=>{let e=c().trim().toLowerCase();return t.types.filter(t=>(p()===`popular`?r.has(t.type):t.category===p())&&(!e||t.label.toLowerCase().includes(e)||t.type.toLowerCase().includes(e)))},w=()=>t.types.find(e=>e.type===v());return t.open()&&(t.types.some(e=>e.type===v())||y(t.types[0]?.type??`text`)),a(n,{get when(){return t.open()},get children(){var e=d(q),r=e.firstChild.firstChild,T=r.firstChild,E=T.firstChild,D=E.nextSibling,O=T.nextSibling,k=r.nextSibling,A=k.firstChild,j=k.nextSibling,M=j.nextSibling,N=M.firstChild,P=N.nextSibling.firstChild,F=P.nextSibling,I=F.nextSibling,L=M.nextSibling.firstChild,ee=L.firstChild,[R,z]=s(ee.nextSibling),B=R.nextSibling,V=L.nextSibling.firstChild,H=V.nextSibling;return e.$$mousedown=e=>{e.target===e.currentTarget&&t.onClose()},m(E,()=>t.t(`settings.customFields.form.addField`)),m(D,()=>t.t(`settings.customFields.form.selectFieldType`)),h(O,`click`,t.onClose,!0),A.$$input=e=>f(e.currentTarget.value),m(j,a(i,{get each(){return S()},children:e=>(()=>{var t=d(J);return t.$$click=()=>_(e.id),m(t,()=>e.label),o(()=>t.classList.toggle(`is-active`,p()===e.id)),g(),t})()})),m(N,a(n,{get when(){return C().length>0},get fallback(){return(()=>{var e=d(ne);return m(e,()=>t.t(`settings.customFields.form.noMatchingFieldTypes`)),e})()},get children(){return a(i,{get each(){return C()},children:e=>(()=>{var t=d(re),n=t.firstChild,r=n.nextSibling,i=r.nextSibling;return t.$$click=()=>y(e.type),m(n,()=>e.label.slice(0,1)),m(r,()=>e.label),m(i,()=>e.type),o(()=>t.classList.toggle(`is-selected`,v()===e.type)),g(),t})()})}})),m(P,()=>w()?.label.slice(0,1)??`?`),m(F,()=>w()?.label??t.t(`settings.customFields.form.fieldType`)),m(I,()=>t.t(`settings.customFields.form.fieldTypeHint`)),m(L,()=>t.t(`settings.customFields.form.fieldLabel`),R,z),B.$$input=e=>x(e.currentTarget.value),h(V,`click`,t.onClose,!0),m(V,()=>t.t(`settings.customFields.form.cancel`)),H.$$click=()=>{let e=w();e&&t.onSelect(e.type,b().trim()||e.label)},m(H,()=>t.t(`settings.customFields.form.selectField`)),o(e=>{var n=t.t(`settings.customFields.form.cancel`),r=t.t(`settings.customFields.form.searchFieldTypes`),i=t.t(`settings.customFields.form.fieldType`),a=t.t(`settings.customFields.form.newFieldDefault`),o=!w();return n!==e.e&&l(O,`aria-label`,e.e=n),r!==e.t&&l(A,`placeholder`,e.t=r),i!==e.a&&l(j,`aria-label`,e.a=i),a!==e.o&&l(B,`placeholder`,e.o=a),o!==e.i&&u(H,`disabled`,e.i=o),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),o(()=>u(A,`value`,c())),o(()=>u(B,`value`,b())),g(),e}})}function Xe(t){let[r,c]=e(null),[u,f]=e(null),[p,h]=e(!1),_=(e,n,r)=>{if(e===n)return;let i=t.fields.findIndex(t=>t.clientId===e),a=t.fields.findIndex(e=>e.clientId===n);if(i<0||a<0)return;let o=t.fields[i];if(!o)return;let s=t.fields.filter(t=>t.clientId!==e),c=s.findIndex(e=>e.clientId===n);c<0||(r===`after`&&(c+=1),s.splice(c,0,o),t.onChange(s))},v=(e,n)=>t.onChange(Ve(t.fields,e,n)),y=e=>{let n=ze(e);n.id=void 0,n.name=`${e.name}_copy`,n.label=`${e.label} ${t.t(`settings.customFields.form.copySuffix`)}`;let r=t.fields.findIndex(t=>t.clientId===e.clientId),i=[...t.fields];i.splice(r+1,0,n),t.onChange(i),t.setExpandedId(n.clientId)},b=(e,n)=>{let r=Re(t.fields.length,n,e);t.onChange([...t.fields,r]),t.setExpandedId(r.clientId),h(!1)},x=()=>{t.onOpenAddField?t.onOpenAddField():h(!0)};return(()=>{var e=d(Y),S=e.firstChild,[C,w]=s(S.nextSibling),T=C.nextSibling,[D,O]=s(T.nextSibling),k=D.nextSibling,[A,j]=s(k.nextSibling),M=A.nextSibling,N=M.firstChild.nextSibling,[P,F]=s(N.nextSibling);return m(e,a(Ye,{open:p,get types(){return t.types},get categories(){return t.categories},get t(){return t.t},onClose:()=>h(!1),onSelect:b}),C,w),m(e,a(i,{get each(){return t.fields},children:(e,i)=>(()=>{var p=d(Z),h=p.firstChild,b=h.firstChild,x=b.nextSibling,S=x.firstChild,C=S.nextSibling,w=C.firstChild,T=w.nextSibling,D=T.firstChild,[O,k]=s(D.nextSibling),A=O.nextSibling.nextSibling,[j,M]=s(A.nextSibling),N=C.nextSibling,P=N.nextSibling,F=P.nextSibling,I=x.nextSibling.firstChild,L=I.nextSibling,ee=L.nextSibling,R=h.nextSibling,[z,B]=s(R.nextSibling);return p.addEventListener(`drop`,e=>{e.preventDefault();let t=r()??e.dataTransfer?.getData(`text/plain`),n=u();t&&n&&_(t,n.id,n.position),c(null),f(null)}),p.addEventListener(`dragleave`,e=>{e.currentTarget.contains(e.relatedTarget)||f(null)}),p.addEventListener(`dragover`,t=>{t.preventDefault();let n=t.currentTarget.getBoundingClientRect();f({id:e.clientId,position:t.clientY<n.top+n.height/2?`before`:`after`})}),b.addEventListener(`dragend`,()=>{c(null),f(null)}),b.addEventListener(`dragstart`,t=>{c(e.clientId),f(null),t.dataTransfer&&(t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,e.clientId),t.dataTransfer.setData(`application/x-okcms-field-id`,e.clientId))}),x.$$click=()=>t.setExpandedId(t.expandedId()===e.clientId?null:e.clientId),m(S,()=>i()+1),m(w,()=>e.label||t.t(`settings.customFields.form.newFieldDefault`)),m(T,()=>e.name,O,k),m(T,()=>We(e,t.types),j,M),m(N,()=>e.name),m(P,()=>We(e,t.types)),m(F,()=>t.expandedId()===e.clientId?`⌃`:`⌄`),I.$$click=()=>t.setExpandedId(e.clientId),m(I,()=>t.t(`settings.customFields.form.editField`)),L.$$click=()=>y(e),m(L,()=>t.t(`settings.customFields.form.duplicateField`)),ee.$$click=()=>t.onChange(t.fields.filter(t=>t.clientId!==e.clientId)),m(ee,()=>t.t(`settings.customFields.form.removeField`)),m(p,a(n,{get when(){return t.expandedId()===e.clientId},get children(){var r=d(X),i=r.firstChild,o=i.firstChild,c=o.nextSibling,[l,u]=s(c.nextSibling),f=i.nextSibling,[p,h]=s(f.nextSibling),g=p.nextSibling,[_,y]=s(g.nextSibling),b=_.nextSibling,[x,S]=s(b.nextSibling);return m(o,()=>t.t(`settings.customFields.form.fieldType`)),m(i,a(E,{get categories(){return t.categories},get types(){return t.types},get value(){return e.type},onChange:t=>v(e.clientId,{type:t})}),l,u),m(r,a(Je,{field:e,get fields(){return t.options},get fieldTypes(){return t.types},get categories(){return t.categories},onChange:t=>v(e.clientId,t),get t(){return t.t}}),p,h),m(r,a(n,{get when(){return Me.has(e.type)},get children(){var n=d(ae),r=n.firstChild,i=r.firstChild,o=r.nextSibling,[c,l]=s(o.nextSibling);return m(i,()=>t.t(`settings.customFields.fieldSettings.subFields`)),m(n,a(Xe,{get fields(){return e.subFields},get types(){return t.types},get categories(){return t.categories},get options(){return t.options},get depth(){return t.depth+1},get t(){return t.t},onChange:t=>v(e.clientId,{subFields:t}),get expandedId(){return t.expandedId},get setExpandedId(){return t.setExpandedId}}),c,l),n}}),_,y),m(r,a(n,{get when(){return e.type===`flexible_content`},get children(){return a(Ze,{field:e,get types(){return t.types},get categories(){return t.categories},get options(){return t.options},get t(){return t.t},onChange:t=>v(e.clientId,t),get expandedId(){return t.expandedId},get setExpandedId(){return t.setExpandedId}})}}),x,S),r}}),z,B),o(n=>{var i=t.expandedId()===e.clientId,a=r()===e.clientId,o=u()?.id===e.clientId&&u()?.position===`before`,s=u()?.id===e.clientId&&u()?.position===`after`,c=e.clientId,d=t.t(`settings.customFields.form.dragHint`),f=t.t(`settings.customFields.form.dragHint`),m=t.expandedId()===e.clientId;return i!==n.e&&p.classList.toggle(`is-expanded`,n.e=i),a!==n.t&&p.classList.toggle(`is-dragging`,n.t=a),o!==n.a&&p.classList.toggle(`is-drop-before`,n.a=o),s!==n.o&&p.classList.toggle(`is-drop-after`,n.o=s),c!==n.i&&l(h,`data-field-id`,n.i=c),d!==n.n&&l(b,`aria-label`,n.n=d),f!==n.s&&l(b,`title`,n.s=f),m!==n.h&&l(x,`aria-expanded`,n.h=m),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),g(),p})()}),D,O),m(e,a(n,{get when(){return t.fields.length===0},get children(){var e=d(ie),n=e.firstChild;return m(n,()=>t.t(`settings.customFields.form.noFields`)),e}}),A,j),M.$$click=x,m(M,()=>t.t(`settings.customFields.form.addField`),P,F),o(()=>l(e,`data-depth`,t.depth)),g(),e})()}function Ze(e){let t=()=>e.field.layouts,n=(n,r)=>e.onChange({layouts:t().map(e=>e.clientId===n?{...e,...r}:e)}),r=()=>e.onChange({layouts:[...t(),{clientId:$(`layout`),name:`layout_${t().length+1}`,label:e.t(`settings.customFields.fieldSettings.newLayout`),display:`block`,subFields:[]}]});return(()=>{var c=d(Q),l=c.firstChild,f=l.firstChild,p=f.nextSibling,h=p.firstChild.nextSibling,[_,v]=s(h.nextSibling),y=l.nextSibling,[b,x]=s(y.nextSibling);return m(f,()=>e.t(`settings.customFields.fieldSettings.layouts`)),p.$$click=r,m(p,()=>e.t(`settings.customFields.fieldSettings.addLayout`),_,v),m(c,a(i,{get each(){return t()},children:(r,i)=>(()=>{var c=d(oe),l=c.firstChild,f=l.firstChild,p=f.firstChild,[h,_]=s(p.nextSibling),v=h.nextSibling,y=f.nextSibling,b=y.firstChild,[x,S]=s(b.nextSibling),C=x.nextSibling,w=y.nextSibling,T=w.firstChild,[E,D]=s(T.nextSibling),O=E.nextSibling,k=w.nextSibling,A=l.nextSibling,j=A.firstChild,M=j.firstChild,N=M.firstChild,[P,F]=s(N.nextSibling),I=P.nextSibling.nextSibling,[L,ee]=s(I.nextSibling),R=j.nextSibling,[z,B]=s(R.nextSibling);return m(f,()=>e.t(`settings.customFields.fieldSettings.layoutName`),h,_),v.$$input=e=>n(r.clientId,{name:e.currentTarget.value}),m(y,()=>e.t(`settings.customFields.fieldSettings.layoutLabel`),x,S),C.$$input=e=>n(r.clientId,{label:e.currentTarget.value}),m(w,()=>e.t(`settings.customFields.fieldSettings.layoutDisplay`),E,D),O.addEventListener(`change`,e=>n(r.clientId,{display:e.currentTarget.value})),k.$$click=()=>e.onChange({layouts:t().filter(e=>e.clientId!==r.clientId)}),m(k,()=>e.t(`settings.customFields.form.removeField`)),m(M,()=>e.t(`settings.customFields.fieldSettings.subFields`),P,F),m(M,()=>i()+1,L,ee),m(A,a(Xe,{get fields(){return r.subFields},get types(){return e.types},get categories(){return e.categories},get options(){return e.options},depth:2,get t(){return e.t},onChange:e=>n(r.clientId,{subFields:e}),get expandedId(){return e.expandedId},get setExpandedId(){return e.setExpandedId}}),z,B),o(()=>u(v,`value`,r.name)),o(()=>u(C,`value`,r.label)),o(()=>u(O,`value`,r.display??`block`)),g(),c})()}),b,x),g(),c})()}function Qe(){let{t:f}=_(),[p,h]=e([]),[y,b]=e([]),[x,S]=e([]),[C,w]=e([]),[T,E]=e([]),[D,O]=e(``),[k,A]=e(``),[j,N]=e(null),[P,F]=e(null),[I,L]=e(!1),[ee,R]=e(!0),[z,B]=e(!1),[V,H]=e(``),[U,W]=e(``),G=r(()=>p().find(e=>e.slug===D())),K=r(()=>x().find(e=>e.key===`core-fields-${D()}`)),te=e=>[...new Set((e.locationRules??[]).flat().filter(e=>e.param===`content_type`&&e.operator===`eq`&&e.value).map(e=>e.value))],q=r(()=>x().filter(e=>{if(e.key.startsWith(`core-fields-`))return!1;let t=te(e);return(!D()||t.length===0||t.includes(D()))&&(!k().trim()||e.title.toLowerCase().includes(k().trim().toLowerCase())||e.key.toLowerCase().includes(k().trim().toLowerCase()))})),J=r(()=>Ae.map(e=>({key:e,label:f(`settings.customFields.standard.fields.${e}`),type:K()?.fields.find(t=>t.coreFieldKey===e||t.name===e)?.type??`text`,locked:e===`title`||e===`slug`||!!K()?.fields.find(t=>t.coreFieldKey===e)?.isLocked}))),ne=r(()=>new Set(G()?.defaultFields?.length?G().defaultFields:Ae)),re=r(()=>{let e=[],t=n=>n.forEach(n=>{e.push({value:n.name,label:`${n.label||n.name} (${n.name})`}),t(n.subFields),n.layouts.forEach(e=>t(e.subFields))});return j()&&t(j().fields),e}),ie=async()=>{R(!0),H(``);try{let[e,t,n,r]=await Promise.all([v.getContentTypes(),v.getTaxonomies(),v.getFieldTypes(),v.getFieldGroups()]),i=await Promise.all(r.map(e=>v.getFieldGroup(e.id)));h(e),b(t),w(n.types),E(n.categories),S(i),!D()&&e[0]&&O(e[0].slug)}catch(e){H(e instanceof Error?e.message:f(`settings.customFields.loadError`))}finally{R(!1)}};t(ie);let Y=()=>{W(``),H(``),F(null),N({title:``,position:`normal`,displayStyle:`standard`,active:!0,locationRules:[[Le(D())]],fields:[],metadata:{labelPlacement:`top`,instructionPlacement:`below`,hideOnScreen:[]}})},ae=e=>{W(``),H(``);let t=e.fields.map(ze);F(null),N({id:e.id,title:e.title,position:e.position??`normal`,displayStyle:e.displayStyle??`standard`,active:e.active!==!1,locationRules:Be(e.locationRules,D()),fields:t,metadata:{...e.metadata??{}}})},X=e=>e===`content_type`?p().map(e=>({value:e.slug,label:`${e.pluralLabel} (${e.slug})`})):e===`taxonomy`?y().map(e=>({value:e.slug,label:`${e.name} (${e.slug})`})):e===`post_status`?[`DRAFT`,`PUBLISHED`,`ARCHIVED`,`TRASHED`].map(e=>({value:e,label:e})):[],Z=e=>{let t=j();t&&N({...t,...e})},Q=e=>{let t=j();t&&N({...t,metadata:{...t.metadata,...e}})},oe=(e,t,n)=>{let r=j();r&&N({...r,locationRules:r.locationRules.map((r,i)=>i===e?r.map((e,r)=>r===t?{...e,...n}:e):r)})},Me=e=>{let t=j();t&&N({...t,locationRules:t.locationRules.map((t,n)=>n===e?[...t,Le(D())]:t)})},Ne=(e,t)=>{let n=j();if(!n)return;let r=n.locationRules.map((n,r)=>r===e?n.filter((e,n)=>n!==t):n).filter(e=>e.length>0);N({...n,locationRules:r.length>0?r:[[Le(D())]]})},Pe=()=>{let e=j();e&&N({...e,locationRules:[...e.locationRules,[Le(D())]]})},Fe=e=>e.flat().find(e=>e.param===`content_type`&&e.operator===`eq`)?.value??D(),Ie=e=>{let t=j();if(!t)return;let n=t.locationRules.map(e=>[...e]),r=n[0]??[],i=r.findIndex(e=>e.param===`content_type`);i>=0?r[i]={...r[i],operator:`eq`,value:e}:r.unshift(Le(e)),n[0]=r,N({...t,locationRules:n})},$=e=>{let t=te(e);return t.length===0?f(`settings.customFields.groups.allContentTypes`):t.map(e=>p().find(t=>t.slug===e)?.pluralLabel??e).join(`, `)},Ve=async e=>{e.preventDefault();let t=j();if(t){if(!t.title.trim()||t.locationRules.some(e=>e.some(e=>!e.value.trim()))){H(f(`settings.customFields.location.required`));return}B(!0),H(``),W(``);try{let e={title:t.title.trim(),locationRules:t.locationRules,position:t.position,displayStyle:t.displayStyle,active:t.active,metadata:t.metadata,fields:t.fields.map((e,t)=>He(e,t))};t.id?await v.updateFieldGroup(t.id,e):await v.createFieldGroup(e),N(null),F(null),W(f(`settings.customFields.form.saved`)),await ie()}catch(e){H(e instanceof Error?e.message:String(e))}finally{B(!1)}}},Ue=async e=>{let t=G(),n=J().find(t=>t.key===e);if(!t||!n||n.locked)return;let r=new Set(ne());r.has(e)?r.delete(e):r.add(e),r.add(`title`),r.add(`slug`);try{let e=await v.updateContentType(t.slug,{defaultFields:[...r]});h(t=>t.map(t=>t.slug===e.slug?e:t))}catch(e){H(e instanceof Error?e.message:String(e))}},We=async e=>{if(window.confirm(f(`settings.customFields.actions.confirmDelete`)))try{await v.deleteFieldGroup(e.id),W(f(`settings.customFields.form.deleted`)),await ie()}catch(e){H(e instanceof Error?e.message:String(e))}},Ge=(e,t)=>{let n=j();if(!n)return;let r=Re(n.fields.length,t,e);Z({fields:[...n.fields,r]}),F(r.clientId),L(!1)};return(()=>{var e=d(me),t=e.firstChild,[r,h]=s(t.nextSibling),_=r.nextSibling,[v,y]=s(_.nextSibling),b=v.nextSibling,[x,S]=s(b.nextSibling);return m(e,a(n,{get when(){return V()},get children(){var e=d(se);return m(e,V),e}}),r,h),m(e,a(n,{get when(){return U()},get children(){var e=d(ce);return m(e,U),e}}),v,y),m(e,a(n,{get when(){return!ee()},get fallback(){return(()=>{var e=d(he);return m(e,()=>f(`settings.customFields.loading`)),e})()},get children(){return a(n,{get when(){return!j()},get fallback(){return(()=>{var e=d(ge),t=e.firstChild,[r,h]=s(t.nextSibling),_=r.nextSibling,v=_.firstChild,y=v.firstChild,b=y.firstChild.nextSibling,[x,S]=s(b.nextSibling),w=y.nextSibling,E=w.nextSibling,D=v.nextSibling.firstChild,O=D.nextSibling,k=_.nextSibling,A=k.firstChild,ee=A.firstChild,[R,B]=s(ee.nextSibling),V=R.nextSibling,H=A.nextSibling,U=k.nextSibling,W=U.firstChild,G=W.firstChild,K=G.firstChild,te=K.nextSibling,q=G.nextSibling,J=W.nextSibling,[ne,ie]=s(J.nextSibling),Y=U.nextSibling,ae=Y.firstChild,se=ae.firstChild.firstChild,ce=se.nextSibling,le=ae.nextSibling,ue=le.firstChild,de=ue.firstChild,fe=de.firstChild,pe=de.nextSibling,me=pe.firstChild.nextSibling,[he,we]=s(me.nextSibling),Te=ue.nextSibling,Ee=Te.firstChild,De=Ee.firstChild,[Oe,ke]=s(De.nextSibling),Ae=Oe.nextSibling,$=Te.nextSibling,[Le,Re]=s($.nextSibling),ze=Y.nextSibling.firstChild,Be=ze.firstChild.firstChild,He=Be.nextSibling,Ue=ze.nextSibling.firstChild,We=Ue.firstChild,Ke=We.firstChild,[qe,Je]=s(Ke.nextSibling),Ze=qe.nextSibling,Qe=We.nextSibling,$e=Qe.firstChild,[et,tt]=s($e.nextSibling),nt=et.nextSibling,rt=nt.firstChild,it=rt.nextSibling,at=it.nextSibling,ot=Qe.nextSibling,st=ot.firstChild,[ct,lt]=s(st.nextSibling),ut=ct.nextSibling,dt=ut.firstChild,ft=dt.nextSibling,pt=ft.nextSibling,mt=ot.nextSibling,ht=mt.firstChild,[gt,_t]=s(ht.nextSibling),vt=gt.nextSibling,yt=vt.firstChild,bt=yt.nextSibling,xt=mt.nextSibling,St=xt.firstChild,[Ct,wt]=s(St.nextSibling),Tt=Ct.nextSibling,Et=Tt.firstChild,Dt=Et.nextSibling,Ot=xt.nextSibling,kt=Ot.firstChild,[At,jt]=s(kt.nextSibling),Mt=At.nextSibling,Nt=Ot.nextSibling,Pt=Nt.firstChild,Ft=Pt.nextSibling.nextSibling,[It,Lt]=s(Ft.nextSibling),Rt=Ue.nextSibling,zt=Rt.firstChild,Bt=zt.nextSibling,[Vt,Ht]=s(Bt.nextSibling);return e.addEventListener(`submit`,Ve),m(e,a(Ye,{open:I,get types(){return C()},get categories(){return T()},t:f,onClose:()=>L(!1),onSelect:Ge}),r,h),y.$$click=()=>N(null),m(y,()=>f(`settings.customFields.form.backToGroups`),x,S),m(w,()=>f(`settings.customFields.form.editorEyebrow`)),m(E,(()=>{var e=c(()=>!!j().id);return()=>e()?f(`settings.customFields.form.editTitle`):f(`settings.customFields.form.createTitle`)})()),D.$$click=()=>N(null),m(D,()=>f(`settings.customFields.form.cancel`)),m(O,(()=>{var e=c(()=>!!z());return()=>e()?f(`common.loading`):f(`settings.customFields.form.save`)})()),m(A,()=>f(`settings.customFields.form.title`),R,B),V.$$input=e=>Z({title:e.currentTarget.value}),m(H,()=>f(`settings.customFields.form.groupTitleHint`)),m(K,()=>f(`settings.customFields.form.fieldsTitle`)),m(te,()=>f(`settings.customFields.form.fieldsDescription`)),q.$$click=()=>L(!0),m(q,()=>f(`settings.customFields.form.addField`)),m(U,a(Xe,{get fields(){return j().fields},get types(){return C()},get categories(){return T()},get options(){return re()},depth:0,t:f,onChange:e=>Z({fields:e}),expandedId:P,setExpandedId:F,onOpenAddField:()=>L(!0)}),ne,ie),m(se,()=>f(`settings.customFields.location.title`)),m(ce,()=>f(`settings.customFields.location.description`)),m(fe,()=>f(`settings.customFields.form.assignTitle`)),pe.$$click=Pe,m(pe,()=>f(`settings.customFields.location.addGroup`),he,we),m(Ee,()=>f(`settings.customFields.form.contentType`),Oe,ke),Ae.addEventListener(`change`,e=>Ie(e.currentTarget.value)),m(Ae,a(i,{get each(){return p()},children:e=>(()=>{var t=d(_e),n=t.firstChild,[r,i]=s(n.nextSibling),a=r.nextSibling.nextSibling,[c,l]=s(a.nextSibling);return c.nextSibling,m(t,()=>e.pluralLabel,r,i),m(t,()=>e.slug,c,l),o(()=>u(t,`value`,e.slug)),t})()})),m(le,a(i,{get each(){return j().locationRules},children:(e,t)=>(()=>{var r=d(ye),c=r.firstChild,[l,p]=s(c.nextSibling),h=l.nextSibling,[_,v]=s(h.nextSibling),y=_.nextSibling,b=y.firstChild.nextSibling,[x,S]=s(b.nextSibling);return m(r,a(n,{get when(){return t()>0},get children(){var e=d(ve);return m(e,()=>f(`settings.customFields.location.or`)),e}}),l,p),m(r,a(i,{each:e,children:(e,r)=>(()=>{var c=d(xe),l=c.firstChild,p=l.nextSibling,h=p.firstChild,_=h.nextSibling,v=p.nextSibling,[y,b]=s(v.nextSibling),x=y.nextSibling;return l.addEventListener(`change`,e=>{let n=e.currentTarget.value;oe(t(),r(),{param:n,value:X(n)[0]?.value??``})}),m(l,()=>je.map(e=>(()=>{var t=d(M);return u(t,`value`,e),m(t,()=>f(`settings.customFields.location.params.${e}`)),t})())),p.addEventListener(`change`,e=>oe(t(),r(),{operator:e.currentTarget.value})),m(h,()=>f(`settings.customFields.location.operators.eq`)),m(_,()=>f(`settings.customFields.location.operators.neq`)),m(c,a(n,{get when(){return X(e.param).length>0},get fallback(){return(()=>{var n=d(Se);return n.$$input=e=>oe(t(),r(),{value:e.currentTarget.value}),o(()=>u(n,`value`,e.value)),g(),n})()},get children(){var n=d(be),c=n.firstChild,l=c.nextSibling,[p,h]=s(l.nextSibling);return n.addEventListener(`change`,e=>oe(t(),r(),{value:e.currentTarget.value})),m(c,()=>f(`settings.customFields.location.chooseValue`)),m(n,a(i,{get each(){return X(e.param)},children:e=>(()=>{var t=d(M);return m(t,()=>e.label),o(()=>u(t,`value`,e.value)),t})()}),p,h),o(()=>u(n,`value`,e.value)),n}}),y,b),x.$$click=()=>Ne(t(),r()),m(x,()=>f(`settings.customFields.location.remove`)),o(()=>u(l,`value`,e.param)),o(()=>u(p,`value`,e.operator)),g(),c})()}),_,v),y.$$click=()=>Me(t()),m(y,()=>f(`settings.customFields.location.addRule`),x,S),g(),r})()}),Le,Re),m(Be,()=>f(`settings.customFields.form.settingsTitle`)),m(He,()=>f(`settings.customFields.form.settingsDescription`)),m(We,()=>f(`settings.customFields.form.description`),qe,Je),Ze.$$input=e=>Q({description:e.currentTarget.value}),m(Qe,()=>f(`settings.customFields.form.position`),et,tt),nt.addEventListener(`change`,e=>Z({position:e.currentTarget.value})),m(rt,()=>f(`settings.customFields.form.positions.normal`)),m(it,()=>f(`settings.customFields.form.positions.side`)),m(at,()=>f(`settings.customFields.form.positions.acf_after_title`)),m(ot,()=>f(`settings.customFields.form.displayStyle`),ct,lt),ut.addEventListener(`change`,e=>Z({displayStyle:e.currentTarget.value})),m(dt,()=>f(`settings.customFields.form.displayStyles.standard`)),m(ft,()=>f(`settings.customFields.form.displayStyles.seamless`)),m(pt,()=>f(`settings.customFields.form.displayStyles.grouped`)),m(mt,()=>f(`settings.customFields.form.labelPlacement`),gt,_t),vt.addEventListener(`change`,e=>Q({labelPlacement:e.currentTarget.value})),m(yt,()=>f(`settings.customFields.fieldSettings.top`)),m(bt,()=>f(`settings.customFields.fieldSettings.left`)),m(xt,()=>f(`settings.customFields.form.instructionPlacement`),Ct,wt),Tt.addEventListener(`change`,e=>Q({instructionPlacement:e.currentTarget.value})),m(Et,()=>f(`settings.customFields.fieldSettings.above`)),m(Dt,()=>f(`settings.customFields.fieldSettings.below`)),m(Ot,()=>f(`settings.customFields.form.menuOrder`),At,jt),Mt.$$input=e=>Q({menuOrder:e.currentTarget.value?Number(e.currentTarget.value):void 0}),Pt.addEventListener(`change`,e=>Z({active:e.currentTarget.checked})),m(Nt,()=>f(`settings.customFields.groups.active`),It,Lt),m(zt,()=>f(`settings.customFields.form.hideOnScreen`)),m(Rt,a(i,{each:[`permalink`,`content`,`excerpt`,`featured_image`,`author`,`revisions`,`comments`],children:e=>(()=>{var t=d(Ce),n=t.firstChild,r=n.nextSibling.nextSibling,[i,a]=s(r.nextSibling);return n.addEventListener(`change`,t=>Q({hideOnScreen:t.currentTarget.checked?[...j().metadata.hideOnScreen??[],e]:(j().metadata.hideOnScreen??[]).filter(t=>t!==e)})),m(t,()=>f(`settings.customFields.form.hide.${e}`),i,a),o(()=>u(n,`checked`,(j().metadata.hideOnScreen??[]).includes(e))),t})()}),Vt,Ht),o(e=>{var t=z(),n=f(`settings.customFields.form.titlePlaceholder`);return t!==e.e&&u(O,`disabled`,e.e=t),n!==e.t&&l(V,`placeholder`,e.t=n),e},{e:void 0,t:void 0}),o(()=>u(V,`value`,j().title)),o(()=>u(Ae,`value`,Fe(j().locationRules))),o(()=>u(Ze,`value`,j().metadata.description??``)),o(()=>u(nt,`value`,j().position)),o(()=>u(ut,`value`,j().displayStyle)),o(()=>u(vt,`value`,j().metadata.labelPlacement??`top`)),o(()=>u(Tt,`value`,j().metadata.instructionPlacement??`below`)),o(()=>u(Mt,`value`,j().metadata.menuOrder??``)),o(()=>u(Pt,`checked`,j().active)),g(),e})()},get children(){return[(()=>{var e=d(le),t=e.firstChild,n=t.firstChild,r=n.nextSibling,i=r.nextSibling,a=t.nextSibling,o=a.firstChild.nextSibling,[c,l]=s(o.nextSibling);return m(n,()=>f(`settings.customFields.listEyebrow`)),m(r,()=>f(`settings.customFields.groups.title`)),m(i,()=>f(`settings.customFields.description`)),a.$$click=Y,m(a,()=>f(`settings.customFields.groups.new`),c,l),g(),e})(),(()=>{var e=d(ue),t=e.firstChild,n=t.firstChild,[r,c]=s(n.nextSibling),h=r.nextSibling,_=h.firstChild,v=_.nextSibling,[y,b]=s(v.nextSibling),x=t.nextSibling;return m(t,()=>f(`settings.customFields.contentType`),r,c),h.addEventListener(`change`,e=>O(e.currentTarget.value)),m(_,()=>f(`settings.customFields.groups.allContentTypes`)),m(h,a(i,{get each(){return p()},children:e=>(()=>{var t=d(_e),n=t.firstChild,[r,i]=s(n.nextSibling),a=r.nextSibling.nextSibling,[c,l]=s(a.nextSibling);return c.nextSibling,m(t,()=>e.pluralLabel,r,i),m(t,()=>e.slug,c,l),o(()=>u(t,`value`,e.slug)),t})()}),y,b),x.$$input=e=>A(e.currentTarget.value),o(()=>l(x,`placeholder`,f(`settings.customFields.groups.search`))),o(()=>u(h,`value`,D())),o(()=>u(x,`value`,k())),g(),e})(),(()=>{var e=d(fe);return m(e,a(n,{get when(){return q().length>0},get fallback(){return(()=>{var e=d(we),t=e.firstChild.nextSibling,n=t.nextSibling,r=n.nextSibling;return m(t,()=>f(`settings.customFields.groups.empty`)),m(n,()=>f(`settings.customFields.groups.emptyHint`)),r.$$click=Y,m(r,()=>f(`settings.customFields.groups.new`)),g(),e})()},get children(){var e=d(de),t=e.firstChild,r=t.firstChild,l=r.nextSibling,u=l.nextSibling,p=u.nextSibling,h=t.nextSibling,[_,v]=s(h.nextSibling);return m(r,()=>f(`settings.customFields.groups.groupName`)),m(l,()=>f(`settings.customFields.groups.appliesTo`)),m(u,()=>f(`settings.customFields.groups.fields`)),m(p,()=>f(`settings.customFields.groups.status`)),m(e,a(i,{get each(){return q()},children:e=>(()=>{var t=d(Ee),r=t.firstChild,i=r.firstChild,l=i.nextSibling,u=l.nextSibling,[p,h]=s(u.nextSibling),_=r.nextSibling,v=_.nextSibling,y=v.nextSibling,b=y.nextSibling.firstChild,x=b.nextSibling;return m(i,()=>e.title),m(l,()=>e.key),m(r,a(n,{get when(){return e.metadata?.description},get children(){var t=d(Te);return m(t,()=>String(e.metadata?.description)),t}}),p,h),m(_,()=>$(e)),m(v,()=>e.fields.length),m(y,(()=>{var t=c(()=>e.active!==!1);return()=>t()?f(`settings.customFields.groups.active`):f(`settings.customFields.groups.inactive`)})()),b.$$click=()=>ae(e),m(b,()=>f(`settings.customFields.groups.edit`)),x.$$click=()=>void We(e),m(x,()=>f(`settings.customFields.actions.delete`)),o(t=>{var n=e.active!==!1,r=e.active===!1;return n!==t.e&&y.classList.toggle(`badge-success`,t.e=n),r!==t.t&&y.classList.toggle(`badge-secondary`,t.t=r),t},{e:void 0,t:void 0}),g(),t})()}),_,v),e}})),e})(),(()=>{var e=d(pe),t=e.firstChild,r=t.firstChild.firstChild,c=r.nextSibling,l=t.nextSibling.firstChild;return m(r,()=>f(`settings.customFields.standard.title`)),m(c,()=>f(`settings.customFields.standard.description`)),m(l,a(i,{get each(){return J()},children:e=>(()=>{var t=d(Oe),r=t.firstChild,i=r.firstChild,c=i.nextSibling,l=c.firstChild,[p,h]=s(l.nextSibling),g=p.nextSibling.nextSibling,[_,v]=s(g.nextSibling),y=r.nextSibling;return m(i,()=>e.label),m(c,()=>e.key,p,h),m(c,()=>e.type,_,v),m(y,a(n,{get when(){return e.locked},get fallback(){return(()=>{var t=d(ke);return t.addEventListener(`change`,()=>void Ue(e.key)),o(()=>u(t,`checked`,ne().has(e.key))),t})()},get children(){var e=d(De);return m(e,()=>f(`settings.customFields.standard.locked`)),e}})),t})()})),e})()]}})}}),x,S),e})()}p([`click`,`input`,`mousedown`]);export{Qe as CustomFieldsManager};
@@ -0,0 +1 @@
1
+ import{f as e,g as t,i as n,r,s as i,u as a}from"./solid.TEtyrbLc.js";import{a as o,d as s,i as c,m as l,s as u}from"./web.D0f8iaHB.js";import{n as d}from"./i18n.BmX2Cv4K.js";import{t as f}from"./api.DSIz0zxF.js";var p=l(`<div class="notice notice--error">`),m=l(`<table class=table><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody>`),h=l(`<div class=dashboard-home><!$><!/><div class=stats-grid><div class="card stat-card"><h3 class=stat-label></h3><p class=stat-value></p></div><div class="card stat-card"><h3 class=stat-label></h3><p class=stat-value></p></div><div class="card stat-card"><h3 class=stat-label></h3><p class=stat-value></p></div><div class="card stat-card"><h3 class=stat-label></h3><p class=stat-value></p></div><div class="card stat-card"><h3 class=stat-label></h3><p class=stat-value></p></div></div><div class=card><div class=card-header><h3></h3><a href=/content/post class="btn btn-secondary btn-sm"></a></div><!$><!/>`),g=l(`<p class=muted>`),_=l(`<tr><td><a></a></td><td></td><td></td><td class=muted>`);function v(e){return e}function y(e){let t=v(e).updated_at??v(e).updatedAt??v(e).created_at;if(typeof t!=`string`)return`—`;let n=new Date(t);return Number.isNaN(n.getTime())?`—`:n.toLocaleString(`pt-BR`)}function b(){let{t:l}=d(),[b,x]=e({total:`—`,published:`—`,drafts:`—`,media:`—`,users:`—`}),[S,C]=e([]),[w,T]=e(``);return t(async()=>{let[e,t,n,r,i,a]=await Promise.allSettled([f.getContent({limit:1}),f.getContent({limit:1,status:`PUBLISHED`}),f.getContent({limit:1,status:`DRAFT`}),f.listMedia({limit:1}),f.listUsers({limit:1}),f.getContent({limit:5})]),o=e=>e.status===`fulfilled`?String(e.value.total):`?`;x({total:o(e),published:o(t),drafts:o(n),media:o(r),users:o(i)}),a.status===`fulfilled`?C(a.value.data??[]):T(a.reason instanceof Error?a.reason.message:String(a.reason))}),(()=>{var e=c(h),t=e.firstChild,[d,f]=o(t.nextSibling),x=d.nextSibling,C=x.firstChild,T=C.firstChild,E=T.nextSibling,D=C.nextSibling,O=D.firstChild,k=O.nextSibling,A=D.nextSibling,j=A.firstChild,M=j.nextSibling,N=A.nextSibling,P=N.firstChild,F=P.nextSibling,I=N.nextSibling.firstChild,L=I.nextSibling,R=x.nextSibling,z=R.firstChild,B=z.firstChild,V=B.nextSibling,H=z.nextSibling,[U,W]=o(H.nextSibling);return u(e,i(n,{get when(){return w()},get children(){var e=c(p);return u(e,w),e}}),d,f),u(T,()=>l(`dashboard.stats.totalContent`)),u(E,()=>b().total),u(O,()=>l(`dashboard.stats.published`)),u(k,()=>b().published),u(j,()=>l(`dashboard.stats.drafts`)),u(M,()=>b().drafts),u(P,()=>l(`dashboard.stats.mediaFiles`)),u(F,()=>b().media),u(I,()=>l(`dashboard.stats.users`)),u(L,()=>b().users),u(B,()=>l(`dashboard.recent.title`)),u(V,()=>l(`dashboard.recent.viewAll`)),u(R,i(n,{get when(){return S().length>0},get fallback(){return(()=>{var e=c(g);return u(e,()=>l(`dashboard.recent.empty`)),e})()},get children(){var e=c(m),t=e.firstChild,n=t.firstChild.firstChild,o=n.nextSibling,d=o.nextSibling,f=d.nextSibling,p=t.nextSibling;return u(n,()=>l(`dashboard.recent.columns.title`)),u(o,()=>l(`dashboard.recent.columns.type`)),u(d,()=>l(`dashboard.recent.columns.status`)),u(f,()=>l(`dashboard.recent.columns.updated`)),u(p,i(r,{get each(){return S()},children:e=>(()=>{var t=c(_),n=t.firstChild,r=n.firstChild,i=n.nextSibling,o=i.nextSibling,l=o.nextSibling;return u(r,()=>String(v(e).title??`—`)),u(i,()=>String(v(e).type??`—`)),u(o,()=>String(v(e).status??`—`)),u(l,()=>y(e)),a(()=>s(r,`href`,`/content/${encodeURIComponent(String(v(e).type??`post`))}/edit?id=${encodeURIComponent(String(v(e).id??``))}`)),t})()})),e}}),U,W),e})()}export{b as DashboardHome};
@@ -1 +1 @@
1
- import{t as e}from"./i18n.Tk18hqHh.js";import{t}from"./api.DSIz0zxF.js";import{n,t as r}from"./lucide.DlU56wZ1.js";(async()=>{await t.isLoggedIn()||window.location.replace(`/login`)})();try{localStorage.getItem(`sidebar-collapsed`)===`true`&&document.body.classList.add(`sidebar-collapsed`)}catch{}var i=()=>{document.querySelectorAll(`[data-nav-group]`).forEach(e=>{let t=e.querySelector(`:scope > .nav-group-header .nav-group-toggle`);t&&t.dataset.bound!==`true`&&(t.dataset.bound=`true`,t.addEventListener(`click`,()=>{let n=!e.classList.contains(`open`);e.classList.toggle(`open`,n),t.setAttribute(`aria-expanded`,String(n))}))})},a=(e,t,n=`nav-item`,r)=>{let i=document.createElement(`a`);return i.className=n,i.href=t,i.textContent=e,r&&(i.dataset.sidebarI18n=r),i},o=async()=>{let e=document.querySelector(`[data-post-types-menu]`);if(e)try{let[i,o]=await Promise.all([t.getContentTypes(),t.getTaxonomies().catch(()=>[])]);e.replaceChildren();let s=new URLSearchParams(window.location.search);for(let t of i){let n=document.createElement(`div`);n.className=`nav-type-entry`;let r=document.createElement(`div`);r.className=`nav-type-row`;let i=a(t.pluralLabel||t.name,`/content/${encodeURIComponent(t.slug)}`,`nav-item nav-type-link`);i.classList.toggle(`active`,window.location.pathname.startsWith(`/content/${t.slug}`));let c=document.createElement(`i`);c.dataset.lucide=t.menuIcon||`box`,c.className=`nav-type-icon`,c.setAttribute(`aria-hidden`,`true`),i.prepend(c),r.append(i);let l=o.filter(e=>e.attachTo?.includes(t.slug));if(l.length>0){let e=document.createElement(`button`);e.className=`nav-taxonomy-toggle`,e.type=`button`,e.textContent=`⌄`,e.setAttribute(`aria-label`,`Toggle ${t.pluralLabel||t.name} taxonomies`),r.append(e),n.append(r);let i=document.createElement(`div`);i.className=`nav-taxonomy-menu`;let o=s.get(`type`)===t.slug||window.location.pathname.startsWith(`/content/${t.slug}`);i.classList.toggle(`open`,o),e.setAttribute(`aria-expanded`,String(o)),e.addEventListener(`click`,()=>{let t=!i.classList.contains(`open`);i.classList.toggle(`open`,t),e.setAttribute(`aria-expanded`,String(t))});for(let e of l){let n=a(e.labels?.plural_name??e.labels?.name??e.name,`/content/${encodeURIComponent(t.slug)}/taxonomy?taxonomy=${encodeURIComponent(e.slug)}`,`nav-subitem nav-taxonomy-item`),r=new URL(n.href,window.location.origin);n.classList.toggle(`active`,window.location.pathname===r.pathname&&s.get(`taxonomy`)===e.slug),i.append(n)}n.append(i)}else n.append(r);e.append(n)}r({icons:n})}catch{}};i(),r({icons:n}),o(),window.addEventListener(`okcms:content-models-changed`,()=>void o());var s=async t=>{let n=await e(t);document.querySelectorAll(`[data-sidebar-i18n]`).forEach(e=>{let t=e.dataset.sidebarI18n;t&&(e.textContent=n(t))})};window.addEventListener(`okcms:locale-changed`,e=>{let t=e.detail?.locale;t&&s(t)});
1
+ import{t as e}from"./i18n.BmX2Cv4K.js";import{t}from"./api.DSIz0zxF.js";import{n,t as r}from"./lucide.DlU56wZ1.js";(async()=>{await t.isLoggedIn()||window.location.replace(`/login`)})();try{localStorage.getItem(`sidebar-collapsed`)===`true`&&document.body.classList.add(`sidebar-collapsed`)}catch{}var i=()=>{document.querySelectorAll(`[data-nav-group]`).forEach(e=>{let t=e.querySelector(`:scope > .nav-group-header .nav-group-toggle`);t&&t.dataset.bound!==`true`&&(t.dataset.bound=`true`,t.addEventListener(`click`,()=>{let n=!e.classList.contains(`open`);e.classList.toggle(`open`,n),t.setAttribute(`aria-expanded`,String(n))}))})},a=(e,t,n=`nav-item`,r)=>{let i=document.createElement(`a`);return i.className=n,i.href=t,i.textContent=e,r&&(i.dataset.sidebarI18n=r),i},o=async()=>{let e=document.querySelector(`[data-post-types-menu]`);if(e)try{let[i,o]=await Promise.all([t.getContentTypes(),t.getTaxonomies().catch(()=>[])]);e.replaceChildren();let s=new URLSearchParams(window.location.search);for(let t of i){let n=document.createElement(`div`);n.className=`nav-type-entry`;let r=document.createElement(`div`);r.className=`nav-type-row`;let i=a(t.pluralLabel||t.name,`/content/${encodeURIComponent(t.slug)}`,`nav-item nav-type-link`);i.classList.toggle(`active`,window.location.pathname.startsWith(`/content/${t.slug}`));let c=document.createElement(`i`);c.dataset.lucide=t.menuIcon||`box`,c.className=`nav-type-icon`,c.setAttribute(`aria-hidden`,`true`),i.prepend(c),r.append(i);let l=o.filter(e=>e.attachTo?.includes(t.slug));if(l.length>0){let e=document.createElement(`button`);e.className=`nav-taxonomy-toggle`,e.type=`button`,e.textContent=`⌄`,e.setAttribute(`aria-label`,`Toggle ${t.pluralLabel||t.name} taxonomies`),r.append(e),n.append(r);let i=document.createElement(`div`);i.className=`nav-taxonomy-menu`;let o=s.get(`type`)===t.slug||window.location.pathname.startsWith(`/content/${t.slug}`);i.classList.toggle(`open`,o),e.setAttribute(`aria-expanded`,String(o)),e.addEventListener(`click`,()=>{let t=!i.classList.contains(`open`);i.classList.toggle(`open`,t),e.setAttribute(`aria-expanded`,String(t))});for(let e of l){let n=a(e.labels?.plural_name??e.labels?.name??e.name,`/content/${encodeURIComponent(t.slug)}/taxonomy?taxonomy=${encodeURIComponent(e.slug)}`,`nav-subitem nav-taxonomy-item`),r=new URL(n.href,window.location.origin);n.classList.toggle(`active`,window.location.pathname===r.pathname&&s.get(`taxonomy`)===e.slug),i.append(n)}n.append(i)}else n.append(r);e.append(n)}r({icons:n})}catch{}};i(),r({icons:n}),o(),window.addEventListener(`okcms:content-models-changed`,()=>void o());var s=async t=>{let n=await e(t);document.querySelectorAll(`[data-sidebar-i18n]`).forEach(e=>{let t=e.dataset.sidebarI18n;t&&(e.textContent=n(t))})};window.addEventListener(`okcms:locale-changed`,e=>{let t=e.detail?.locale;t&&s(t)});
@@ -1,4 +1,4 @@
1
- import{u as e}from"./solid.TEtyrbLc.js";import{i as t,o as n,p as r,r as i,u as a}from"./web.C8wWxyYF.js";import{n as o}from"./i18n.Tk18hqHh.js";import{t as s}from"./version.CebqHGW-.js";var c=r(`<footer class=admin-footer role=contentinfo><div class=footer-content><div class=footer-left><p class=footer-version><span class=product-name>OkCMS</span><span class=version-badge>v<!$><!/></span></p></div><nav class=footer-links><a href=https://oktisworks.com target=_blank rel="noopener noreferrer"></a><a href=https://github.com/oktis-works/cms target=_blank rel="noopener noreferrer"></a><a href=https://docs.oktisworks.com target=_blank rel="noopener noreferrer"></a><a href=https://oktisworks.com/community target=_blank rel="noopener noreferrer"></a></nav><div class=footer-right><p class=footer-powered></p></div></div><style>
1
+ import{u as e}from"./solid.TEtyrbLc.js";import{a as t,d as n,i as r,m as i,s as a}from"./web.D0f8iaHB.js";import{n as o}from"./i18n.BmX2Cv4K.js";import{t as s}from"./version.KwdsE3xt.js";var c=i(`<footer class=admin-footer role=contentinfo><div class=footer-content><div class=footer-left><p class=footer-version><span class=product-name>OkCMS</span><span class=version-badge>v<!$><!/></span></p></div><nav class=footer-links><a href=https://oktisworks.com target=_blank rel="noopener noreferrer"></a><a href=https://github.com/oktis-works/cms target=_blank rel="noopener noreferrer"></a><a href=https://docs.oktisworks.com target=_blank rel="noopener noreferrer"></a><a href=https://oktisworks.com/community target=_blank rel="noopener noreferrer"></a></nav><div class=footer-right><p class=footer-powered></p></div></div><style>
2
2
  .admin-footer {
3
3
  position: static;
4
4
  width: 100%;
@@ -69,4 +69,4 @@ import{u as e}from"./solid.TEtyrbLc.js";import{i as t,o as n,p as r,r as i,u as
69
69
  [dir="rtl"] .footer-links { flex-direction: row-reverse; }
70
70
  [dir="rtl"] .footer-right { text-align: left; }
71
71
  [dir="rtl"] .footer-left { align-items: flex-end; }
72
- `);function l(){let{t:r}=o(),l=s;return(()=>{var o=i(c),s=o.firstChild.firstChild,u=s.firstChild.firstChild.nextSibling,d=u.firstChild.nextSibling,[f,p]=t(d.nextSibling),m=s.nextSibling,h=m.firstChild,g=h.nextSibling,_=g.nextSibling,v=_.nextSibling,y=m.nextSibling.firstChild;return n(u,l,f,p),n(h,()=>r(`footer.website`)),n(g,()=>r(`footer.github`)),n(_,()=>r(`footer.docs`)),n(v,()=>r(`footer.community`)),n(y,()=>r(`footer.poweredBy`)),e(()=>a(m,`aria-label`,r(`footer.links`))),o})()}export{l as Footer};
72
+ `);function l(){let{t:i}=o(),l=s;return(()=>{var o=r(c),s=o.firstChild.firstChild,u=s.firstChild.firstChild.nextSibling,d=u.firstChild.nextSibling,[f,p]=t(d.nextSibling),m=s.nextSibling,h=m.firstChild,g=h.nextSibling,_=g.nextSibling,v=_.nextSibling,y=m.nextSibling.firstChild;return a(u,l,f,p),a(h,()=>i(`footer.website`)),a(g,()=>i(`footer.github`)),a(_,()=>i(`footer.docs`)),a(v,()=>i(`footer.community`)),a(y,()=>i(`footer.poweredBy`)),e(()=>n(m,`aria-label`,i(`footer.links`))),o})()}export{l as Footer};
@@ -0,0 +1 @@
1
+ import{f as e,g as t,i as n,l as r,s as i}from"./solid.TEtyrbLc.js";import{a,c as o,i as s,m as c,s as l}from"./web.D0f8iaHB.js";import{n as u}from"./i18n.BmX2Cv4K.js";import{t as d}from"./api.DSIz0zxF.js";import{i as f,n as p,r as m,s as h}from"./dist.D3896CDR.js";var g=c(`<div class="notice notice--error">`),_=c(`<div class=notice>`),v=c(`<form><h3></h3><div class=form-grid></div><div class=media-details__actions>`),y=c(`<div class=general-settings><!$><!/><!$><!/><!$><!/>`),b=c(`<p class=muted>`);function x(){let{t:c}=u(),[x,S]=e({}),[C,w]=e(!1),[T,E]=e(``),[D,O]=e(``),[k,A]=e(!1),j=r(()=>[{key:`siteTitle`,label:c(`settings.general.fields.siteTitle`),type:`text`,placeholder:c(`settings.general.fields.siteTitlePlaceholder`)},{key:`siteDescription`,label:c(`settings.general.fields.siteDescription`),type:`text`,placeholder:c(`settings.general.fields.siteDescriptionPlaceholder`)},{key:`language`,label:c(`settings.general.fields.language`),type:`select`,options:[`pt-BR`,`en-US`,`es-ES`]},{key:`timezone`,label:c(`settings.general.fields.timezone`),type:`text`,placeholder:c(`settings.general.fields.timezonePlaceholder`)}]);t(async()=>{try{let e=await d.getSettings(`general`),t={};for(let n of e)t[n.key]=typeof n.value==`string`?n.value:JSON.stringify(n.value??``);for(let e of j())t[e.key]===void 0&&(t[e.key]=``);S(t),w(!0)}catch(e){E(e instanceof Error?e.message:String(e))}});let M=async e=>{e.preventDefault(),E(``),O(``),A(!0);try{let e=await d.getSettings(`general`),t=new Map(e.map(e=>[e.key,e]));await d.updateSettings(j().map(e=>{let n=t.get(e.key);return{key:e.key,value:x()[e.key]??``,group:n?.group??`general`,type:n?.type??`string`}})),O(c(`settings.general.saved`))}catch(e){E(e instanceof Error?e.message:String(e))}finally{A(!1)}};return(()=>{var e=s(y),t=e.firstChild,[r,u]=a(t.nextSibling),d=r.nextSibling,[w,E]=a(d.nextSibling),O=w.nextSibling,[A,N]=a(O.nextSibling);return l(e,i(n,{get when(){return T()},get children(){var e=s(g);return l(e,T),e}}),r,u),l(e,i(n,{get when(){return D()},get children(){var e=s(_);return l(e,D),e}}),w,E),l(e,i(n,{get when(){return C()},get fallback(){return(()=>{var e=s(b);return l(e,()=>c(`settings.general.loading`)),e})()},get children(){return i(m,{get children(){var e=s(v),t=e.firstChild,n=t.nextSibling,r=n.nextSibling;return e.addEventListener(`submit`,M),l(t,()=>c(`settings.general.title`)),l(n,()=>j().map(e=>e.type===`select`?i(h,{get name(){return e.key},get label(){return e.label},get value(){return x()[e.key]??``},get options(){return o(()=>`options`in e)()?e.options.map(e=>({value:e,label:e})):[]},onChange:t=>S({...x(),[e.key]:t})}):i(f,{get name(){return e.key},get label(){return e.label},get placeholder(){return o(()=>`placeholder`in e)()?e.placeholder:``},get value(){return x()[e.key]??``},onInput:t=>S({...x(),[e.key]:t})}))),l(r,i(p,{variant:`primary`,type:`submit`,get disabled(){return k()},get loading(){return k()},get children(){return c(`settings.general.save`)}})),e}})}}),A,N),e})()}export{x as GeneralSettings};
@@ -0,0 +1 @@
1
+ import{f as e,g as t,i as n,r,s as i,u as a}from"./solid.TEtyrbLc.js";import{a as o,c as s,d as c,f as l,i as u,m as d,r as f,s as p,u as m}from"./web.D0f8iaHB.js";import{n as h}from"./i18n.BmX2Cv4K.js";import{t as g}from"./api.DSIz0zxF.js";var _=d(`<div class="notice notice--error">`),v=d(`<div class="notice notice--success">`),y=d(`<div class=table-scroll><table class=table><thead><tr><th></th><th></th><th></th><th></th><th></th><th></th></tr></thead><tbody>`),b=d(`<div class="resource-hub logs-manager"><!$><!/><!$><!/><section class=card><div class=card-header-row><div><h3></h3><p></p></div></div><form class="resource-form logs-retention-form"><label><!$><!/><input class=input type=number min=1 max=3650 required></label><button class="btn btn-primary"type=submit></button></form></section><section class=card><div class=card-header-row><h3></h3><button class=btn type=button></button></div><div class=logs-filters><input class=input><input class=input><button class=btn type=button></button></div><!$><!/>`),x=d(`<p>`),S=d(`<tr><td></td><td><code></code></td><td><!$><!/><!$><!/></td><td></td><td></td><td>`);function C(){let{t:d}=h(),[f,C]=e([]),[w,T]=e(90),[E,D]=e(``),[O,k]=e(``),[A,j]=e(``),[M,N]=e(``),[P,F]=e(!0),I=async()=>{F(!0),j(``);try{let[e,t]=await Promise.all([g.getAuditLogConfig(),g.listAuditLogs({limit:500,action:E()||void 0,resourceType:O()||void 0})]);T(e.retentionDays),C(t.data)}catch(e){j(e instanceof Error?e.message:String(e))}finally{F(!1)}};t(I);let L=async e=>{e.preventDefault();try{let e=await g.updateAuditLogConfig(w());T(e.retentionDays),N(d(`logs.retentionSaved`)),await I()}catch(e){j(e instanceof Error?e.message:String(e))}};return(()=>{var e=u(b),t=e.firstChild,[h,g]=o(t.nextSibling),C=h.nextSibling,[j,N]=o(C.nextSibling),F=j.nextSibling,R=F.firstChild,z=R.firstChild.firstChild,B=z.nextSibling,V=R.nextSibling,H=V.firstChild,U=H.firstChild,[W,ee]=o(U.nextSibling),G=W.nextSibling,te=H.nextSibling,K=F.nextSibling,q=K.firstChild,J=q.firstChild,Y=J.nextSibling,X=q.nextSibling,Z=X.firstChild,Q=Z.nextSibling,$=Q.nextSibling,ne=X.nextSibling,[re,ie]=o(ne.nextSibling);return p(e,i(n,{get when(){return A()},get children(){var e=u(_);return p(e,A),e}}),h,g),p(e,i(n,{get when(){return M()},get children(){var e=u(v);return p(e,M),e}}),j,N),p(z,()=>d(`logs.retentionTitle`)),p(B,()=>d(`logs.retentionDescription`)),V.addEventListener(`submit`,L),p(H,()=>d(`logs.retentionDays`),W,ee),G.$$input=e=>T(Number(e.currentTarget.value)),p(te,()=>d(`common.save`)),p(J,()=>d(`logs.historyTitle`)),Y.$$click=()=>void I(),p(Y,()=>d(`common.refresh`)),Z.$$input=e=>D(e.currentTarget.value),Q.$$input=e=>k(e.currentTarget.value),$.$$click=()=>void I(),p($,()=>d(`common.filter`)),p(K,i(n,{get when(){return!P()},get fallback(){return(()=>{var e=u(x);return p(e,()=>d(`logs.loading`)),e})()},get children(){return i(n,{get when(){return f().length>0},get fallback(){return(()=>{var e=u(x);return p(e,()=>d(`logs.empty`)),e})()},get children(){var e=u(y),t=e.firstChild.firstChild,n=t.firstChild.firstChild,a=n.nextSibling,c=a.nextSibling,l=c.nextSibling,m=l.nextSibling,h=m.nextSibling,g=t.nextSibling;return p(n,()=>d(`logs.columns.date`)),p(a,()=>d(`logs.columns.action`)),p(c,()=>d(`logs.columns.resource`)),p(l,()=>d(`logs.columns.user`)),p(m,()=>d(`logs.columns.status`)),p(h,()=>d(`logs.columns.ip`)),p(g,i(r,{get each(){return f()},children:e=>(()=>{var t=u(S),n=t.firstChild,r=n.nextSibling,i=r.firstChild,a=r.nextSibling,c=a.firstChild,[l,f]=o(c.nextSibling),m=l.nextSibling,[h,g]=o(m.nextSibling),_=a.nextSibling,v=_.nextSibling,y=v.nextSibling;return p(n,(()=>{var t=s(()=>!!e.created_at);return()=>t()?new Date(e.created_at).toLocaleString():`—`})()),p(i,()=>e.action),p(a,()=>e.resourceType,l,f),p(a,(()=>{var t=s(()=>!!e.resourceId);return()=>t()?`:${e.resourceId}`:``})(),h,g),p(_,()=>e.userId??d(`logs.system`)),p(v,()=>String(e.changes?.status??`—`)),p(y,()=>e.ipAddress??`—`),t})()})),e}})}}),re,ie),a(e=>{var t=d(`logs.actionFilter`),n=d(`logs.resourceFilter`);return t!==e.e&&c(Z,`placeholder`,e.e=t),n!==e.t&&c(Q,`placeholder`,e.t=n),e},{e:void 0,t:void 0}),a(()=>l(G,`value`,w())),a(()=>l(Z,`value`,E())),a(()=>l(Q,`value`,O())),m(),e})()}f([`input`,`click`]);export{C as LogsManager};
@@ -0,0 +1 @@
1
+ import{f as e,g as t,i as n,r,s as i,u as a}from"./solid.TEtyrbLc.js";import{a as o,c as s,d as c,f as l,i as u,m as d,r as f,s as p,u as ee}from"./web.D0f8iaHB.js";import{n as m}from"./i18n.BmX2Cv4K.js";import{t as h}from"./api.DSIz0zxF.js";import{a as g,i as _,n as v,o as y,s as te}from"./dist.D3896CDR.js";var ne=d(`<div class="notice notice--error">`),re=d(`<div class=notice>`),ie=d(`<div class=media-grid>`),ae=d(`<div class=media-library><!$><!/><!$><!/><div class=upload-zone><p><strong></strong> ou</p><label class="btn btn-primary"style=cursor:pointer><!$><!/><input type=file multiple style=display:none></label><p class=muted></p></div><div class=toolbar><!$><!/><!$><!/><!$><!/></div><!$><!/><!$><!/><!$><!/>`),oe=d(`<p class=muted>`),se=d(`<img loading=lazy>`,!0,!1,!1),ce=d(`<button type=button class=media-card><div class=media-card__preview></div><div class=media-card__meta><span class=media-card__name></span><span class=muted><!$><!/> · <!$><!/>`),le=d(`<span class=media-card__ext>`),ue=d(`<img>`),de=d(`<video controls>`),fe=d(`<audio controls>`),pe=d(`<iframe>`),me=d(`<div class="media-card__ext media-modal__file-icon">`),he=d(`<dt>`),ge=d(`<dd>`),_e=d(`<div class=media-modal><div class=media-modal__preview><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/></div><div class=media-modal__layout><div class=media-modal__fields><!$><!/><!$><!/><!$><!/><label class=field__label><!$><!/><textarea class="input media-modal__textarea"name=media-description></textarea></label></div><dl class="media-details__list media-modal__facts"><dt></dt><dd></dd><dt></dt><dd></dd><dt></dt><dd></dd><!$><!/><dt></dt><dd></dd><dt></dt><dd class=media-details__url><code></code><button class="btn btn-secondary btn-sm"type=button></button></dd></dl></div><div class=media-modal__replace><label class="btn btn-secondary"style=cursor:pointer><!$><!/><input type=file style=display:none></label><span class=muted></span></div><div class=media-details__actions><!$><!/><!$><!/><!$><!/>`);function ve(e){return Number.isFinite(e)?e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`:`—`}function b(e){return e.mime_type.startsWith(`image/`)}function ye(e){return e.mime_type.startsWith(`video/`)}function be(e){return e.mime_type.startsWith(`audio/`)}function xe(e){return e.mime_type===`application/pdf`}function x(e){return e.title?.trim()||e.filename}function Se(e){let t=e.metadata,n=Number(t?.width),r=Number(t?.height);return n>0&&r>0?`${n} × ${r} px`:null}function S(e){return{title:e.title??e.filename,alt:e.alt??``,caption:e.caption??``,description:e.description??``}}function C(d){let{t:f}=m(),[C,w]=e([]),[Ce,T]=e(0),[E,D]=e(1),[O,we]=e(``),[k,A]=e(``),[j,M]=e(``),[Te,N]=e(``),[Ee,P]=e(!1),[F,I]=e(null),[L,R]=e({title:``,alt:``,caption:``,description:``}),[De,z]=e(!1),[Oe,B]=e(!1),[ke,V]=e(!1),H=e=>h.mediaUrl(e.url),U=async()=>{try{let e=await h.listMedia({page:E(),limit:24,search:O()||void 0,mimeType:k()||void 0});w(e.data??[]),T(e.total??0)}catch(e){M(e instanceof Error?e.message:String(e))}};t(U);let W=async()=>{D(1),await U()},Ae=e=>{I(e),R(S(e)),M(``)},G=async e=>{if(e.length===0)return;P(!0),M(``),N(``);let t=0;for(let n of Array.from(e))try{await h.uploadMedia(n,{alt:``}),t+=1}catch(e){M(`${n.name}: ${e instanceof Error?e.message:String(e)}`)}P(!1),t>0&&(N(f(`media.toasts.uploaded`,{count:t})),D(1),await U())},je=async e=>{if(confirm(f(`media.details.confirmDelete`,{filename:e.filename})))try{await h.deleteMedia(e.id),F()?.id===e.id&&I(null),await U()}catch(e){M(e instanceof Error?e.message:String(e))}},Me=async()=>{let e=F();if(e){B(!0),M(``);try{let t=await h.updateMedia(e.id,L()),n={...e,...t};I(n),R(S(n)),N(f(`media.details.saved`)),await U()}catch(e){M(e instanceof Error?e.message:String(e))}finally{B(!1)}}},Ne=async e=>{let t=F();if(t){V(!0),M(``);try{let n=await h.replaceMediaFile(t.id,e),r={...t,...n};I(r),R(S(r)),N(f(`media.details.replaced`)),await U()}catch(e){M(e instanceof Error?e.message:String(e))}finally{V(!1)}}},Pe=async e=>{try{await navigator.clipboard.writeText(e),N(f(`media.details.copied`))}catch{M(f(`media.details.copyError`))}};return(()=>{var e=u(ae),t=e.firstChild,[m,h]=o(t.nextSibling),S=m.nextSibling,[w,T]=o(S.nextSibling),M=w.nextSibling,N=M.firstChild,P=N.firstChild,B=N.nextSibling,V=B.firstChild,[Fe,Ie]=o(V.nextSibling),K=Fe.nextSibling,Le=B.nextSibling,q=M.nextSibling,Re=q.firstChild,[J,Y]=o(Re.nextSibling),ze=J.nextSibling,[X,Be]=o(ze.nextSibling),Ve=X.nextSibling,[He,Z]=o(Ve.nextSibling),Ue=q.nextSibling,[Q,We]=o(Ue.nextSibling),Ge=Q.nextSibling,[$,Ke]=o(Ge.nextSibling),qe=$.nextSibling,[Je,Ye]=o(qe.nextSibling);return p(e,i(n,{get when(){return j()},get children(){var e=u(ne);return p(e,j),e}}),m,h),p(e,i(n,{get when(){return Te()},get children(){var e=u(re);return p(e,Te),e}}),w,T),M.addEventListener(`drop`,e=>{e.preventDefault(),z(!1),e.dataTransfer&&G(e.dataTransfer.files)}),M.addEventListener(`dragleave`,()=>z(!1)),M.addEventListener(`dragover`,e=>{e.preventDefault(),z(!0)}),p(P,()=>f(`media.upload.dropzone`)),p(B,(()=>{var e=s(()=>!!Ee());return()=>e()?f(`media.upload.uploading`):f(`media.upload.select`)})(),Fe,Ie),K.addEventListener(`change`,e=>{e.currentTarget.files&&G(e.currentTarget.files),e.currentTarget.value=``}),p(Le,()=>f(`media.upload.hint`)),p(q,i(_,{name:`media-search`,get placeholder(){return f(`media.toolbar.search`)},get value(){return O()},onInput:e=>{we(e),W()}}),J,Y),p(q,i(te,{name:`media-mime`,get placeholder(){return f(`media.toolbar.allTypes`)},get value(){return k()},get options(){return[{value:`image/png`,label:f(`media.mimeTypes.png`)},{value:`image/jpeg`,label:f(`media.mimeTypes.jpeg`)},{value:`image/gif`,label:f(`media.mimeTypes.gif`)},{value:`image/webp`,label:f(`media.mimeTypes.webp`)},{value:`image/svg+xml`,label:f(`media.mimeTypes.svg`)},{value:`application/pdf`,label:f(`media.mimeTypes.pdf`)},{value:`video/mp4`,label:f(`media.mimeTypes.mp4`)},{value:`audio/mpeg`,label:f(`media.mimeTypes.mp3`)}]},onChange:e=>{A(e),W()}}),X,Be),p(q,i(v,{variant:`secondary`,onClick:()=>void W(),get children(){return f(`media.toolbar.searchBtn`)}}),He,Z),p(e,i(n,{get when(){return C().length>0},get fallback(){return(()=>{var e=u(oe);return p(e,()=>f(`media.empty`)),e})()},get children(){var e=u(ie);return p(e,i(r,{get each(){return C()},children:e=>(()=>{var t=u(ce),r=t.firstChild,s=r.nextSibling.firstChild,l=s.nextSibling,d=l.firstChild,[f,m]=o(d.nextSibling),h=f.nextSibling.nextSibling,[g,_]=o(h.nextSibling);return t.$$click=()=>Ae(e),p(r,i(n,{get when(){return b(e)},get fallback(){return(()=>{var t=u(le);return p(t,()=>e.mime_type.split(`/`)[1]?.toUpperCase()??`FILE`),t})()},get children(){var t=u(se);return a(n=>{var r=H(e),i=e.alt??x(e);return r!==n.e&&c(t,`src`,n.e=r),i!==n.t&&c(t,`alt`,n.t=i),n},{e:void 0,t:void 0}),t}})),p(s,()=>x(e)),p(l,()=>e.filename,f,m),p(l,()=>ve(e.size),g,_),a(n=>{var r=F()?.id===e.id,i=x(e);return r!==n.e&&t.classList.toggle(`media-card--selected`,n.e=r),i!==n.t&&c(s,`title`,n.t=i),n},{e:void 0,t:void 0}),ee(),t})()})),e}}),Q,We),p(e,i(y,{get page(){return E()},limit:24,get total(){return Ce()},onPageChange:e=>{D(e),U()}}),$,Ke),p(e,i(g,{get open(){return!!F()},get title(){return s(()=>!!F())()?x(F()):f(`media.details.title`)},onClose:()=>I(null),get children(){return i(n,{get when(){return F()},children:e=>(()=>{var t=u(_e),r=t.firstChild,d=r.firstChild,[m,h]=o(d.nextSibling),g=m.nextSibling,[y,te]=o(g.nextSibling),ne=y.nextSibling,[re,ie]=o(ne.nextSibling),ae=re.nextSibling,[oe,se]=o(ae.nextSibling),ce=oe.nextSibling,[le,S]=o(ce.nextSibling),C=r.nextSibling,w=C.firstChild,Ce=w.firstChild,[T,E]=o(Ce.nextSibling),D=T.nextSibling,[O,we]=o(D.nextSibling),k=O.nextSibling,[A,j]=o(k.nextSibling),M=A.nextSibling,Te=M.firstChild,[N,Ee]=o(Te.nextSibling),P=N.nextSibling,F=w.nextSibling,De=F.firstChild,z=De.nextSibling,B=z.nextSibling,V=B.nextSibling,U=V.nextSibling,W=U.nextSibling,Ae=W.nextSibling,[G,Fe]=o(Ae.nextSibling),Ie=G.nextSibling,K=Ie.nextSibling,Le=K.nextSibling,q=Le.nextSibling.firstChild,Re=q.nextSibling,J=C.nextSibling,Y=J.firstChild,ze=Y.firstChild,[X,Be]=o(ze.nextSibling),Ve=X.nextSibling,He=Y.nextSibling,Z=J.nextSibling,Ue=Z.firstChild,[Q,We]=o(Ue.nextSibling),Ge=Q.nextSibling,[$,Ke]=o(Ge.nextSibling),qe=$.nextSibling,[Je,Ye]=o(qe.nextSibling);return p(r,i(n,{get when(){return b(e())},get children(){var t=u(ue);return a(n=>{var r=H(e()),i=L().alt||x(e());return r!==n.e&&c(t,`src`,n.e=r),i!==n.t&&c(t,`alt`,n.t=i),n},{e:void 0,t:void 0}),t}}),m,h),p(r,i(n,{get when(){return ye(e())},get children(){var t=u(de);return a(()=>c(t,`src`,H(e()))),t}}),y,te),p(r,i(n,{get when(){return be(e())},get children(){var t=u(fe);return a(()=>c(t,`src`,H(e()))),t}}),re,ie),p(r,i(n,{get when(){return xe(e())},get children(){var t=u(pe);return a(n=>{var r=x(e()),i=H(e());return r!==n.e&&c(t,`title`,n.e=r),i!==n.t&&c(t,`src`,n.t=i),n},{e:void 0,t:void 0}),t}}),oe,se),p(r,i(n,{get when(){return s(()=>!(b(e())||ye(e())||be(e())))()&&!xe(e())},get children(){var t=u(me);return p(t,()=>e().mime_type.split(`/`)[1]?.toUpperCase()??`FILE`),t}}),le,S),p(w,i(_,{name:`media-title`,get label(){return f(`media.details.titleField`)},get value(){return L().title},onInput:e=>R({...L(),title:e})}),T,E),p(w,i(_,{name:`media-alt`,get label(){return f(`media.details.alt`)},get value(){return L().alt},onInput:e=>R({...L(),alt:e})}),O,we),p(w,i(_,{name:`media-caption`,get label(){return f(`media.details.caption`)},get value(){return L().caption},onInput:e=>R({...L(),caption:e})}),A,j),p(M,()=>f(`media.details.description`),N,Ee),P.$$input=e=>R({...L(),description:e.currentTarget.value}),p(De,()=>f(`media.details.file`)),p(z,()=>e().filename),p(B,()=>f(`media.details.type`)),p(V,()=>e().mime_type),p(U,()=>f(`media.details.size`)),p(W,()=>ve(e().size)),p(F,i(n,{get when(){return Se(e())},get children(){return[(()=>{var e=u(he);return p(e,()=>f(`media.details.dimensions`)),e})(),(()=>{var t=u(ge);return p(t,()=>Se(e())),t})()]}}),G,Fe),p(Ie,()=>f(`media.details.uploaded`)),p(K,(()=>{var t=s(()=>!!e().created_at);return()=>t()?new Date(e().created_at).toLocaleString():`—`})()),p(Le,()=>f(`media.details.url`)),p(q,()=>H(e())),Re.$$click=()=>void Pe(H(e())),p(Re,()=>f(`media.details.copy`)),p(Y,(()=>{var e=s(()=>!!ke());return()=>e()?f(`media.details.replacing`):f(`media.details.replace`)})(),X,Be),Ve.addEventListener(`change`,e=>{let t=e.currentTarget.files?.[0];t&&Ne(t),e.currentTarget.value=``}),p(He,()=>f(`media.details.replaceHint`)),p(Z,i(v,{variant:`primary`,get disabled(){return Oe()},get loading(){return Oe()},onClick:()=>void Me(),get children(){return f(`media.details.save`)}}),Q,We),p(Z,i(v,{variant:`danger`,onClick:()=>void je(e()),get children(){return f(`media.details.delete`)}}),$,Ke),p(Z,i(v,{variant:`secondary`,onClick:()=>I(null),get children(){return f(`media.details.close`)}}),Je,Ye),a(()=>l(Ve,`disabled`,ke())),a(()=>l(P,`value`,L().description)),ee(),t})()})}}),Je,Ye),a(e=>{var t=!!(De()||d.focusUpload),n=Ee();return t!==e.e&&M.classList.toggle(`upload-zone--active`,e.e=t),n!==e.t&&l(K,`disabled`,e.t=n),e},{e:void 0,t:void 0}),e})()}f([`click`,`input`]);export{C as MediaLibrary};
@@ -1 +1 @@
1
- import{f as e,g as t,i as n,l as r,r as i,s as a,u as o}from"./solid.TEtyrbLc.js";import{d as s,i as c,l,n as u,o as d,p as f,r as p,s as m,u as h}from"./web.C8wWxyYF.js";import{n as g}from"./i18n.Tk18hqHh.js";import{t as _}from"./api.DSIz0zxF.js";var v=f(`<div class=wp-menu-empty-level>`),y=f(`<div class=wp-menu-tree><!$><!/><!$><!/>`),b=f(`<article class=wp-menu-item><div class=wp-menu-item__header><span class=wp-menu-drag draggable=true>⠿⠿⠿</span><span class=wp-menu-item__label><strong></strong><small></small></span><div class=wp-menu-item__actions><button type=button class="btn btn-sm">↑</button><button type=button class="btn btn-sm">↓</button><button type=button class="btn btn-sm">→</button><button type=button class="btn btn-sm">←</button></div></div><details class=wp-menu-item__details><summary></summary><div class=wp-menu-item__fields><label><!$><!/><input class=input></label><label><!$><!/><input class=input></label><label><!$><!/><input class=input></label><label><!$><!/><input class=input></label><label><!$><!/><select class=input><option value=_self></option><option value=_blank></option></select></label><label><!$><!/><input class=input></label><label class=wp-menu-item__wide><!$><!/><textarea class=input rows=2></textarea></label><button type=button class="btn btn-danger btn-sm"></button></div></details><!$><!/>`),x=f(`<p class=muted>`),S=f(`<details class=wp-menu-box><summary></summary><div class=wp-menu-box__body><!$><!/><!$><!/>`),C=f(`<div class="notice notice--error">`),w=f(`<div class=notice>`),T=f(`<div class="menus-manager wp-menus-manager"><!$><!/><!$><!/><!$><!/><style>.wp-menu-editor__top,.wp-structure-heading,.wp-menu-editor__identity,.wp-menu-item__header,.wp-menu-item__actions,.form-actions{display:flex;align-items:center;gap:.7rem}.wp-menu-editor__top,.wp-structure-heading{justify-content:space-between}.wp-menu-editor__top{margin-bottom:1rem}.wp-menu-editor__top h3{margin:.25rem 0 0}.wp-eyebrow{display:block;margin-top:.7rem;font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;color:var(--color-muted)}.wp-menu-editor__identity{margin-bottom:1rem;align-items:end}.wp-menu-editor__identity label{display:grid;gap:.35rem;flex:1}.wp-menu-editor__columns{display:grid;grid-template-columns:330px minmax(0,1fr);gap:1.2rem;align-items:start}.wp-menu-sources,.wp-menu-structure{min-width:0}.wp-menu-sources>h4,.wp-structure-heading h4{margin:0}.wp-menu-box{background:var(--color-surface,#fff);border:1px solid var(--color-border,#ddd);margin-bottom:.7rem}.wp-menu-box summary{cursor:pointer;padding:.8rem;font-weight:600}.wp-menu-box__body{padding:0 .8rem .8rem;display:grid;gap:.6rem}.wp-menu-box__body p{margin:0}.wp-source-list{display:grid;gap:.35rem;max-height:220px;overflow:auto;border:1px solid var(--color-border,#ddd);padding:.45rem}.wp-source-row{display:flex!important;align-items:start;gap:.45rem!important;padding:.3rem}.wp-source-row span,.wp-source-link{display:grid;gap:.12rem;text-align:left}.wp-source-row small,.wp-source-link small,.wp-menu-item__label small{color:var(--color-muted);font-size:.75rem}.wp-source-link{border:0;background:none;color:inherit;padding:.35rem;width:100%;cursor:pointer}.wp-source-link:hover{background:var(--color-surface-muted,#f5f5f5)}.wp-taxonomy-source{display:grid;gap:.2rem;border-top:1px solid var(--color-border,#ddd);padding-top:.5rem}.wp-taxonomy-source:first-child{border-top:0;padding-top:0}.wp-menu-structure{background:var(--color-surface-muted,#f7f7f7);padding:1rem}.wp-menu-structure .wp-structure-heading{margin-bottom:1rem}.wp-menu-tree{display:grid;gap:.55rem}.wp-menu-tree[data-depth="1"]{margin:.55rem 0 0 2rem}.wp-menu-item{background:var(--color-surface,#fff);border:1px solid var(--color-border,#dcdcde);box-shadow:0 1px 1px rgba(0,0,0,.04)}.wp-menu-item__header{padding:.55rem .7rem}.wp-menu-drag{cursor:grab;letter-spacing:-.2rem;width:1.4rem;color:var(--color-muted);user-select:none}.wp-menu-item__label{display:grid;gap:.15rem;flex:1;min-width:0}.wp-menu-item__label small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-menu-item__actions{margin-left:auto}.wp-menu-item__details{border-top:1px solid var(--color-border,#ddd)}.wp-menu-item__details summary{padding:.5rem .7rem;cursor:pointer;color:var(--color-muted);font-size:.85rem}.wp-menu-item__fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem;padding:.7rem;border-top:1px solid var(--color-border,#ddd)}.wp-menu-item__fields label{display:grid;gap:.3rem}.wp-menu-item__wide{grid-column:1/-1}.wp-menu-empty,.wp-menu-empty-level{text-align:center;padding:2rem;color:var(--color-muted)}.wp-menu-empty-level{border:1px dashed var(--color-border,#ccc);padding:1rem}.wp-menu-settings{margin-top:1rem}.wp-menu-settings h4{margin-top:0}.wp-menu-settings p{margin-bottom:0}.wp-menus-manager .menu-actions{white-space:nowrap;text-align:right}@media(max-width:850px){.wp-menu-editor__columns{grid-template-columns:1fr}.wp-menu-sources{order:2}.wp-menu-structure{order:1}.wp-menu-editor__identity,.wp-menu-editor__top{align-items:stretch;display:grid}.wp-menu-item__fields{grid-template-columns:1fr}.wp-menu-item__wide{grid-column:auto}}`),E=f(`<div class=skeleton>`),ee=f(`<div class=manager-toolbar><p class=muted></p><button class="btn btn-primary"type=button>+ <!$><!/>`),D=f(`<table class=table><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody>`),te=f(`<section class=card>`),O=f(`<p class="muted empty-state">`),k=f(`<tr><td><strong></strong></td><td><code></code></td><td></td><td class=menu-actions><button class="btn btn-secondary btn-sm"type=button></button> <button class="btn btn-danger btn-sm"type=button>`),ne=f(`<input class=input>`),A=f(`<div class=wp-source-list>`),j=f(`<button type=button class="btn btn-secondary btn-sm">`),re=f(`<label><!$><!/><input class=input placeholder=https://>`),ie=f(`<label><!$><!/><input class=input>`),ae=f(`<form class=wp-menu-editor><div class=wp-menu-editor__top><div><button type=button class="btn btn-secondary btn-sm">← <!$><!/></button><span class=wp-eyebrow></span><h3></h3></div><div class=form-actions><button class="btn btn-secondary"type=button></button><button class="btn btn-primary"type=submit></button></div></div><div class="wp-menu-editor__identity card"><label><!$><!/><input class=input required></label><label><!$><!/><input class=input></label></div><div class=wp-menu-editor__columns><aside class=wp-menu-sources><h4></h4><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/></aside><main class=wp-menu-structure><div class=wp-structure-heading><div><h4></h4><p class=muted></p></div><span class=badge><!$><!/> <!$><!/></span></div><!$><!/><section class="card wp-menu-settings"><h4></h4><label class=checkbox-label><input type=checkbox> <!$><!/></label><p class=muted>`),oe=f(`<label class=wp-source-row><input type=checkbox><span><!$><!/><small>/<!$><!/>`),se=f(`<label class=wp-source-row><input type=checkbox><span><!$><!/><small>/post/<!$><!/>`),M=f(`<div class=wp-taxonomy-source><strong></strong><!$><!/>`),N=f(`<button type=button class=wp-source-link><!$><!/><small>/<!$><!/>/<!$><!/>`),ce=f(`<button type=button class=wp-source-link><!$><!/><small>/<!$><!/>`),le=f(`<div class="wp-menu-empty card">`);function P(e){return`${e}_${typeof globalThis.crypto?.randomUUID==`function`?globalThis.crypto.randomUUID():Math.random().toString(36).slice(2)}`}function F(e){return e.toLowerCase().normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/(^-|-$)/g,``)}function I(e,t=null){let n=e.id||P(`item`);return{...e,id:n,clientId:n,parentId:t??e.parentId??null,children:[]}}function ue(e){let t=(Array.isArray(e)?e:[]).map(e=>I(e)),n=new Map(t.map(e=>[e.id,e])),r=[];for(let e of t){let t=e.parentId?n.get(e.parentId):void 0;t&&t.id!==e.id?t.children.push(e):r.push(e)}let i=e=>(e.sort((e,t)=>(e.order??0)-(t.order??0)),e.forEach(e=>i(e.children)),e);return i(r)}function L(e,t=null){let n=[];return e.forEach((e,r)=>{let{clientId:i,children:a,...o}=e;n.push({...o,id:e.id,parentId:t,order:r}),n.push(...L(a,e.id))}),n}function R(e){return e.map(e=>({...e,children:R(e.children)}))}function z(e,t){return e.id===t||e.children.some(e=>z(e,t))}function B(e,t){let n=e.findIndex(e=>e.id===t);if(n>=0){let t=[...e],[r]=t.splice(n,1);return{items:t,removed:r}}for(let n=0;n<e.length;n+=1){let r=B(e[n].children,t);if(r.removed){let t=[...e];return t[n]={...t[n],children:r.items},{items:t,removed:r.removed}}}return{items:e}}function V(e,t,n){let r=e.findIndex(e=>e.id===t);if(r>=0){let t=[...e];return t.splice(r,0,n),{items:t,inserted:!0}}for(let r=0;r<e.length;r+=1){let i=V(e[r].children,t,n);if(i.inserted){let t=[...e];return t[r]={...t[r],children:i.items},{items:t,inserted:!0}}}return{items:e,inserted:!1}}function H(e,t,n){for(let r=0;r<e.length;r+=1){let i=e[r];if(i.id===t){let t=[...e];return t[r]={...i,children:[...i.children,n]},{items:t,inserted:!0}}let a=H(i.children,t,n);if(a.inserted){let t=[...e];return t[r]={...i,children:a.items},{items:t,inserted:!0}}}return{items:e,inserted:!1}}function U(e,t,n){return e.map(e=>e.id===t?{...e,...n}:{...e,children:U(e.children,t,n)})}function de(e,t){return B(e,t).items}function fe(e,t,n){if(t===n||e.some(e=>e.id===t&&z(e,n)))return e;let r=B(e,t);if(!r.removed)return e;let i=V(r.items,n,r.removed);return i.inserted?i.items:e}function pe(e,t,n){if(t===n||e.some(e=>e.id===t&&z(e,n)))return e;let r=B(e,t);if(!r.removed)return e;let i=H(r.items,n,r.removed);return i.inserted?i.items:e}function W(e,t,n){let r=e.findIndex(e=>e.id===t);if(r>=0)return{siblings:e,index:r,parent:n};for(let n of e){let e=W(n.children,t,n);if(e)return e}return null}function me(e,t,n){let r=R(e),i=W(r,t);if(!i)return e;let a=i.index+n;return a<0||a>=i.siblings.length?e:([i.siblings[i.index],i.siblings[a]]=[i.siblings[a],i.siblings[i.index]],r)}function he(e,t){let n=R(e),r=W(n,t);return!r||r.index===0?e:pe(n,t,r.siblings[r.index-1].id)}function ge(e,t){let n=R(e),r=W(n,t);return r?.parent?fe(n,t,r.parent.id):e}function _e(e){let t=P(`item`);return{id:t,clientId:t,type:e.type,label:e.label,url:e.url,objectId:e.objectId,objectType:e.objectType,parentId:null,order:0,target:`_self`,children:[]}}function ve(t){let[r,u]=e(null);return(()=>{var e=p(y),f=e.firstChild,[m,g]=c(f.nextSibling),_=m.nextSibling,[x,S]=c(_.nextSibling);return d(e,a(i,{get each(){return t.items},children:e=>(()=>{var i=p(b),f=i.firstChild,m=f.firstChild,g=m.nextSibling,_=g.firstChild,v=_.nextSibling,y=g.nextSibling.firstChild,x=y.nextSibling,S=x.nextSibling,C=S.nextSibling,w=f.nextSibling,T=w.firstChild,E=T.nextSibling.firstChild,ee=E.firstChild,[D,te]=c(ee.nextSibling),O=D.nextSibling,k=E.nextSibling,ne=k.firstChild,[A,j]=c(ne.nextSibling),re=A.nextSibling,ie=k.nextSibling,ae=ie.firstChild,[oe,se]=c(ae.nextSibling),M=oe.nextSibling,N=ie.nextSibling,ce=N.firstChild,[le,P]=c(ce.nextSibling),F=le.nextSibling,I=N.nextSibling,ue=I.firstChild,[L,R]=c(ue.nextSibling),z=L.nextSibling,B=z.firstChild,V=B.nextSibling,H=I.nextSibling,pe=H.firstChild,[W,_e]=c(pe.nextSibling),G=W.nextSibling,K=H.nextSibling,q=K.firstChild,[J,ye]=c(q.nextSibling),Y=J.nextSibling,be=K.nextSibling,xe=w.nextSibling,[Se,Ce]=c(xe.nextSibling);return i.addEventListener(`drop`,n=>{n.preventDefault();let i=r()??n.dataTransfer?.getData(`text/plain`);i&&t.onChange(fe(t.items,i,e.id)),u(null)}),i.addEventListener(`dragover`,e=>e.preventDefault()),m.addEventListener(`dragend`,()=>u(null)),m.addEventListener(`dragstart`,t=>{u(e.id),t.dataTransfer?.setData(`text/plain`,e.id)}),d(_,()=>e.label||t.t(`menus.editor.untitled`)),d(v,()=>e.url||t.t(`menus.editor.noUrl`)),y.$$click=()=>t.onChange(me(t.items,e.id,-1)),x.$$click=()=>t.onChange(me(t.items,e.id,1)),S.$$click=()=>t.onChange(he(t.items,e.id)),C.$$click=()=>t.onChange(ge(t.items,e.id)),d(T,()=>t.t(`menus.editor.itemSettings`)),d(E,()=>t.t(`menus.editor.navigationLabel`),D,te),O.$$input=n=>t.onChange(U(t.items,e.id,{label:n.currentTarget.value})),d(k,()=>t.t(`menus.editor.url`),A,j),re.$$input=n=>t.onChange(U(t.items,e.id,{url:n.currentTarget.value})),d(ie,()=>t.t(`menus.editor.titleAttribute`),oe,se),M.$$input=n=>t.onChange(U(t.items,e.id,{attrTitle:n.currentTarget.value})),d(N,()=>t.t(`menus.editor.cssClasses`),le,P),F.$$input=n=>t.onChange(U(t.items,e.id,{cssClasses:n.currentTarget.value})),d(I,()=>t.t(`menus.editor.target`),L,R),z.addEventListener(`change`,n=>t.onChange(U(t.items,e.id,{target:n.currentTarget.value}))),d(B,()=>t.t(`menus.editor.sameWindow`)),d(V,()=>t.t(`menus.editor.newWindow`)),d(H,()=>t.t(`menus.editor.xfn`),W,_e),G.$$input=n=>t.onChange(U(t.items,e.id,{xfn:n.currentTarget.value})),d(K,()=>t.t(`menus.editor.description`),J,ye),Y.$$input=n=>t.onChange(U(t.items,e.id,{description:n.currentTarget.value})),be.$$click=()=>t.onChange(de(t.items,e.id)),d(be,()=>t.t(`menus.editor.remove`)),d(i,a(n,{get when(){return e.children.length>0},get children(){return a(ve,{get items(){return e.children},get depth(){return(t.depth??0)+1},get t(){return t.t},onChange:n=>t.onChange(U(t.items,e.id,{children:n}))})}}),Se,Ce),o(e=>{var n=t.t(`menus.editor.drag`),r=t.t(`menus.editor.up`),i=t.t(`menus.editor.down`),a=t.t(`menus.editor.indent`),o=t.t(`menus.editor.outdent`);return n!==e.e&&h(m,`title`,e.e=n),r!==e.t&&h(y,`title`,e.t=r),i!==e.a&&h(x,`title`,e.a=i),a!==e.o&&h(S,`title`,e.o=a),o!==e.i&&h(C,`title`,e.i=o),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),o(()=>s(O,`value`,e.label)),o(()=>s(re,`value`,e.url??``)),o(()=>s(M,`value`,e.attrTitle??``)),o(()=>s(F,`value`,e.cssClasses??``)),o(()=>s(z,`value`,e.target??`_self`)),o(()=>s(G,`value`,e.xfn??``)),o(()=>s(Y,`value`,e.description??``)),l(),i})()}),m,g),d(e,a(n,{get when(){return t.items.length===0},get children(){var e=p(v);return d(e,()=>t.t(`menus.editor.emptyLevel`)),e}}),x,S),o(()=>h(e,`data-depth`,t.depth??0)),e})()}function G(e){return(()=>{var t=p(S),r=t.firstChild,i=r.nextSibling,l=i.firstChild,[u,f]=c(l.nextSibling),m=u.nextSibling,[h,g]=c(m.nextSibling);return d(r,()=>e.title),d(i,a(n,{get when(){return e.description},get children(){var t=p(x);return d(t,()=>e.description),t}}),u,f),d(i,()=>e.children,h,g),o(()=>s(t,`open`,e.open)),t})()}function K(){let{t:u}=g(),[f,v]=e([]),[y,b]=e(null),[x,S]=e([]),[I,R]=e([]),[z,B]=e({}),[V,H]=e([]),[U,de]=e([]),[fe,pe]=e({}),[W,me]=e(``),[he,ge]=e(``),[K,q]=e([]),[J,ye]=e(``),[Y,be]=e(``),[xe,Se]=e(!0),[Ce,we]=e(!1),[Te,X]=e(``),[Ee,Z]=e(``),De=async()=>{Se(!0),X(``);try{let[e,t,n,r,i]=await Promise.all([_.getMenus(),_.getContent({type:`page`,status:`PUBLISHED`,limit:100}),_.getContent({type:`post`,status:`PUBLISHED`,limit:100}),_.getContentTypes(),_.getTaxonomies()]);v(e),S(t.data),R(n.data),H(r),de(i);let a=await Promise.all(r.filter(e=>e.slug!==`page`&&e.slug!==`post`&&!e.singleton).map(async e=>[e.slug,(await _.getContent({type:e.slug,status:`PUBLISHED`,limit:100})).data]));B(Object.fromEntries(a));let o=await Promise.all(i.map(async e=>[e.slug,await _.getTaxonomyTerms(e.slug)]));pe(Object.fromEntries(o))}catch(e){X(e instanceof Error?e.message:String(e))}finally{Se(!1)}};t(De);let Oe=e=>{b({id:e?.id,name:e?.name??``,slug:e?.slug??``,items:ue(e?.items),settings:{...e?.settings??{}}}),q([]),X(``),Z(``)},Q=e=>{let t=y();t&&b({...t,...e})},$=e=>{let t=y();t&&Q({items:[...t.items,_e(e)]})},ke=e=>{let t=new Set(K()),n=y();n&&(Q({items:[...n.items,...e.filter(e=>t.has(e.id)).map(_e)]}),q([]))},Ae=()=>{J().trim()&&Y().trim()&&($({id:P(`custom`),type:`custom`,label:Y().trim(),url:J().trim()}),ye(``),be(``))},je=async e=>{e.preventDefault();let t=y();if(t){if(!t.name.trim()){X(u(`menus.nameRequired`));return}we(!0),X(``);try{let e={name:t.name.trim(),slug:t.slug.trim()||F(t.name),items:L(t.items),settings:t.settings};t.id?await _.updateMenu(t.id,e):await _.createMenu(e),b(null),Z(u(`menus.saved`)),await De()}catch(e){X(e instanceof Error?e.message:String(e))}finally{we(!1)}}},Me=async e=>{if(e.id&&confirm(u(`menus.confirmDelete`,{name:e.name})))try{await _.deleteMenu(e.id),Z(u(`menus.deleted`)),await De()}catch(e){X(e instanceof Error?e.message:String(e))}},Ne=r(()=>x().filter(e=>!W()||`${e.title} ${e.slug}`.toLowerCase().includes(W().toLowerCase()))),Pe=r(()=>I().filter(e=>!he()||`${e.title} ${e.slug}`.toLowerCase().includes(he().toLowerCase()))),Fe=e=>({id:`page:${e.id}`,type:`page`,label:e.title,url:`/${e.slug}`,objectId:e.id,objectType:`page`}),Ie=e=>({id:`post:${e.id}`,type:`post`,label:e.title,url:`/post/${e.slug}`,objectId:e.id,objectType:`post`}),Le=e=>({id:`content:${e.type}:${e.id}`,type:`content`,label:e.title,url:`/${e.type}/${e.slug}`,objectId:e.id,objectType:e.type});return(()=>{var e=p(T),t=e.firstChild,[r,g]=c(t.nextSibling),_=r.nextSibling,[v,x]=c(_.nextSibling),S=v.nextSibling,[P,I]=c(S.nextSibling);return P.nextSibling,d(e,a(n,{get when(){return Te()},get children(){var e=p(C);return d(e,Te),e}}),r,g),d(e,a(n,{get when(){return Ee()},get children(){var e=p(w);return d(e,Ee),e}}),v,x),d(e,a(n,{get when(){return!xe()},get fallback(){return(()=>{var e=p(E);return d(e,()=>u(`common.loading`)),e})()},get children(){return a(n,{get when(){return y()},get fallback(){return[(()=>{var e=p(ee),t=e.firstChild,n=t.nextSibling,r=n.firstChild.nextSibling,[i,a]=c(r.nextSibling);return d(t,()=>u(`menus.hint`)),n.$$click=()=>Oe(),d(n,()=>u(`menus.new`),i,a),l(),e})(),(()=>{var e=p(te);return d(e,a(n,{get when(){return f().length>0},get fallback(){return(()=>{var e=p(O);return d(e,()=>u(`menus.empty`)),e})()},get children(){var e=p(D),t=e.firstChild,n=t.firstChild.firstChild,r=n.nextSibling,o=r.nextSibling,s=t.nextSibling;return d(n,()=>u(`menus.name`)),d(r,()=>u(`menus.slug`)),d(o,()=>u(`menus.items`)),d(s,a(i,{get each(){return f()},children:e=>(()=>{var t=p(k),n=t.firstChild,r=n.firstChild,i=n.nextSibling,a=i.firstChild,o=i.nextSibling,s=o.nextSibling.firstChild,c=s.nextSibling.nextSibling;return d(r,()=>e.name),d(a,()=>e.slug),d(o,()=>e.items?.length??0),s.$$click=()=>Oe(e),d(s,()=>u(`common.edit`)),c.$$click=()=>void Me(e),d(c,()=>u(`common.delete`)),l(),t})()})),e}})),e})()]},children:e=>(()=>{var t=p(ae),r=t.firstChild,f=r.firstChild,g=f.firstChild,_=g.firstChild.nextSibling,[v,y]=c(_.nextSibling),x=g.nextSibling,S=x.nextSibling,C=f.nextSibling.firstChild,w=C.nextSibling,T=r.nextSibling,E=T.firstChild,ee=E.firstChild,[D,te]=c(ee.nextSibling),O=D.nextSibling,k=E.nextSibling,P=k.firstChild,[I,ue]=c(P.nextSibling),L=I.nextSibling,R=T.nextSibling.firstChild,B=R.firstChild,H=B.nextSibling,[de,pe]=c(H.nextSibling),_e=de.nextSibling,[xe,Se]=c(_e.nextSibling),we=xe.nextSibling,[Te,X]=c(we.nextSibling),Ee=Te.nextSibling,[Z,De]=c(Ee.nextSibling),Oe=Z.nextSibling,[Me,Re]=c(Oe.nextSibling),ze=Me.nextSibling,[Be,Ve]=c(ze.nextSibling),He=Be.nextSibling,[Ue,We]=c(He.nextSibling),Ge=R.nextSibling,Ke=Ge.firstChild,qe=Ke.firstChild,Je=qe.firstChild,Ye=Je.nextSibling,Xe=qe.nextSibling,Ze=Xe.firstChild,[Qe,$e]=c(Ze.nextSibling),et=Qe.nextSibling.nextSibling,[tt,nt]=c(et.nextSibling),rt=Ke.nextSibling,[it,at]=c(rt.nextSibling),ot=it.nextSibling.firstChild,st=ot.nextSibling,ct=st.firstChild,lt=ct.nextSibling.nextSibling,[ut,dt]=c(lt.nextSibling),ft=st.nextSibling;return t.addEventListener(`submit`,je),g.$$click=()=>b(null),d(g,()=>u(`menus.back`),v,y),d(x,()=>u(`menus.editor.eyebrow`)),d(S,(()=>{var t=m(()=>!!e().id);return()=>t()?u(`menus.edit`):u(`menus.create`)})()),C.$$click=()=>b(null),d(C,()=>u(`common.cancel`)),d(w,(()=>{var e=m(()=>!!Ce());return()=>e()?u(`common.loading`):u(`common.save`)})()),d(E,()=>u(`menus.name`),D,te),O.$$input=e=>Q({name:e.currentTarget.value}),d(k,()=>u(`menus.slug`),I,ue),L.$$input=e=>Q({slug:e.currentTarget.value}),d(B,()=>u(`menus.editor.addItems`)),d(R,a(G,{get title(){return u(`menus.sources.pages`)},open:!0,get children(){return[(()=>{var e=p(ne);return e.$$input=e=>me(e.currentTarget.value),o(()=>h(e,`placeholder`,u(`menus.editor.search`))),o(()=>s(e,`value`,W())),l(),e})(),(()=>{var e=p(A);return d(e,a(i,{get each(){return Ne()},children:e=>(()=>{var t=p(oe),n=t.firstChild,r=n.nextSibling,i=r.firstChild,[a,l]=c(i.nextSibling),u=a.nextSibling,f=u.firstChild.nextSibling,[m,h]=c(f.nextSibling);return n.addEventListener(`change`,t=>q(t.currentTarget.checked?[...K(),`page:${e.id}`]:K().filter(t=>t!==`page:${e.id}`))),d(r,()=>e.title,a,l),d(u,()=>e.slug,m,h),o(()=>s(n,`checked`,K().includes(`page:${e.id}`))),t})()})),e})(),(()=>{var e=p(j);return e.$$click=()=>ke(Ne().map(Fe)),d(e,()=>u(`menus.editor.addSelected`)),l(),e})()]}}),de,pe),d(R,a(G,{get title(){return u(`menus.sources.posts`)},get children(){return[(()=>{var e=p(ne);return e.$$input=e=>ge(e.currentTarget.value),o(()=>h(e,`placeholder`,u(`menus.editor.search`))),o(()=>s(e,`value`,he())),l(),e})(),(()=>{var e=p(A);return d(e,a(i,{get each(){return Pe()},children:e=>(()=>{var t=p(se),n=t.firstChild,r=n.nextSibling,i=r.firstChild,[a,l]=c(i.nextSibling),u=a.nextSibling,f=u.firstChild.nextSibling,[m,h]=c(f.nextSibling);return n.addEventListener(`change`,t=>q(t.currentTarget.checked?[...K(),`post:${e.id}`]:K().filter(t=>t!==`post:${e.id}`))),d(r,()=>e.title,a,l),d(u,()=>e.slug,m,h),o(()=>s(n,`checked`,K().includes(`post:${e.id}`))),t})()})),e})(),(()=>{var e=p(j);return e.$$click=()=>ke(Pe().map(Ie)),d(e,()=>u(`menus.editor.addSelected`)),l(),e})()]}}),xe,Se),d(R,a(G,{get title(){return u(`menus.sources.contentTypes`)},get children(){return a(i,{get each(){return V().filter(e=>e.slug!==`page`&&e.slug!==`post`&&!e.singleton)},children:e=>(()=>{var t=p(M),n=t.firstChild,r=n.nextSibling,[o,s]=c(r.nextSibling);return d(n,()=>e.pluralLabel),d(t,a(i,{get each(){return z()[e.slug]??[]},children:t=>(()=>{var n=p(N),r=n.firstChild,[i,a]=c(r.nextSibling),o=i.nextSibling,s=o.firstChild.nextSibling,[u,f]=c(s.nextSibling),m=u.nextSibling.nextSibling,[h,g]=c(m.nextSibling);return n.$$click=()=>$(Le(t)),d(n,()=>t.title,i,a),d(o,()=>e.slug,u,f),d(o,()=>t.slug,h,g),l(),n})()}),o,s),t})()})}}),Te,X),d(R,a(G,{get title(){return u(`menus.sources.custom`)},get description(){return u(`menus.sources.customHint`)},get children(){return[(()=>{var e=p(re),t=e.firstChild,[n,r]=c(t.nextSibling),i=n.nextSibling;return d(e,()=>u(`menus.editor.url`),n,r),i.$$input=e=>ye(e.currentTarget.value),o(()=>s(i,`value`,J())),l(),e})(),(()=>{var e=p(ie),t=e.firstChild,[n,r]=c(t.nextSibling),i=n.nextSibling;return d(e,()=>u(`menus.editor.navigationLabel`),n,r),i.$$input=e=>be(e.currentTarget.value),o(()=>s(i,`value`,Y())),l(),e})(),(()=>{var e=p(j);return e.$$click=Ae,d(e,()=>u(`menus.editor.addToMenu`)),l(),e})()]}}),Z,De),d(R,a(G,{get title(){return u(`menus.sources.home`)},get children(){var e=p(j);return e.$$click=()=>$({id:`home`,type:`home`,label:u(`menus.sources.home`),url:`/`}),d(e,()=>u(`menus.editor.addToMenu`)),l(),e}}),Me,Re),d(R,a(G,{get title(){return u(`menus.sources.archives`)},get children(){var e=p(A);return d(e,a(i,{get each(){return V().filter(e=>e.hasArchive)},children:e=>(()=>{var t=p(ce),n=t.firstChild,[r,i]=c(n.nextSibling),a=r.nextSibling,o=a.firstChild.nextSibling,[s,u]=c(o.nextSibling);return t.$$click=()=>$({id:`archive:${e.slug}`,type:`archive`,label:e.pluralLabel,url:`/${e.slug}`,objectType:e.slug}),d(t,()=>e.pluralLabel,r,i),d(a,()=>e.slug,s,u),l(),t})()})),e}}),Be,Ve),d(R,a(G,{get title(){return u(`menus.sources.taxonomies`)},get children(){return a(i,{get each(){return U()},children:e=>(()=>{var t=p(M),n=t.firstChild,r=n.nextSibling,[o,s]=c(r.nextSibling);return d(n,()=>e.name),d(t,a(i,{get each(){return fe()[e.slug]??[]},children:t=>(()=>{var n=p(N),r=n.firstChild,[i,a]=c(r.nextSibling),o=i.nextSibling,s=o.firstChild.nextSibling,[u,f]=c(s.nextSibling),m=u.nextSibling.nextSibling,[h,g]=c(m.nextSibling);return n.$$click=()=>$({id:`term:${e.slug}:${t.slug}`,type:`taxonomy`,label:t.name,url:`/${e.slug}/${t.slug}`,objectId:t.id,objectType:e.slug}),d(n,()=>t.name,i,a),d(o,()=>e.slug,u,f),d(o,()=>t.slug,h,g),l(),n})()}),o,s),t})()})}}),Ue,We),d(Je,()=>u(`menus.editor.structure`)),d(Ye,()=>u(`menus.editor.structureHint`)),d(Xe,()=>e().items.length,Qe,$e),d(Xe,()=>u(`menus.items`),tt,nt),d(Ge,a(n,{get when(){return e().items.length>0},get fallback(){return(()=>{var e=p(le);return d(e,()=>u(`menus.editor.empty`)),e})()},get children(){return a(ve,{get items(){return e().items},t:u,onChange:e=>Q({items:e})})}}),it,at),d(ot,()=>u(`menus.editor.settings`)),ct.addEventListener(`change`,t=>Q({settings:{...e().settings,autoAddNewPages:t.currentTarget.checked}})),d(st,()=>u(`menus.editor.autoAddPages`),ut,dt),d(ft,()=>u(`menus.editor.autoAddPagesHint`)),o(t=>{var n=Ce(),r=F(e().name);return n!==t.e&&s(w,`disabled`,t.e=n),r!==t.t&&h(L,`placeholder`,t.t=r),t},{e:void 0,t:void 0}),o(()=>s(O,`value`,e().name)),o(()=>s(L,`value`,e().slug)),o(()=>s(ct,`checked`,e().settings.autoAddNewPages===!0)),l(),t})()})}}),P,I),e})()}u([`click`,`input`]);export{K as MenuManager};
1
+ import{f as e,g as t,i as n,l as r,r as i,s as a,u as o}from"./solid.TEtyrbLc.js";import{a as s,c,d as l,f as u,i as d,m as f,r as p,s as m,u as h}from"./web.D0f8iaHB.js";import{n as g}from"./i18n.BmX2Cv4K.js";import{t as _}from"./api.DSIz0zxF.js";var v=f(`<div class=wp-menu-empty-level>`),y=f(`<div class=wp-menu-tree><!$><!/><!$><!/>`),b=f(`<article class=wp-menu-item><div class=wp-menu-item__header><span class=wp-menu-drag draggable=true>⠿⠿⠿</span><span class=wp-menu-item__label><strong></strong><small></small></span><div class=wp-menu-item__actions><button type=button class="btn btn-sm">↑</button><button type=button class="btn btn-sm">↓</button><button type=button class="btn btn-sm">→</button><button type=button class="btn btn-sm">←</button></div></div><details class=wp-menu-item__details><summary></summary><div class=wp-menu-item__fields><label><!$><!/><input class=input></label><label><!$><!/><input class=input></label><label><!$><!/><input class=input></label><label><!$><!/><input class=input></label><label><!$><!/><select class=input><option value=_self></option><option value=_blank></option></select></label><label><!$><!/><input class=input></label><label class=wp-menu-item__wide><!$><!/><textarea class=input rows=2></textarea></label><button type=button class="btn btn-danger btn-sm"></button></div></details><!$><!/>`),x=f(`<p class=muted>`),S=f(`<details class=wp-menu-box><summary></summary><div class=wp-menu-box__body><!$><!/><!$><!/>`),C=f(`<div class="notice notice--error">`),w=f(`<div class=notice>`),T=f(`<div class="menus-manager wp-menus-manager"><!$><!/><!$><!/><!$><!/><style>.wp-menu-editor__top,.wp-structure-heading,.wp-menu-editor__identity,.wp-menu-item__header,.wp-menu-item__actions,.form-actions{display:flex;align-items:center;gap:.7rem}.wp-menu-editor__top,.wp-structure-heading{justify-content:space-between}.wp-menu-editor__top{margin-bottom:1rem}.wp-menu-editor__top h3{margin:.25rem 0 0}.wp-eyebrow{display:block;margin-top:.7rem;font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;color:var(--color-muted)}.wp-menu-editor__identity{margin-bottom:1rem;align-items:end}.wp-menu-editor__identity label{display:grid;gap:.35rem;flex:1}.wp-menu-editor__columns{display:grid;grid-template-columns:330px minmax(0,1fr);gap:1.2rem;align-items:start}.wp-menu-sources,.wp-menu-structure{min-width:0}.wp-menu-sources>h4,.wp-structure-heading h4{margin:0}.wp-menu-box{background:var(--color-surface,#fff);border:1px solid var(--color-border,#ddd);margin-bottom:.7rem}.wp-menu-box summary{cursor:pointer;padding:.8rem;font-weight:600}.wp-menu-box__body{padding:0 .8rem .8rem;display:grid;gap:.6rem}.wp-menu-box__body p{margin:0}.wp-source-list{display:grid;gap:.35rem;max-height:220px;overflow:auto;border:1px solid var(--color-border,#ddd);padding:.45rem}.wp-source-row{display:flex!important;align-items:start;gap:.45rem!important;padding:.3rem}.wp-source-row span,.wp-source-link{display:grid;gap:.12rem;text-align:left}.wp-source-row small,.wp-source-link small,.wp-menu-item__label small{color:var(--color-muted);font-size:.75rem}.wp-source-link{border:0;background:none;color:inherit;padding:.35rem;width:100%;cursor:pointer}.wp-source-link:hover{background:var(--color-surface-muted,#f5f5f5)}.wp-taxonomy-source{display:grid;gap:.2rem;border-top:1px solid var(--color-border,#ddd);padding-top:.5rem}.wp-taxonomy-source:first-child{border-top:0;padding-top:0}.wp-menu-structure{background:var(--color-surface-muted,#f7f7f7);padding:1rem}.wp-menu-structure .wp-structure-heading{margin-bottom:1rem}.wp-menu-tree{display:grid;gap:.55rem}.wp-menu-tree[data-depth="1"]{margin:.55rem 0 0 2rem}.wp-menu-item{background:var(--color-surface,#fff);border:1px solid var(--color-border,#dcdcde);box-shadow:0 1px 1px rgba(0,0,0,.04)}.wp-menu-item__header{padding:.55rem .7rem}.wp-menu-drag{cursor:grab;letter-spacing:-.2rem;width:1.4rem;color:var(--color-muted);user-select:none}.wp-menu-item__label{display:grid;gap:.15rem;flex:1;min-width:0}.wp-menu-item__label small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-menu-item__actions{margin-left:auto}.wp-menu-item__details{border-top:1px solid var(--color-border,#ddd)}.wp-menu-item__details summary{padding:.5rem .7rem;cursor:pointer;color:var(--color-muted);font-size:.85rem}.wp-menu-item__fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem;padding:.7rem;border-top:1px solid var(--color-border,#ddd)}.wp-menu-item__fields label{display:grid;gap:.3rem}.wp-menu-item__wide{grid-column:1/-1}.wp-menu-empty,.wp-menu-empty-level{text-align:center;padding:2rem;color:var(--color-muted)}.wp-menu-empty-level{border:1px dashed var(--color-border,#ccc);padding:1rem}.wp-menu-settings{margin-top:1rem}.wp-menu-settings h4{margin-top:0}.wp-menu-settings p{margin-bottom:0}.wp-menus-manager .menu-actions{white-space:nowrap;text-align:right}@media(max-width:850px){.wp-menu-editor__columns{grid-template-columns:1fr}.wp-menu-sources{order:2}.wp-menu-structure{order:1}.wp-menu-editor__identity,.wp-menu-editor__top{align-items:stretch;display:grid}.wp-menu-item__fields{grid-template-columns:1fr}.wp-menu-item__wide{grid-column:auto}}`),E=f(`<div class=skeleton>`),ee=f(`<div class=manager-toolbar><p class=muted></p><button class="btn btn-primary"type=button>+ <!$><!/>`),D=f(`<table class=table><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody>`),te=f(`<section class=card>`),O=f(`<p class="muted empty-state">`),k=f(`<tr><td><strong></strong></td><td><code></code></td><td></td><td class=menu-actions><button class="btn btn-secondary btn-sm"type=button></button> <button class="btn btn-danger btn-sm"type=button>`),ne=f(`<input class=input>`),A=f(`<div class=wp-source-list>`),j=f(`<button type=button class="btn btn-secondary btn-sm">`),re=f(`<label><!$><!/><input class=input placeholder=https://>`),ie=f(`<label><!$><!/><input class=input>`),ae=f(`<form class=wp-menu-editor><div class=wp-menu-editor__top><div><button type=button class="btn btn-secondary btn-sm">← <!$><!/></button><span class=wp-eyebrow></span><h3></h3></div><div class=form-actions><button class="btn btn-secondary"type=button></button><button class="btn btn-primary"type=submit></button></div></div><div class="wp-menu-editor__identity card"><label><!$><!/><input class=input required></label><label><!$><!/><input class=input></label></div><div class=wp-menu-editor__columns><aside class=wp-menu-sources><h4></h4><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/></aside><main class=wp-menu-structure><div class=wp-structure-heading><div><h4></h4><p class=muted></p></div><span class=badge><!$><!/> <!$><!/></span></div><!$><!/><section class="card wp-menu-settings"><h4></h4><label class=checkbox-label><input type=checkbox> <!$><!/></label><p class=muted>`),oe=f(`<label class=wp-source-row><input type=checkbox><span><!$><!/><small>/<!$><!/>`),se=f(`<label class=wp-source-row><input type=checkbox><span><!$><!/><small>/post/<!$><!/>`),M=f(`<div class=wp-taxonomy-source><strong></strong><!$><!/>`),N=f(`<button type=button class=wp-source-link><!$><!/><small>/<!$><!/>/<!$><!/>`),ce=f(`<button type=button class=wp-source-link><!$><!/><small>/<!$><!/>`),le=f(`<div class="wp-menu-empty card">`);function P(e){return`${e}_${typeof globalThis.crypto?.randomUUID==`function`?globalThis.crypto.randomUUID():Math.random().toString(36).slice(2)}`}function F(e){return e.toLowerCase().normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/(^-|-$)/g,``)}function I(e,t=null){let n=e.id||P(`item`);return{...e,id:n,clientId:n,parentId:t??e.parentId??null,children:[]}}function ue(e){let t=(Array.isArray(e)?e:[]).map(e=>I(e)),n=new Map(t.map(e=>[e.id,e])),r=[];for(let e of t){let t=e.parentId?n.get(e.parentId):void 0;t&&t.id!==e.id?t.children.push(e):r.push(e)}let i=e=>(e.sort((e,t)=>(e.order??0)-(t.order??0)),e.forEach(e=>i(e.children)),e);return i(r)}function L(e,t=null){let n=[];return e.forEach((e,r)=>{let{clientId:i,children:a,...o}=e;n.push({...o,id:e.id,parentId:t,order:r}),n.push(...L(a,e.id))}),n}function R(e){return e.map(e=>({...e,children:R(e.children)}))}function z(e,t){return e.id===t||e.children.some(e=>z(e,t))}function B(e,t){let n=e.findIndex(e=>e.id===t);if(n>=0){let t=[...e],[r]=t.splice(n,1);return{items:t,removed:r}}for(let n=0;n<e.length;n+=1){let r=B(e[n].children,t);if(r.removed){let t=[...e];return t[n]={...t[n],children:r.items},{items:t,removed:r.removed}}}return{items:e}}function V(e,t,n){let r=e.findIndex(e=>e.id===t);if(r>=0){let t=[...e];return t.splice(r,0,n),{items:t,inserted:!0}}for(let r=0;r<e.length;r+=1){let i=V(e[r].children,t,n);if(i.inserted){let t=[...e];return t[r]={...t[r],children:i.items},{items:t,inserted:!0}}}return{items:e,inserted:!1}}function H(e,t,n){for(let r=0;r<e.length;r+=1){let i=e[r];if(i.id===t){let t=[...e];return t[r]={...i,children:[...i.children,n]},{items:t,inserted:!0}}let a=H(i.children,t,n);if(a.inserted){let t=[...e];return t[r]={...i,children:a.items},{items:t,inserted:!0}}}return{items:e,inserted:!1}}function U(e,t,n){return e.map(e=>e.id===t?{...e,...n}:{...e,children:U(e.children,t,n)})}function de(e,t){return B(e,t).items}function fe(e,t,n){if(t===n||e.some(e=>e.id===t&&z(e,n)))return e;let r=B(e,t);if(!r.removed)return e;let i=V(r.items,n,r.removed);return i.inserted?i.items:e}function pe(e,t,n){if(t===n||e.some(e=>e.id===t&&z(e,n)))return e;let r=B(e,t);if(!r.removed)return e;let i=H(r.items,n,r.removed);return i.inserted?i.items:e}function W(e,t,n){let r=e.findIndex(e=>e.id===t);if(r>=0)return{siblings:e,index:r,parent:n};for(let n of e){let e=W(n.children,t,n);if(e)return e}return null}function me(e,t,n){let r=R(e),i=W(r,t);if(!i)return e;let a=i.index+n;return a<0||a>=i.siblings.length?e:([i.siblings[i.index],i.siblings[a]]=[i.siblings[a],i.siblings[i.index]],r)}function he(e,t){let n=R(e),r=W(n,t);return!r||r.index===0?e:pe(n,t,r.siblings[r.index-1].id)}function ge(e,t){let n=R(e),r=W(n,t);return r?.parent?fe(n,t,r.parent.id):e}function _e(e){let t=P(`item`);return{id:t,clientId:t,type:e.type,label:e.label,url:e.url,objectId:e.objectId,objectType:e.objectType,parentId:null,order:0,target:`_self`,children:[]}}function ve(t){let[r,c]=e(null);return(()=>{var e=d(y),f=e.firstChild,[p,g]=s(f.nextSibling),_=p.nextSibling,[x,S]=s(_.nextSibling);return m(e,a(i,{get each(){return t.items},children:e=>(()=>{var i=d(b),f=i.firstChild,p=f.firstChild,g=p.nextSibling,_=g.firstChild,v=_.nextSibling,y=g.nextSibling.firstChild,x=y.nextSibling,S=x.nextSibling,C=S.nextSibling,w=f.nextSibling,T=w.firstChild,E=T.nextSibling.firstChild,ee=E.firstChild,[D,te]=s(ee.nextSibling),O=D.nextSibling,k=E.nextSibling,ne=k.firstChild,[A,j]=s(ne.nextSibling),re=A.nextSibling,ie=k.nextSibling,ae=ie.firstChild,[oe,se]=s(ae.nextSibling),M=oe.nextSibling,N=ie.nextSibling,ce=N.firstChild,[le,P]=s(ce.nextSibling),F=le.nextSibling,I=N.nextSibling,ue=I.firstChild,[L,R]=s(ue.nextSibling),z=L.nextSibling,B=z.firstChild,V=B.nextSibling,H=I.nextSibling,pe=H.firstChild,[W,_e]=s(pe.nextSibling),G=W.nextSibling,K=H.nextSibling,q=K.firstChild,[J,ye]=s(q.nextSibling),Y=J.nextSibling,be=K.nextSibling,xe=w.nextSibling,[Se,Ce]=s(xe.nextSibling);return i.addEventListener(`drop`,n=>{n.preventDefault();let i=r()??n.dataTransfer?.getData(`text/plain`);i&&t.onChange(fe(t.items,i,e.id)),c(null)}),i.addEventListener(`dragover`,e=>e.preventDefault()),p.addEventListener(`dragend`,()=>c(null)),p.addEventListener(`dragstart`,t=>{c(e.id),t.dataTransfer?.setData(`text/plain`,e.id)}),m(_,()=>e.label||t.t(`menus.editor.untitled`)),m(v,()=>e.url||t.t(`menus.editor.noUrl`)),y.$$click=()=>t.onChange(me(t.items,e.id,-1)),x.$$click=()=>t.onChange(me(t.items,e.id,1)),S.$$click=()=>t.onChange(he(t.items,e.id)),C.$$click=()=>t.onChange(ge(t.items,e.id)),m(T,()=>t.t(`menus.editor.itemSettings`)),m(E,()=>t.t(`menus.editor.navigationLabel`),D,te),O.$$input=n=>t.onChange(U(t.items,e.id,{label:n.currentTarget.value})),m(k,()=>t.t(`menus.editor.url`),A,j),re.$$input=n=>t.onChange(U(t.items,e.id,{url:n.currentTarget.value})),m(ie,()=>t.t(`menus.editor.titleAttribute`),oe,se),M.$$input=n=>t.onChange(U(t.items,e.id,{attrTitle:n.currentTarget.value})),m(N,()=>t.t(`menus.editor.cssClasses`),le,P),F.$$input=n=>t.onChange(U(t.items,e.id,{cssClasses:n.currentTarget.value})),m(I,()=>t.t(`menus.editor.target`),L,R),z.addEventListener(`change`,n=>t.onChange(U(t.items,e.id,{target:n.currentTarget.value}))),m(B,()=>t.t(`menus.editor.sameWindow`)),m(V,()=>t.t(`menus.editor.newWindow`)),m(H,()=>t.t(`menus.editor.xfn`),W,_e),G.$$input=n=>t.onChange(U(t.items,e.id,{xfn:n.currentTarget.value})),m(K,()=>t.t(`menus.editor.description`),J,ye),Y.$$input=n=>t.onChange(U(t.items,e.id,{description:n.currentTarget.value})),be.$$click=()=>t.onChange(de(t.items,e.id)),m(be,()=>t.t(`menus.editor.remove`)),m(i,a(n,{get when(){return e.children.length>0},get children(){return a(ve,{get items(){return e.children},get depth(){return(t.depth??0)+1},get t(){return t.t},onChange:n=>t.onChange(U(t.items,e.id,{children:n}))})}}),Se,Ce),o(e=>{var n=t.t(`menus.editor.drag`),r=t.t(`menus.editor.up`),i=t.t(`menus.editor.down`),a=t.t(`menus.editor.indent`),o=t.t(`menus.editor.outdent`);return n!==e.e&&l(p,`title`,e.e=n),r!==e.t&&l(y,`title`,e.t=r),i!==e.a&&l(x,`title`,e.a=i),a!==e.o&&l(S,`title`,e.o=a),o!==e.i&&l(C,`title`,e.i=o),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),o(()=>u(O,`value`,e.label)),o(()=>u(re,`value`,e.url??``)),o(()=>u(M,`value`,e.attrTitle??``)),o(()=>u(F,`value`,e.cssClasses??``)),o(()=>u(z,`value`,e.target??`_self`)),o(()=>u(G,`value`,e.xfn??``)),o(()=>u(Y,`value`,e.description??``)),h(),i})()}),p,g),m(e,a(n,{get when(){return t.items.length===0},get children(){var e=d(v);return m(e,()=>t.t(`menus.editor.emptyLevel`)),e}}),x,S),o(()=>l(e,`data-depth`,t.depth??0)),e})()}function G(e){return(()=>{var t=d(S),r=t.firstChild,i=r.nextSibling,c=i.firstChild,[l,f]=s(c.nextSibling),p=l.nextSibling,[h,g]=s(p.nextSibling);return m(r,()=>e.title),m(i,a(n,{get when(){return e.description},get children(){var t=d(x);return m(t,()=>e.description),t}}),l,f),m(i,()=>e.children,h,g),o(()=>u(t,`open`,e.open)),t})()}function K(){let{t:f}=g(),[p,v]=e([]),[y,b]=e(null),[x,S]=e([]),[I,R]=e([]),[z,B]=e({}),[V,H]=e([]),[U,de]=e([]),[fe,pe]=e({}),[W,me]=e(``),[he,ge]=e(``),[K,q]=e([]),[J,ye]=e(``),[Y,be]=e(``),[xe,Se]=e(!0),[Ce,we]=e(!1),[Te,X]=e(``),[Ee,Z]=e(``),De=async()=>{Se(!0),X(``);try{let[e,t,n,r,i]=await Promise.all([_.getMenus(),_.getContent({type:`page`,status:`PUBLISHED`,limit:100}),_.getContent({type:`post`,status:`PUBLISHED`,limit:100}),_.getContentTypes(),_.getTaxonomies()]);v(e),S(t.data),R(n.data),H(r),de(i);let a=await Promise.all(r.filter(e=>e.slug!==`page`&&e.slug!==`post`&&!e.singleton).map(async e=>[e.slug,(await _.getContent({type:e.slug,status:`PUBLISHED`,limit:100})).data]));B(Object.fromEntries(a));let o=await Promise.all(i.map(async e=>[e.slug,await _.getTaxonomyTerms(e.slug)]));pe(Object.fromEntries(o))}catch(e){X(e instanceof Error?e.message:String(e))}finally{Se(!1)}};t(De);let Oe=e=>{b({id:e?.id,name:e?.name??``,slug:e?.slug??``,items:ue(e?.items),settings:{...e?.settings??{}}}),q([]),X(``),Z(``)},Q=e=>{let t=y();t&&b({...t,...e})},$=e=>{let t=y();t&&Q({items:[...t.items,_e(e)]})},ke=e=>{let t=new Set(K()),n=y();n&&(Q({items:[...n.items,...e.filter(e=>t.has(e.id)).map(_e)]}),q([]))},Ae=()=>{J().trim()&&Y().trim()&&($({id:P(`custom`),type:`custom`,label:Y().trim(),url:J().trim()}),ye(``),be(``))},je=async e=>{e.preventDefault();let t=y();if(t){if(!t.name.trim()){X(f(`menus.nameRequired`));return}we(!0),X(``);try{let e={name:t.name.trim(),slug:t.slug.trim()||F(t.name),items:L(t.items),settings:t.settings};t.id?await _.updateMenu(t.id,e):await _.createMenu(e),b(null),Z(f(`menus.saved`)),await De()}catch(e){X(e instanceof Error?e.message:String(e))}finally{we(!1)}}},Me=async e=>{if(e.id&&confirm(f(`menus.confirmDelete`,{name:e.name})))try{await _.deleteMenu(e.id),Z(f(`menus.deleted`)),await De()}catch(e){X(e instanceof Error?e.message:String(e))}},Ne=r(()=>x().filter(e=>!W()||`${e.title} ${e.slug}`.toLowerCase().includes(W().toLowerCase()))),Pe=r(()=>I().filter(e=>!he()||`${e.title} ${e.slug}`.toLowerCase().includes(he().toLowerCase()))),Fe=e=>({id:`page:${e.id}`,type:`page`,label:e.title,url:`/${e.slug}`,objectId:e.id,objectType:`page`}),Ie=e=>({id:`post:${e.id}`,type:`post`,label:e.title,url:`/post/${e.slug}`,objectId:e.id,objectType:`post`}),Le=e=>({id:`content:${e.type}:${e.id}`,type:`content`,label:e.title,url:`/${e.type}/${e.slug}`,objectId:e.id,objectType:e.type});return(()=>{var e=d(T),t=e.firstChild,[r,g]=s(t.nextSibling),_=r.nextSibling,[v,x]=s(_.nextSibling),S=v.nextSibling,[P,I]=s(S.nextSibling);return P.nextSibling,m(e,a(n,{get when(){return Te()},get children(){var e=d(C);return m(e,Te),e}}),r,g),m(e,a(n,{get when(){return Ee()},get children(){var e=d(w);return m(e,Ee),e}}),v,x),m(e,a(n,{get when(){return!xe()},get fallback(){return(()=>{var e=d(E);return m(e,()=>f(`common.loading`)),e})()},get children(){return a(n,{get when(){return y()},get fallback(){return[(()=>{var e=d(ee),t=e.firstChild,n=t.nextSibling,r=n.firstChild.nextSibling,[i,a]=s(r.nextSibling);return m(t,()=>f(`menus.hint`)),n.$$click=()=>Oe(),m(n,()=>f(`menus.new`),i,a),h(),e})(),(()=>{var e=d(te);return m(e,a(n,{get when(){return p().length>0},get fallback(){return(()=>{var e=d(O);return m(e,()=>f(`menus.empty`)),e})()},get children(){var e=d(D),t=e.firstChild,n=t.firstChild.firstChild,r=n.nextSibling,o=r.nextSibling,s=t.nextSibling;return m(n,()=>f(`menus.name`)),m(r,()=>f(`menus.slug`)),m(o,()=>f(`menus.items`)),m(s,a(i,{get each(){return p()},children:e=>(()=>{var t=d(k),n=t.firstChild,r=n.firstChild,i=n.nextSibling,a=i.firstChild,o=i.nextSibling,s=o.nextSibling.firstChild,c=s.nextSibling.nextSibling;return m(r,()=>e.name),m(a,()=>e.slug),m(o,()=>e.items?.length??0),s.$$click=()=>Oe(e),m(s,()=>f(`common.edit`)),c.$$click=()=>void Me(e),m(c,()=>f(`common.delete`)),h(),t})()})),e}})),e})()]},children:e=>(()=>{var t=d(ae),r=t.firstChild,p=r.firstChild,g=p.firstChild,_=g.firstChild.nextSibling,[v,y]=s(_.nextSibling),x=g.nextSibling,S=x.nextSibling,C=p.nextSibling.firstChild,w=C.nextSibling,T=r.nextSibling,E=T.firstChild,ee=E.firstChild,[D,te]=s(ee.nextSibling),O=D.nextSibling,k=E.nextSibling,P=k.firstChild,[I,ue]=s(P.nextSibling),L=I.nextSibling,R=T.nextSibling.firstChild,B=R.firstChild,H=B.nextSibling,[de,pe]=s(H.nextSibling),_e=de.nextSibling,[xe,Se]=s(_e.nextSibling),we=xe.nextSibling,[Te,X]=s(we.nextSibling),Ee=Te.nextSibling,[Z,De]=s(Ee.nextSibling),Oe=Z.nextSibling,[Me,Re]=s(Oe.nextSibling),ze=Me.nextSibling,[Be,Ve]=s(ze.nextSibling),He=Be.nextSibling,[Ue,We]=s(He.nextSibling),Ge=R.nextSibling,Ke=Ge.firstChild,qe=Ke.firstChild,Je=qe.firstChild,Ye=Je.nextSibling,Xe=qe.nextSibling,Ze=Xe.firstChild,[Qe,$e]=s(Ze.nextSibling),et=Qe.nextSibling.nextSibling,[tt,nt]=s(et.nextSibling),rt=Ke.nextSibling,[it,at]=s(rt.nextSibling),ot=it.nextSibling.firstChild,st=ot.nextSibling,ct=st.firstChild,lt=ct.nextSibling.nextSibling,[ut,dt]=s(lt.nextSibling),ft=st.nextSibling;return t.addEventListener(`submit`,je),g.$$click=()=>b(null),m(g,()=>f(`menus.back`),v,y),m(x,()=>f(`menus.editor.eyebrow`)),m(S,(()=>{var t=c(()=>!!e().id);return()=>t()?f(`menus.edit`):f(`menus.create`)})()),C.$$click=()=>b(null),m(C,()=>f(`common.cancel`)),m(w,(()=>{var e=c(()=>!!Ce());return()=>e()?f(`common.loading`):f(`common.save`)})()),m(E,()=>f(`menus.name`),D,te),O.$$input=e=>Q({name:e.currentTarget.value}),m(k,()=>f(`menus.slug`),I,ue),L.$$input=e=>Q({slug:e.currentTarget.value}),m(B,()=>f(`menus.editor.addItems`)),m(R,a(G,{get title(){return f(`menus.sources.pages`)},open:!0,get children(){return[(()=>{var e=d(ne);return e.$$input=e=>me(e.currentTarget.value),o(()=>l(e,`placeholder`,f(`menus.editor.search`))),o(()=>u(e,`value`,W())),h(),e})(),(()=>{var e=d(A);return m(e,a(i,{get each(){return Ne()},children:e=>(()=>{var t=d(oe),n=t.firstChild,r=n.nextSibling,i=r.firstChild,[a,c]=s(i.nextSibling),l=a.nextSibling,f=l.firstChild.nextSibling,[p,h]=s(f.nextSibling);return n.addEventListener(`change`,t=>q(t.currentTarget.checked?[...K(),`page:${e.id}`]:K().filter(t=>t!==`page:${e.id}`))),m(r,()=>e.title,a,c),m(l,()=>e.slug,p,h),o(()=>u(n,`checked`,K().includes(`page:${e.id}`))),t})()})),e})(),(()=>{var e=d(j);return e.$$click=()=>ke(Ne().map(Fe)),m(e,()=>f(`menus.editor.addSelected`)),h(),e})()]}}),de,pe),m(R,a(G,{get title(){return f(`menus.sources.posts`)},get children(){return[(()=>{var e=d(ne);return e.$$input=e=>ge(e.currentTarget.value),o(()=>l(e,`placeholder`,f(`menus.editor.search`))),o(()=>u(e,`value`,he())),h(),e})(),(()=>{var e=d(A);return m(e,a(i,{get each(){return Pe()},children:e=>(()=>{var t=d(se),n=t.firstChild,r=n.nextSibling,i=r.firstChild,[a,c]=s(i.nextSibling),l=a.nextSibling,f=l.firstChild.nextSibling,[p,h]=s(f.nextSibling);return n.addEventListener(`change`,t=>q(t.currentTarget.checked?[...K(),`post:${e.id}`]:K().filter(t=>t!==`post:${e.id}`))),m(r,()=>e.title,a,c),m(l,()=>e.slug,p,h),o(()=>u(n,`checked`,K().includes(`post:${e.id}`))),t})()})),e})(),(()=>{var e=d(j);return e.$$click=()=>ke(Pe().map(Ie)),m(e,()=>f(`menus.editor.addSelected`)),h(),e})()]}}),xe,Se),m(R,a(G,{get title(){return f(`menus.sources.contentTypes`)},get children(){return a(i,{get each(){return V().filter(e=>e.slug!==`page`&&e.slug!==`post`&&!e.singleton)},children:e=>(()=>{var t=d(M),n=t.firstChild,r=n.nextSibling,[o,c]=s(r.nextSibling);return m(n,()=>e.pluralLabel),m(t,a(i,{get each(){return z()[e.slug]??[]},children:t=>(()=>{var n=d(N),r=n.firstChild,[i,a]=s(r.nextSibling),o=i.nextSibling,c=o.firstChild.nextSibling,[l,u]=s(c.nextSibling),f=l.nextSibling.nextSibling,[p,g]=s(f.nextSibling);return n.$$click=()=>$(Le(t)),m(n,()=>t.title,i,a),m(o,()=>e.slug,l,u),m(o,()=>t.slug,p,g),h(),n})()}),o,c),t})()})}}),Te,X),m(R,a(G,{get title(){return f(`menus.sources.custom`)},get description(){return f(`menus.sources.customHint`)},get children(){return[(()=>{var e=d(re),t=e.firstChild,[n,r]=s(t.nextSibling),i=n.nextSibling;return m(e,()=>f(`menus.editor.url`),n,r),i.$$input=e=>ye(e.currentTarget.value),o(()=>u(i,`value`,J())),h(),e})(),(()=>{var e=d(ie),t=e.firstChild,[n,r]=s(t.nextSibling),i=n.nextSibling;return m(e,()=>f(`menus.editor.navigationLabel`),n,r),i.$$input=e=>be(e.currentTarget.value),o(()=>u(i,`value`,Y())),h(),e})(),(()=>{var e=d(j);return e.$$click=Ae,m(e,()=>f(`menus.editor.addToMenu`)),h(),e})()]}}),Z,De),m(R,a(G,{get title(){return f(`menus.sources.home`)},get children(){var e=d(j);return e.$$click=()=>$({id:`home`,type:`home`,label:f(`menus.sources.home`),url:`/`}),m(e,()=>f(`menus.editor.addToMenu`)),h(),e}}),Me,Re),m(R,a(G,{get title(){return f(`menus.sources.archives`)},get children(){var e=d(A);return m(e,a(i,{get each(){return V().filter(e=>e.hasArchive)},children:e=>(()=>{var t=d(ce),n=t.firstChild,[r,i]=s(n.nextSibling),a=r.nextSibling,o=a.firstChild.nextSibling,[c,l]=s(o.nextSibling);return t.$$click=()=>$({id:`archive:${e.slug}`,type:`archive`,label:e.pluralLabel,url:`/${e.slug}`,objectType:e.slug}),m(t,()=>e.pluralLabel,r,i),m(a,()=>e.slug,c,l),h(),t})()})),e}}),Be,Ve),m(R,a(G,{get title(){return f(`menus.sources.taxonomies`)},get children(){return a(i,{get each(){return U()},children:e=>(()=>{var t=d(M),n=t.firstChild,r=n.nextSibling,[o,c]=s(r.nextSibling);return m(n,()=>e.name),m(t,a(i,{get each(){return fe()[e.slug]??[]},children:t=>(()=>{var n=d(N),r=n.firstChild,[i,a]=s(r.nextSibling),o=i.nextSibling,c=o.firstChild.nextSibling,[l,u]=s(c.nextSibling),f=l.nextSibling.nextSibling,[p,g]=s(f.nextSibling);return n.$$click=()=>$({id:`term:${e.slug}:${t.slug}`,type:`taxonomy`,label:t.name,url:`/${e.slug}/${t.slug}`,objectId:t.id,objectType:e.slug}),m(n,()=>t.name,i,a),m(o,()=>e.slug,l,u),m(o,()=>t.slug,p,g),h(),n})()}),o,c),t})()})}}),Ue,We),m(Je,()=>f(`menus.editor.structure`)),m(Ye,()=>f(`menus.editor.structureHint`)),m(Xe,()=>e().items.length,Qe,$e),m(Xe,()=>f(`menus.items`),tt,nt),m(Ge,a(n,{get when(){return e().items.length>0},get fallback(){return(()=>{var e=d(le);return m(e,()=>f(`menus.editor.empty`)),e})()},get children(){return a(ve,{get items(){return e().items},t:f,onChange:e=>Q({items:e})})}}),it,at),m(ot,()=>f(`menus.editor.settings`)),ct.addEventListener(`change`,t=>Q({settings:{...e().settings,autoAddNewPages:t.currentTarget.checked}})),m(st,()=>f(`menus.editor.autoAddPages`),ut,dt),m(ft,()=>f(`menus.editor.autoAddPagesHint`)),o(t=>{var n=Ce(),r=F(e().name);return n!==t.e&&u(w,`disabled`,t.e=n),r!==t.t&&l(L,`placeholder`,t.t=r),t},{e:void 0,t:void 0}),o(()=>u(O,`value`,e().name)),o(()=>u(L,`value`,e().slug)),o(()=>u(ct,`checked`,e().settings.autoAddNewPages===!0)),h(),t})()})}}),P,I),e})()}p([`click`,`input`]);export{K as MenuManager};
@@ -1,4 +1,4 @@
1
- import{f as e,g as t,r as n,s as r,u as i}from"./solid.TEtyrbLc.js";import{d as a,i as o,l as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./web.C8wWxyYF.js";import{n as h}from"./i18n.Tk18hqHh.js";import{t as g}from"./api.DSIz0zxF.js";var _=u(`<div class=plugin-manager><div class=page-header><h2></h2><p class=page-description></p><p class=page-hint></p></div><!$><!/><!$><!/><!$><!/><style>
1
+ import{f as e,g as t,r as n,s as r,u as i}from"./solid.TEtyrbLc.js";import{a,c as o,d as s,f as c,i as l,m as u,n as d,r as f,s as p,u as m}from"./web.D0f8iaHB.js";import{n as h}from"./i18n.BmX2Cv4K.js";import{t as g}from"./api.DSIz0zxF.js";var _=u(`<div class=plugin-manager><div class=page-header><h2></h2><p class=page-description></p><p class=page-hint></p></div><!$><!/><!$><!/><!$><!/><style>
2
2
  .page-header {
3
3
  margin-bottom: 1.5rem;
4
4
  }
@@ -95,4 +95,4 @@ import{f as e,g as t,r as n,s as r,u as i}from"./solid.TEtyrbLc.js";import{d as
95
95
  text-align: center;
96
96
  color: var(--color-muted);
97
97
  }
98
- `),v=u(`<div class="alert alert-error">`),y=u(`<div class=skeleton>Loading...`),b=u(`<div class=plugins-table-container><table class=table><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody></tbody></table><!$><!/>`),x=u(`<tr class=plugin-row><td class=plugin-name><strong></strong><!$><!/></td><td></td><td><span></span></td><td><button>`),S=u(`<span class=plugin-description>`),C=u(`<div class=empty-state>`);function w(){let{t:c}=h(),[u,w]=e([]),[T,E]=e(!0),[D,O]=e(null),[k,A]=e(null);t(async()=>{await j()});async function j(){try{E(!0);let e=await g.getPlugins();w(e)}catch{O(c(`plugins.loadError`))}finally{E(!1)}}let M=e=>e.status===`ACTIVE`||e.status===`ACTIVATED`;async function N(e){let t=M(e);A(e.id);try{let n=t?await g.deactivatePlugin(e.id):await g.activatePlugin(e.id);w(u().map(t=>t.id===e.id?n:t))}catch{O(c(t?`plugins.deactivateError`:`plugins.activateError`))}finally{A(null)}}let P=e=>{switch(e){case`ACTIVE`:case`ACTIVATED`:return c(`plugins.status.active`);case`INSTALLED`:return c(`plugins.status.installed`);case`INACTIVE`:case`DEACTIVATED`:return c(`plugins.status.inactive`);default:return e}},F=e=>{switch(e){case`ACTIVE`:case`ACTIVATED`:return`status-active`;case`INSTALLED`:return`status-installed`;case`INACTIVE`:case`DEACTIVATED`:return`status-inactive`;default:return``}};return(()=>{var e=d(_),t=e.firstChild,h=t.firstChild,g=h.nextSibling,w=g.nextSibling,E=t.nextSibling,[O,A]=o(E.nextSibling),j=O.nextSibling,[I,L]=o(j.nextSibling),R=I.nextSibling,[z,B]=o(R.nextSibling);return z.nextSibling,l(h,()=>c(`plugins.title`)),l(g,()=>c(`plugins.description`)),l(w,()=>c(`plugins.directoryHint`)),l(e,(()=>{var e=f(()=>!!D());return()=>e()&&(()=>{var e=d(v);return l(e,D),e})()})(),O,A),l(e,(()=>{var e=f(()=>!!T());return()=>e()&&d(y)})(),I,L),l(e,(()=>{var e=f(()=>!(T()||D()));return()=>e()&&(()=>{var e=d(b),t=e.firstChild,h=t.firstChild,g=h.firstChild.firstChild,_=g.nextSibling,v=_.nextSibling,y=v.nextSibling,w=h.nextSibling,T=t.nextSibling,[E,D]=o(T.nextSibling);return l(g,()=>c(`plugins.columns.name`)),l(_,()=>c(`plugins.columns.version`)),l(v,()=>c(`plugins.columns.status`)),l(y,()=>c(`plugins.columns.actions`)),l(w,r(n,{get each(){return u()},children:e=>(()=>{var t=d(x),n=t.firstChild,r=n.firstChild,u=r.nextSibling,[h,g]=o(u.nextSibling),_=n.nextSibling,v=_.nextSibling,y=v.firstChild,b=v.nextSibling.firstChild;return l(r,()=>e.name),l(n,(()=>{var t=f(()=>!!e.manifest?.description);return()=>t()&&(()=>{var t=d(S);return l(t,()=>e.manifest.description),t})()})(),h,g),l(_,()=>e.version),l(y,()=>P(e.status)),b.$$click=()=>N(e),l(b,(()=>{var t=f(()=>!!M(e));return()=>t()?c(`plugins.deactivate`):c(`plugins.activate`)})()),i(t=>{var n=`status-badge ${F(e.status)}`,r=`btn btn-sm ${k()===e.id?`btn-loading`:``}`,i=k()!==null,o=M(e)?c(`plugins.deactivate`):c(`plugins.activate`);return n!==t.e&&p(y,t.e=n),r!==t.t&&p(b,t.t=r),i!==t.a&&a(b,`disabled`,t.a=i),o!==t.o&&m(b,`aria-label`,t.o=o),t},{e:void 0,t:void 0,a:void 0,o:void 0}),s(),t})()})),l(e,(()=>{var e=f(()=>u().length===0);return()=>e()&&(()=>{var e=d(C);return l(e,()=>c(`plugins.empty`)),e})()})(),E,D),e})()})(),z,B),e})()}c([`click`]);export{w as PluginManager};
98
+ `),v=u(`<div class="alert alert-error">`),y=u(`<div class=skeleton>Loading...`),b=u(`<div class=plugins-table-container><table class=table><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody></tbody></table><!$><!/>`),x=u(`<tr class=plugin-row><td class=plugin-name><strong></strong><!$><!/></td><td></td><td><span></span></td><td><button>`),S=u(`<span class=plugin-description>`),C=u(`<div class=empty-state>`);function w(){let{t:u}=h(),[f,w]=e([]),[T,E]=e(!0),[D,O]=e(null),[k,A]=e(null);t(async()=>{await j()});async function j(){try{E(!0);let e=await g.getPlugins();w(e)}catch{O(u(`plugins.loadError`))}finally{E(!1)}}let M=e=>e.status===`ACTIVE`||e.status===`ACTIVATED`;async function N(e){let t=M(e);A(e.id);try{let n=t?await g.deactivatePlugin(e.id):await g.activatePlugin(e.id);w(f().map(t=>t.id===e.id?n:t))}catch{O(u(t?`plugins.deactivateError`:`plugins.activateError`))}finally{A(null)}}let P=e=>{switch(e){case`ACTIVE`:case`ACTIVATED`:return u(`plugins.status.active`);case`INSTALLED`:return u(`plugins.status.installed`);case`INACTIVE`:case`DEACTIVATED`:return u(`plugins.status.inactive`);default:return e}},F=e=>{switch(e){case`ACTIVE`:case`ACTIVATED`:return`status-active`;case`INSTALLED`:return`status-installed`;case`INACTIVE`:case`DEACTIVATED`:return`status-inactive`;default:return``}};return(()=>{var e=l(_),t=e.firstChild,h=t.firstChild,g=h.nextSibling,w=g.nextSibling,E=t.nextSibling,[O,A]=a(E.nextSibling),j=O.nextSibling,[I,L]=a(j.nextSibling),R=I.nextSibling,[z,B]=a(R.nextSibling);return z.nextSibling,p(h,()=>u(`plugins.title`)),p(g,()=>u(`plugins.description`)),p(w,()=>u(`plugins.directoryHint`)),p(e,(()=>{var e=o(()=>!!D());return()=>e()&&(()=>{var e=l(v);return p(e,D),e})()})(),O,A),p(e,(()=>{var e=o(()=>!!T());return()=>e()&&l(y)})(),I,L),p(e,(()=>{var e=o(()=>!(T()||D()));return()=>e()&&(()=>{var e=l(b),t=e.firstChild,h=t.firstChild,g=h.firstChild.firstChild,_=g.nextSibling,v=_.nextSibling,y=v.nextSibling,w=h.nextSibling,T=t.nextSibling,[E,D]=a(T.nextSibling);return p(g,()=>u(`plugins.columns.name`)),p(_,()=>u(`plugins.columns.version`)),p(v,()=>u(`plugins.columns.status`)),p(y,()=>u(`plugins.columns.actions`)),p(w,r(n,{get each(){return f()},children:e=>(()=>{var t=l(x),n=t.firstChild,r=n.firstChild,f=r.nextSibling,[h,g]=a(f.nextSibling),_=n.nextSibling,v=_.nextSibling,y=v.firstChild,b=v.nextSibling.firstChild;return p(r,()=>e.name),p(n,(()=>{var t=o(()=>!!e.manifest?.description);return()=>t()&&(()=>{var t=l(S);return p(t,()=>e.manifest.description),t})()})(),h,g),p(_,()=>e.version),p(y,()=>P(e.status)),b.$$click=()=>N(e),p(b,(()=>{var t=o(()=>!!M(e));return()=>t()?u(`plugins.deactivate`):u(`plugins.activate`)})()),i(t=>{var n=`status-badge ${F(e.status)}`,r=`btn btn-sm ${k()===e.id?`btn-loading`:``}`,i=k()!==null,a=M(e)?u(`plugins.deactivate`):u(`plugins.activate`);return n!==t.e&&d(y,t.e=n),r!==t.t&&d(b,t.t=r),i!==t.a&&c(b,`disabled`,t.a=i),a!==t.o&&s(b,`aria-label`,t.o=a),t},{e:void 0,t:void 0,a:void 0,o:void 0}),m(),t})()})),p(e,(()=>{var e=o(()=>f().length===0);return()=>e()&&(()=>{var e=l(C);return p(e,()=>u(`plugins.empty`)),e})()})(),E,D),e})()})(),z,B),e})()}f([`click`]);export{w as PluginManager};
@@ -0,0 +1 @@
1
+ import{f as e,g as t,i as n,l as r,r as i,s as a,u as o}from"./solid.TEtyrbLc.js";import{a as s,c,d as l,f as u,i as d,m as f,r as p,s as m,u as h}from"./web.D0f8iaHB.js";import{n as g}from"./i18n.BmX2Cv4K.js";import{t as _}from"./api.DSIz0zxF.js";var v=f(`<div class="notice notice--error">`),y=f(`<button type=button class="btn btn-secondary">`),b=f(`<div class=post-types-manager><!$><!/><form class=card><h3></h3><div class=form-grid><label><!$><!/><input class=input required pattern=[a-z0-9_]+></label><label><!$><!/><input class=input required></label><label><!$><!/><input class=input required></label><label><!$><!/><input class=input placeholder=box><small class=muted></small></label></div><fieldset class=supports><legend></legend><!$><!/><label><input type=checkbox> <!$><!/></label><label><input type=checkbox> <!$><!/></label></fieldset><button type=submit class="btn btn-primary"></button><!$><!/></form><table class=table><thead><tr><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th></tr></thead><tbody>`),x=f(`<label><input type=checkbox> <!$><!/>`),ee=f(`<button type=button class="btn btn-danger">`),te=f(`<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td><button type=button class="btn btn-secondary"></button> <!$><!/>`);function S(){let{t:f}=g(),[p,S]=e([]),[C,w]=e(``),[ne,T]=e(!1),[E,D]=e(null),re=r(()=>[{value:`title`,label:f(`settings.postTypes.form.supportsOptions.title`)},{value:`editor`,label:f(`settings.postTypes.form.supportsOptions.editor`)},{value:`thumbnail`,label:f(`settings.postTypes.form.supportsOptions.thumbnail`)},{value:`excerpt`,label:f(`settings.postTypes.form.supportsOptions.excerpt`)},{value:`revisions`,label:f(`settings.postTypes.form.supportsOptions.revisions`)}]),[O,k]=e({name:``,slug:``,singularLabel:``,pluralLabel:``,hasArchive:!1,singleton:!1,menuIcon:`box`,supports:[`title`,`editor`]}),A=()=>{D(null),k({name:``,slug:``,singularLabel:``,pluralLabel:``,hasArchive:!1,singleton:!1,menuIcon:`box`,supports:[`title`,`editor`]})},j=async()=>{try{S(await _.getContentTypes())}catch(e){w(e instanceof Error?e.message:String(e))}};t(j);let ie=async e=>{e.preventDefault(),w(``),T(!0);try{let e={name:O().name||O().slug,slug:O().slug,singularLabel:O().singularLabel,pluralLabel:O().pluralLabel,hasArchive:O().hasArchive,singleton:O().singleton,menuIcon:O().menuIcon||`box`,supports:O().supports};E()?await _.updateContentType(E(),e):await _.createContentType(e),A(),await j(),window.dispatchEvent(new Event(`okcms:content-models-changed`))}catch(e){w(e instanceof Error?e.message:String(e))}finally{T(!1)}},ae=e=>{D(e.slug),k({name:e.name,slug:e.slug,singularLabel:e.singularLabel,pluralLabel:e.pluralLabel,hasArchive:e.hasArchive??!1,singleton:e.singleton??!1,menuIcon:e.menuIcon??`box`,supports:[...e.supports??[`title`,`editor`]]})},oe=async e=>{try{await _.deleteContentType(e),await j(),window.dispatchEvent(new Event(`okcms:content-models-changed`))}catch(e){w(e instanceof Error?e.message:String(e))}};return(()=>{var e=d(b),t=e.firstChild,[r,g]=s(t.nextSibling),_=r.nextSibling,S=_.firstChild,w=S.nextSibling,T=w.firstChild,D=T.firstChild,[j,se]=s(D.nextSibling),M=j.nextSibling,N=T.nextSibling,ce=N.firstChild,[P,le]=s(ce.nextSibling),F=P.nextSibling,I=N.nextSibling,ue=I.firstChild,[L,de]=s(ue.nextSibling),R=L.nextSibling,z=I.nextSibling,fe=z.firstChild,[B,pe]=s(fe.nextSibling),V=B.nextSibling,me=V.nextSibling,H=w.nextSibling,U=H.firstChild,he=U.nextSibling,[W,ge]=s(he.nextSibling),G=W.nextSibling,K=G.firstChild,_e=K.nextSibling.nextSibling,[ve,ye]=s(_e.nextSibling),q=G.nextSibling,J=q.firstChild,be=J.nextSibling.nextSibling,[xe,Se]=s(be.nextSibling),Y=H.nextSibling,Ce=Y.nextSibling,[we,Te]=s(Ce.nextSibling),X=_.nextSibling.firstChild,Z=X.firstChild.firstChild,Q=Z.nextSibling,$=Q.nextSibling,Ee=$.nextSibling,De=Ee.nextSibling,Oe=De.nextSibling,ke=Oe.nextSibling,Ae=ke.nextSibling,je=X.nextSibling;return m(e,a(n,{get when(){return C()},get children(){var e=d(v);return m(e,C),e}}),r,g),_.addEventListener(`submit`,ie),m(S,(()=>{var e=c(()=>!!E());return()=>e()?f(`settings.postTypes.form.editTitle`):f(`settings.postTypes.form.title`)})()),m(T,()=>f(`settings.postTypes.form.slug`),j,se),M.$$input=e=>k({...O(),slug:e.currentTarget.value}),m(N,()=>f(`settings.postTypes.form.singular`),P,le),F.$$input=e=>k({...O(),singularLabel:e.currentTarget.value}),m(I,()=>f(`settings.postTypes.form.plural`),L,de),R.$$input=e=>k({...O(),pluralLabel:e.currentTarget.value}),m(z,()=>f(`settings.postTypes.form.icon`),B,pe),V.$$input=e=>k({...O(),menuIcon:e.currentTarget.value}),m(me,()=>f(`settings.postTypes.form.iconHint`)),m(U,()=>f(`settings.postTypes.form.supports`)),m(H,a(i,{get each(){return re()},children:e=>(()=>{var t=d(x),n=t.firstChild,r=n.nextSibling.nextSibling,[i,a]=s(r.nextSibling);return n.addEventListener(`change`,t=>k({...O(),supports:t.currentTarget.checked?[...O().supports,e.value]:O().supports.filter(t=>t!==e.value)})),m(t,()=>e.label,i,a),o(()=>u(n,`checked`,O().supports.includes(e.value))),t})()}),W,ge),K.addEventListener(`change`,e=>k({...O(),hasArchive:e.currentTarget.checked})),m(G,()=>f(`settings.postTypes.form.hasArchive`),ve,ye),J.addEventListener(`change`,e=>k({...O(),singleton:e.currentTarget.checked})),m(q,()=>f(`settings.postTypes.form.singleton`),xe,Se),m(Y,(()=>{var e=c(()=>!!E());return()=>e()?f(`settings.postTypes.form.update`):f(`settings.postTypes.form.create`)})()),m(_,a(n,{get when(){return E()},get children(){var e=d(y);return e.$$click=A,m(e,()=>f(`settings.postTypes.form.cancel`)),h(),e}}),we,Te),m(Z,()=>f(`settings.postTypes.table.slug`)),m(Q,()=>f(`settings.postTypes.table.singular`)),m($,()=>f(`settings.postTypes.table.plural`)),m(Ee,()=>f(`settings.postTypes.table.source`)),m(De,()=>f(`settings.postTypes.table.supports`)),m(Oe,()=>f(`settings.postTypes.table.archive`)),m(ke,()=>f(`settings.postTypes.table.mode`)),m(Ae,()=>f(`settings.postTypes.table.icon`)),m(je,a(i,{get each(){return p()},children:e=>(()=>{var t=d(te),r=t.firstChild,i=r.nextSibling,o=i.nextSibling,l=o.nextSibling,u=l.nextSibling,p=u.nextSibling,g=p.nextSibling,_=g.nextSibling,v=_.nextSibling,y=v.firstChild,b=y.nextSibling.nextSibling,[x,S]=s(b.nextSibling);return m(r,()=>e.slug),m(i,()=>e.singularLabel),m(o,()=>e.pluralLabel),m(l,()=>e.source??f(`settings.postTypes.sources.admin`)),m(u,()=>(e.supports??[]).join(`, `)),m(p,(()=>{var t=c(()=>!!e.hasArchive);return()=>t()?f(`common.yes`):f(`common.no`)})()),m(g,(()=>{var t=c(()=>!!e.singleton);return()=>t()?f(`settings.postTypes.table.singleton`):f(`settings.postTypes.table.collection`)})()),m(_,()=>e.menuIcon??`box`),y.$$click=()=>ae(e),m(y,()=>f(`settings.postTypes.table.actions.edit`)),m(v,a(n,{get when(){return e.source!==`CORE`},get children(){var t=d(ee);return t.$$click=()=>oe(e.slug),m(t,()=>f(`settings.postTypes.table.actions.remove`)),h(),t}}),x,S),h(),t})()})),o(e=>{var t=f(`settings.postTypes.form.slugHint`),n=ne();return t!==e.e&&l(M,`title`,e.e=t),n!==e.t&&u(Y,`disabled`,e.t=n),e},{e:void 0,t:void 0}),o(()=>u(M,`value`,O().slug)),o(()=>u(F,`value`,O().singularLabel)),o(()=>u(R,`value`,O().pluralLabel)),o(()=>u(V,`value`,O().menuIcon)),o(()=>u(K,`checked`,O().hasArchive)),o(()=>u(J,`checked`,O().singleton)),h(),e})()}p([`input`,`click`]);export{S as PostTypesManager};
@@ -1,4 +1,4 @@
1
- import{f as e,g as t,r as n,s as r,u as i}from"./solid.TEtyrbLc.js";import{d as a,i as o,l as s,n as c,o as l,p as u,r as d,s as f,u as p}from"./web.C8wWxyYF.js";import{n as m}from"./i18n.Tk18hqHh.js";import{t as h}from"./api.DSIz0zxF.js";import{DashboardWidget as g}from"./AtGlanceWidget.Bx6FJSG5.js";var _=u(`<div class=quick-draft-wrapper><div class=quick-draft-content-wrapper>`),v=u(`<style>
1
+ import{f as e,g as t,r as n,s as r,u as i}from"./solid.TEtyrbLc.js";import{a,c as o,d as s,f as c,i as l,m as u,r as d,s as f,u as p}from"./web.D0f8iaHB.js";import{n as m}from"./i18n.BmX2Cv4K.js";import{t as h}from"./api.DSIz0zxF.js";import{DashboardWidget as g}from"./AtGlanceWidget.Buy1lfZh.js";var _=u(`<div class=quick-draft-wrapper><div class=quick-draft-content-wrapper>`),v=u(`<style>
2
2
  .quick-draft-form { display: flex; flex-direction: column; gap: 1rem; }
3
3
  .form-group textarea { min-height: 100px; resize: vertical; font-family: inherit; }
4
4
  .drafts-list h4 { margin-bottom: 1rem; }
@@ -14,4 +14,4 @@ import{f as e,g as t,r as n,s as r,u as i}from"./solid.TEtyrbLc.js";import{d as
14
14
  .draft-meta { display: flex; gap: 0.5rem; font-size: 0.8125rem; color: var(--color-muted); }
15
15
  .status-draft { color: var(--color-warning); font-weight: 500; }
16
16
  .draft-date { font-size: 0.75rem; }
17
- `),y=u(`<div class=skeleton>Loading...`),b=u(`<div class=quick-draft-content><form class=quick-draft-form><div class=form-group><label for=quick-draft-title></label><input type=text id=quick-draft-title class=input required></div><div class=form-group><label for=quick-draft-content></label><textarea id=quick-draft-content class=input rows=4></textarea></div><div class=form-actions><button type=submit class="btn btn-primary"></button><button type=button class="btn btn-secondary"></button></div></form><div class=drafts-section>`),x=u(`<span class=spinner>`),S=u(`<div class=drafts-list><h4></h4><!$><!/>`),C=u(`<a class=draft-item><div class=draft-info><span class=draft-title></span><span class=draft-meta><span class=status-draft></span><span class=draft-date>`),w=u(`<p class=empty-state>`);function T(){let{t:c}=m(),[u,T]=e([]),[E,D]=e(!0),[O,k]=e(!1),[A,j]=e(``),[M,N]=e(``);t(async()=>{try{let e=await h.getContent({type:`post`,status:`DRAFT`,limit:5});T(e.data??[])}catch(e){console.error(`Failed to load drafts:`,e)}finally{D(!1)}});let P=async e=>{if(e.preventDefault(),A().trim()){k(!0);try{let e=await h.createContent({type:`post`,title:A(),slug:A().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/(^-|-$)/g,``),excerpt:M(),status:`DRAFT`,body:{content:M()}});T([e,...u()]),j(``),N(``)}catch(e){console.error(`Failed to save draft:`,e)}finally{k(!1)}}},F=e=>e?new Date(e).toLocaleDateString(`pt-BR`,{day:`2-digit`,month:`2-digit`,year:`numeric`,hour:`2-digit`,minute:`2-digit`}):``;return r(g,{get title(){return c(`dashboard.widgets.quickDraft.title`)},panelId:`quick-draft`,get children(){return[(()=>{var e=d(_),t=e.firstChild;return l(t,(()=>{var e=f(()=>!!E());return()=>e()?d(y):(()=>{var e=d(b),t=e.firstChild,m=t.firstChild,h=m.firstChild,g=h.nextSibling,_=m.nextSibling,v=_.firstChild,y=v.nextSibling,T=_.nextSibling.firstChild,E=T.nextSibling,D=t.nextSibling;return t.addEventListener(`submit`,P),l(h,()=>c(`dashboard.widgets.quickDraft.heading`)),g.$$input=e=>j(e.currentTarget.value),l(v,()=>c(`dashboard.widgets.quickDraft.content`)),y.$$input=e=>N(e.currentTarget.value),l(T,(()=>{var e=f(()=>!!O());return()=>e()?d(x):c(`dashboard.widgets.quickDraft.save`)})()),E.$$click=()=>{j(``),N(``)},l(E,()=>c(`common.cancel`)),l(D,(()=>{var e=f(()=>u().length>0);return()=>e()?(()=>{var e=d(S),t=e.firstChild,a=t.nextSibling,[s,f]=o(a.nextSibling);return l(t,()=>c(`dashboard.widgets.quickDraft.yourDrafts`)),l(e,r(n,{get each(){return u()},children:e=>(()=>{var t=d(C),n=t.firstChild.firstChild,r=n.nextSibling.firstChild,a=r.nextSibling;return l(n,()=>e.title),l(r,()=>c(`content.list.statuses.draft`)),l(a,()=>F(e.updated_at)),i(()=>p(t,`href`,`/content/${encodeURIComponent(e.type||`post`)}/edit?id=${e.id}`)),t})()}),s,f),e})():(()=>{var e=d(w);return l(e,()=>c(`dashboard.widgets.quickDraft.noDrafts`)),e})()})()),i(e=>{var t=c(`dashboard.widgets.quickDraft.headingPlaceholder`),n=c(`dashboard.widgets.quickDraft.contentPlaceholder`),r=O();return t!==e.e&&p(g,`placeholder`,e.e=t),n!==e.t&&p(y,`placeholder`,e.t=n),r!==e.a&&a(T,`disabled`,e.a=r),e},{e:void 0,t:void 0,a:void 0}),i(()=>a(g,`value`,A())),i(()=>a(y,`value`,M())),s(),e})()})()),e})(),d(v)]}})}c([`input`,`click`]);export{T as QuickDraftWidget};
17
+ `),y=u(`<div class=skeleton>Loading...`),b=u(`<div class=quick-draft-content><form class=quick-draft-form><div class=form-group><label for=quick-draft-title></label><input type=text id=quick-draft-title class=input required></div><div class=form-group><label for=quick-draft-content></label><textarea id=quick-draft-content class=input rows=4></textarea></div><div class=form-actions><button type=submit class="btn btn-primary"></button><button type=button class="btn btn-secondary"></button></div></form><div class=drafts-section>`),x=u(`<span class=spinner>`),S=u(`<div class=drafts-list><h4></h4><!$><!/>`),C=u(`<a class=draft-item><div class=draft-info><span class=draft-title></span><span class=draft-meta><span class=status-draft></span><span class=draft-date>`),w=u(`<p class=empty-state>`);function T(){let{t:u}=m(),[d,T]=e([]),[E,D]=e(!0),[O,k]=e(!1),[A,j]=e(``),[M,N]=e(``);t(async()=>{try{let e=await h.getContent({type:`post`,status:`DRAFT`,limit:5});T(e.data??[])}catch(e){console.error(`Failed to load drafts:`,e)}finally{D(!1)}});let P=async e=>{if(e.preventDefault(),A().trim()){k(!0);try{let e=await h.createContent({type:`post`,title:A(),slug:A().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/(^-|-$)/g,``),excerpt:M(),status:`DRAFT`,body:{content:M()}});T([e,...d()]),j(``),N(``)}catch(e){console.error(`Failed to save draft:`,e)}finally{k(!1)}}},F=e=>e?new Date(e).toLocaleDateString(`pt-BR`,{day:`2-digit`,month:`2-digit`,year:`numeric`,hour:`2-digit`,minute:`2-digit`}):``;return r(g,{get title(){return u(`dashboard.widgets.quickDraft.title`)},panelId:`quick-draft`,get children(){return[(()=>{var e=l(_),t=e.firstChild;return f(t,(()=>{var e=o(()=>!!E());return()=>e()?l(y):(()=>{var e=l(b),t=e.firstChild,m=t.firstChild,h=m.firstChild,g=h.nextSibling,_=m.nextSibling,v=_.firstChild,y=v.nextSibling,T=_.nextSibling.firstChild,E=T.nextSibling,D=t.nextSibling;return t.addEventListener(`submit`,P),f(h,()=>u(`dashboard.widgets.quickDraft.heading`)),g.$$input=e=>j(e.currentTarget.value),f(v,()=>u(`dashboard.widgets.quickDraft.content`)),y.$$input=e=>N(e.currentTarget.value),f(T,(()=>{var e=o(()=>!!O());return()=>e()?l(x):u(`dashboard.widgets.quickDraft.save`)})()),E.$$click=()=>{j(``),N(``)},f(E,()=>u(`common.cancel`)),f(D,(()=>{var e=o(()=>d().length>0);return()=>e()?(()=>{var e=l(S),t=e.firstChild,o=t.nextSibling,[c,p]=a(o.nextSibling);return f(t,()=>u(`dashboard.widgets.quickDraft.yourDrafts`)),f(e,r(n,{get each(){return d()},children:e=>(()=>{var t=l(C),n=t.firstChild.firstChild,r=n.nextSibling.firstChild,a=r.nextSibling;return f(n,()=>e.title),f(r,()=>u(`content.list.statuses.draft`)),f(a,()=>F(e.updated_at)),i(()=>s(t,`href`,`/content/${encodeURIComponent(e.type||`post`)}/edit?id=${e.id}`)),t})()}),c,p),e})():(()=>{var e=l(w);return f(e,()=>u(`dashboard.widgets.quickDraft.noDrafts`)),e})()})()),i(e=>{var t=u(`dashboard.widgets.quickDraft.headingPlaceholder`),n=u(`dashboard.widgets.quickDraft.contentPlaceholder`),r=O();return t!==e.e&&s(g,`placeholder`,e.e=t),n!==e.t&&s(y,`placeholder`,e.t=n),r!==e.a&&c(T,`disabled`,e.a=r),e},{e:void 0,t:void 0,a:void 0}),i(()=>c(g,`value`,A())),i(()=>c(y,`value`,M())),p(),e})()})()),e})(),l(v)]}})}d([`input`,`click`]);export{T as QuickDraftWidget};
@@ -0,0 +1 @@
1
+ import{f as e,g as t,i as n,r,s as i,u as a}from"./solid.TEtyrbLc.js";import{a as o,d as s,f as c,i as l,m as u,r as d,s as f,u as p}from"./web.D0f8iaHB.js";import{n as m}from"./i18n.BmX2Cv4K.js";import{t as h}from"./api.DSIz0zxF.js";var g=u(`<div class="notice notice--error">`),_=u(`<div class=resource-hub><!$><!/><div class=access-grid><section class=card><h3></h3><button class="btn btn-primary"type=button>+ <!$><!/></button><!$><!/><table class=table><tbody></tbody></table></section><section class=card><h3></h3><button class="btn btn-primary"type=button>+ <!$><!/></button><!$><!/><table class=table><tbody>`),v=u(`<form class=resource-form><input class=input required><input class=input required><input class=input><button class="btn btn-primary"type=submit>`),y=u(`<button class="btn btn-danger"type=button>`),b=u(`<tr><td></td><td></td><td><button class=btn type=button></button><!$><!/>`),x=u(`<tr><td></td><td></td><td></td><td><button class=btn type=button></button><button class="btn btn-danger"type=button>`);function S(){let{t:u}=m(),[d,S]=e([]),[C,w]=e([]),[T,E]=e(null),[D,O]=e(null),[k,A]=e(``),j=async()=>{try{S(await h.listRoles()),w((await h.listTenants({limit:100})).data??[])}catch(e){A(e instanceof Error?e.message:String(e))}};return t(j),(()=>{var e=l(_),t=e.firstChild,[m,S]=o(t.nextSibling),w=m.nextSibling.firstChild,M=w.firstChild,N=M.nextSibling,P=N.firstChild.nextSibling,[F,I]=o(P.nextSibling),L=N.nextSibling,[R,z]=o(L.nextSibling),B=R.nextSibling.firstChild,V=w.nextSibling,H=V.firstChild,U=H.nextSibling,W=U.firstChild.nextSibling,[G,K]=o(W.nextSibling),q=U.nextSibling,[J,Y]=o(q.nextSibling),X=J.nextSibling.firstChild;return f(e,i(n,{get when(){return k()},get children(){var e=l(g);return f(e,k),e}}),m,S),f(M,()=>u(`access.roles`)),N.$$click=()=>E({name:``,slug:``,permissions:[]}),f(N,()=>u(`common.create`),F,I),f(w,i(n,{get when(){return T()},children:e=>(()=>{var t=l(v),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,o=i.nextSibling;return t.addEventListener(`submit`,t=>{t.preventDefault(),(e().id?h.updateRole(e().id,e()):h.createRole(e())).then(()=>(E(null),j())).catch(e=>A(e instanceof Error?e.message:String(e)))}),n.$$input=t=>E({...e(),name:t.currentTarget.value}),r.$$input=t=>E({...e(),slug:t.currentTarget.value}),i.$$input=t=>E({...e(),permissions:t.currentTarget.value.split(`,`).map(e=>e.trim()).filter(Boolean)}),f(o,()=>u(`common.save`)),a(e=>{var t=u(`resources.name`),a=u(`resources.slug`),o=u(`access.permissions`);return t!==e.e&&s(n,`placeholder`,e.e=t),a!==e.t&&s(r,`placeholder`,e.t=a),o!==e.a&&s(i,`placeholder`,e.a=o),e},{e:void 0,t:void 0,a:void 0}),a(()=>c(n,`value`,e().name??``)),a(()=>c(r,`value`,e().slug??``)),a(()=>c(i,`value`,(e().permissions??[]).join(`, `))),p(),t})()}),R,z),f(B,i(r,{get each(){return d()},children:e=>(()=>{var t=l(b),r=t.firstChild,a=r.nextSibling,s=a.nextSibling,c=s.firstChild,d=c.nextSibling,[m,g]=o(d.nextSibling);return f(r,()=>e.name),f(a,()=>e.slug),c.$$click=()=>E(e),f(c,()=>u(`common.edit`)),f(s,i(n,{get when(){return!e.is_system},get children(){var t=l(y);return t.$$click=()=>void h.deleteRole(e.id).then(j),f(t,()=>u(`common.delete`)),p(),t}}),m,g),p(),t})()})),f(H,()=>u(`access.tenants`)),U.$$click=()=>O({name:``,slug:``}),f(U,()=>u(`common.create`),G,K),f(V,i(n,{get when(){return D()},children:e=>(()=>{var t=l(v),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,o=i.nextSibling;return t.addEventListener(`submit`,t=>{t.preventDefault(),(e().id?h.updateTenant(e().id,e()):h.createTenant(e())).then(()=>(O(null),j())).catch(e=>A(e instanceof Error?e.message:String(e)))}),n.$$input=t=>O({...e(),name:t.currentTarget.value}),r.$$input=t=>O({...e(),slug:t.currentTarget.value}),i.$$input=t=>O({...e(),domain:t.currentTarget.value}),f(o,()=>u(`common.save`)),a(e=>{var t=u(`resources.name`),a=u(`resources.slug`),o=u(`access.domain`);return t!==e.e&&s(n,`placeholder`,e.e=t),a!==e.t&&s(r,`placeholder`,e.t=a),o!==e.a&&s(i,`placeholder`,e.a=o),e},{e:void 0,t:void 0,a:void 0}),a(()=>c(n,`value`,e().name??``)),a(()=>c(r,`value`,e().slug??``)),a(()=>c(i,`value`,e().domain??``)),p(),t})()}),J,Y),f(X,i(r,{get each(){return C()},children:e=>(()=>{var t=l(x),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,a=i.nextSibling.firstChild,o=a.nextSibling;return f(n,()=>e.name),f(r,()=>e.slug),f(i,()=>e.status),a.$$click=()=>O(e),f(a,()=>u(`common.edit`)),o.$$click=()=>e.id&&void h.deleteTenant(e.id).then(j),f(o,()=>u(`common.delete`)),p(),t})()})),p(),e})()}d([`click`,`input`]);export{S as AccessManager};
@@ -0,0 +1 @@
1
+ import{f as e,g as t,i as n,r,s as i,u as a}from"./solid.TEtyrbLc.js";import{a as o,c as s,d as c,f as l,i as u,m as d,r as f,s as p,u as m}from"./web.D0f8iaHB.js";import{n as h}from"./i18n.BmX2Cv4K.js";import{t as g}from"./api.DSIz0zxF.js";var _=d(`<div class="notice notice--error">`),v=d(`<div class=taxonomies-manager><!$><!/><form class=card><h3></h3><div class=form-grid><label><!$><!/><input class=input required></label><label><!$><!/><input class=input pattern=[a-z0-9_]*></label><label><input type=checkbox> <!$><!/></label></div><fieldset><legend></legend><!$><!/></fieldset><button type=submit class="btn btn-primary"></button></form><table class=table><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody>`),y=d(`<label><input type=checkbox> <!$><!/> (<!$><!/>)`),b=d(`<button type=button class="btn btn-danger">`),x=d(`<tr><td><!$><!/> (<!$><!/>)</td><td></td><td></td><td>`),ee=d(`<label style=margin-right:0.75rem><input type=checkbox> <!$><!/>`);function S(){let{t:d}=h(),[f,S]=e([]),[C,w]=e([]),[T,E]=e(``),[D,O]=e(!1),[k,A]=e({name:``,slug:``,hierarchical:!1,attachTo:[]}),j=async()=>{try{let[e,t]=await Promise.all([g.getTaxonomies(),g.getContentTypes()]);S(e),w(t)}catch(e){E(e instanceof Error?e.message:String(e))}};t(j);let M=async e=>{e.preventDefault(),E(``),O(!0);try{await g.createTaxonomy({name:k().name,slug:k().slug||void 0,hierarchical:k().hierarchical,attachTo:k().attachTo,labels:{singular_name:k().name}}),A({name:``,slug:``,hierarchical:!1,attachTo:[]}),await j(),window.dispatchEvent(new Event(`okcms:content-models-changed`))}catch(e){E(e instanceof Error?e.message:String(e))}finally{O(!1)}},N=async(e,t)=>{let n=e.attachTo?.includes(t);try{n?await g.detachTaxonomy(e.slug,t):await g.attachTaxonomy(e.slug,t),await j(),window.dispatchEvent(new Event(`okcms:content-models-changed`))}catch(e){E(e instanceof Error?e.message:String(e))}},P=async e=>{try{await g.deleteTaxonomy(e),await j(),window.dispatchEvent(new Event(`okcms:content-models-changed`))}catch(e){E(e instanceof Error?e.message:String(e))}};return(()=>{var e=u(v),t=e.firstChild,[h,g]=o(t.nextSibling),S=h.nextSibling,w=S.firstChild,E=w.nextSibling,O=E.firstChild,j=O.firstChild,[F,I]=o(j.nextSibling),L=F.nextSibling,R=O.nextSibling,z=R.firstChild,[B,V]=o(z.nextSibling),H=B.nextSibling,U=R.nextSibling,W=U.firstChild,G=W.nextSibling.nextSibling,[K,q]=o(G.nextSibling),J=E.nextSibling,Y=J.firstChild,te=Y.nextSibling,[ne,re]=o(te.nextSibling),X=J.nextSibling,Z=S.nextSibling.firstChild,Q=Z.firstChild.firstChild,$=Q.nextSibling,ie=$.nextSibling,ae=Z.nextSibling;return p(e,i(n,{get when(){return T()},get children(){var e=u(_);return p(e,T),e}}),h,g),S.addEventListener(`submit`,M),p(w,()=>d(`settings.taxonomies.form.title`)),p(O,()=>d(`settings.taxonomies.form.name`),F,I),L.$$input=e=>A({...k(),name:e.currentTarget.value}),p(R,()=>d(`settings.taxonomies.form.slug`),B,V),H.$$input=e=>A({...k(),slug:e.currentTarget.value}),W.addEventListener(`change`,e=>A({...k(),hierarchical:e.currentTarget.checked})),p(U,()=>d(`settings.taxonomies.form.hierarchical`),K,q),p(Y,()=>d(`settings.taxonomies.form.attachTo`)),p(J,i(r,{get each(){return C()},children:e=>(()=>{var t=u(y),n=t.firstChild,r=n.nextSibling.nextSibling,[i,s]=o(r.nextSibling),c=i.nextSibling.nextSibling,[d,f]=o(c.nextSibling);return d.nextSibling,n.addEventListener(`change`,t=>A({...k(),attachTo:t.currentTarget.checked?[...k().attachTo,e.slug]:k().attachTo.filter(t=>t!==e.slug)})),p(t,()=>e.pluralLabel,i,s),p(t,()=>e.slug,d,f),a(()=>l(n,`checked`,k().attachTo.includes(e.slug))),t})()}),ne,re),p(X,()=>d(`settings.taxonomies.form.create`)),p(Q,()=>d(`settings.taxonomies.table.taxonomy`)),p($,()=>d(`settings.taxonomies.table.hierarchical`)),p(ie,()=>d(`settings.taxonomies.table.attachedTypes`)),p(ae,i(r,{get each(){return f()},children:e=>(()=>{var t=u(x),c=t.firstChild,f=c.firstChild,[h,g]=o(f.nextSibling),_=h.nextSibling.nextSibling,[v,y]=o(_.nextSibling);v.nextSibling;var S=c.nextSibling,w=S.nextSibling,T=w.nextSibling;return p(c,()=>e.name,h,g),p(c,()=>e.slug,v,y),p(S,(()=>{var t=s(()=>!!e.hierarchical);return()=>t()?d(`common.yes`):d(`common.no`)})()),p(w,i(r,{get each(){return C()},children:t=>(()=>{var n=u(ee),r=n.firstChild,i=r.nextSibling.nextSibling,[s,c]=o(i.nextSibling);return r.addEventListener(`change`,()=>N(e,t.slug)),p(n,()=>t.slug,s,c),a(()=>l(r,`checked`,e.attachTo?.includes(t.slug)??!1)),n})()})),p(T,i(n,{get when(){return e.source!==`CORE`},get children(){var t=u(b);return t.$$click=()=>P(e.slug),p(t,()=>d(`settings.taxonomies.table.actions.remove`)),m(),t}})),t})()})),a(e=>{var t=d(`settings.taxonomies.form.slugHint`),n=D();return t!==e.e&&c(H,`title`,e.e=t),n!==e.t&&l(X,`disabled`,e.t=n),e},{e:void 0,t:void 0}),a(()=>l(L,`value`,k().name)),a(()=>l(H,`value`,k().slug)),a(()=>l(W,`checked`,k().hierarchical)),m(),e})()}f([`input`,`click`]);export{S as TaxonomiesManager};
@@ -0,0 +1 @@
1
+ import{f as e,g as t,i as n,r,s as i,u as a}from"./solid.TEtyrbLc.js";import{a as o,c as s,f as c,i as l,m as u,r as d,s as f,u as p}from"./web.D0f8iaHB.js";import{n as m}from"./i18n.BmX2Cv4K.js";import{t as h}from"./api.DSIz0zxF.js";var g=u(`<div class="notice notice--error">`),_=u(`<button class=btn type=button>`),v=u(`<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=u(`<table class=table><thead><tr><th></th><th></th><th></th></tr></thead><tbody>`),b=u(`<div class=card><div class=card-header><div><h3></h3><p class=muted></p></div><span class=badge></span></div><!$><!/>`),x=u(`<div class=terms-panel><!$><!/><!$><!/><!$><!/>`),S=u(`<p class=muted>`),C=u(`<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(u){let{t:d}=m(),[w,T]=e(null),[E,D]=e([]),[O,k]=e(``),[A,j]=e(``),[M,N]=e(``),[P,F]=e(null),[I,L]=e(``),[R,z]=e(!1),B=async()=>{if(u.taxonomySlug)try{let[e,t]=await Promise.all([h.getTaxonomies(),h.getTaxonomyTerms(u.taxonomySlug)]);T(e.find(e=>e.slug===u.taxonomySlug)??null),D(t)}catch(e){L(e instanceof Error?e.message:String(e))}};t(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(u.taxonomySlug,P(),e):await h.createTaxonomyTerm(u.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(u.taxonomySlug,e.id),await B()}catch(e){L(e instanceof Error?e.message:String(e))}};return(()=>{var e=l(x),t=e.firstChild,[m,h]=o(t.nextSibling),T=m.nextSibling,[D,F]=o(T.nextSibling),L=D.nextSibling,[z,B]=o(L.nextSibling);return f(e,i(n,{get when(){return I()},get children(){var e=l(g);return f(e,I),e}}),m,h),f(e,i(n,{get when(){return s(()=>!w())()&&u.taxonomySlug},get children(){var e=l(g);return f(e,()=>d(`content.taxonomy.notFound`)),e}}),D,F),f(e,i(n,{get when(){return w()},get children(){return[(()=>{var e=l(v),t=e.firstChild,r=t.nextSibling,u=r.firstChild,[m,h]=o(u.nextSibling),g=m.nextSibling,y=r.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 e.addEventListener(`submit`,U),f(t,(()=>{var e=s(()=>!!P());return()=>e()?d(`content.taxonomy.editTerm`):d(`content.taxonomy.addTerm`)})()),f(r,()=>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(n,{get when(){return P()},get children(){var e=l(_);return e.$$click=V,f(e,()=>d(`common.cancel`)),p(),e}}),B,H),a(()=>c(L,`disabled`,R())),a(()=>c(g,`value`,O())),a(()=>c(C,`value`,A())),a(()=>c(F,`value`,M())),p(),e})(),(()=>{var e=l(b),t=e.firstChild,a=t.firstChild,c=a.firstChild,m=c.nextSibling,h=a.nextSibling,g=t.nextSibling,[_,v]=o(g.nextSibling);return f(c,()=>w().name),f(m,(()=>{var e=s(()=>!!u.contentType);return()=>e()?`${d(`content.taxonomy.attachedTo`)}: ${u.contentType}`:d(`content.taxonomy.descriptionHint`)})()),f(h,()=>E().length),f(e,i(n,{get when(){return E().length>0},get fallback(){return(()=>{var e=l(S);return f(e,()=>d(`content.taxonomy.empty`)),e})()},get children(){var e=l(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=l(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),e})()}d([`input`,`click`]);export{w as TaxonomyTermsManager};
@@ -1,4 +1,4 @@
1
- import{f as e,g as t,r as n,s as r,u as i}from"./solid.TEtyrbLc.js";import{d as a,i as o,l as s,n as c,o as l,p as u,r as d,s as f,t as p}from"./web.C8wWxyYF.js";import{n as m}from"./i18n.Tk18hqHh.js";import{t as h}from"./api.DSIz0zxF.js";var g=u(`<div class=theme-manager><div class=page-header><h2></h2><p class=page-description></p><p class=page-hint></p></div><!$><!/><!$><!/><!$><!/><style>
1
+ import{f as e,g as t,r as n,s as r,u as i}from"./solid.TEtyrbLc.js";import{a,c as o,f as s,i as c,m as l,n as u,r as d,s as f,u as p}from"./web.D0f8iaHB.js";import{n as m}from"./i18n.BmX2Cv4K.js";import{t as h}from"./api.DSIz0zxF.js";var g=l(`<div class=theme-manager><div class=page-header><h2></h2><p class=page-description></p><p class=page-hint></p></div><!$><!/><!$><!/><!$><!/><style>
2
2
  .page-header {
3
3
  margin-bottom: 1.5rem;
4
4
  }
@@ -126,4 +126,4 @@ import{f as e,g as t,r as n,s as r,u as i}from"./solid.TEtyrbLc.js";import{d as
126
126
  text-align: center;
127
127
  color: var(--color-muted);
128
128
  }
129
- `),_=u(`<div class="alert alert-error">`),v=u(`<div class=skeleton>Loading...`),y=u(`<div class=themes-grid><!$><!/><!$><!/>`),b=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>`),x=u(`<div class="theme-badge active-badge">`),S=u(`<p class=theme-desc>`),C=u(`<div class=empty-state>`);function w(){let{t:c}=m(),[u,w]=e([]),[T,E]=e(!0),[D,O]=e(null),[k,A]=e(null);t(async()=>{await j()});async function j(){try{E(!0);let e=await h.getThemes();w(e)}catch{O(c(`themes.loadError`))}finally{E(!1)}}async function M(e){let t=e.status===`ACTIVE`;A(e.id);try{let n=t?await h.deactivateTheme(e.id):await h.activateTheme(e.id);w(u().map(t=>t.id===e.id?n:t))}catch{O(c(t?`themes.deactivateError`:`themes.activateError`))}finally{A(null)}}let N=e=>{switch(e){case`ACTIVE`:return c(`themes.status.active`);case`INSTALLED`:return c(`themes.status.installed`);case`INACTIVE`:return c(`themes.status.inactive`);default:return e}},P=e=>{switch(e){case`ACTIVE`:return`status-active`;case`INSTALLED`:return`status-installed`;case`INACTIVE`:return`status-inactive`;default:return``}};return(()=>{var e=d(g),t=e.firstChild,m=t.firstChild,h=m.nextSibling,w=h.nextSibling,E=t.nextSibling,[O,A]=o(E.nextSibling),j=O.nextSibling,[F,I]=o(j.nextSibling),L=F.nextSibling,[R,z]=o(L.nextSibling);return R.nextSibling,l(m,()=>c(`themes.title`)),l(h,()=>c(`themes.description`)),l(w,()=>c(`themes.directoryHint`)),l(e,(()=>{var e=f(()=>!!D());return()=>e()&&(()=>{var e=d(_);return l(e,D),e})()})(),O,A),l(e,(()=>{var e=f(()=>!!T());return()=>e()&&d(v)})(),F,I),l(e,(()=>{var e=f(()=>!(T()||D()));return()=>e()&&(()=>{var e=d(y),t=e.firstChild,[m,h]=o(t.nextSibling),g=m.nextSibling,[_,v]=o(g.nextSibling);return l(e,r(n,{get each(){return u()},children:e=>(()=>{var t=d(b),n=t.firstChild,r=n.nextSibling,u=r.firstChild,m=u.nextSibling,h=m.firstChild,[g,_]=o(h.nextSibling),v=g.nextSibling.nextSibling,[y,C]=o(v.nextSibling),w=m.nextSibling,T=w.firstChild,E=w.nextSibling,[D,O]=o(E.nextSibling),A=r.nextSibling.firstChild;return l(n,(()=>{var t=f(()=>!!e.manifest?.name);return()=>t()&&(()=>{var e=d(x);return l(e,()=>c(`themes.active`)),e})()})()),l(u,()=>e.name),l(m,()=>c(`themes.version`),g,_),l(m,()=>e.version,y,C),l(T,()=>N(e.status)),l(r,(()=>{var t=f(()=>!!e.manifest?.description);return()=>t()&&(()=>{var t=d(S);return l(t,()=>e.manifest.description),t})()})(),D,O),A.$$click=()=>M(e),l(A,(()=>{var t=f(()=>e.status===`ACTIVE`);return()=>t()?c(`themes.deactivate`):c(`themes.activate`)})()),i(n=>{var r=`theme-card ${e.status===`ACTIVE`?`active`:``}`,i=`status-badge ${P(e.status)}`,o=`btn ${k()===e.id?`btn-loading`:``}`,s=k()!==null;return r!==n.e&&p(t,n.e=r),i!==n.t&&p(T,n.t=i),o!==n.a&&p(A,n.a=o),s!==n.o&&a(A,`disabled`,n.o=s),n},{e:void 0,t:void 0,a:void 0,o:void 0}),s(),t})()}),m,h),l(e,(()=>{var e=f(()=>u().length===0);return()=>e()&&(()=>{var e=d(C);return l(e,()=>c(`themes.empty`)),e})()})(),_,v),e})()})(),R,z),e})()}c([`click`]);export{w as ThemeManager};
129
+ `),_=l(`<div class="alert alert-error">`),v=l(`<div class=skeleton>Loading...`),y=l(`<div class=themes-grid><!$><!/><!$><!/>`),b=l(`<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>`),x=l(`<div class="theme-badge active-badge">`),S=l(`<p class=theme-desc>`),C=l(`<div class=empty-state>`);function w(){let{t:l}=m(),[d,w]=e([]),[T,E]=e(!0),[D,O]=e(null),[k,A]=e(null);t(async()=>{await j()});async function j(){try{E(!0);let e=await h.getThemes();w(e)}catch{O(l(`themes.loadError`))}finally{E(!1)}}async function M(e){let t=e.status===`ACTIVE`;A(e.id);try{let n=t?await h.deactivateTheme(e.id):await h.activateTheme(e.id);w(d().map(t=>t.id===e.id?n:t))}catch{O(l(t?`themes.deactivateError`:`themes.activateError`))}finally{A(null)}}let N=e=>{switch(e){case`ACTIVE`:return l(`themes.status.active`);case`INSTALLED`:return l(`themes.status.installed`);case`INACTIVE`:return l(`themes.status.inactive`);default:return e}},P=e=>{switch(e){case`ACTIVE`:return`status-active`;case`INSTALLED`:return`status-installed`;case`INACTIVE`:return`status-inactive`;default:return``}};return(()=>{var e=c(g),t=e.firstChild,m=t.firstChild,h=m.nextSibling,w=h.nextSibling,E=t.nextSibling,[O,A]=a(E.nextSibling),j=O.nextSibling,[F,I]=a(j.nextSibling),L=F.nextSibling,[R,z]=a(L.nextSibling);return R.nextSibling,f(m,()=>l(`themes.title`)),f(h,()=>l(`themes.description`)),f(w,()=>l(`themes.directoryHint`)),f(e,(()=>{var e=o(()=>!!D());return()=>e()&&(()=>{var e=c(_);return f(e,D),e})()})(),O,A),f(e,(()=>{var e=o(()=>!!T());return()=>e()&&c(v)})(),F,I),f(e,(()=>{var e=o(()=>!(T()||D()));return()=>e()&&(()=>{var e=c(y),t=e.firstChild,[m,h]=a(t.nextSibling),g=m.nextSibling,[_,v]=a(g.nextSibling);return f(e,r(n,{get each(){return d()},children:e=>(()=>{var t=c(b),n=t.firstChild,r=n.nextSibling,d=r.firstChild,m=d.nextSibling,h=m.firstChild,[g,_]=a(h.nextSibling),v=g.nextSibling.nextSibling,[y,C]=a(v.nextSibling),w=m.nextSibling,T=w.firstChild,E=w.nextSibling,[D,O]=a(E.nextSibling),A=r.nextSibling.firstChild;return f(n,(()=>{var t=o(()=>!!e.manifest?.name);return()=>t()&&(()=>{var e=c(x);return f(e,()=>l(`themes.active`)),e})()})()),f(d,()=>e.name),f(m,()=>l(`themes.version`),g,_),f(m,()=>e.version,y,C),f(T,()=>N(e.status)),f(r,(()=>{var t=o(()=>!!e.manifest?.description);return()=>t()&&(()=>{var t=c(S);return f(t,()=>e.manifest.description),t})()})(),D,O),A.$$click=()=>M(e),f(A,(()=>{var t=o(()=>e.status===`ACTIVE`);return()=>t()?l(`themes.deactivate`):l(`themes.activate`)})()),i(n=>{var r=`theme-card ${e.status===`ACTIVE`?`active`:``}`,i=`status-badge ${P(e.status)}`,a=`btn ${k()===e.id?`btn-loading`:``}`,o=k()!==null;return r!==n.e&&u(t,n.e=r),i!==n.t&&u(T,n.t=i),a!==n.a&&u(A,n.a=a),o!==n.o&&s(A,`disabled`,n.o=o),n},{e:void 0,t:void 0,a:void 0,o:void 0}),p(),t})()}),m,h),f(e,(()=>{var e=o(()=>d().length===0);return()=>e()&&(()=>{var e=c(C);return f(e,()=>l(`themes.empty`)),e})()})(),_,v),e})()})(),R,z),e})()}d([`click`]);export{w as ThemeManager};