@oktis-works/admin 0.5.4 → 0.5.5

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 (72) hide show
  1. package/dist/client/_astro/{ActivityWidget.BNFwjO71.js → ActivityWidget.CLFjbNJf.js} +1 -1
  2. package/dist/client/_astro/{AdminBar.DRgRB1PC.js → AdminBar.CKYNoMCz.js} +1 -1
  3. package/dist/client/_astro/{AtGlanceWidget.h60KI_JU.js → AtGlanceWidget.rW3GsIjs.js} +1 -1
  4. package/dist/client/_astro/{ContentEditor.BDb6qSSI.js → ContentEditor.BmpwqkNT.js} +1 -1
  5. package/dist/client/_astro/ContentEditor.saSUoKf0.js +1 -0
  6. package/dist/client/_astro/ContentTypeWorkspace.00bHkcJD.js +1 -0
  7. package/dist/client/_astro/{DashboardHome.1vPxu78E.js → DashboardHome.DCz0EiH2.js} +1 -1
  8. package/dist/client/_astro/{DashboardLayout.astro_astro_type_script_index_0_lang.D3odZySo.js → DashboardLayout.astro_astro_type_script_index_0_lang.DdRNBOsR.js} +1 -1
  9. package/dist/client/_astro/{FieldGroupEditor.C9U6-zxk.js → FieldGroupEditor.Bdm2FW0L.js} +1 -1
  10. package/dist/client/_astro/{FieldGroupList.DYFBUBY7.js → FieldGroupList.BaNTs6an.js} +1 -1
  11. package/dist/client/_astro/{Footer.BwLmoHuk.js → Footer.BqulPU-0.js} +1 -1
  12. package/dist/client/_astro/GeneralSettings.BH-f6pL0.js +1 -0
  13. package/dist/client/_astro/{LogsManager.CBwBkCUP.js → LogsManager.1c_AlgX8.js} +1 -1
  14. package/dist/client/_astro/MediaLibrary.DH7eqign.js +1 -0
  15. package/dist/client/_astro/{MenuManager.BhYhygsR.js → MenuManager.CLPv5Ths.js} +1 -1
  16. package/dist/client/_astro/{PluginManager.DxAKvMfM.js → PluginManager.Duzn64IF.js} +1 -1
  17. package/dist/client/_astro/{PostTypesManager.DLymaQPT.js → PostTypesManager.BHKbIEwD.js} +1 -1
  18. package/dist/client/_astro/{QuickDraftWidget.CfUR8qmY.js → QuickDraftWidget.DLKpQRu8.js} +1 -1
  19. package/dist/client/_astro/{ResourceHubs.BnINa0O3.js → ResourceHubs.CL3KxW6a.js} +1 -1
  20. package/dist/client/_astro/{TaxonomiesManager.1EZYO2u5.js → TaxonomiesManager.DEwFIIP9.js} +1 -1
  21. package/dist/client/_astro/{TaxonomyTermsManager.YXbuam33.js → TaxonomyTermsManager.DWljfgZH.js} +1 -1
  22. package/dist/client/_astro/{ThemeManager.EFMZJdmx.js → ThemeManager.CAGeBTsz.js} +1 -1
  23. package/dist/client/_astro/{UserCreateForm.C_m7ovUU.js → UserCreateForm.wCOVD_YS.js} +1 -1
  24. package/dist/client/_astro/UsersManager.RHbgYhoE.js +1 -0
  25. package/dist/client/_astro/{WebhooksManager.CKRtabi3.js → WebhooksManager.B-g7Wbit.js} +1 -1
  26. package/dist/client/_astro/api.CGA0D2A2.js +1 -0
  27. package/dist/client/_astro/extensions.CKCZC04g.js +1 -0
  28. package/dist/client/_astro/{i18n.EKfvSb1v.js → i18n.3zKFZ7KU.js} +1 -1
  29. package/dist/client/_astro/{login.astro_astro_type_script_index_0_lang.D8XVBan6.js → login.astro_astro_type_script_index_0_lang.DzXBvx_L.js} +1 -1
  30. package/dist/client/_astro/src.DQwsXUur.js +1 -0
  31. package/dist/client/_astro/{version.B4bPYHRP.js → version.DMCc00VQ.js} +1 -1
  32. package/dist/server/chunks/{ContentEditor_DfYDk5IM.mjs → ContentEditor_BJIimcCo.mjs} +525 -2
  33. package/dist/server/chunks/{DashboardLayout_7Gcd6oTS.mjs → DashboardLayout_65mMCENw.mjs} +9 -6
  34. package/dist/server/chunks/{MediaLibrary_fu8AtNog.mjs → MediaLibrary_C0RSa4ta.mjs} +2 -2
  35. package/dist/server/chunks/{_id__BVLdyCKg.mjs → _id__DxVKarzj.mjs} +2 -2
  36. package/dist/server/chunks/{_slug__DG6xjEan.mjs → _slug__CzAHP75q.mjs} +1 -1
  37. package/dist/server/chunks/{access_B8fU0pWq.mjs → access_Ckqo1E-w.mjs} +2 -2
  38. package/dist/server/chunks/{custom-fields_BOqCiSPQ.mjs → custom-fields_Bahyrq-n.mjs} +2 -2
  39. package/dist/server/chunks/{dist_D98LO9y-.mjs → dist_CP9QIrJI.mjs} +2 -1394
  40. package/dist/server/chunks/{edit_C27RHq7N.mjs → edit_D5xfX3vT.mjs} +2 -2
  41. package/dist/server/chunks/{general_TSviTaPT.mjs → general_Cl6S80ws.mjs} +2 -2
  42. package/dist/server/chunks/{i18n_Co0XNC0I.mjs → i18n_B-Vk5esc.mjs} +4 -1
  43. package/dist/server/chunks/{index_BwaqRmvv.mjs → index_-cQPQBUp.mjs} +2 -2
  44. package/dist/server/chunks/{index_t5k7sOZ8.mjs → index_BHrQe5Hj.mjs} +3 -3
  45. package/dist/server/chunks/{index_CCNhQxvS.mjs → index_C2ozXuTS.mjs} +2 -2
  46. package/dist/server/chunks/{index_40l_yCUu.mjs → index_C58uHJZI.mjs} +1 -1
  47. package/dist/server/chunks/{index_CRSTdqw0.mjs → index_DqA4Ie-S.mjs} +2 -2
  48. package/dist/server/chunks/{logs_DrjJ6S6J.mjs → logs_Bf4fqT8n.mjs} +2 -2
  49. package/dist/server/chunks/{menus_DjfOcrez.mjs → menus_Cq6sQKRq.mjs} +2 -2
  50. package/dist/server/chunks/{new_DNNbQ1Zw.mjs → new_B-geMMoa.mjs} +2 -2
  51. package/dist/server/chunks/{new_B484WwaA.mjs → new_DM3-Wq-j.mjs} +2 -2
  52. package/dist/server/chunks/{node_CECPlmah.mjs → node_kWZa8y--.mjs} +1 -1
  53. package/dist/server/chunks/{plugins_Bhuk-oUR.mjs → plugins_BnnK185w.mjs} +2 -2
  54. package/dist/server/chunks/{post-types_BtisIanW.mjs → post-types_BJz6Zjgo.mjs} +2 -2
  55. package/dist/server/chunks/semver_WbqCUY_o.mjs +1395 -0
  56. package/dist/server/chunks/{sharp_DQfjpH-u.mjs → sharp_37gnUicY.mjs} +2 -2
  57. package/dist/server/chunks/{taxonomies_CHJK2gT1.mjs → taxonomies_ygpYI9wq.mjs} +2 -2
  58. package/dist/server/chunks/{taxonomy_DboKpEOu.mjs → taxonomy_b8pfYEmY.mjs} +2 -2
  59. package/dist/server/chunks/{themes_MC8vERGL.mjs → themes_M56sjN9n.mjs} +2 -2
  60. package/dist/server/chunks/{upload_BMoVV-rt.mjs → upload_B2dn_wjn.mjs} +2 -2
  61. package/dist/server/chunks/{webhooks_EHN9q7Yv.mjs → webhooks_BlAAcsf_.mjs} +2 -2
  62. package/dist/server/entry.mjs +24 -24
  63. package/dist/server/virtual_astro_middleware.mjs +1 -1
  64. package/package.json +5 -5
  65. package/dist/client/_astro/ContentEditor.QGAstGzA.js +0 -1
  66. package/dist/client/_astro/ContentTypeWorkspace.K35mfD2P.js +0 -1
  67. package/dist/client/_astro/GeneralSettings.EU3z_sSD.js +0 -1
  68. package/dist/client/_astro/MediaLibrary.D56bkgPF.js +0 -1
  69. package/dist/client/_astro/UsersManager.t4-9GwDK.js +0 -1
  70. package/dist/client/_astro/api.CM0tblEa.js +0 -1
  71. package/dist/client/_astro/dist.D-evrPNi.js +0 -1
  72. package/dist/client/_astro/extensions.OpEcHTzv.js +0 -1
@@ -1,4 +1,4 @@
1
- import{d as e,p as t,r as n,s as r,v as i}from"./solid.8gBSxpeo.js";import{c as a,d as o,i as s,m as c,s as l}from"./web.DwNv8rLL.js";import{n as u}from"./i18n.EKfvSb1v.js";import{t as d}from"./api.CM0tblEa.js";var f=c(`<div class=activity-widget data-widget-panel=activity style="grid-column:span 2"><div class=dashboard-widget-header><h3 class=dashboard-widget-title></h3></div><div class=dashboard-widget-content></div><div class=styles-container><style>
1
+ import{d as e,p as t,r as n,s as r,v as i}from"./solid.8gBSxpeo.js";import{c as a,d as o,i as s,m as c,s as l}from"./web.DwNv8rLL.js";import{n as u}from"./i18n.3zKFZ7KU.js";import{t as d}from"./api.CGA0D2A2.js";var f=c(`<div class=activity-widget data-widget-panel=activity style="grid-column:span 2"><div class=dashboard-widget-header><h3 class=dashboard-widget-title></h3></div><div class=dashboard-widget-content></div><div class=styles-container><style>
2
2
  .activity-list { display: flex; flex-direction: column; gap: 0.5rem; }
3
3
  .activity-item {
4
4
  display: flex; gap: 0.75rem; padding: 0.75rem;
@@ -1,4 +1,4 @@
1
- import{d as e,i as t,p as n,s as r,v as i}from"./solid.8gBSxpeo.js";import{a,d as o,i as s,m as c,n as l,r as u,s as d,u as f}from"./web.DwNv8rLL.js";import{a as p,i as m,n as h,r as g}from"./i18n.EKfvSb1v.js";import{t as _}from"./api.CM0tblEa.js";var v=c(`<style>
1
+ import{d as e,i as t,p as n,s as r,v as i}from"./solid.8gBSxpeo.js";import{a,d as o,i as s,m as c,n as l,r as u,s as d,u as f}from"./web.DwNv8rLL.js";import{a as p,i as m,n as h,r as g}from"./i18n.3zKFZ7KU.js";import{t as _}from"./api.CGA0D2A2.js";var v=c(`<style>
2
2
  #admin-bar {
3
3
  position: fixed;
4
4
  top: 0;
@@ -1,4 +1,4 @@
1
- import{d as e,i as t,p as n,s as r,v as i}from"./solid.8gBSxpeo.js";import{d as a,i as o,m as s,n as c,p as l,s as u}from"./web.DwNv8rLL.js";import{n as d}from"./i18n.EKfvSb1v.js";import{t as f}from"./api.CM0tblEa.js";import{t as p}from"./version.B4bPYHRP.js";var m=s(`<div><div class=dashboard-widget-header><h3 class=dashboard-widget-title></h3></div><div class=dashboard-widget-content></div><style>
1
+ import{d as e,i as t,p as n,s as r,v as i}from"./solid.8gBSxpeo.js";import{d as a,i as o,m as s,n as c,p as l,s as u}from"./web.DwNv8rLL.js";import{n as d}from"./i18n.3zKFZ7KU.js";import{t as f}from"./api.CGA0D2A2.js";import{t as p}from"./version.DMCc00VQ.js";var m=s(`<div><div class=dashboard-widget-header><h3 class=dashboard-widget-title></h3></div><div class=dashboard-widget-content></div><style>
2
2
  .dashboard-widget {
3
3
  background: var(--color-surface);
4
4
  border: 1px solid var(--color-border);
@@ -1,3 +1,3 @@
1
- import{d as e,i as t,p as n,r,s as i,u as a,v as o}from"./solid.8gBSxpeo.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.DwNv8rLL.js";import{n as g}from"./i18n.EKfvSb1v.js";import{t as _}from"./api.CM0tblEa.js";import"./dist.D-evrPNi.js";function v(e){return e==null?!0:typeof e==`string`?e.trim()===``:Array.isArray(e)?e.length===0:!1}function y(e,t,n,r){return!t||!v(e)||(r.push({field:n,code:`REQUIRED`,message:`${n} é obrigatório`}),!1)}function b(e,t,n,r){if(v(e))return;let i=String(e),a=t.minLength??t.minimum,o=t.characterLimit??t.maxLength;a!==void 0&&i.length<a&&r.push({field:n,code:`MIN_LENGTH`,message:`${n} deve ter pelo menos ${a} caracteres`}),o!==void 0&&i.length>o&&r.push({field:n,code:`CHARACTER_LIMIT`,message:`${n} excede o limite de ${o} caracteres`})}function x(e,t,n){v(e)||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(e))||n.push({field:t,code:`INVALID_EMAIL`,message:`${t} não é um e-mail válido`})}function S(e,t,n){if(!v(e))try{let t=new URL(String(e));if(![`http:`,`https:`].includes(t.protocol))throw Error(`protocol`)}catch{n.push({field:t,code:`INVALID_URL`,message:`${t} não é uma URL válida (http/https)`})}}function C(e,t,n,r){if(v(e))return;let i=Number(e);if(Number.isNaN(i)){r.push({field:n,code:`NOT_A_NUMBER`,message:`${n} deve ser um número`});return}let a=t.minValue??t.min,o=t.maxValue??t.max,s=t.step;if(a!==void 0&&i<a&&r.push({field:n,code:`MIN_VALUE`,message:`${n} deve ser maior ou igual a ${a}`}),o!==void 0&&i>o&&r.push({field:n,code:`MAX_VALUE`,message:`${n} deve ser menor ou igual a ${o}`}),s!==void 0&&s>0){let e=a??0;Math.abs((i-e)/s-Math.round((i-e)/s))>1e-9&&r.push({field:n,code:`STEP_MISMATCH`,message:`${n} deve seguir o incremento de ${s}`})}}function w(e){let t=e.choices??[];return new Set(t.map(e=>String(e.value)))}function T(e,t,n,r,i){n||t.has(String(e))||i.push({field:r,code:`INVALID_CHOICE`,message:`${r} contém um valor fora das opções permitidas`})}function E(e,t,n,r){let i=t.minSelections,a=t.maxSelections;i!==void 0&&e.length<i&&r.push({field:n,code:`MIN_SELECTIONS`,message:`${n} requer no mínimo ${i} seleção(ões)`}),a!==void 0&&e.length>a&&r.push({field:n,code:`MAX_SELECTIONS`,message:`${n} permite no máximo ${a} seleção(ões)`})}function D(e,t,n,r){if(v(e))return;let i=!!t.multiple,a=!!(t.allowCustom??!1),o=w(t);if(i){if(!Array.isArray(e)){r.push({field:n,code:`NOT_ARRAY`,message:`${n} deve ser uma lista`});return}if(!a)for(let t of e)T(t,o,!1,n,r);E(e,t,n,r);return}T(e,o,a,n,r),Array.isArray(e)&&r.push({field:n,code:`SINGLE_ONLY`,message:`${n} aceita apenas um valor`})}function O(e,t,n,r){if(v(e))return;if(!Array.isArray(e)){r.push({field:n,code:`NOT_ARRAY`,message:`${n} deve ser uma lista de valores`});return}let i=w(t);for(let t of e)T(t,i,!0,n,r);E(e,t,n,r)}function k(e,t,n,r){v(e)||T(e,w(t),!!t.allowCustom,n,r)}function A(e,t,n){e!=null&&typeof e!=`boolean`&&e!==0&&e!==1&&e!==`0`&&e!==`1`&&n.push({field:t,code:`NOT_BOOLEAN`,message:`${t} deve ser verdadeiro ou falso`})}function j(e,t,n,r){if(typeof e!=`object`||!e||Array.isArray(e)){r.push({field:n,code:`INVALID_MEDIA`,message:`${n} deve referenciar uma mídia válida`});return}let i=e,a=t.mimeTypes??[];a.length>0&&i.mimeType&&(a.map(e=>e.toLowerCase()).includes(i.mimeType.toLowerCase())||r.push({field:n,code:`INVALID_MIME`,message:`${n} não aceita arquivos do tipo ${i.mimeType}`}));let o=t.maxSize,s=t.minSize;if(i.size!==void 0&&(o!==void 0&&i.size>o&&r.push({field:n,code:`FILE_TOO_LARGE`,message:`${n} excede o tamanho máximo de ${Math.round(o/1024)}KB`}),s!==void 0&&i.size<s&&r.push({field:n,code:`FILE_TOO_SMALL`,message:`${n} está abaixo do tamanho mínimo de ${Math.round(s/1024)}KB`})),i.width!==void 0&&i.height!==void 0){let e=t.minWidth,a=t.maxWidth,o=t.minHeight,s=t.maxHeight;e!==void 0&&i.width<e&&r.push({field:n,code:`MIN_WIDTH`,message:`${n} requer largura mínima de ${e}px`}),a!==void 0&&i.width>a&&r.push({field:n,code:`MAX_WIDTH`,message:`${n} permite largura máxima de ${a}px`}),o!==void 0&&i.height<o&&r.push({field:n,code:`MIN_HEIGHT`,message:`${n} requer altura mínima de ${o}px`}),s!==void 0&&i.height>s&&r.push({field:n,code:`MAX_HEIGHT`,message:`${n} permite altura máxima de ${s}px`})}}function M(e,t,n,r){v(e)||j(e,t,n,r)}function N(e,t,n,r){v(e)||j(e,t,n,r)}function P(e,t,n,r){if(e==null)return;if(!Array.isArray(e)){r.push({field:n,code:`NOT_ARRAY`,message:`${n} deve ser uma lista de imagens`});return}let i=t.minSelections!==void 0||t.maxSelections!==void 0;if(e.length===0&&!i)return;let a=t.minSelections,o=t.maxSelections;a!==void 0&&e.length<a&&r.push({field:n,code:`MIN_SELECTIONS`,message:`${n} requer no mínimo ${a} imagem(ns)`}),o!==void 0&&e.length>o&&r.push({field:n,code:`MAX_SELECTIONS`,message:`${n} permite no máximo ${o} imagem(ns)`});for(let i of e)j(i,t,n,r)}function F(e,t,n,r){if(v(e))return;let i=t.multiple!==!1,a=t.minSelections,o=t.maxSelections,s=Array.isArray(e)?e:[e];for(let e of s)if(typeof e!=`string`&&typeof e!=`number`){r.push({field:n,code:`INVALID_ID`,message:`${n} contém um identificador inválido`});return}i?(o!==void 0&&s.length>o&&r.push({field:n,code:`MAX_SELECTIONS`,message:`${n} permite no máximo ${o} seleção(ões)`}),a!==void 0&&s.length<a&&r.push({field:n,code:`MIN_SELECTIONS`,message:`${n} requer no mínimo ${a} seleção(ões)`})):s.length>1&&r.push({field:n,code:`SINGLE_ONLY`,message:`${n} aceita apenas um valor`})}function ee(e,t,n){if(v(e))return;if(typeof e!=`object`||!e){n.push({field:t,code:`INVALID_LINK`,message:`${t} deve ser um objeto de link`});return}let r=e;if(!r.url||typeof r.url!=`string`){n.push({field:t,code:`LINK_URL_REQUIRED`,message:`${t} requer uma URL`});return}try{let e=new URL(r.url);if(![`http:`,`https:`,`mailto:`,`tel:`].includes(e.protocol)&&!r.url.startsWith(`#`)&&!r.url.startsWith(`/`))throw Error(`protocol`)}catch{!r.url.startsWith(`#`)&&!r.url.startsWith(`/`)&&!r.url.startsWith(`?`)&&n.push({field:t,code:`INVALID_URL`,message:`${t} contém uma URL inválida`})}r.target!==void 0&&![`_self`,`_blank`].includes(String(r.target))&&n.push({field:t,code:`INVALID_TARGET`,message:`${t} aceita apenas _self ou _blank`})}function I(e,t,n){if(v(e))return;if(typeof e!=`object`||!e){n.push({field:t,code:`INVALID_MAP`,message:`${t} deve conter endereço e coordenadas`});return}let r=e;v(r.address)&&n.push({field:t,code:`ADDRESS_REQUIRED`,message:`${t} requer um endereço`});let i=Number(r.lat),a=Number(r.lng);(!Number.isFinite(i)||i<-90||i>90)&&n.push({field:t,code:`INVALID_LATITUDE`,message:`${t} contém latitude inválida (-90 a 90)`}),(!Number.isFinite(a)||a<-180||a>180)&&n.push({field:t,code:`INVALID_LONGITUDE`,message:`${t} contém longitude inválida (-180 a 180)`})}var L=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;function R(e,t,n,r){if(v(e))return;let i=String(e),a=i.startsWith(`rgba(`);if(a&&!t.enableOpacity){r.push({field:n,code:`OPACITY_DISABLED`,message:`${n} não permite transparência`});return}if(!a&&!L.test(i)){r.push({field:n,code:`INVALID_COLOR`,message:`${n} deve ser uma cor em formato hexadecimal válido`});return}let o=t.palette??[];o.length>0&&(o.map(e=>e.toLowerCase()).includes(i.toLowerCase())||r.push({field:n,code:`NOT_IN_PALETTE`,message:`${n} deve usar uma cor da paleta definida`}))}function z(e,t){if(e.type===`clone`||e.type===`repeater`||e.type===`group`||e.type===`flexible_content`)return null;let n=e.config??{},r=[];switch(y(t,e.required,e.label,r),e.type){case`text`:case`textarea`:case`password`:b(t,n,e.label,r);break;case`email`:x(t,e.label,r);break;case`url`:case`oembed`:S(t,e.label,r);break;case`number`:case`range`:C(t,n,e.label,r);break;case`wysiwyg`:b(t,n,e.label,r);break;case`select`:D(t,n,e.label,r);break;case`checkbox`:O(t,n,e.label,r);break;case`radio`:k(t,n,e.label,r);break;case`true_false`:A(t,e.label,r);break;case`image`:M(t,n,e.label,r);break;case`file`:N(t,n,e.label,r);break;case`gallery`:P(t,n,e.label,r);break;case`link`:ee(t,e.label,r);break;case`page_link`:case`post_object`:case`relationship`:case`taxonomy`:case`user`:F(t,n,e.label,r);break;case`google_map`:I(t,e.label,r);break;case`color_picker`:R(t,n,e.label,r)}return r[0]?.message??null}function te(e){let t=new Map;for(let n of e)t.set(n.name,n);let n=[],r=new Set,i=e=>{r.has(e.name)||(r.add(e.name),n.push(e))};for(let n of e){if(n.type!==`clone`){i(n);continue}let e=n.config??{},r=e.display??`seamless`,a=e.clone??[],o=[];for(let e of a){let n=t.get(e);n&&n.type!==`clone`&&o.push(n)}if(o.length!==0){if(r===`group`){i({...n,type:`group`,name:n.name,label:n.label,required:!1,conditionalLogic:void 0,subFields:o.map(e=>({...e,name:`${n.name}_${e.name}`}))});continue}for(let e of o)i(e)}}return n}var ne=new Set(`a.abbr.b.blockquote.br.code.dd.div.dl.dt.em.figcaption.figure.h1.h2.h3.h4.h5.h6.hr.i.img.li.ol.p.pre.q.s.span.strong.sub.sup.u.ul`.split(`.`)),B=new Set([`br`,`hr`,`img`]),re=new Set([`script`,`style`,`iframe`,`object`,`embed`,`svg`,`math`,`textarea`,`title`,`noscript`,`template`]),V=new Set([`class`,`title`,`alt`,`width`,`height`,`href`,`src`,`target`,`rel`]),H=new Set([`http`,`https`,`mailto`,`tel`]),ie=new Set([`http`,`https`]),U={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`,colon:`:`,tab:` `,newline:`
1
+ import{d as e,i as t,p as n,r,s as i,u as a,v as o}from"./solid.8gBSxpeo.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.DwNv8rLL.js";import{n as g}from"./i18n.3zKFZ7KU.js";import{t as _}from"./api.CGA0D2A2.js";import"./src.DQwsXUur.js";function v(e){return e==null?!0:typeof e==`string`?e.trim()===``:Array.isArray(e)?e.length===0:!1}function y(e,t,n,r){return!t||!v(e)||(r.push({field:n,code:`REQUIRED`,message:`${n} é obrigatório`}),!1)}function b(e,t,n,r){if(v(e))return;let i=String(e),a=t.minLength??t.minimum,o=t.characterLimit??t.maxLength;a!==void 0&&i.length<a&&r.push({field:n,code:`MIN_LENGTH`,message:`${n} deve ter pelo menos ${a} caracteres`}),o!==void 0&&i.length>o&&r.push({field:n,code:`CHARACTER_LIMIT`,message:`${n} excede o limite de ${o} caracteres`})}function x(e,t,n){v(e)||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(e))||n.push({field:t,code:`INVALID_EMAIL`,message:`${t} não é um e-mail válido`})}function S(e,t,n){if(!v(e))try{let t=new URL(String(e));if(![`http:`,`https:`].includes(t.protocol))throw Error(`protocol`)}catch{n.push({field:t,code:`INVALID_URL`,message:`${t} não é uma URL válida (http/https)`})}}function C(e,t,n,r){if(v(e))return;let i=Number(e);if(Number.isNaN(i)){r.push({field:n,code:`NOT_A_NUMBER`,message:`${n} deve ser um número`});return}let a=t.minValue??t.min,o=t.maxValue??t.max,s=t.step;if(a!==void 0&&i<a&&r.push({field:n,code:`MIN_VALUE`,message:`${n} deve ser maior ou igual a ${a}`}),o!==void 0&&i>o&&r.push({field:n,code:`MAX_VALUE`,message:`${n} deve ser menor ou igual a ${o}`}),s!==void 0&&s>0){let e=a??0;Math.abs((i-e)/s-Math.round((i-e)/s))>1e-9&&r.push({field:n,code:`STEP_MISMATCH`,message:`${n} deve seguir o incremento de ${s}`})}}function w(e){let t=e.choices??[];return new Set(t.map(e=>String(e.value)))}function T(e,t,n,r,i){n||t.has(String(e))||i.push({field:r,code:`INVALID_CHOICE`,message:`${r} contém um valor fora das opções permitidas`})}function E(e,t,n,r){let i=t.minSelections,a=t.maxSelections;i!==void 0&&e.length<i&&r.push({field:n,code:`MIN_SELECTIONS`,message:`${n} requer no mínimo ${i} seleção(ões)`}),a!==void 0&&e.length>a&&r.push({field:n,code:`MAX_SELECTIONS`,message:`${n} permite no máximo ${a} seleção(ões)`})}function D(e,t,n,r){if(v(e))return;let i=!!t.multiple,a=!!(t.allowCustom??!1),o=w(t);if(i){if(!Array.isArray(e)){r.push({field:n,code:`NOT_ARRAY`,message:`${n} deve ser uma lista`});return}if(!a)for(let t of e)T(t,o,!1,n,r);E(e,t,n,r);return}T(e,o,a,n,r),Array.isArray(e)&&r.push({field:n,code:`SINGLE_ONLY`,message:`${n} aceita apenas um valor`})}function O(e,t,n,r){if(v(e))return;if(!Array.isArray(e)){r.push({field:n,code:`NOT_ARRAY`,message:`${n} deve ser uma lista de valores`});return}let i=w(t);for(let t of e)T(t,i,!0,n,r);E(e,t,n,r)}function k(e,t,n,r){v(e)||T(e,w(t),!!t.allowCustom,n,r)}function A(e,t,n){e!=null&&typeof e!=`boolean`&&e!==0&&e!==1&&e!==`0`&&e!==`1`&&n.push({field:t,code:`NOT_BOOLEAN`,message:`${t} deve ser verdadeiro ou falso`})}function j(e,t,n,r){if(typeof e!=`object`||!e||Array.isArray(e)){r.push({field:n,code:`INVALID_MEDIA`,message:`${n} deve referenciar uma mídia válida`});return}let i=e,a=t.mimeTypes??[];a.length>0&&i.mimeType&&(a.map(e=>e.toLowerCase()).includes(i.mimeType.toLowerCase())||r.push({field:n,code:`INVALID_MIME`,message:`${n} não aceita arquivos do tipo ${i.mimeType}`}));let o=t.maxSize,s=t.minSize;if(i.size!==void 0&&(o!==void 0&&i.size>o&&r.push({field:n,code:`FILE_TOO_LARGE`,message:`${n} excede o tamanho máximo de ${Math.round(o/1024)}KB`}),s!==void 0&&i.size<s&&r.push({field:n,code:`FILE_TOO_SMALL`,message:`${n} está abaixo do tamanho mínimo de ${Math.round(s/1024)}KB`})),i.width!==void 0&&i.height!==void 0){let e=t.minWidth,a=t.maxWidth,o=t.minHeight,s=t.maxHeight;e!==void 0&&i.width<e&&r.push({field:n,code:`MIN_WIDTH`,message:`${n} requer largura mínima de ${e}px`}),a!==void 0&&i.width>a&&r.push({field:n,code:`MAX_WIDTH`,message:`${n} permite largura máxima de ${a}px`}),o!==void 0&&i.height<o&&r.push({field:n,code:`MIN_HEIGHT`,message:`${n} requer altura mínima de ${o}px`}),s!==void 0&&i.height>s&&r.push({field:n,code:`MAX_HEIGHT`,message:`${n} permite altura máxima de ${s}px`})}}function M(e,t,n,r){v(e)||j(e,t,n,r)}function N(e,t,n,r){v(e)||j(e,t,n,r)}function P(e,t,n,r){if(e==null)return;if(!Array.isArray(e)){r.push({field:n,code:`NOT_ARRAY`,message:`${n} deve ser uma lista de imagens`});return}let i=t.minSelections!==void 0||t.maxSelections!==void 0;if(e.length===0&&!i)return;let a=t.minSelections,o=t.maxSelections;a!==void 0&&e.length<a&&r.push({field:n,code:`MIN_SELECTIONS`,message:`${n} requer no mínimo ${a} imagem(ns)`}),o!==void 0&&e.length>o&&r.push({field:n,code:`MAX_SELECTIONS`,message:`${n} permite no máximo ${o} imagem(ns)`});for(let i of e)j(i,t,n,r)}function F(e,t,n,r){if(v(e))return;let i=t.multiple!==!1,a=t.minSelections,o=t.maxSelections,s=Array.isArray(e)?e:[e];for(let e of s)if(typeof e!=`string`&&typeof e!=`number`){r.push({field:n,code:`INVALID_ID`,message:`${n} contém um identificador inválido`});return}i?(o!==void 0&&s.length>o&&r.push({field:n,code:`MAX_SELECTIONS`,message:`${n} permite no máximo ${o} seleção(ões)`}),a!==void 0&&s.length<a&&r.push({field:n,code:`MIN_SELECTIONS`,message:`${n} requer no mínimo ${a} seleção(ões)`})):s.length>1&&r.push({field:n,code:`SINGLE_ONLY`,message:`${n} aceita apenas um valor`})}function ee(e,t,n){if(v(e))return;if(typeof e!=`object`||!e){n.push({field:t,code:`INVALID_LINK`,message:`${t} deve ser um objeto de link`});return}let r=e;if(!r.url||typeof r.url!=`string`){n.push({field:t,code:`LINK_URL_REQUIRED`,message:`${t} requer uma URL`});return}try{let e=new URL(r.url);if(![`http:`,`https:`,`mailto:`,`tel:`].includes(e.protocol)&&!r.url.startsWith(`#`)&&!r.url.startsWith(`/`))throw Error(`protocol`)}catch{!r.url.startsWith(`#`)&&!r.url.startsWith(`/`)&&!r.url.startsWith(`?`)&&n.push({field:t,code:`INVALID_URL`,message:`${t} contém uma URL inválida`})}r.target!==void 0&&![`_self`,`_blank`].includes(String(r.target))&&n.push({field:t,code:`INVALID_TARGET`,message:`${t} aceita apenas _self ou _blank`})}function I(e,t,n){if(v(e))return;if(typeof e!=`object`||!e){n.push({field:t,code:`INVALID_MAP`,message:`${t} deve conter endereço e coordenadas`});return}let r=e;v(r.address)&&n.push({field:t,code:`ADDRESS_REQUIRED`,message:`${t} requer um endereço`});let i=Number(r.lat),a=Number(r.lng);(!Number.isFinite(i)||i<-90||i>90)&&n.push({field:t,code:`INVALID_LATITUDE`,message:`${t} contém latitude inválida (-90 a 90)`}),(!Number.isFinite(a)||a<-180||a>180)&&n.push({field:t,code:`INVALID_LONGITUDE`,message:`${t} contém longitude inválida (-180 a 180)`})}var L=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;function R(e,t,n,r){if(v(e))return;let i=String(e),a=i.startsWith(`rgba(`);if(a&&!t.enableOpacity){r.push({field:n,code:`OPACITY_DISABLED`,message:`${n} não permite transparência`});return}if(!a&&!L.test(i)){r.push({field:n,code:`INVALID_COLOR`,message:`${n} deve ser uma cor em formato hexadecimal válido`});return}let o=t.palette??[];o.length>0&&(o.map(e=>e.toLowerCase()).includes(i.toLowerCase())||r.push({field:n,code:`NOT_IN_PALETTE`,message:`${n} deve usar uma cor da paleta definida`}))}function z(e,t){if(e.type===`clone`||e.type===`repeater`||e.type===`group`||e.type===`flexible_content`)return null;let n=e.config??{},r=[];switch(y(t,e.required,e.label,r),e.type){case`text`:case`textarea`:case`password`:b(t,n,e.label,r);break;case`slug`:b(t,n,e.label,r),!v(t)&&!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(String(t))&&r.push({field:e.label,code:`INVALID_SLUG`,message:`${e.label} deve ser um slug válido (a-z, 0-9 e hífens)`});break;case`email`:x(t,e.label,r);break;case`url`:case`oembed`:S(t,e.label,r);break;case`number`:case`range`:C(t,n,e.label,r);break;case`wysiwyg`:b(t,n,e.label,r);break;case`select`:D(t,n,e.label,r);break;case`checkbox`:O(t,n,e.label,r);break;case`radio`:k(t,n,e.label,r);break;case`true_false`:A(t,e.label,r);break;case`image`:M(t,n,e.label,r);break;case`file`:N(t,n,e.label,r);break;case`gallery`:P(t,n,e.label,r);break;case`link`:ee(t,e.label,r);break;case`page_link`:case`post_object`:case`relationship`:case`taxonomy`:case`user`:F(t,n,e.label,r);break;case`google_map`:I(t,e.label,r);break;case`color_picker`:R(t,n,e.label,r)}return r[0]?.message??null}function te(e){let t=new Map;for(let n of e)t.set(n.name,n);let n=[],r=new Set,i=e=>{r.has(e.name)||(r.add(e.name),n.push(e))};for(let n of e){if(n.type!==`clone`){i(n);continue}let e=n.config??{},r=e.display??`seamless`,a=e.clone??[],o=[];for(let e of a){let n=t.get(e);n&&n.type!==`clone`&&o.push(n)}if(o.length!==0){if(r===`group`){i({...n,type:`group`,name:n.name,label:n.label,required:!1,conditionalLogic:void 0,subFields:o.map(e=>({...e,name:`${n.name}_${e.name}`}))});continue}for(let e of o)i(e)}}return n}var ne=new Set(`a.abbr.b.blockquote.br.code.dd.div.dl.dt.em.figcaption.figure.h1.h2.h3.h4.h5.h6.hr.i.img.li.ol.p.pre.q.s.span.strong.sub.sup.u.ul`.split(`.`)),B=new Set([`br`,`hr`,`img`]),re=new Set([`script`,`style`,`iframe`,`object`,`embed`,`svg`,`math`,`textarea`,`title`,`noscript`,`template`]),V=new Set([`class`,`title`,`alt`,`width`,`height`,`href`,`src`,`target`,`rel`]),H=new Set([`http`,`https`,`mailto`,`tel`]),ie=new Set([`http`,`https`]),U={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`,colon:`:`,tab:` `,newline:`
2
2
  `,sol:`/`,lpar:`(`,rpar:`)`,num:`#`,period:`.`,excl:`!`,comma:`,`};function W(e){return e.replace(/&#x([0-9a-fA-F]+);?/g,(e,t)=>G(parseInt(t,16))).replace(/&#(\d+);?/g,(e,t)=>G(parseInt(t,10))).replace(/&([a-zA-Z][a-zA-Z0-9]{1,30});?/g,(e,t)=>U[t in U?t:t.toLowerCase()]??e)}function G(e){if(!Number.isFinite(e)||e<0||e>1114111)return``;try{return String.fromCodePoint(e)}catch{return``}}function ae(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}function K(e){return e.replace(/&(?![a-zA-Z][a-zA-Z0-9]{1,30};|#[0-9]{1,7};|#[xX][0-9a-fA-F]{1,6};)|[<>]/g,e=>e===`&`?`&amp;`:e===`<`?`&lt;`:`&gt;`)}function q(e,t){let n=W(e).replace(/[\t\n\r]/g,``).trim(),r=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(n);return!r||t.has(r[1].toLowerCase())}function J(e){return ae(W(e))}function oe(e){let t=[],n=e.length,r=0,i=e=>e===` `||e===` `||e===`
3
3
  `||e===`\r`||e===`\f`;for(;r<n;){for(;r<n&&(i(e.charAt(r))||e.charAt(r)===`/`);)r++;if(r>=n)break;let a=``;for(;r<n&&!i(e.charAt(r))&&e.charAt(r)!==`=`&&e.charAt(r)!==`>`&&e.charAt(r)!==`/`&&e.charAt(r)!==`<`;)a+=e.charAt(r),r++;if(!a){r++;continue}let o=``,s=r;for(;s<n&&i(e.charAt(s));)s++;if(s<n&&e.charAt(s)===`=`){for(s++;s<n&&i(e.charAt(s));)s++;if(s<n&&(e.charAt(s)===`"`||e.charAt(s)===`'`)){let t=e.charAt(s);s++;let r=s;for(;s<n&&e.charAt(s)!==t;)s++;o=e.slice(r,s),s++}else{let t=s;for(;s<n&&!i(e.charAt(s))&&e.charAt(s)!==`>`;)s++;o=e.slice(t,s)}r=s}t.push([a.toLowerCase(),o])}return t}function se(e,t){let n=[],r=new Set,i=!1;for(let[e,a]of t)if(V.has(e)&&!r.has(e)&&(e!==`href`||q(a,H))&&(e!==`src`||q(a,ie))){if(e===`target`){if(J(a)!==`_blank`)continue;i=!0;continue}e!==`rel`&&(r.add(e),n.push(`${e}="${J(a)}"`))}return e===`a`&&i&&(n.push(`target="_blank"`),n.push(`rel="noopener noreferrer"`)),n.length>0?` ${n.join(` `)}`:``}function ce(e){if(typeof e!=`string`||e.length===0)return``;let t=e.toLowerCase(),n=e.length,r=[],i=``,a=0;for(;a<n;){let o=e.indexOf(`<`,a);if(o===-1){i+=K(e.slice(a));break}if(o>a&&(i+=K(e.slice(a,o))),e.startsWith(`<!--`,o)){let t=e.indexOf(`-->`,o+4);a=t===-1?n:t+3;continue}if(e.charAt(o+1)===`!`||e.charAt(o+1)===`?`){let t=e.indexOf(`>`,o+2);a=t===-1?n:t+1;continue}let s=/^<(\/?)([a-zA-Z][a-zA-Z0-9]*)(?=[\s/>])/.exec(e.slice(o,Math.min(o+64,n)));if(!s){i+=`&lt;`,a=o+1;continue}let c=s[1]===`/`,l=s[2].toLowerCase(),u=o+s[0].length,d=``;for(;u<n;){let t=e[u];if(d)t===d&&(d=``);else if(t===`"`||t===`'`)d=t;else if(t===`>`)break;u++}if(u>=n)break;let f=e.slice(o+s[0].length,u);if(a=u+1,!c&&re.has(l)){let r=t.indexOf(`</${l}`,a);if(r===-1)break;let i=e.indexOf(`>`,r);a=i===-1?n:i+1;continue}if(c){let e=r.lastIndexOf(l);if(e!==-1){for(let t=r.length-1;t>=e;t--)i+=`</${r[t]}>`;r.length=e}continue}if(!ne.has(l))continue;let p=se(l,oe(f));B.has(l)?i+=`<${l}${p} />`:(i+=`<${l}${p}>`,r.push(l))}for(let e=r.length-1;e>=0;e--)i+=`</${r[e]}>`;return i}var le=f(`<ul class=relationship-picker__selection>`),ue=f(`<li class=relationship-picker__empty>Buscando...`),de=f(`<li class=relationship-picker__empty>Nenhum resultado`),Y=f(`<ul class=relationship-picker__results><!$><!/><!$><!/><!$><!/>`),fe=f(`<div class=relationship-picker><!$><!/><input type=search class=input><!$><!/>`),pe=f(`<li><!$><!/><button type=button aria-label=Remover>×`),X=f(`<li><button type=button><!$><!/><span class=relationship-picker__type>`);function me(o){let[f,p]=n(``),[g,v]=n([]),[y,b]=n([]),[x,S]=n(!1),[C,w]=n(!1),T=a(()=>{let e=o.value;return Array.isArray(e)?e.map(String):e?[String(e)]:[]}),E=async()=>{S(!0);try{let e=await _.getContent({type:o.postType,status:`PUBLISHED`,search:f()||void 0,limit:10});v(e.data.filter(e=>!T().includes(e.id)).map(e=>({id:e.id,title:e.title,type:e.type}))),w(!0)}catch{v([])}finally{S(!1)}},D=e=>{b(t=>[...t,e]),o.multiple?o.onChange([...T(),e.id]):(o.onChange(e.id),p(``)),v([]),w(!1)},O=e=>{b(t=>t.filter(t=>t.id!==e));let t=T().filter(t=>t!==e);o.onChange(o.multiple?t:t[0]??null)},k=async()=>{C()||await E()};return(()=>{var n=d(fe),a=n.firstChild,[_,v]=s(a.nextSibling),b=_.nextSibling,S=b.nextSibling,[A,j]=s(S.nextSibling);return m(n,i(t,{get when(){return y().length>0||T().length>0},get children(){var e=d(le);return m(e,i(r,{get each(){return y()},children:e=>(()=>{var t=d(pe),n=t.firstChild,[r,i]=s(n.nextSibling),a=r.nextSibling;return m(t,()=>e.title,r,i),a.$$click=()=>O(e.id),h(),t})()})),e}}),_,v),b.addEventListener(`blur`,()=>setTimeout(()=>w(!1),150)),b.$$input=e=>{p(e.currentTarget.value),E()},b.addEventListener(`focus`,()=>void k()),m(n,i(t,{get when(){return c(()=>!!C())()&&(x()||g().length>0)},get children(){var e=d(Y),n=e.firstChild,[a,o]=s(n.nextSibling),l=a.nextSibling,[u,f]=s(l.nextSibling),p=u.nextSibling,[_,v]=s(p.nextSibling);return m(e,i(t,{get when(){return x()},get children(){return d(ue)}}),a,o),m(e,i(r,{get each(){return g()},children:e=>(()=>{var t=d(X),n=t.firstChild,r=n.firstChild,[i,a]=s(r.nextSibling),o=i.nextSibling;return n.$$click=()=>D(e),n.$$mousedown=e=>e.preventDefault(),m(n,()=>e.title,i,a),m(o,()=>e.type),h(),t})()}),u,f),m(e,i(t,{get when(){return c(()=>!x())()&&g().length===0},get children(){return d(de)}}),_,v),e}}),A,j),e(()=>l(b,`placeholder`,o.placeholder??`Buscar conteúdo...`)),e(()=>u(b,`value`,f())),h(),n})()}p([`input`,`click`,`mousedown`]);var he=f(`<span class=field-renderer__required>*`),ge=f(`<p class=field-renderer__instructions>`),Z=f(`<p class=field-renderer__error role=alert>`),_e=f(`<div class=field-renderer><label class=field-renderer__label><!$><!/><!$><!/></label><!$><!/><!$><!/><!$><!/>`),Q=f(`<input type=text class=input>`),ve=f(`<textarea class=input>`),ye=f(`<textarea class="input wysiwyg"rows=8>`),be=f(`<input type=number class=input>`),xe=f(`<input type=email class=input>`),Se=f(`<input type=url class=input placeholder=https://>`),Ce=f(`<input type=password class=input>`),we=f(`<input type=checkbox>`),Te=f(`<select class=input>`),Ee=f(`<option>`),De=f(`<div class=field-renderer__choices>`),Oe=f(`<label><input type=radio> <!$><!/>`),ke=f(`<label><input type=checkbox> <!$><!/>`),Ae=f(`<input type=date class=input>`),je=f(`<input type=datetime-local class=input>`),Me=f(`<input type=time class=input>`),Ne=f(`<input type=color>`),Pe=f(`<div class=field-renderer__map><input type=text class=input placeholder=Endereço><input type=number class=input placeholder="Latitude (-90 a 90)"step=any min=-90 max=90><input type=number class=input placeholder="Longitude (-180 a 180)"step=any min=-180 max=180>`),Fe=f(`<div class=field-renderer__link><input type=url class=input placeholder="https:// ou /caminho"><select class=input><option value=_self>Mesma janela</option><option value=_blank>Nova janela`),Ie=f(`<div class=field-renderer__rows><!$><!/><button type=button class=btn>+ Adicionar linha`),Le=f(`<div class=field-renderer__rows><!$><!/><select class=input value><option value>+ Adicionar layout...</option><!$><!/>`),Re=f(`<div class=field-renderer__row><div class=field-renderer__row-header><span><!$><!/> <!$><!/></span><button type=button class=btn>↑</button><button type=button class=btn>↓</button><button type=button class="btn btn-danger">Remover</button></div><!$><!/>`),ze=f(`<p class=field-renderer__instructions>Layout "<!$><!/>" não encontrado.`),Be=f(`<fieldset class=field-renderer__group>`),Ve=f(`<div class=field-renderer__row><div class=field-renderer__row-header><span>Linha <!$><!/></span><button type=button class="btn btn-danger">Remover</button></div><!$><!/>`),He=f(`<input type=file class=input>`);function Ue(e){return e==null||e===``||Array.isArray(e)&&e.length===0||typeof e==`boolean`&&!e}function We(e){return e.toLowerCase().normalize(`NFD`).replace(/[̀-ͯ]/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/(^-|-$)/g,``)}function Ge(e,t){if(typeof t==`boolean`)return!!e===t;let n=Number(e),r=Number(t);return e===t||!Number.isNaN(n)&&!Number.isNaN(r)&&n===r}function Ke(e,t){let n=e.conditionalLogic;return!n?.groups||n.groups.length===0||n.groups.map(e=>{let n=e.rules??[];if(n.length===0)return!0;let r=n.map(e=>{let n=t[e.field];switch(e.operator){case`eq`:return Ge(n,e.value);case`neq`:return!Ge(n,e.value);case`gt`:return Number(n)>Number(e.value);case`lt`:return Number(n)<Number(e.value);case`contains`:return Array.isArray(n)?n.includes(e.value):String(n??``).includes(String(e.value));case`pattern_matches`:try{return new RegExp(String(e.value)).test(String(n??``))}catch{return!1}case`has_any_value`:return!Ue(n);case`has_no_value`:return Ue(n);default:return!1}});return e.match===`ANY`?r.some(Boolean):r.every(Boolean)}).some(Boolean)}var qe=new Set([`message`,`tab`,`accordion`]);function $(r){let o=()=>Ke(r.field,r.values),[u,f]=n(!1),p=()=>r.values[r.field.name],h=a(()=>u()?z(r.field,r.values[r.field.name]):null),g=e=>{f(!0),r.onChange(r.field.name,e)};return i(t,{get when(){return c(()=>!!o())()&&!qe.has(r.field.type)},get children(){var n=d(_e),a=n.firstChild,o=a.firstChild,[c,u]=s(o.nextSibling),f=c.nextSibling,[_,v]=s(f.nextSibling),y=a.nextSibling,[b,x]=s(y.nextSibling),S=b.nextSibling,[C,w]=s(S.nextSibling),T=C.nextSibling,[E,D]=s(T.nextSibling);return m(a,()=>r.field.label,c,u),m(a,i(t,{get when(){return r.field.required},get children(){return d(he)}}),_,v),m(n,i(t,{get when(){return r.field.instructions},get children(){var e=d(ge);return m(e,()=>r.field.instructions),e}}),b,x),m(n,i(Je,{get field(){return r.field},get value(){return p()},onChange:g,get values(){return r.values}}),C,w),m(n,i(t,{get when(){return h()},get children(){var e=d(Z);return m(e,h),e}}),E,D),e(()=>l(n,`data-field-type`,r.field.type)),n}})}function Je(n){let a=()=>n.field.config??{};switch(n.field.type){case`text`:return(()=>{var t=d(Q);return t.addEventListener(`blur`,e=>n.onChange(e.currentTarget.value.trim())),t.$$input=e=>n.onChange(e.currentTarget.value),e(e=>{var n=a().placeholder,r=a().maxLength??a().characterLimit;return n!==e.e&&l(t,`placeholder`,e.e=n),r!==e.t&&l(t,`maxlength`,e.t=r),e},{e:void 0,t:void 0}),e(()=>u(t,`value`,n.value??a().defaultValue??``)),h(),t})();case`textarea`:return(()=>{var t=d(ve);return t.$$input=e=>n.onChange(e.currentTarget.value),e(e=>{var n=a().rows??4,r=a().placeholder,i=a().maxLength??a().characterLimit;return n!==e.e&&l(t,`rows`,e.e=n),r!==e.t&&l(t,`placeholder`,e.t=r),i!==e.a&&l(t,`maxlength`,e.a=i),e},{e:void 0,t:void 0,a:void 0}),e(()=>u(t,`value`,n.value??a().defaultValue??``)),h(),t})();case`wysiwyg`:return(()=>{var e=d(ye);return e.$$input=e=>n.onChange(e.currentTarget.value),h(),e})();case`number`:case`range`:return(()=>{var t=d(be);return t.$$input=e=>n.onChange(e.currentTarget.value===``?void 0:Number(e.currentTarget.value)),e(e=>{var n=a().min??a().minValue,r=a().max??a().maxValue,i=a().step;return n!==e.e&&l(t,`min`,e.e=n),r!==e.t&&l(t,`max`,e.t=r),i!==e.a&&l(t,`step`,e.a=i),e},{e:void 0,t:void 0,a:void 0}),e(()=>u(t,`value`,n.value??a().defaultValue??``)),h(),t})();case`email`:return(()=>{var e=d(xe);return e.$$input=e=>n.onChange(e.currentTarget.value),h(),e})();case`url`:return(()=>{var e=d(Se);return e.$$input=e=>n.onChange(e.currentTarget.value),h(),e})();case`password`:return(()=>{var e=d(Ce);return e.$$input=e=>n.onChange(e.currentTarget.value),h(),e})();case`slug`:return(()=>{var t=d(Q);return t.addEventListener(`blur`,e=>n.onChange(We(e.currentTarget.value.trim()))),t.$$input=e=>n.onChange(We(e.currentTarget.value)),e(()=>l(t,`placeholder`,a().placeholder)),e(()=>u(t,`value`,n.value??a().defaultValue??``)),h(),t})();case`true_false`:return(()=>{var t=d(we);return t.addEventListener(`change`,e=>n.onChange(e.currentTarget.checked)),e(()=>u(t,`checked`,!!n.value)),t})();case`select`:return(()=>{var t=d(Te);return t.addEventListener(`change`,e=>n.onChange(e.currentTarget.multiple?Array.from(e.currentTarget.selectedOptions).map(e=>e.value):e.currentTarget.value)),m(t,i(r,{get each(){return a().choices??[]},children:t=>(()=>{var n=d(Ee);return m(n,()=>t.label),e(()=>u(n,`value`,t.value)),n})()})),e(()=>u(t,`multiple`,a().multiple===!0)),t})();case`radio`:return(()=>{var t=d(De);return m(t,i(r,{get each(){return a().choices??[]},children:t=>(()=>{var r=d(Oe),i=r.firstChild,a=i.nextSibling.nextSibling,[o,c]=s(a.nextSibling);return i.addEventListener(`change`,()=>n.onChange(t.value)),m(r,()=>t.label,o,c),e(()=>l(i,`name`,n.field.name)),e(()=>u(i,`checked`,n.value===t.value)),r})()})),t})();case`checkbox`:return(()=>{var t=d(De);return m(t,i(r,{get each(){return a().choices??[]},children:t=>{let r=()=>Array.isArray(n.value)&&n.value.includes(t.value);return(()=>{var i=d(ke),a=i.firstChild,o=a.nextSibling.nextSibling,[c,l]=s(o.nextSibling);return a.addEventListener(`change`,e=>{let r=Array.isArray(n.value)?[...n.value]:[];n.onChange(e.currentTarget.checked?[...r,t.value]:r.filter(e=>e!==t.value))}),m(i,()=>t.label,c,l),e(()=>u(a,`checked`,r())),i})()}})),t})();case`date_picker`:return(()=>{var e=d(Ae);return e.$$input=e=>n.onChange(e.currentTarget.value),h(),e})();case`date_time_picker`:return(()=>{var e=d(je);return e.$$input=e=>n.onChange(e.currentTarget.value),h(),e})();case`time_picker`:return(()=>{var e=d(Me);return e.$$input=e=>n.onChange(e.currentTarget.value),h(),e})();case`color_picker`:return(()=>{var e=d(Ne);return e.addEventListener(`change`,e=>n.onChange(e.currentTarget.value)),e})();case`image`:case`file`:return i(Xe,{multiple:!1,get onChange(){return n.onChange},get accept(){return n.field.type===`image`?`image/*`:void 0}});case`gallery`:return i(Xe,{multiple:!0,get onChange(){return n.onChange},accept:`image/*`});case`google_map`:return(()=>{var e=d(Pe),t=e.firstChild,r=t.nextSibling,i=r.nextSibling;return t.$$input=e=>{let t=n.value??{};n.onChange({...t,address:e.currentTarget.value})},r.$$input=e=>{let t=n.value??{};n.onChange({...t,lat:Number(e.currentTarget.value)})},i.$$input=e=>{let t=n.value??{};n.onChange({...t,lng:Number(e.currentTarget.value)})},h(),e})();case`link`:return(()=>{var e=d(Fe),t=e.firstChild,r=t.nextSibling;return t.$$input=e=>{let t=n.value??{};n.onChange({...t,url:e.currentTarget.value})},r.addEventListener(`change`,e=>{let t=n.value??{};n.onChange({...t,target:e.currentTarget.value})}),h(),e})();case`relationship`:case`post_object`:return i(me,{get postType(){return a().postType},get multiple(){return a().multiple!==!1},get value(){return n.value},get onChange(){return n.onChange}});case`taxonomy`:case`user`:return i(Ze,{get field(){return n.field},get value(){return n.value},get onChange(){return n.onChange},get multiple(){return a().multiple!==!1}});case`repeater`:{let e=()=>Array.isArray(n.value)?n.value:[];return(()=>{var t=d(Ie),a=t.firstChild,[o,c]=s(a.nextSibling),l=o.nextSibling;return m(t,i(r,{get each(){return e()},children:(t,r)=>i(Ye,{get field(){return n.field},row:t,get index(){return r()},onUpdate:t=>{let i=[...e()];i[r()]=t,n.onChange(i)},onRemove:()=>{n.onChange(e().filter((e,t)=>t!==r()))}})}),o,c),l.$$click=()=>n.onChange([...e(),{}]),h(),t})()}case`flexible_content`:{let o=()=>n.field.layouts.length>0?n.field.layouts:a().layouts??[],c=()=>(Array.isArray(n.value)?n.value:[]).map(e=>({fc_layout:String(e.fc_layout??``),data:e}));return(()=>{var a=d(Le),l=a.firstChild,[f,p]=s(l.nextSibling),g=f.nextSibling,_=g.firstChild.nextSibling,[v,y]=s(_.nextSibling);return m(a,i(r,{get each(){return c()},children:(a,l)=>{let f=()=>o().find(e=>e.name===a.fc_layout),p=()=>{let{fc_layout:e,...t}=a.data;return t};return(()=>{var o=d(Re),g=o.firstChild,_=g.firstChild,v=_.firstChild,[y,b]=s(v.nextSibling),x=y.nextSibling.nextSibling,[S,C]=s(x.nextSibling),w=_.nextSibling,T=w.nextSibling,E=T.nextSibling,D=g.nextSibling,[O,k]=s(D.nextSibling);return m(_,()=>f()?.label||a.fc_layout||`Linha`,y,b),m(_,()=>l()+1,S,C),w.$$click=()=>{let e=[...Array.isArray(n.value)?n.value:[]];[e[l()-1],e[l()]]=[e[l()],e[l()-1]],n.onChange(e)},T.$$click=()=>{let e=[...Array.isArray(n.value)?n.value:[]];[e[l()],e[l()+1]]=[e[l()+1],e[l()]],n.onChange(e)},E.$$click=()=>n.onChange((Array.isArray(n.value)?n.value:[]).filter((e,t)=>t!==l())),m(o,i(t,{get when(){return f()},get fallback(){return(()=>{var e=d(ze),t=e.firstChild.nextSibling,[n,r]=s(t.nextSibling);return n.nextSibling,m(e,()=>a.fc_layout,n,r),e})()},get children(){return i(r,{get each(){return f().subFields??[]},children:e=>i($,{field:e,get values(){return p()},onChange:(e,t)=>{let r=[...Array.isArray(n.value)?n.value:[]];r[l()]={...r[l()],[e]:t},n.onChange(r)}})})}}),O,k),e(e=>{var t=l()===0,n=l()===c().length-1;return t!==e.e&&u(w,`disabled`,e.e=t),n!==e.t&&u(T,`disabled`,e.t=n),e},{e:void 0,t:void 0}),h(),o})()}}),f,p),g.addEventListener(`change`,e=>{e.currentTarget.value&&(n.onChange([...Array.isArray(n.value)?n.value:[],{fc_layout:e.currentTarget.value}]),e.currentTarget.value=``)}),m(g,i(r,{get each(){return o()},children:t=>(()=>{var n=d(Ee);return m(n,()=>t.label??t.name),e(()=>u(n,`value`,t.name)),n})()}),v,y),a})()}case`group`:return(()=>{var e=d(Be);return m(e,i(r,{get each(){return n.field.subFields??[]},children:e=>i($,{field:e,get values(){return n.value??{}},onChange:(e,t)=>n.onChange({...n.value??{},[e]:t})})})),e})();default:return(()=>{var e=d(Q);return e.$$input=e=>n.onChange(e.currentTarget.value),h(),e})()}}function Ye(e){return(()=>{var t=d(Ve),n=t.firstChild,a=n.firstChild,o=a.firstChild.nextSibling,[c,l]=s(o.nextSibling),u=a.nextSibling,f=n.nextSibling,[p,g]=s(f.nextSibling);return m(a,()=>e.index+1,c,l),u.$$click=()=>e.onRemove(),m(t,i(r,{get each(){return e.field.subFields??[]},children:t=>i($,{field:t,get values(){return e.row},onChange:(t,n)=>e.onUpdate({...e.row,[t]:n})})}),p,g),h(),t})()}function Xe(t){return(()=>{var n=d(He);return n.addEventListener(`change`,e=>{let n=Array.from(e.currentTarget.files??[]);t.onChange(t.multiple?n:n[0])}),e(e=>{var r=t.multiple,i=t.accept;return r!==e.e&&u(n,`multiple`,e.e=r),i!==e.t&&l(n,`accept`,e.t=i),e},{e:void 0,t:void 0}),n})()}function Ze(t){let n=()=>Array.isArray(t.value)?t.value:t.value?[t.value]:[];return(()=>{var a=d(Te);return a.addEventListener(`change`,e=>{let n=Array.from(e.currentTarget.selectedOptions).map(e=>e.value);t.onChange(t.multiple?n:n[0])}),m(a,i(r,{get each(){return t.field.config?.choices??[]},children:t=>(()=>{var r=d(Ee);return m(r,()=>t.label),e(()=>u(r,`selected`,n().includes(t.value))),e(()=>u(r,`value`,t.value)),r})()})),e(e=>{var n=t.multiple,r=Math.min(6,Math.max(3,(t.field.config?.choices??[]).length||3));return n!==e.e&&u(a,`multiple`,e.e=n),r!==e.t&&l(a,`size`,e.t=r),e},{e:void 0,t:void 0}),a})()}p([`input`,`click`]);var Qe=f(`<div class="notice notice--success">`),$e=f(`<input class=classic-editor__title required>`),et=f(`<div class=classic-editor__toolbar role=toolbar><button type=button><strong>B</strong></button><button type=button><em>I</em></button><button type=button><u>U</u></button><span class=classic-editor__toolbar-divider></span><button type=button>❝</button><button type=button>• List</button><button type=button>1. List</button><button type=button>Link`),tt=f(`<div class=classic-editor__body data-classic-editor role=textbox aria-multiline=true>`),nt=f(`<label class=classic-editor__excerpt><span></span><textarea class=input rows=4>`),rt=f(`<section class="card custom-fields"><h3></h3><!$><!/>`),it=f(`<section class="card classic-editor__panel"><h3></h3><input class=input><p class=muted>`),at=f(`<section class="card classic-editor__panel"><h3></h3><label><!$><!/><select class=input><option value></option><!$><!/>`),ot=f(`<form class="content-editor classic-editor"><!$><!/><!$><!/><div class=classic-editor__topbar><div><span class=classic-editor__eyebrow></span><h2></h2></div><div class=classic-editor__actions><a class="btn btn-secondary"></a><button type=submit class="btn btn-primary"></button></div></div><div class=classic-editor__columns><main class=classic-editor__main><section class="card classic-editor__canvas-card"><!$><!/><div class=classic-editor__permalink><span><!$><!/>:</span><input class=input></div><!$><!/><!$><!/></section><!$><!/></main><aside class=classic-editor__sidebar><section class="card classic-editor__panel"><h3></h3><label><!$><!/><select class=input><option value=DRAFT></option><option value=PUBLISHED></option><option value=ARCHIVED></option></select></label><button type=submit class="btn btn-primary classic-editor__full-button"></button></section><!$><!/><!$><!/>`),st=f(`<div class="notice notice--error">`),ct=f(`<option>`);function lt(a){let{t:f}=g(),[p,v]=n([]),[y,b]=n([]),[x,S]=n([]),[C,w]=n({}),[T,E]=n([]),[D,O]=n(!1),[k,A]=n(``),[j,M]=n({type:a.initialType||`post`,title:``,status:`DRAFT`}),N=()=>new Set(p().find(e=>e.slug===j().type)?.supports??[`title`,`editor`]),P=e=>N().has(e),F=(e,t)=>t||e[0]?.slug||`post`,ee=()=>{let e=new Set;for(let t of x())for(let n of t.manifest?.provides?.layouts??[])e.add(n);return[...e].sort()},I=async e=>{try{let t=typeof e==`string`?{type:e}:e,n=await _.getFieldGroups(t.type?t:void 0),r=await Promise.all(n.filter(e=>e.active).map(async e=>(await _.getFieldGroup(e.id)).fields??[]));b(te(r.flat()))}catch(e){E([e instanceof Error?e.message:String(e)])}};o(async()=>{let e=[];try{let[t,n]=await Promise.all([_.getContentTypes(),_.getThemes().catch(()=>[])]);e=t,v(t),S(n)}catch(e){E([e instanceof Error?e.message:String(e)])}let t=new URLSearchParams(window.location.search).get(`id`);if(t||a.singleton)try{let e=t?await _.getContentById(t):await _.getSingletonContent(j().type);if(!e){await I({type:j().type,status:j().status});return}let n=e;M({id:e.id,type:e.type,title:e.title,slug:e.slug,excerpt:e.excerpt,featuredImageId:n.featuredImageId??n.featured_image_id,status:e.status,layout:e.layout}),w(e.body??{})}catch(e){E([e instanceof Error?e.message:String(e)])}else e.some(e=>e.slug===j().type)||M({...j(),type:F(e,a.initialType)});await I({type:j().type,slug:j().slug,status:j().status})});let L=()=>{let e=C().content;return typeof e==`string`?e:``},R=e=>{w({...C(),content:e.innerHTML})},z=(e,t)=>{document.execCommand(e,!1,t);let n=document.querySelector(`[data-classic-editor]`);n&&R(n)},ne=async e=>{e.preventDefault(),A(``),E([]),O(!0);try{let e={...j(),layout:j().layout||null,body:{...C(),content:ce(L())},...P(`excerpt`)?{}:{excerpt:void 0},...P(`thumbnail`)?{}:{featuredImageId:void 0}},t=j().id?await _.updateContent(j().id,e):await _.createContent(e);M({...j(),id:t.id}),A(f(`content.editor.saved`))}catch(e){E([e instanceof Error?e.message:String(e)])}finally{O(!1)}};return(()=>{var n=d(ot),a=n.firstChild,[o,g]=s(a.nextSibling),_=o.nextSibling,[v,b]=s(_.nextSibling),x=v.nextSibling,S=x.firstChild,E=S.firstChild,O=E.nextSibling,A=S.nextSibling.firstChild,N=A.nextSibling,F=x.nextSibling.firstChild,I=F.firstChild,te=I.firstChild,[B,re]=s(te.nextSibling),V=B.nextSibling,H=V.firstChild,ie=H.firstChild,[U,W]=s(ie.nextSibling);U.nextSibling;var G=H.nextSibling,ae=V.nextSibling,[K,q]=s(ae.nextSibling),J=K.nextSibling,[oe,se]=s(J.nextSibling),le=I.nextSibling,[ue,de]=s(le.nextSibling),Y=F.nextSibling,fe=Y.firstChild,pe=fe.firstChild,X=pe.nextSibling,me=X.firstChild,[he,ge]=s(me.nextSibling),Z=he.nextSibling,_e=Z.firstChild,Q=_e.nextSibling,ve=Q.nextSibling,ye=X.nextSibling,be=fe.nextSibling,[xe,Se]=s(be.nextSibling),Ce=xe.nextSibling,[we,Te]=s(Ce.nextSibling);return n.addEventListener(`submit`,ne),m(n,i(t,{get when(){return T().length>0},get children(){return i(r,{get each(){return T()},children:e=>(()=>{var t=d(st);return m(t,e),t})()})}}),o,g),m(n,i(t,{get when(){return k()},get children(){var e=d(Qe);return m(e,k),e}}),v,b),m(E,()=>p().find(e=>e.slug===j().type)?.singularLabel||j().type),m(O,(()=>{var e=c(()=>!!j().id);return()=>e()?f(`content.editor.editing`):f(`content.editor.adding`)})()),m(A,()=>f(`content.editor.backToList`)),m(N,(()=>{var e=c(()=>!!D());return()=>e()?f(`content.editor.saving`):f(`content.editor.save`)})()),m(I,i(t,{get when(){return P(`title`)},get children(){var t=d($e);return t.$$input=e=>M({...j(),title:e.currentTarget.value}),e(e=>{var n=f(`content.editor.title`),r=f(`content.editor.titlePlaceholder`);return n!==e.e&&l(t,`aria-label`,e.e=n),r!==e.t&&l(t,`placeholder`,e.t=r),e},{e:void 0,t:void 0}),e(()=>u(t,`value`,j().title)),h(),t}}),B,re),m(H,()=>f(`content.editor.slug`),U,W),G.$$input=e=>M({...j(),slug:e.currentTarget.value}),m(I,i(t,{get when(){return P(`editor`)},get children(){return[(()=>{var t=d(et),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,a=i.nextSibling.nextSibling,o=a.nextSibling,s=o.nextSibling,c=s.nextSibling;return n.$$click=()=>z(`bold`),r.$$click=()=>z(`italic`),i.$$click=()=>z(`underline`),a.$$click=()=>z(`formatBlock`,`blockquote`),o.$$click=()=>z(`insertUnorderedList`),s.$$click=()=>z(`insertOrderedList`),c.$$click=()=>z(`createLink`,window.prompt(f(`content.editor.linkPrompt`))||``),e(()=>l(t,`aria-label`,f(`content.editor.toolbar`))),h(),t})(),(()=>{var t=d(tt);return t.$$input=e=>R(e.currentTarget),l(t,`contenteditable`,!0),e(e=>{var n=f(`content.editor.bodyPlaceholder`),r=ce(L());return n!==e.e&&l(t,`data-placeholder`,e.e=n),r!==e.t&&u(t,`innerHTML`,e.t=r),e},{e:void 0,t:void 0}),h(),t})()]}}),K,q),m(I,i(t,{get when(){return P(`excerpt`)},get children(){var t=d(nt),n=t.firstChild,r=n.nextSibling;return m(n,()=>f(`content.editor.excerpt`)),r.$$input=e=>M({...j(),excerpt:e.currentTarget.value}),e(()=>u(r,`value`,j().excerpt??``)),h(),t}}),oe,se),m(F,i(t,{get when(){return y().length>0},get children(){var e=d(rt),t=e.firstChild,n=t.nextSibling,[a,o]=s(n.nextSibling);return m(t,()=>f(`content.editor.customFields`)),m(e,i(r,{get each(){return y()},children:e=>i($,{field:e,get values(){return C()},onChange:(e,t)=>w({...C(),[e]:t})})}),a,o),e}}),ue,de),m(pe,()=>f(`content.editor.publishPanel`)),m(X,()=>f(`content.editor.status`),he,ge),Z.addEventListener(`change`,e=>M({...j(),status:e.currentTarget.value})),m(_e,()=>f(`content.editor.statusOptions.draft`)),m(Q,()=>f(`content.editor.statusOptions.published`)),m(ve,()=>f(`content.editor.statusOptions.archived`)),m(ye,(()=>{var e=c(()=>!!D());return()=>e()?f(`content.editor.saving`):f(`content.editor.save`)})()),m(Y,i(t,{get when(){return P(`thumbnail`)},get children(){var t=d(it),n=t.firstChild,r=n.nextSibling,i=r.nextSibling;return m(n,()=>f(`content.editor.featuredImage`)),r.$$input=e=>M({...j(),featuredImageId:e.currentTarget.value}),m(i,()=>f(`content.editor.featuredImageHint`)),e(()=>l(r,`placeholder`,f(`content.editor.mediaIdPlaceholder`))),e(()=>u(r,`value`,j().featuredImageId??``)),h(),t}}),xe,Se),m(Y,i(t,{get when(){return ee().length>0},get children(){var t=d(at),n=t.firstChild,a=n.nextSibling,o=a.firstChild,[c,l]=s(o.nextSibling),p=c.nextSibling,h=p.firstChild,g=h.nextSibling,[_,v]=s(g.nextSibling);return m(n,()=>f(`content.editor.pageAttributes`)),m(a,()=>f(`content.editor.layout`),c,l),p.addEventListener(`change`,e=>M({...j(),layout:e.currentTarget.value||null})),m(h,()=>f(`content.editor.layoutAuto`)),m(p,i(r,{get each(){return ee()},children:e=>(()=>{var t=d(ct);return u(t,`value`,e),m(t,e),t})()}),_,v),e(()=>u(p,`value`,j().layout??``)),t}}),we,Te),e(e=>{var t=`/content/${encodeURIComponent(j().type)}`,n=D(),r=f(`content.editor.slugPlaceholder`),i=D();return t!==e.e&&l(A,`href`,e.e=t),n!==e.t&&u(N,`disabled`,e.t=n),r!==e.a&&l(G,`placeholder`,e.a=r),i!==e.o&&u(ye,`disabled`,e.o=i),e},{e:void 0,t:void 0,a:void 0,o:void 0}),e(()=>u(G,`value`,j().slug??``)),e(()=>u(Z,`value`,j().status)),h(),n})()}p([`input`,`click`]);export{lt as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./ContentEditor.BmpwqkNT.js";export{e as ContentEditor};
@@ -0,0 +1 @@
1
+ import{d as e,i as t,p as n,s as r,u as i,v as a}from"./solid.8gBSxpeo.js";import{a as o,c as s,d as c,i as l,m as u,s as d}from"./web.DwNv8rLL.js";import{n as f}from"./i18n.3zKFZ7KU.js";import{t as p}from"./api.CGA0D2A2.js";import{c as m,i as h,n as g,o as _,r as v,s as y,t as b}from"./src.DQwsXUur.js";import{t as x}from"./ContentEditor.BmpwqkNT.js";var S=u(`<span class=muted>`),C=u(`<div class=users-table__actions><a class="btn btn-secondary btn-sm"></a><!$><!/><!$><!/>`),w=u(`<div class="notice notice--error">`),T=u(`<div class=notice>`),E=u(`<div class=content-list><div class=content-list__heading><div><h2></h2><p class=muted></p></div><a class="btn btn-primary"></a></div><!$><!/><!$><!/><div class=toolbar><!$><!/><!$><!/><!$><!/></div><!$><!/>`);function D(e){return e}function O(e){let t=D(e).updated_at??D(e).updatedAt??D(e).created_at;if(typeof t!=`string`)return`—`;let n=new Date(t);return Number.isNaN(n.getTime())?`—`:n.toLocaleString(`pt-BR`)}function k(s){let{t:u}=f(),[x,k]=n([]),[A,j]=n([]),[M,N]=n(0),[P,F]=n(1),[I,L]=n(``),[R]=n(s.contentType),[z,B]=n(``),[V,H]=n(``),[U,W]=n(``),[G,K]=n(``),q=async()=>{try{let e=await p.getContent({page:P(),limit:20,type:R()||void 0,status:z()||void 0,search:I()||void 0});k(e.data??[]),N(e.total??0)}catch(e){H(e instanceof Error?e.message:String(e))}};a(async()=>{let e=new URLSearchParams(window.location.search);B(e.get(`status`)??``),L(e.get(`search`)??``),await q();try{j(await p.getContentTypes())}catch{}});let J=i(()=>A().find(e=>e.slug===R())),Y=i(()=>J()?.pluralLabel||u(`content.list.title`)),X=i(()=>`/content/${encodeURIComponent(R())}/new`),Z=async()=>{F(1),await q()},Q=async e=>{let t=D(e).status===`PUBLISHED`;K(e.id),H(``),W(``);try{await p.publishToggle(e.id,t),W(u(t?`content.list.toasts.unpublished`:`content.list.toasts.published`)),await q()}catch(e){H(e instanceof Error?e.message:String(e))}finally{K(``)}},$=async e=>{let t=String(D(e).title??e.id);if(confirm(u(`content.list.confirmDelete`,{title:t})))try{await p.deleteContent(e.id),await q()}catch(e){H(e instanceof Error?e.message:String(e))}},ee=i(()=>[{key:`title`,label:u(`content.list.columns.title`)},{key:`type`,label:u(`content.list.columns.type`)},{key:`status`,label:u(`content.list.columns.status`),render:(e,t)=>{let n=String(t.status??``);return r(b,{variant:n===`PUBLISHED`?`success`:n===`ARCHIVED`?`warning`:`secondary`,children:n})}},{key:`updated_at`,label:u(`content.list.columns.updated`),render:(e,t)=>(()=>{var e=l(S);return d(e,()=>O(t)),e})()},{key:`actions`,label:``,render:(t,n)=>{let i=n,a=D(i).status===`PUBLISHED`;return(()=>{var t=l(C),n=t.firstChild,s=n.nextSibling,[f,p]=o(s.nextSibling),m=f.nextSibling,[h,_]=o(m.nextSibling);return d(n,()=>u(`content.list.actions.edit`)),d(t,r(g,{variant:a?`secondary`:`primary`,size:`sm`,get loading(){return G()===i.id},onClick:()=>void Q(i),get children(){return u(a?`content.list.actions.unpublish`:`content.list.actions.publish`)}}),f,p),d(t,r(g,{variant:`danger`,size:`sm`,onClick:()=>void $(i),get children(){return u(`content.list.actions.delete`)}}),h,_),e(()=>c(n,`href`,`/content/${encodeURIComponent(i.type||R())}/edit?id=${encodeURIComponent(i.id)}`)),t})()}}]);return(()=>{var n=l(E),i=n.firstChild,a=i.firstChild,s=a.firstChild,f=s.nextSibling,p=a.nextSibling,b=i.nextSibling,[S,C]=o(b.nextSibling),D=S.nextSibling,[O,k]=o(D.nextSibling),A=O.nextSibling,j=A.firstChild,[N,R]=o(j.nextSibling),H=N.nextSibling,[W,G]=o(H.nextSibling),K=W.nextSibling,[J,Q]=o(K.nextSibling),$=A.nextSibling,[te,ne]=o($.nextSibling);return d(s,Y),d(f,()=>u(`content.list.description`)),d(p,()=>u(`content.list.buttons.addNew`)),d(n,r(t,{get when(){return V()},get children(){var e=l(w);return d(e,V),e}}),S,C),d(n,r(t,{get when(){return U()},get children(){var e=l(T);return d(e,U),e}}),O,k),d(A,r(h,{name:`search`,get placeholder(){return u(`content.list.filters.search`)},get value(){return I()},onInput:e=>{L(e),Z()}}),N,R),d(A,r(y,{name:`status`,get placeholder(){return u(`content.list.filters.allStatus`)},get value(){return z()},get options(){return[{value:`DRAFT`,label:u(`content.list.statuses.draft`)},{value:`PUBLISHED`,label:u(`content.list.statuses.published`)},{value:`ARCHIVED`,label:u(`content.list.statuses.archived`)}]},onChange:e=>{B(e),Z()}}),W,G),d(A,r(g,{variant:`secondary`,onClick:()=>void Z(),get children(){return u(`content.list.buttons.search`)}}),J,Q),d(n,r(v,{get children(){return[r(m,{get columns(){return ee()},get data(){return x()},get emptyMessage(){return u(`content.list.empty`)}}),r(_,{get page(){return P()},limit:20,get total(){return M()},onPageChange:e=>{F(e),q()}})]}}),te,ne),e(()=>c(p,`href`,X())),n})()}var A=u(`<div class="notice notice--error">`),j=u(`<div class=card>`);function M(e){let{t:i}=f(),[o,c]=n(null),[u,m]=n(``);return a(async()=>{try{let t=(await p.getContentTypes()).find(t=>t.slug===e.contentType);if(!t){m(i(`content.list.typeNotFound`));return}c(t)}catch(e){m(e instanceof Error?e.message:String(e))}}),r(t,{get when(){return o()},get fallback(){return s(()=>!!u())()?(()=>{var e=l(A);return d(e,u),e})():(()=>{var e=l(j);return d(e,()=>i(`common.loading`)),e})()},children:e=>r(t,{get when(){return e().singleton},get fallback(){return r(k,{get contentType(){return e().slug}})},get children(){return r(x,{get initialType(){return e().slug},singleton:!0})}})})}export{M as ContentTypeWorkspace};
@@ -1 +1 @@
1
- import{d as e,i as t,p as n,r,s as i,v as a}from"./solid.8gBSxpeo.js";import{a as o,d as s,i as c,m as l,s as u}from"./web.DwNv8rLL.js";import{n as d}from"./i18n.EKfvSb1v.js";import{t as f}from"./api.CM0tblEa.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]=n({total:`—`,published:`—`,drafts:`—`,media:`—`,users:`—`}),[S,C]=n([]),[w,T]=n(``);return a(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 n=c(h),a=n.firstChild,[d,f]=o(a.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(n,i(t,{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(t,{get when(){return S().length>0},get fallback(){return(()=>{var e=c(g);return u(e,()=>l(`dashboard.recent.empty`)),e})()},get children(){var t=c(m),n=t.firstChild,a=n.firstChild.firstChild,o=a.nextSibling,d=o.nextSibling,f=d.nextSibling,p=n.nextSibling;return u(a,()=>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:t=>(()=>{var n=c(_),r=n.firstChild,i=r.firstChild,a=r.nextSibling,o=a.nextSibling,l=o.nextSibling;return u(i,()=>String(v(t).title??`—`)),u(a,()=>String(v(t).type??`—`)),u(o,()=>String(v(t).status??`—`)),u(l,()=>y(t)),e(()=>s(i,`href`,`/content/${encodeURIComponent(String(v(t).type??`post`))}/edit?id=${encodeURIComponent(String(v(t).id??``))}`)),n})()})),t}}),U,W),n})()}export{b as DashboardHome};
1
+ import{d as e,i as t,p as n,r,s as i,v as a}from"./solid.8gBSxpeo.js";import{a as o,d as s,i as c,m as l,s as u}from"./web.DwNv8rLL.js";import{n as d}from"./i18n.3zKFZ7KU.js";import{t as f}from"./api.CGA0D2A2.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]=n({total:`—`,published:`—`,drafts:`—`,media:`—`,users:`—`}),[S,C]=n([]),[w,T]=n(``);return a(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 n=c(h),a=n.firstChild,[d,f]=o(a.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(n,i(t,{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(t,{get when(){return S().length>0},get fallback(){return(()=>{var e=c(g);return u(e,()=>l(`dashboard.recent.empty`)),e})()},get children(){var t=c(m),n=t.firstChild,a=n.firstChild.firstChild,o=a.nextSibling,d=o.nextSibling,f=d.nextSibling,p=n.nextSibling;return u(a,()=>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:t=>(()=>{var n=c(_),r=n.firstChild,i=r.firstChild,a=r.nextSibling,o=a.nextSibling,l=o.nextSibling;return u(i,()=>String(v(t).title??`—`)),u(a,()=>String(v(t).type??`—`)),u(o,()=>String(v(t).status??`—`)),u(l,()=>y(t)),e(()=>s(i,`href`,`/content/${encodeURIComponent(String(v(t).type??`post`))}/edit?id=${encodeURIComponent(String(v(t).id??``))}`)),n})()})),t}}),U,W),n})()}export{b as DashboardHome};
@@ -1 +1 @@
1
- import{t as e}from"./i18n.EKfvSb1v.js";import{t}from"./api.CM0tblEa.js";import{t as n}from"./lucide.s17cczpi.js";import{t as r}from"./iconsAndAliases.ujTnkhnl.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)}n({icons:r})}catch{}};i(),n({icons:r}),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.3zKFZ7KU.js";import{t}from"./api.CGA0D2A2.js";import{t as n}from"./lucide.s17cczpi.js";import{t as r}from"./iconsAndAliases.ujTnkhnl.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)}n({icons:r})}catch{}};i(),n({icons:r}),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{S as e,_ as t,b as n,c as r,d as i,g as a,i as o,l as s,o as c,p as l,r as u,s as d,u as f,v as p}from"./solid.8gBSxpeo.js";import{a as m,c as h,d as g,f as _,h as v,i as y,m as b,n as x,r as S,s as C,t as w,u as T}from"./web.DwNv8rLL.js";import{n as E}from"./i18n.EKfvSb1v.js";import{t as D}from"./api.CM0tblEa.js";import{t as O}from"./lucide.s17cczpi.js";import{t as k}from"./iconsAndAliases.ujTnkhnl.js";import{t as A}from"./FbIcon.uhYN8ybK.js";var ee=b(`<div class=fb-tabs><div class=fb-tabs__list role=tablist></div><div class=fb-tabs__panel role=tabpanel>`),te=b(`<span class=fb-tabs__badge>`),ne=b(`<button type=button role=tab class=fb-tabs__tab><span></span><!$><!/>`);function re(e){return(()=>{var t=y(ee),n=t.firstChild,r=n.nextSibling;return C(n,d(u,{get each(){return e.tabs},children:t=>(()=>{var n=y(ne),r=n.firstChild,a=r.nextSibling,[s,c]=m(a.nextSibling);return n.$$click=()=>e.onChange(t.id),C(r,()=>t.label),C(n,d(o,{get when(){return t.badge},get children(){var e=y(te);return C(e,()=>t.badge),e}}),s,c),i(r=>{var i=e.active===t.id,a=!!t.disabled,o=e.active===t.id,s=t.disabled;return i!==r.e&&n.classList.toggle(`is-active`,r.e=i),a!==r.t&&n.classList.toggle(`is-disabled`,r.t=a),o!==r.a&&g(n,`aria-selected`,r.a=o),s!==r.o&&_(n,`disabled`,r.o=s),r},{e:void 0,t:void 0,a:void 0,o:void 0}),T(),n})()})),C(r,()=>e.children),i(()=>g(n,`aria-label`,e.ariaLabel)),t})()}S([`click`]);var ie=Symbol.for(`preact-signals`);function j(){if(F>1){F--;return}let e,t=!1;for((function(){let e=se;for(se=void 0;e!==void 0;){let t=e.S;if(t.v===e.v)for(let n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();oe!==void 0;){let n=oe;for(oe=void 0,ce++;n!==void 0;){let r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&me(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(ce=0,F--,t)throw e}function M(e){if(F>0)return e();ue=++le,F++;try{return e()}finally{j()}}var N,ae,oe;function P(e){let t=N,n=ae;N=void 0,ae=void 0;try{return e()}finally{N=t,ae=n}}var se,F=0,ce=0,le=0,ue=0,de=0;function fe(e){if(N===void 0)return;let t=e.n;if(t===void 0||t.t!==N)return t={i:0,S:e,p:N.s,n:void 0,t:N,e:void 0,x:void 0,r:t},N.s!==void 0&&(N.s.n=t),N.s=t,e.n=t,32&N.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=N.s,t.n=void 0,N.s.n=t,N.s=t),t}function I(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}I.prototype.brand=ie,I.prototype.h=function(){return!0},I.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t===void 0?P(()=>{var e;(e=this.W)==null||e.call(this)}):t.e=e)},I.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&P(()=>{var e;(e=this.Z)==null||e.call(this)}))}},I.prototype.subscribe=function(e){return Ce(()=>{let t=this.value;P(()=>e(t))},{name:`sub`})},I.prototype.valueOf=function(){return this.value},I.prototype.toString=function(){return this.value+``},I.prototype.toJSON=function(){return this.value},I.prototype.peek=function(){return P(()=>this.value)},Object.defineProperty(I.prototype,"value",{get(){let e=fe(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(ce>100)throw Error(`Cycle detected`);(function(e){F!==0&&ce===0&&e.l!==ue&&(e.l=ue,se={S:e,v:e.v,i:e.i,o:se})})(this),this.v=e,this.i++,de++,F++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{j()}}}});function pe(e,t){return new I(e,t)}function me(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function he(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function ge(e){let t,n=e.s;for(;n!==void 0;){let e=n.p;n.i===-1?(n.S.U(n),e!==void 0&&(e.n=n.n),n.n!==void 0&&(n.n.p=e)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=e}e.s=t}function _e(e,t){I.call(this,void 0,t),this.x=e,this.s=void 0,this.g=de-1,this.f=4}_e.prototype=new I,_e.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===de))return!0;if(this.g=de,this.f|=1,this.i>0&&!me(this))return this.f&=-2,!0;let e=N;try{he(this),N=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return N=e,ge(this),this.f&=-2,!0},_e.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}I.prototype.S.call(this,e)},_e.prototype.U=function(e){if(this.t!==void 0&&(I.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},_e.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(_e.prototype,"value",{get(){if(1&this.f)throw Error(`Cycle detected`);let e=fe(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function ve(e,t){return new _e(e,t)}function ye(e){let t=e.m;if(e.m=void 0,typeof t==`function`){F++;let n=N;N=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,be(e),t}finally{N=n,j()}}}function be(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ye(e)}function xe(e){if(N!==this)throw Error(`Out-of-order effect`);ge(this),N=e,this.f&=-2,8&this.f&&be(this),j()}function Se(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,ae&&ae.push(this)}Se.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e==`function`&&(this.m=e)}finally{e()}},Se.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,ye(this),he(this),F++;let e=N;return N=this,xe.bind(this,e)},Se.prototype.N=function(){2&this.f||(this.f|=2,this.u=oe,oe=this)},Se.prototype.d=function(){this.f|=8,1&this.f||be(this)},Se.prototype.dispose=function(){this.d()};function Ce(e,t){let n=new Se(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}var we=Object.create,Te=Object.defineProperty,Ee=Object.defineProperties,De=Object.getOwnPropertyDescriptor,Oe=Object.getOwnPropertyDescriptors,ke=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,Me=(e,t)=>(t=Symbol[e])?t:Symbol.for(`Symbol.`+e),Ne=e=>{throw TypeError(e)},Pe=(e,t,n)=>t in e?Te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fe=(e,t)=>{for(var n in t||={})Ae.call(t,n)&&Pe(e,n,t[n]);if(ke)for(var n of ke(t))je.call(t,n)&&Pe(e,n,t[n]);return e},Ie=(e,t)=>Ee(e,Oe(t)),Le=(e,t)=>Te(e,`name`,{value:t,configurable:!0}),Re=e=>[,,,we(e?.[Me(`metadata`)]??null)],ze=[`class`,`method`,`getter`,`setter`,`accessor`,`field`,`value`,`get`,`set`],Be=e=>e!==void 0&&typeof e!=`function`?Ne(`Function expected`):e,Ve=(e,t,n,r,i)=>({kind:ze[e],name:t,metadata:r,addInitializer:e=>n._?Ne(`Already initialized`):i.push(Be(e||null))}),He=(e,t)=>Pe(t,Me(`metadata`),e[3]),Ue=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r},We=(e,t,n,r,i,a)=>{var o,s,c,l,u,d=t&7,f=!!(t&8),p=!!(t&16),m=d>3?e.length+1:d?f?1:2:0,h=ze[d+5],g=d>3&&(e[m-1]=[]),_=e[m]||(e[m]=[]),v=d&&(!p&&!f&&(i=i.prototype),d<5&&(d>3||!p)&&De(d<4?i:{get[n](){return qe(this,a)},set[n](e){return Ye(this,a,e)}},n));d?p&&d<4&&Le(a,(d>2?`set `:d>1?`get `:``)+n):Le(i,n);for(var y=r.length-1;y>=0;y--)l=Ve(d,n,c={},e[3],_),d&&(l.static=f,l.private=p,u=l.access={has:p?e=>Ke(i,e):e=>n in e},d^3&&(u.get=p?e=>(d^1?qe:Xe)(e,i,d^4?a:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>Ye(e,i,t,d^4?a:v.set):(e,t)=>e[n]=t)),s=(0,r[y])(d?d<4?p?a:v[h]:d>4?void 0:{get:v.get,set:v.set}:i,l),c._=1,d^4||s===void 0?Be(s)&&(d>4?g.unshift(s):d?p?a=s:v[h]=s:i=s):typeof s!=`object`||!s?Ne(`Object expected`):(Be(o=s.get)&&(v.get=o),Be(o=s.set)&&(v.set=o),Be(o=s.init)&&g.unshift(o));return d||He(e,i),v&&Te(i,n,v),p?d^4?a:v:i},Ge=(e,t,n)=>t.has(e)||Ne(`Cannot `+n),Ke=(e,t)=>Object(t)===t?e.has(t):Ne(`Cannot use the "in" operator on this value`),qe=(e,t,n)=>(Ge(e,t,`read from private field`),n?n.call(e):t.get(e)),Je=(e,t,n)=>t.has(e)?Ne(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Ye=(e,t,n,r)=>(Ge(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Xe=(e,t,n)=>(Ge(e,t,`access private method`),n);function Ze(e,t){if(t){let n;return ve(()=>{let r=e();return r&&n&&t(n,r)?n:(n=r,r)})}return ve(e)}function Qe(e,t){if(Object.is(e,t))return!0;if(e===null||t===null)return!1;if(typeof e==`function`&&typeof t==`function`)return e===t;if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:!e.some((e,n)=>!Qe(e,t[n]));if(typeof e==`object`&&typeof t==`object`){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&!n.some(n=>!Qe(e[n],t[n]))}return!1}function L({get:e},t){return{init(e){return pe(e)},get(){return e.call(this).value},set(t){let n=e.call(this);n.peek()!==t&&(n.value=t)}}}function R(e,t){let n=new WeakMap;return function(){let t=n.get(this);return t||(t=Ze(e.bind(this)),n.set(this,t)),t.value}}function $e(e=!0){return function(t,n){n.addInitializer(function(){let t=n.kind===`field`||n.static?this:Object.getPrototypeOf(this),r=Object.getOwnPropertyDescriptor(t,n.name);r&&Object.defineProperty(t,n.name,Ie(Fe({},r),{enumerable:e}))})}}function et(...e){let t=e.map(e=>Ce(e));return()=>t.forEach(e=>e())}var tt,nt,rt,it,at,ot=[L],st,ct,lt,ut,dt,z,ft,pt,mt,ht,gt,_t,vt,yt;at=[L],it=[L],rt=[$e()],nt=[$e()],tt=[$e()];var bt=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,Ue(st,5,this),Je(this,z),Je(this,ct,Ue(st,8,this)),Ue(st,11,this),Je(this,ft,Ue(st,12,this)),Ue(st,15,this),Je(this,gt,Ue(st,16,this)),Ue(st,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return qe(this,z,vt)}get initial(){return qe(this,z,ut)}get previous(){return qe(this,z,mt)}set current(e){let t=P(()=>qe(this,z,vt));e&&t&&this.equals(t,e)||M(()=>{qe(this,z,ut)||Ye(this,z,e,dt),Ye(this,z,t,ht),Ye(this,z,e,yt)})}reset(e=this.defaultValue){M(()=>{Ye(this,z,void 0,ht),Ye(this,z,e,dt),Ye(this,z,e,yt)})}};st=Re(null),ct=new WeakMap,z=new WeakSet,ft=new WeakMap,gt=new WeakMap,lt=We(st,20,`#initial`,ot,z,ct),ut=lt.get,dt=lt.set,pt=We(st,20,`#previous`,at,z,ft),mt=pt.get,ht=pt.set,_t=We(st,20,`#current`,it,z,gt),vt=_t.get,yt=_t.set,We(st,2,`current`,rt,bt),We(st,2,`initial`,nt,bt),We(st,2,`previous`,tt,bt),He(st,bt);function xt(e){return P(()=>{let t={};for(let n in e)t[n]=e[n];return t})}var St,Ct=class{constructor(){Je(this,St,new WeakMap)}get(e,t){return e?qe(this,St).get(e)?.get(t):void 0}set(e,t,n){if(e)return qe(this,St).has(e)||qe(this,St).set(e,new Map),qe(this,St).get(e)?.set(t,n)}clear(e){return e?qe(this,St).get(e)?.clear():void 0}};St=new WeakMap;var wt=Object.create,Tt=Object.defineProperty,Et=Object.getOwnPropertyDescriptor,Dt=Object.getOwnPropertySymbols,Ot=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable,At=(e,t)=>(t=Symbol[e])?t:Symbol.for(`Symbol.`+e),jt=e=>{throw TypeError(e)},Mt=Math.pow,Nt=(e,t,n)=>t in e?Tt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pt=(e,t)=>{for(var n in t||={})Ot.call(t,n)&&Nt(e,n,t[n]);if(Dt)for(var n of Dt(t))kt.call(t,n)&&Nt(e,n,t[n]);return e},Ft=(e,t)=>Tt(e,`name`,{value:t,configurable:!0}),It=e=>[,,,wt(e?.[At(`metadata`)]??null)],Lt=[`class`,`method`,`getter`,`setter`,`accessor`,`field`,`value`,`get`,`set`],Rt=e=>e!==void 0&&typeof e!=`function`?jt(`Function expected`):e,zt=(e,t,n,r,i)=>({kind:Lt[e],name:t,metadata:r,addInitializer:e=>n._?jt(`Already initialized`):i.push(Rt(e||null))}),Bt=(e,t)=>Nt(t,At(`metadata`),e[3]),Vt=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r},Ht=(e,t,n,r,i,a)=>{var o,s,c,l,u,d=t&7,f=!!(t&8),p=!!(t&16),m=d>3?e.length+1:d?f?1:2:0,h=Lt[d+5],g=d>3&&(e[m-1]=[]),_=e[m]||(e[m]=[]),v=d&&(!p&&!f&&(i=i.prototype),d<5&&(d>3||!p)&&Et(d<4?i:{get[n](){return Gt(this,a)},set[n](e){return qt(this,a,e)}},n));d?p&&d<4&&Ft(a,(d>2?`set `:d>1?`get `:``)+n):Ft(i,n);for(var y=r.length-1;y>=0;y--)l=zt(d,n,c={},e[3],_),d&&(l.static=f,l.private=p,u=l.access={has:p?e=>Wt(i,e):e=>n in e},d^3&&(u.get=p?e=>(d^1?Gt:Jt)(e,i,d^4?a:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>qt(e,i,t,d^4?a:v.set):(e,t)=>e[n]=t)),s=(0,r[y])(d?d<4?p?a:v[h]:d>4?void 0:{get:v.get,set:v.set}:i,l),c._=1,d^4||s===void 0?Rt(s)&&(d>4?g.unshift(s):d?p?a=s:v[h]=s:i=s):typeof s!=`object`||!s?jt(`Object expected`):(Rt(o=s.get)&&(v.get=o),Rt(o=s.set)&&(v.set=o),Rt(o=s.init)&&g.unshift(o));return d||Bt(e,i),v&&Tt(i,n,v),p?d^4?a:v:i},Ut=(e,t,n)=>t.has(e)||jt(`Cannot `+n),Wt=(e,t)=>Object(t)===t?e.has(t):jt(`Cannot use the "in" operator on this value`),Gt=(e,t,n)=>(Ut(e,t,`read from private field`),n?n.call(e):t.get(e)),Kt=(e,t,n)=>t.has(e)?jt(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),qt=(e,t,n,r)=>(Ut(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Jt=(e,t,n)=>(Ut(e,t,`access private method`),n),Yt=class e{constructor(e,t){this.x=e,this.y=t}static delta(t,n){return new e(t.x-n.x,t.y-n.y)}static distance(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}static equals(e,t){return e.x===t.x&&e.y===t.y}static from({x:t,y:n}){return new e(t,n)}},Xt=class e{constructor(e,t,n,r){this.left=e,this.top=t,this.width=n,this.height=r,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(t,n){let{top:r,left:i,width:a,height:o,scale:s}=this,c=new e(i+t,r+n,a,o);return c.scale=Pt({},s),c}get boundingRectangle(){let{width:e,height:t,left:n,top:r,right:i,bottom:a}=this;return{width:e,height:t,left:n,top:r,right:i,bottom:a}}get center(){let{left:e,top:t,right:n,bottom:r}=this;return new Yt((e+n)/2,(t+r)/2)}get area(){let{width:e,height:t}=this;return e*t}equals(t){if(!(t instanceof e))return!1;let{left:n,top:r,width:i,height:a}=this;return n===t.left&&r===t.top&&i===t.width&&a===t.height}containsPoint(e){let{top:t,left:n,bottom:r,right:i}=this;return t<=e.y&&e.y<=r&&n<=e.x&&e.x<=i}intersectionArea(t){return t instanceof e?Zt(this,t):0}intersectionRatio(e){let{area:t}=this,n=this.intersectionArea(e);return n/(e.area+t-n)}get bottom(){let{top:e,height:t}=this;return e+t}get right(){let{left:e,width:t}=this;return e+t}get aspectRatio(){let{width:e,height:t}=this;return e/t}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:t,left:n,width:r,height:i}){return new e(n,t,r,i)}static delta(e,t,n={x:`center`,y:`center`}){let r=(e,t)=>{let r=n[t],i=t===`x`?e.left:e.top,a=t===`x`?e.width:e.height;return r==`start`?i:r==`end`?i+a:i+a/2};return Yt.delta({x:r(e,`x`),y:r(e,`y`)},{x:r(t,`x`),y:r(t,`y`)})}static intersectionRatio(t,n){return e.from(t).intersectionRatio(e.from(n))}};function Zt(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;return r<i&&n<a?o*s:0}var Qt,$t,en,tn,nn,rn=class extends (en=bt,$t=[R],Qt=[R],en){constructor(e){let t=Yt.from(e);super(t,(e,t)=>Yt.equals(e,t)),Vt(nn,5,this),Kt(this,tn,0),this.velocity={x:0,y:0}}get delta(){return Yt.delta(this.current,this.initial)}get direction(){let{current:e,previous:t}=this;if(!t)return null;let n={x:e.x-t.x,y:e.y-t.y};return!n.x&&!n.y?null:Math.abs(n.x)>Math.abs(n.y)?n.x>0?`right`:`left`:n.y>0?`down`:`up`}get current(){return super.current}set current(e){let{current:t}=this,n=Yt.from(e),r={x:n.x-t.x,y:n.y-t.y},i=Date.now(),a=i-Gt(this,tn),o=e=>Math.round(e/a*100);M(()=>{qt(this,tn,i),this.velocity={x:o(r.x),y:o(r.y)},super.current=n})}reset(e=this.defaultValue){super.reset(Yt.from(e)),this.velocity={x:0,y:0}}};nn=It(en),tn=new WeakMap,Ht(nn,2,`delta`,$t,rn),Ht(nn,2,`direction`,Qt,rn),Bt(nn,rn);function an({x:e,y:t},n){let r=Math.abs(e),i=Math.abs(t);return typeof n==`number`?Math.sqrt(Mt(r,2)+Mt(i,2))>n:`x`in n&&`y`in n?r>n.x&&i>n.y:`x`in n?r>n.x:`y`in n&&i>n.y}var on=(e=>(e.Horizontal=`x`,e.Vertical=`y`,e))(on||{}),sn=Object.values(on),cn=Object.create,ln=Object.defineProperty,un=Object.defineProperties,dn=Object.getOwnPropertyDescriptor,fn=Object.getOwnPropertyDescriptors,pn=Object.getOwnPropertySymbols,mn=Object.prototype.hasOwnProperty,hn=Object.prototype.propertyIsEnumerable,gn=(e,t)=>(t=Symbol[e])?t:Symbol.for(`Symbol.`+e),_n=e=>{throw TypeError(e)},vn=(e,t,n)=>t in e?ln(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yn=(e,t)=>{for(var n in t||={})mn.call(t,n)&&vn(e,n,t[n]);if(pn)for(var n of pn(t))hn.call(t,n)&&vn(e,n,t[n]);return e},bn=(e,t)=>un(e,fn(t)),xn=(e,t)=>ln(e,`name`,{value:t,configurable:!0}),Sn=(e,t)=>{var n={};for(var r in e)mn.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&pn)for(var r of pn(e))t.indexOf(r)<0&&hn.call(e,r)&&(n[r]=e[r]);return n},Cn=e=>[,,,cn(e?.[gn(`metadata`)]??null)],wn=[`class`,`method`,`getter`,`setter`,`accessor`,`field`,`value`,`get`,`set`],Tn=e=>e!==void 0&&typeof e!=`function`?_n(`Function expected`):e,En=(e,t,n,r,i)=>({kind:wn[e],name:t,metadata:r,addInitializer:e=>n._?_n(`Already initialized`):i.push(Tn(e||null))}),Dn=(e,t)=>vn(t,gn(`metadata`),e[3]),B=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r},V=(e,t,n,r,i,a)=>{var o,s,c,l,u,d=t&7,f=!!(t&8),p=!!(t&16),m=d>3?e.length+1:d?f?1:2:0,h=wn[d+5],g=d>3&&(e[m-1]=[]),_=e[m]||(e[m]=[]),v=d&&(!p&&!f&&(i=i.prototype),d<5&&(d>3||!p)&&dn(d<4?i:{get[n](){return H(this,a)},set[n](e){return An(this,a,e)}},n));d?p&&d<4&&xn(a,(d>2?`set `:d>1?`get `:``)+n):xn(i,n);for(var y=r.length-1;y>=0;y--)l=En(d,n,c={},e[3],_),d&&(l.static=f,l.private=p,u=l.access={has:p?e=>kn(i,e):e=>n in e},d^3&&(u.get=p?e=>(d^1?H:jn)(e,i,d^4?a:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>An(e,i,t,d^4?a:v.set):(e,t)=>e[n]=t)),s=(0,r[y])(d?d<4?p?a:v[h]:d>4?void 0:{get:v.get,set:v.set}:i,l),c._=1,d^4||s===void 0?Tn(s)&&(d>4?g.unshift(s):d?p?a=s:v[h]=s:i=s):typeof s!=`object`||!s?_n(`Object expected`):(Tn(o=s.get)&&(v.get=o),Tn(o=s.set)&&(v.set=o),Tn(o=s.init)&&g.unshift(o));return d||Dn(e,i),v&&ln(i,n,v),p?d^4?a:v:i},On=(e,t,n)=>t.has(e)||_n(`Cannot `+n),kn=(e,t)=>Object(t)===t?e.has(t):_n(`Cannot use the "in" operator on this value`),H=(e,t,n)=>(On(e,t,`read from private field`),n?n.call(e):t.get(e)),U=(e,t,n)=>t.has(e)?_n(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),An=(e,t,n,r)=>(On(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),jn=(e,t,n)=>(On(e,t,`access private method`),n);function Mn(e,t){return{plugin:e,options:t}}function Nn(e){return t=>Mn(e,t)}function Pn(e){return typeof e==`function`?{plugin:e,options:void 0}:e}var Fn=[L],In,Ln,Rn,W=class{constructor(e,t){this.manager=e,this.options=t,U(this,Ln,B(In,8,this,!1)),B(In,11,this),U(this,Rn,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return P(()=>this.disabled)}configure(e){this.options=e}registerEffect(e){let t=Ce(e.bind(this));return H(this,Rn).add(t),t}destroy(){H(this,Rn).forEach(e=>e())}static configure(e){return Mn(this,e)}};In=Cn(null),Ln=new WeakMap,Rn=new WeakMap,V(In,4,`disabled`,Fn,W,Ln),Dn(In,W);var zn=class extends W{},Bn,Vn=class{constructor(e){this.manager=e,this.instances=new Map,U(this,Bn,[])}get values(){return Array.from(this.instances.values())}set values(e){let t=e.map(Pn).reduce((e,t)=>{let n=e.find(({plugin:e})=>e===t.plugin);return n?(n.options=t.options,e):[...e,t]},[]),n=t.map(({plugin:e})=>e);for(let e of H(this,Bn))if(!n.includes(e)){if(e.prototype instanceof zn)continue;this.unregister(e)}for(let{plugin:e,options:n}of t)this.register(e,n);An(this,Bn,n)}get(e){return this.instances.get(e)}register(e,t){let n=this.instances.get(e);if(n)return n.options!==t&&(n.options=t),n;let r=new e(this.manager,t);return this.instances.set(e,r),r}unregister(e){let t=this.instances.get(e);t&&(t.destroy(),this.instances.delete(e))}destroy(){for(let e of this.instances.values())e.destroy();this.instances.clear()}};Bn=new WeakMap;function Hn(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}var Un=[],Wn,Gn,Kn=class extends W{constructor(e){super(e),U(this,Wn),U(this,Gn),this.computeCollisions=this.computeCollisions.bind(this),An(this,Gn,pe(Un)),this.destroy=et(()=>{let e=this.computeCollisions(),t=P(()=>this.manager.dragOperation.position.current);if(e!==Un){let e=H(this,Wn);if(An(this,Wn,t),e&&t.x==e.x&&t.y==e.y)return}else An(this,Wn,void 0);H(this,Gn).value=e},()=>{let{dragOperation:e}=this.manager;e.status.initialized&&this.forceUpdate()})}forceUpdate(e=!0){P(()=>{e?H(this,Gn).value=this.computeCollisions():An(this,Wn,void 0)})}computeCollisions(e,t){let{registry:n,dragOperation:r}=this.manager,{source:i,shape:a,status:o}=r;if(!o.initialized||!a)return Un;let s=[],c=[];for(let a of e??n.droppables){if(a.disabled||i&&!a.accepts(i))continue;let e=t??a.collisionDetector;if(!e)continue;c.push(a),a.shape;let n=P(()=>e({droppable:a,dragOperation:r}));n&&(a.collisionPriority!=null&&(n.priority=a.collisionPriority),s.push(n))}return c.length===0?Un:(s.sort(Hn),s)}get collisions(){return H(this,Gn).value}};Wn=new WeakMap,Gn=new WeakMap;var qn,Jn,Yn=[L],Xn,Zn,Qn,$n,er,tr,nr;Jn=[L],qn=[L];var rr=class e{constructor(e,t){U(this,$n,B(Qn,8,this)),B(Qn,11,this),U(this,er),U(this,tr,B(Qn,12,this)),B(Qn,15,this),U(this,nr,B(Qn,16,this)),B(Qn,19,this);let{effects:n,id:r,data:i={},disabled:a=!1,register:o=!0}=e,s=r;An(this,er,pe(r)),this.manager=t,this.data=i,this.disabled=a,this.effects=()=>[()=>{let{id:e,manager:t}=this;if(e!==s)return s=e,t?.registry.register(this),()=>t?.registry.unregister(this)},...n?.()??[]],this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),t&&o&&queueMicrotask(this.register)}get id(){let t=H(this,er).value;return e.pendingIdChanges?.get(this)??t}set id(t){t!==(e.pendingIdChanges?.get(this)??H(this,er).peek())&&(e.pendingIdChanges||(e.pendingIdChanges=new Map,queueMicrotask(()=>{var t;return jn(t=e,Xn,Zn).call(t)})),e.pendingIdChanges.set(this,t))}register(){return this.manager?.registry.register(this)}unregister(){var e;(e=this.manager)==null||e.registry.unregister(this)}destroy(){var e;(e=this.manager)==null||e.registry.unregister(this)}};Qn=Cn(null),Xn=new WeakSet,Zn=function(){let e=rr.pendingIdChanges;rr.pendingIdChanges=null,e&&M(()=>{for(let[t,n]of e)H(t,er).value=n})},$n=new WeakMap,er=new WeakMap,tr=new WeakMap,nr=new WeakMap,V(Qn,4,`manager`,Yn,rr,$n),V(Qn,4,`data`,Jn,rr,tr),V(Qn,4,`disabled`,qn,rr,nr),U(rr,Xn),Dn(Qn,rr),rr.pendingIdChanges=null;var ir=rr,ar=class{constructor(){this.map=pe(new Map),this.cleanupFunctions=new WeakMap,this.register=(e,t)=>{let n=this.map.peek(),r=n.get(e),i=()=>this.unregister(e,t);if(r===t)return i;r&&r.id===e&&(this.cleanupFunctions.get(r)?.(),this.cleanupFunctions.delete(r));let a=new Map(n);for(let[r,i]of n)if(i===t&&r!==e){a.delete(r);break}a.set(e,t),this.map.value=a;let o=et(...t.effects());return this.cleanupFunctions.set(t,o),i},this.unregister=(e,t)=>{let n=this.map.peek();if(n.get(e)!==t)return;this.cleanupFunctions.get(t)?.(),this.cleanupFunctions.delete(t);let r=new Map(n);r.delete(e),this.map.value=r}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(e){return this.map.value.has(e)}get(e){return this.map.value.get(e)}destroy(){for(let e of this)this.cleanupFunctions.get(e)?.(),e.destroy();this.map.value=new Map}},or,sr,cr,lr,ur,dr,fr,pr,mr,hr,gr,_r=class extends (fr=ir,dr=[L],ur=[L],lr=[L],cr=[R],sr=[R],or=[R],fr){constructor(e,t){var n=e,{modifiers:r,type:i,sensors:a,plugins:o,effects:s}=n,c=Sn(n,[`modifiers`,`type`,`sensors`,`plugins`,`effects`]);super(bn(yn({},c),{effects:()=>[...s?.()??[],()=>{let{manager:e,plugins:t}=this;if(e&&t)for(let n of t){let{plugin:t}=Pn(n);e.registry.plugins.register(t)}}]}),t),B(pr,5,this),U(this,mr,B(pr,8,this)),B(pr,11,this),U(this,hr,B(pr,12,this)),B(pr,15,this),U(this,gr,B(pr,16,this,this.isDragSource?`dragging`:`idle`)),B(pr,19,this),this.type=i,this.sensors=a,this.modifiers=r,this.alignment=c.alignment,this.plugins=o}pluginConfig(e){if(this.plugins)for(let t of this.plugins){let n=Pn(t);if(n.plugin===e)return n.options}}get isDropping(){return this.status===`dropping`&&this.isDragSource}get isDragging(){return this.status===`dragging`&&this.isDragSource}get isDragSource(){return this.manager?.dragOperation.source?.id===this.id}};pr=Cn(fr),mr=new WeakMap,hr=new WeakMap,gr=new WeakMap,V(pr,4,`type`,dr,_r,mr),V(pr,4,`modifiers`,ur,_r,hr),V(pr,4,`status`,lr,_r,gr),V(pr,2,`isDropping`,cr,_r),V(pr,2,`isDragging`,sr,_r),V(pr,2,`isDragSource`,or,_r),Dn(pr,_r);var vr,yr,br,xr,Sr,Cr,wr,G,Tr,Er,Dr,Or,kr,Ar=class extends (wr=ir,Cr=[L],Sr=[L],xr=[L],br=[L],yr=[L],vr=[R],wr){constructor(e,t){var n=e,{accept:r,collisionDetector:i,collisionPriority:a,type:o}=n,s=Sn(n,[`accept`,`collisionDetector`,`collisionPriority`,`type`]);super(s,t),B(G,5,this),U(this,Tr,B(G,8,this)),B(G,11,this),U(this,Er,B(G,12,this)),B(G,15,this),U(this,Dr,B(G,16,this)),B(G,19,this),U(this,Or,B(G,20,this)),B(G,23,this),U(this,kr,B(G,24,this)),B(G,27,this),this.accept=r,this.collisionDetector=i,this.collisionPriority=a,this.type=o}accepts(e){let{accept:t}=this;return t?typeof t==`function`?t(e):e.type?Array.isArray(t)?t.includes(e.type):e.type===t:!1:!0}get isDropTarget(){return this.manager?.dragOperation.target?.id===this.id}};G=Cn(wr),Tr=new WeakMap,Er=new WeakMap,Dr=new WeakMap,Or=new WeakMap,kr=new WeakMap,V(G,4,`accept`,Cr,Ar,Tr),V(G,4,`type`,Sr,Ar,Er),V(G,4,`collisionDetector`,xr,Ar,Dr),V(G,4,`collisionPriority`,br,Ar,Or),V(G,4,`shape`,yr,Ar,kr),V(G,2,`isDropTarget`,vr,Ar),Dn(G,Ar);var jr=class{constructor(){this.registry=new Map}addEventListener(e,t){let{registry:n}=this,r=new Set(n.get(e));return r.add(t),n.set(e,r),()=>this.removeEventListener(e,t)}removeEventListener(e,t){let{registry:n}=this,r=new Set(n.get(e));r.delete(t),n.set(e,r)}dispatch(e,...t){let{registry:n}=this,r=n.get(e);if(r)for(let e of r)e(...t)}},Mr=class extends jr{constructor(e){super(),this.manager=e}dispatch(e,t){let n=[t,this.manager];super.dispatch(e,...n)}};function Nr(e,t=!0){let n=!1;return bn(yn({},e),{cancelable:t,get defaultPrevented(){return n},preventDefault(){t&&(n=!0)}})}var Pr=class extends zn{constructor(e){super(e);let t=(e,t)=>e.map(({id:e})=>e).join(``)===t.map(({id:e})=>e).join(``),n=[];this.destroy=et(()=>{let{dragOperation:t,collisionObserver:r}=e;t.status.initializing&&(n=[],r.enable())},()=>{let{collisionObserver:r,monitor:i}=e,{collisions:a}=r;if(r.isDisabled()||ir.pendingIdChanges)return;let o=Nr({collisions:a});if(i.dispatch(`collision`,o),o.defaultPrevented||t(a,n))return;n=a;let[s]=a;P(()=>{s?.id!==e.dragOperation.target?.id&&(r.disable(),e.actions.setDropTarget(s?.id).then(()=>{r.enable()}))})})}},Fr=(e=>(e[e.Lowest=0]=`Lowest`,e[e.Low=1]=`Low`,e[e.Normal=2]=`Normal`,e[e.High=3]=`High`,e[e.Highest=4]=`Highest`,e))(Fr||{}),Ir=(e=>(e[e.Collision=0]=`Collision`,e[e.ShapeIntersection=1]=`ShapeIntersection`,e[e.PointerIntersection=2]=`PointerIntersection`,e))(Ir||{}),Lr,Rr,zr,Br,Vr,Hr,Ur=[L],Wr,Gr;Hr=[R],Vr=[R],Br=[R],zr=[R],Rr=[R],Lr=[R];var Kr=class{constructor(){B(Wr,5,this),U(this,Gr,B(Wr,8,this,`idle`)),B(Wr,11,this)}get current(){return this.value}get idle(){return this.value===`idle`}get initializing(){return this.value===`initializing`}get initialized(){let{value:e}=this;return e!==`idle`&&e!==`initialization-pending`}get dragging(){return this.value===`dragging`}get dropped(){return this.value===`dropped`}set(e){this.value=e}};Wr=Cn(null),Gr=new WeakMap,V(Wr,4,`value`,Ur,Kr,Gr),V(Wr,2,`current`,Hr,Kr),V(Wr,2,`idle`,Vr,Kr),V(Wr,2,`initializing`,Br,Kr),V(Wr,2,`initialized`,zr,Kr),V(Wr,2,`dragging`,Rr,Kr),V(Wr,2,`dropped`,Lr,Kr),Dn(Wr,Kr);var qr=class{constructor(e){this.manager=e}setDragSource(e){let{dragOperation:t}=this.manager;t.sourceIdentifier=typeof e==`string`||typeof e==`number`?e:e.id}setDropTarget(e){return P(()=>{let{dragOperation:t}=this.manager,n=e??null;if(t.targetIdentifier===n)return Promise.resolve(!1);t.targetIdentifier=n;let r=Nr({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch(`dragover`,r),this.manager.renderer.rendering.then(()=>r.defaultPrevented)})}start(e){return P(()=>{let{dragOperation:t}=this.manager;if(e.source!=null&&this.setDragSource(e.source),!t.source)throw Error(`Cannot start a drag operation without a drag source`);if(!t.status.idle)throw Error(`Cannot start a drag operation while another is active`);let n=new AbortController,{event:r,coordinates:i}=e;M(()=>{t.status.set(`initialization-pending`),t.shape=null,t.canceled=!1,t.activatorEvent=r??null,t.position.reset(i)});let a=Nr({operation:t.snapshot()});return this.manager.monitor.dispatch(`beforedragstart`,a),a.defaultPrevented?(t.reset(),n.abort(),n):(t.status.set(`initializing`),t.controller=n,this.manager.renderer.rendering.then(()=>{if(n.signal.aborted)return;let{status:e}=t;e.current===`initializing`&&M(()=>{t.status.set(`dragging`),this.manager.monitor.dispatch(`dragstart`,{nativeEvent:r,operation:t.snapshot(),cancelable:!1})})}),n)})}move(e){return P(()=>{let{dragOperation:t}=this.manager,{status:n,controller:r}=t;if(!n.dragging||!r||r.signal.aborted)return;let i=Nr({nativeEvent:e.event,operation:t.snapshot(),by:e.by,to:e.to},e.cancelable??!0);(e.propagate??!0)&&this.manager.monitor.dispatch(`dragmove`,i),queueMicrotask(()=>{if(i.defaultPrevented)return;let n=e.to??{x:t.position.current.x+(e.by?.x??0),y:t.position.current.y+(e.by?.y??0)};t.position.current=n})})}stop(e={}){return P(()=>{let{dragOperation:t}=this.manager,{controller:n}=t;if(!n||n.signal.aborted)return;let r,i=()=>{let e={resume:()=>{},abort:()=>{}};return r=new Promise((t,n)=>{e.resume=t,e.abort=n}),e};n.abort();let a=()=>{this.manager.renderer.rendering.then(()=>{t.status.set(`dropped`);let e=P(()=>t.source?.status===`dropping`),r=()=>{t.controller===n&&(t.controller=void 0),t.reset()};if(e){let{source:e}=t,n=Ce(()=>{e?.status===`idle`&&(n(),r())})}else this.manager.renderer.rendering.then(r)})};t.canceled=e.canceled??!1,this.manager.monitor.dispatch(`dragend`,{nativeEvent:e.event,operation:t.snapshot(),canceled:e.canceled??!1,suspend:i}),r?r.then(a).catch(()=>t.reset()):a()})}},Jr=class extends W{constructor(e,t){super(e,t),this.manager=e,this.options=t}},Yr=class extends AbortController{constructor(e,t){super(),this.constraints=e,this.onActivate=t,this.activated=!1;for(let t of e??[])t.controller=this}onEvent(e){if(!this.activated){if(this.constraints?.length)for(let t of this.constraints)t.onEvent(e);else this.activate(e)}}activate(e){this.activated||(this.activated=!0,this.onActivate(e))}abort(e){this.activated=!1,super.abort(e)}},Xr,Zr=class{constructor(e){this.options=e,U(this,Xr)}set controller(e){An(this,Xr,e),e.signal.addEventListener(`abort`,()=>this.abort())}activate(e){var t;(t=H(this,Xr))==null||t.activate(e)}};Xr=new WeakMap;var Qr=class extends W{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},$r=class{constructor(e){this.draggables=new ar,this.droppables=new ar,this.plugins=new Vn(e),this.sensors=new Vn(e),this.modifiers=new Vn(e)}register(e,t){if(e instanceof _r)return this.draggables.register(e.id,e);if(e instanceof Ar)return this.droppables.register(e.id,e);if(e.prototype instanceof Qr)return this.modifiers.register(e,t);if(e.prototype instanceof Jr)return this.sensors.register(e,t);if(e.prototype instanceof W)return this.plugins.register(e,t);throw Error(`Invalid instance type`)}unregister(e){if(e instanceof ir)return e instanceof _r?this.draggables.unregister(e.id,e):e instanceof Ar?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof Qr)return this.modifiers.unregister(e);if(e.prototype instanceof Jr)return this.sensors.unregister(e);if(e.prototype instanceof W)return this.plugins.unregister(e);throw Error(`Invalid instance type`)}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}},ei,ti,ni,ri,ii,ai,oi,si,ci=[R],li,ui,di,K,fi,pi,mi,hi,gi,_i;si=[L],oi=[L],ai=[L],ii=[L],ri=[L],ni=[R],ti=[R],ei=[R];var vi=class{constructor(e){B(K,5,this),U(this,li),U(this,ui),U(this,di,new bt(void 0,(e,t)=>e&&t?e.equals(t):e===t)),this.status=new Kr,U(this,fi,B(K,8,this,!1)),B(K,11,this),U(this,pi,B(K,12,this,null)),B(K,15,this),U(this,mi,B(K,16,this,null)),B(K,19,this),U(this,hi,B(K,20,this,null)),B(K,23,this),U(this,gi,B(K,24,this,[])),B(K,27,this),this.position=new rn({x:0,y:0}),U(this,_i,{x:0,y:0}),An(this,li,e)}get shape(){let{current:e,initial:t,previous:n}=H(this,di);return!e||!t?null:{current:e,initial:t,previous:n}}set shape(e){e?H(this,di).current=e:H(this,di).reset()}get source(){let e=this.sourceIdentifier;if(e==null)return null;let t=H(this,li).registry.draggables.get(e);return t&&An(this,ui,t),t??H(this,ui)??null}get target(){let e=this.targetIdentifier;return e==null?null:H(this,li).registry.droppables.get(e)??null}get transform(){let{x:e,y:t}=this.position.delta,n={x:e,y:t};for(let e of this.modifiers)n=e.apply(bn(yn({},this.snapshot()),{transform:n}));return An(this,_i,n),n}snapshot(){return P(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:H(this,_i),shape:this.shape?xt(this.shape):null,position:xt(this.position),status:xt(this.status),canceled:this.canceled}))}reset(){M(()=>{this.status.set(`idle`),this.sourceIdentifier=null,this.targetIdentifier=null,H(this,di).reset(),this.position.reset({x:0,y:0}),An(this,_i,{x:0,y:0}),this.modifiers=[]})}};K=Cn(null),li=new WeakMap,ui=new WeakMap,di=new WeakMap,fi=new WeakMap,pi=new WeakMap,mi=new WeakMap,hi=new WeakMap,gi=new WeakMap,_i=new WeakMap,V(K,2,`shape`,ci,vi),V(K,4,`canceled`,si,vi,fi),V(K,4,`activatorEvent`,oi,vi,pi),V(K,4,`sourceIdentifier`,ai,vi,mi),V(K,4,`targetIdentifier`,ii,vi,hi),V(K,4,`modifiers`,ri,vi,gi),V(K,2,`source`,ni,vi),V(K,2,`target`,ti,vi),V(K,2,`transform`,ei,vi),Dn(K,vi);var yi={get rendering(){return Promise.resolve()}};function bi(e,t){return typeof e==`function`?e(t):e??t}var xi=class{constructor(e){this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach(e=>e.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};let t=e??{},n=bi(t.plugins,[]),r=bi(t.sensors,[]),i=bi(t.modifiers,[]),a=t.renderer??yi,o=new Mr(this),s=new $r(this);this.registry=s,this.monitor=o,this.renderer=a,this.actions=new qr(this),this.dragOperation=new vi(this),this.collisionObserver=new Kn(this),this.plugins=[Pr,...n],this.modifiers=i,this.sensors=r;let{destroy:c}=this,l=et(()=>{let e=P(()=>this.dragOperation.modifiers),t=this.modifiers;for(let n of e)t.includes(n)||n.destroy();this.dragOperation.modifiers=(this.dragOperation.source?.modifiers)?.map(e=>{let{plugin:t,options:n}=Pn(e);return new t(this,n)})??t});this.destroy=()=>{l(),c()}}get plugins(){return this.registry.plugins.values}set plugins(e){this.registry.plugins.values=e}get modifiers(){return this.registry.modifiers.values}set modifiers(e){this.registry.modifiers.values=e}get sensors(){return this.registry.sensors.values}set sensors(e){this.registry.sensors.values=e}},Si=e=>{throw TypeError(e)},Ci=(e,t,n)=>t.has(e)||Si(`Cannot `+n),q=(e,t,n)=>(Ci(e,t,`read from private field`),t.get(e)),wi=(e,t,n)=>t.has(e)?Si(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Ti=(e,t,n,r)=>(Ci(e,t,`write to private field`),t.set(e,n),n),Ei=(e,t,n)=>(Ci(e,t,`access private method`),n);function Di(e){return e?e instanceof KeyframeEffect||`getKeyframes`in e&&typeof e.getKeyframes==`function`:!1}function Oi(e,t){let n=e.getAnimations(),r=null;for(let e of n){if(e.playState!==`running`)continue;let{effect:n}=e,i=(Di(n)?n.getKeyframes():[]).filter(t);i.length>0&&(r=[i[i.length-1],e])}return r}function ki(e){let{width:t,height:n,top:r,left:i,bottom:a,right:o}=e.getBoundingClientRect();return{width:t,height:n,top:r,left:i,bottom:a,right:o}}function Ai(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function ji(e){return`nodeType`in e}function Mi(e){return e?Ai(e)?e:ji(e)?`defaultView`in e?e.defaultView??window:e.ownerDocument?.defaultView??window:window:window}function Ni(e){let{Document:t}=Mi(e);return e instanceof t||`nodeType`in e&&e.nodeType===Node.DOCUMENT_NODE}function Pi(e){return!e||Ai(e)?!1:e instanceof Mi(e).HTMLElement||`namespaceURI`in e&&typeof e.namespaceURI==`string`&&e.namespaceURI.endsWith(`html`)}function Fi(e){return e instanceof Mi(e).SVGElement||`namespaceURI`in e&&typeof e.namespaceURI==`string`&&e.namespaceURI.endsWith(`svg`)}function Ii(e){return e?Ai(e)?e.document:ji(e)?Ni(e)?e:Pi(e)||Fi(e)?e.ownerDocument:document:document:document}function Li(e){let{documentElement:t}=Ii(e),n=Mi(e).visualViewport,r=n?.width??t.clientWidth,i=n?.height??t.clientHeight,a=n?.offsetTop??0,o=n?.offsetLeft??0;return{top:a,left:o,right:o+r,bottom:a+i,width:r,height:i}}function Ri(e,t){if(zi(e)&&e.open===!1)return!1;let{overflow:n,overflowX:r,overflowY:i}=getComputedStyle(e);return n===`visible`&&r===`visible`&&i===`visible`}function zi(e){return e.tagName===`DETAILS`}function Bi(e,t=e.getBoundingClientRect(),n=0){let r=t,{ownerDocument:i}=e,a=i.defaultView??window,o=e.parentElement;for(;o&&o!==i.documentElement;){if(!Ri(o)){let e=o.getBoundingClientRect(),t=n*(e.bottom-e.top),i=n*(e.right-e.left),a=n*(e.bottom-e.top),s=n*(e.right-e.left);r={top:Math.max(r.top,e.top-t),right:Math.min(r.right,e.right+i),bottom:Math.min(r.bottom,e.bottom+a),left:Math.max(r.left,e.left-s),width:0,height:0},r.width=r.right-r.left,r.height=r.bottom-r.top}o=o.parentElement}let s=a.visualViewport,c=s?.offsetTop??0,l=s?.offsetLeft??0,u=s?.width??a.innerWidth,d=s?.height??a.innerHeight,f=n*d,p=n*u;return r={top:Math.max(r.top,c-f),right:Math.min(r.right,l+u+p),bottom:Math.min(r.bottom,c+d+f),left:Math.max(r.left,l-p),width:0,height:0},r.width=r.right-r.left,r.height=r.bottom-r.top,r.width<0&&(r.width=0),r.height<0&&(r.height=0),r}function Vi(e){return{x:e.clientX,y:e.clientY}}var Hi=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ui(e=document,t=new Set){if(t.has(e))return[];t.add(e);let n=[e];for(let r of Array.from(e.querySelectorAll(`iframe, frame`)))try{let e=r.contentDocument;e&&!t.has(e)&&n.push(...Ui(e,t))}catch{}try{let r=e.defaultView;if(r&&r!==window.top){let i=r.parent;i&&i.document&&i.document!==e&&n.push(...Ui(i.document,t))}}catch{}return n}function Wi(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Gi(){let e=Wi()?window.visualViewport:null;return{x:e?.offsetLeft??0,y:e?.offsetTop??0}}function Ki(e){return!e||!ji(e)?!1:e instanceof Mi(e).ShadowRoot}function qi(e){if(e&&ji(e)){let t=e.getRootNode();if(Ki(t)||t instanceof Document)return t}return Ii(e)}function Ji(e){return e.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Yi(e){let t=`input, textarea, select, canvas, [contenteditable]`,n=e.cloneNode(!0),r=Array.from(e.querySelectorAll(t));return Array.from(n.querySelectorAll(t)).forEach((e,t)=>{let n=r[t];Xi(e)&&Xi(n)&&(e.type!==`file`&&(e.value=n.value),e.type===`radio`&&e.name&&(e.name=`Cloned__${e.name}`)),Zi(e)&&Zi(n)&&n.width>0&&n.height>0&&e.getContext(`2d`)?.drawImage(n,0,0)}),n}function Xi(e){return`value`in e}function Zi(e){return e.tagName===`CANVAS`}function Qi(e,{x:t,y:n}){let r=e.elementFromPoint(t,n);if($i(r)){let{contentDocument:e}=r;if(e){let{left:i,top:a}=r.getBoundingClientRect();return Qi(e,{x:t-i,y:n-a})}}return r}function $i(e){return e?.tagName===`IFRAME`}var ea=new WeakMap;function ta(e){return e.closest(`
1
+ import{S as e,_ as t,b as n,c as r,d as i,g as a,i as o,l as s,o as c,p as l,r as u,s as d,u as f,v as p}from"./solid.8gBSxpeo.js";import{a as m,c as h,d as g,f as _,h as v,i as y,m as b,n as x,r as S,s as C,t as w,u as T}from"./web.DwNv8rLL.js";import{n as E}from"./i18n.3zKFZ7KU.js";import{t as D}from"./api.CGA0D2A2.js";import{t as O}from"./lucide.s17cczpi.js";import{t as k}from"./iconsAndAliases.ujTnkhnl.js";import{t as A}from"./FbIcon.uhYN8ybK.js";var ee=b(`<div class=fb-tabs><div class=fb-tabs__list role=tablist></div><div class=fb-tabs__panel role=tabpanel>`),te=b(`<span class=fb-tabs__badge>`),ne=b(`<button type=button role=tab class=fb-tabs__tab><span></span><!$><!/>`);function re(e){return(()=>{var t=y(ee),n=t.firstChild,r=n.nextSibling;return C(n,d(u,{get each(){return e.tabs},children:t=>(()=>{var n=y(ne),r=n.firstChild,a=r.nextSibling,[s,c]=m(a.nextSibling);return n.$$click=()=>e.onChange(t.id),C(r,()=>t.label),C(n,d(o,{get when(){return t.badge},get children(){var e=y(te);return C(e,()=>t.badge),e}}),s,c),i(r=>{var i=e.active===t.id,a=!!t.disabled,o=e.active===t.id,s=t.disabled;return i!==r.e&&n.classList.toggle(`is-active`,r.e=i),a!==r.t&&n.classList.toggle(`is-disabled`,r.t=a),o!==r.a&&g(n,`aria-selected`,r.a=o),s!==r.o&&_(n,`disabled`,r.o=s),r},{e:void 0,t:void 0,a:void 0,o:void 0}),T(),n})()})),C(r,()=>e.children),i(()=>g(n,`aria-label`,e.ariaLabel)),t})()}S([`click`]);var ie=Symbol.for(`preact-signals`);function j(){if(F>1){F--;return}let e,t=!1;for((function(){let e=se;for(se=void 0;e!==void 0;){let t=e.S;if(t.v===e.v)for(let n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();oe!==void 0;){let n=oe;for(oe=void 0,ce++;n!==void 0;){let r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&me(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(ce=0,F--,t)throw e}function M(e){if(F>0)return e();ue=++le,F++;try{return e()}finally{j()}}var N,ae,oe;function P(e){let t=N,n=ae;N=void 0,ae=void 0;try{return e()}finally{N=t,ae=n}}var se,F=0,ce=0,le=0,ue=0,de=0;function fe(e){if(N===void 0)return;let t=e.n;if(t===void 0||t.t!==N)return t={i:0,S:e,p:N.s,n:void 0,t:N,e:void 0,x:void 0,r:t},N.s!==void 0&&(N.s.n=t),N.s=t,e.n=t,32&N.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=N.s,t.n=void 0,N.s.n=t,N.s=t),t}function I(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}I.prototype.brand=ie,I.prototype.h=function(){return!0},I.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t===void 0?P(()=>{var e;(e=this.W)==null||e.call(this)}):t.e=e)},I.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&P(()=>{var e;(e=this.Z)==null||e.call(this)}))}},I.prototype.subscribe=function(e){return Ce(()=>{let t=this.value;P(()=>e(t))},{name:`sub`})},I.prototype.valueOf=function(){return this.value},I.prototype.toString=function(){return this.value+``},I.prototype.toJSON=function(){return this.value},I.prototype.peek=function(){return P(()=>this.value)},Object.defineProperty(I.prototype,"value",{get(){let e=fe(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(ce>100)throw Error(`Cycle detected`);(function(e){F!==0&&ce===0&&e.l!==ue&&(e.l=ue,se={S:e,v:e.v,i:e.i,o:se})})(this),this.v=e,this.i++,de++,F++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{j()}}}});function pe(e,t){return new I(e,t)}function me(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function he(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function ge(e){let t,n=e.s;for(;n!==void 0;){let e=n.p;n.i===-1?(n.S.U(n),e!==void 0&&(e.n=n.n),n.n!==void 0&&(n.n.p=e)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=e}e.s=t}function _e(e,t){I.call(this,void 0,t),this.x=e,this.s=void 0,this.g=de-1,this.f=4}_e.prototype=new I,_e.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===de))return!0;if(this.g=de,this.f|=1,this.i>0&&!me(this))return this.f&=-2,!0;let e=N;try{he(this),N=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return N=e,ge(this),this.f&=-2,!0},_e.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}I.prototype.S.call(this,e)},_e.prototype.U=function(e){if(this.t!==void 0&&(I.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},_e.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(_e.prototype,"value",{get(){if(1&this.f)throw Error(`Cycle detected`);let e=fe(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function ve(e,t){return new _e(e,t)}function ye(e){let t=e.m;if(e.m=void 0,typeof t==`function`){F++;let n=N;N=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,be(e),t}finally{N=n,j()}}}function be(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ye(e)}function xe(e){if(N!==this)throw Error(`Out-of-order effect`);ge(this),N=e,this.f&=-2,8&this.f&&be(this),j()}function Se(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,ae&&ae.push(this)}Se.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e==`function`&&(this.m=e)}finally{e()}},Se.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,ye(this),he(this),F++;let e=N;return N=this,xe.bind(this,e)},Se.prototype.N=function(){2&this.f||(this.f|=2,this.u=oe,oe=this)},Se.prototype.d=function(){this.f|=8,1&this.f||be(this)},Se.prototype.dispose=function(){this.d()};function Ce(e,t){let n=new Se(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}var we=Object.create,Te=Object.defineProperty,Ee=Object.defineProperties,De=Object.getOwnPropertyDescriptor,Oe=Object.getOwnPropertyDescriptors,ke=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,Me=(e,t)=>(t=Symbol[e])?t:Symbol.for(`Symbol.`+e),Ne=e=>{throw TypeError(e)},Pe=(e,t,n)=>t in e?Te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fe=(e,t)=>{for(var n in t||={})Ae.call(t,n)&&Pe(e,n,t[n]);if(ke)for(var n of ke(t))je.call(t,n)&&Pe(e,n,t[n]);return e},Ie=(e,t)=>Ee(e,Oe(t)),Le=(e,t)=>Te(e,`name`,{value:t,configurable:!0}),Re=e=>[,,,we(e?.[Me(`metadata`)]??null)],ze=[`class`,`method`,`getter`,`setter`,`accessor`,`field`,`value`,`get`,`set`],Be=e=>e!==void 0&&typeof e!=`function`?Ne(`Function expected`):e,Ve=(e,t,n,r,i)=>({kind:ze[e],name:t,metadata:r,addInitializer:e=>n._?Ne(`Already initialized`):i.push(Be(e||null))}),He=(e,t)=>Pe(t,Me(`metadata`),e[3]),Ue=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r},We=(e,t,n,r,i,a)=>{var o,s,c,l,u,d=t&7,f=!!(t&8),p=!!(t&16),m=d>3?e.length+1:d?f?1:2:0,h=ze[d+5],g=d>3&&(e[m-1]=[]),_=e[m]||(e[m]=[]),v=d&&(!p&&!f&&(i=i.prototype),d<5&&(d>3||!p)&&De(d<4?i:{get[n](){return qe(this,a)},set[n](e){return Ye(this,a,e)}},n));d?p&&d<4&&Le(a,(d>2?`set `:d>1?`get `:``)+n):Le(i,n);for(var y=r.length-1;y>=0;y--)l=Ve(d,n,c={},e[3],_),d&&(l.static=f,l.private=p,u=l.access={has:p?e=>Ke(i,e):e=>n in e},d^3&&(u.get=p?e=>(d^1?qe:Xe)(e,i,d^4?a:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>Ye(e,i,t,d^4?a:v.set):(e,t)=>e[n]=t)),s=(0,r[y])(d?d<4?p?a:v[h]:d>4?void 0:{get:v.get,set:v.set}:i,l),c._=1,d^4||s===void 0?Be(s)&&(d>4?g.unshift(s):d?p?a=s:v[h]=s:i=s):typeof s!=`object`||!s?Ne(`Object expected`):(Be(o=s.get)&&(v.get=o),Be(o=s.set)&&(v.set=o),Be(o=s.init)&&g.unshift(o));return d||He(e,i),v&&Te(i,n,v),p?d^4?a:v:i},Ge=(e,t,n)=>t.has(e)||Ne(`Cannot `+n),Ke=(e,t)=>Object(t)===t?e.has(t):Ne(`Cannot use the "in" operator on this value`),qe=(e,t,n)=>(Ge(e,t,`read from private field`),n?n.call(e):t.get(e)),Je=(e,t,n)=>t.has(e)?Ne(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Ye=(e,t,n,r)=>(Ge(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Xe=(e,t,n)=>(Ge(e,t,`access private method`),n);function Ze(e,t){if(t){let n;return ve(()=>{let r=e();return r&&n&&t(n,r)?n:(n=r,r)})}return ve(e)}function Qe(e,t){if(Object.is(e,t))return!0;if(e===null||t===null)return!1;if(typeof e==`function`&&typeof t==`function`)return e===t;if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:!e.some((e,n)=>!Qe(e,t[n]));if(typeof e==`object`&&typeof t==`object`){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&!n.some(n=>!Qe(e[n],t[n]))}return!1}function L({get:e},t){return{init(e){return pe(e)},get(){return e.call(this).value},set(t){let n=e.call(this);n.peek()!==t&&(n.value=t)}}}function R(e,t){let n=new WeakMap;return function(){let t=n.get(this);return t||(t=Ze(e.bind(this)),n.set(this,t)),t.value}}function $e(e=!0){return function(t,n){n.addInitializer(function(){let t=n.kind===`field`||n.static?this:Object.getPrototypeOf(this),r=Object.getOwnPropertyDescriptor(t,n.name);r&&Object.defineProperty(t,n.name,Ie(Fe({},r),{enumerable:e}))})}}function et(...e){let t=e.map(e=>Ce(e));return()=>t.forEach(e=>e())}var tt,nt,rt,it,at,ot=[L],st,ct,lt,ut,dt,z,ft,pt,mt,ht,gt,_t,vt,yt;at=[L],it=[L],rt=[$e()],nt=[$e()],tt=[$e()];var bt=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,Ue(st,5,this),Je(this,z),Je(this,ct,Ue(st,8,this)),Ue(st,11,this),Je(this,ft,Ue(st,12,this)),Ue(st,15,this),Je(this,gt,Ue(st,16,this)),Ue(st,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return qe(this,z,vt)}get initial(){return qe(this,z,ut)}get previous(){return qe(this,z,mt)}set current(e){let t=P(()=>qe(this,z,vt));e&&t&&this.equals(t,e)||M(()=>{qe(this,z,ut)||Ye(this,z,e,dt),Ye(this,z,t,ht),Ye(this,z,e,yt)})}reset(e=this.defaultValue){M(()=>{Ye(this,z,void 0,ht),Ye(this,z,e,dt),Ye(this,z,e,yt)})}};st=Re(null),ct=new WeakMap,z=new WeakSet,ft=new WeakMap,gt=new WeakMap,lt=We(st,20,`#initial`,ot,z,ct),ut=lt.get,dt=lt.set,pt=We(st,20,`#previous`,at,z,ft),mt=pt.get,ht=pt.set,_t=We(st,20,`#current`,it,z,gt),vt=_t.get,yt=_t.set,We(st,2,`current`,rt,bt),We(st,2,`initial`,nt,bt),We(st,2,`previous`,tt,bt),He(st,bt);function xt(e){return P(()=>{let t={};for(let n in e)t[n]=e[n];return t})}var St,Ct=class{constructor(){Je(this,St,new WeakMap)}get(e,t){return e?qe(this,St).get(e)?.get(t):void 0}set(e,t,n){if(e)return qe(this,St).has(e)||qe(this,St).set(e,new Map),qe(this,St).get(e)?.set(t,n)}clear(e){return e?qe(this,St).get(e)?.clear():void 0}};St=new WeakMap;var wt=Object.create,Tt=Object.defineProperty,Et=Object.getOwnPropertyDescriptor,Dt=Object.getOwnPropertySymbols,Ot=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable,At=(e,t)=>(t=Symbol[e])?t:Symbol.for(`Symbol.`+e),jt=e=>{throw TypeError(e)},Mt=Math.pow,Nt=(e,t,n)=>t in e?Tt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pt=(e,t)=>{for(var n in t||={})Ot.call(t,n)&&Nt(e,n,t[n]);if(Dt)for(var n of Dt(t))kt.call(t,n)&&Nt(e,n,t[n]);return e},Ft=(e,t)=>Tt(e,`name`,{value:t,configurable:!0}),It=e=>[,,,wt(e?.[At(`metadata`)]??null)],Lt=[`class`,`method`,`getter`,`setter`,`accessor`,`field`,`value`,`get`,`set`],Rt=e=>e!==void 0&&typeof e!=`function`?jt(`Function expected`):e,zt=(e,t,n,r,i)=>({kind:Lt[e],name:t,metadata:r,addInitializer:e=>n._?jt(`Already initialized`):i.push(Rt(e||null))}),Bt=(e,t)=>Nt(t,At(`metadata`),e[3]),Vt=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r},Ht=(e,t,n,r,i,a)=>{var o,s,c,l,u,d=t&7,f=!!(t&8),p=!!(t&16),m=d>3?e.length+1:d?f?1:2:0,h=Lt[d+5],g=d>3&&(e[m-1]=[]),_=e[m]||(e[m]=[]),v=d&&(!p&&!f&&(i=i.prototype),d<5&&(d>3||!p)&&Et(d<4?i:{get[n](){return Gt(this,a)},set[n](e){return qt(this,a,e)}},n));d?p&&d<4&&Ft(a,(d>2?`set `:d>1?`get `:``)+n):Ft(i,n);for(var y=r.length-1;y>=0;y--)l=zt(d,n,c={},e[3],_),d&&(l.static=f,l.private=p,u=l.access={has:p?e=>Wt(i,e):e=>n in e},d^3&&(u.get=p?e=>(d^1?Gt:Jt)(e,i,d^4?a:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>qt(e,i,t,d^4?a:v.set):(e,t)=>e[n]=t)),s=(0,r[y])(d?d<4?p?a:v[h]:d>4?void 0:{get:v.get,set:v.set}:i,l),c._=1,d^4||s===void 0?Rt(s)&&(d>4?g.unshift(s):d?p?a=s:v[h]=s:i=s):typeof s!=`object`||!s?jt(`Object expected`):(Rt(o=s.get)&&(v.get=o),Rt(o=s.set)&&(v.set=o),Rt(o=s.init)&&g.unshift(o));return d||Bt(e,i),v&&Tt(i,n,v),p?d^4?a:v:i},Ut=(e,t,n)=>t.has(e)||jt(`Cannot `+n),Wt=(e,t)=>Object(t)===t?e.has(t):jt(`Cannot use the "in" operator on this value`),Gt=(e,t,n)=>(Ut(e,t,`read from private field`),n?n.call(e):t.get(e)),Kt=(e,t,n)=>t.has(e)?jt(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),qt=(e,t,n,r)=>(Ut(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Jt=(e,t,n)=>(Ut(e,t,`access private method`),n),Yt=class e{constructor(e,t){this.x=e,this.y=t}static delta(t,n){return new e(t.x-n.x,t.y-n.y)}static distance(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}static equals(e,t){return e.x===t.x&&e.y===t.y}static from({x:t,y:n}){return new e(t,n)}},Xt=class e{constructor(e,t,n,r){this.left=e,this.top=t,this.width=n,this.height=r,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(t,n){let{top:r,left:i,width:a,height:o,scale:s}=this,c=new e(i+t,r+n,a,o);return c.scale=Pt({},s),c}get boundingRectangle(){let{width:e,height:t,left:n,top:r,right:i,bottom:a}=this;return{width:e,height:t,left:n,top:r,right:i,bottom:a}}get center(){let{left:e,top:t,right:n,bottom:r}=this;return new Yt((e+n)/2,(t+r)/2)}get area(){let{width:e,height:t}=this;return e*t}equals(t){if(!(t instanceof e))return!1;let{left:n,top:r,width:i,height:a}=this;return n===t.left&&r===t.top&&i===t.width&&a===t.height}containsPoint(e){let{top:t,left:n,bottom:r,right:i}=this;return t<=e.y&&e.y<=r&&n<=e.x&&e.x<=i}intersectionArea(t){return t instanceof e?Zt(this,t):0}intersectionRatio(e){let{area:t}=this,n=this.intersectionArea(e);return n/(e.area+t-n)}get bottom(){let{top:e,height:t}=this;return e+t}get right(){let{left:e,width:t}=this;return e+t}get aspectRatio(){let{width:e,height:t}=this;return e/t}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:t,left:n,width:r,height:i}){return new e(n,t,r,i)}static delta(e,t,n={x:`center`,y:`center`}){let r=(e,t)=>{let r=n[t],i=t===`x`?e.left:e.top,a=t===`x`?e.width:e.height;return r==`start`?i:r==`end`?i+a:i+a/2};return Yt.delta({x:r(e,`x`),y:r(e,`y`)},{x:r(t,`x`),y:r(t,`y`)})}static intersectionRatio(t,n){return e.from(t).intersectionRatio(e.from(n))}};function Zt(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;return r<i&&n<a?o*s:0}var Qt,$t,en,tn,nn,rn=class extends (en=bt,$t=[R],Qt=[R],en){constructor(e){let t=Yt.from(e);super(t,(e,t)=>Yt.equals(e,t)),Vt(nn,5,this),Kt(this,tn,0),this.velocity={x:0,y:0}}get delta(){return Yt.delta(this.current,this.initial)}get direction(){let{current:e,previous:t}=this;if(!t)return null;let n={x:e.x-t.x,y:e.y-t.y};return!n.x&&!n.y?null:Math.abs(n.x)>Math.abs(n.y)?n.x>0?`right`:`left`:n.y>0?`down`:`up`}get current(){return super.current}set current(e){let{current:t}=this,n=Yt.from(e),r={x:n.x-t.x,y:n.y-t.y},i=Date.now(),a=i-Gt(this,tn),o=e=>Math.round(e/a*100);M(()=>{qt(this,tn,i),this.velocity={x:o(r.x),y:o(r.y)},super.current=n})}reset(e=this.defaultValue){super.reset(Yt.from(e)),this.velocity={x:0,y:0}}};nn=It(en),tn=new WeakMap,Ht(nn,2,`delta`,$t,rn),Ht(nn,2,`direction`,Qt,rn),Bt(nn,rn);function an({x:e,y:t},n){let r=Math.abs(e),i=Math.abs(t);return typeof n==`number`?Math.sqrt(Mt(r,2)+Mt(i,2))>n:`x`in n&&`y`in n?r>n.x&&i>n.y:`x`in n?r>n.x:`y`in n&&i>n.y}var on=(e=>(e.Horizontal=`x`,e.Vertical=`y`,e))(on||{}),sn=Object.values(on),cn=Object.create,ln=Object.defineProperty,un=Object.defineProperties,dn=Object.getOwnPropertyDescriptor,fn=Object.getOwnPropertyDescriptors,pn=Object.getOwnPropertySymbols,mn=Object.prototype.hasOwnProperty,hn=Object.prototype.propertyIsEnumerable,gn=(e,t)=>(t=Symbol[e])?t:Symbol.for(`Symbol.`+e),_n=e=>{throw TypeError(e)},vn=(e,t,n)=>t in e?ln(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yn=(e,t)=>{for(var n in t||={})mn.call(t,n)&&vn(e,n,t[n]);if(pn)for(var n of pn(t))hn.call(t,n)&&vn(e,n,t[n]);return e},bn=(e,t)=>un(e,fn(t)),xn=(e,t)=>ln(e,`name`,{value:t,configurable:!0}),Sn=(e,t)=>{var n={};for(var r in e)mn.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&pn)for(var r of pn(e))t.indexOf(r)<0&&hn.call(e,r)&&(n[r]=e[r]);return n},Cn=e=>[,,,cn(e?.[gn(`metadata`)]??null)],wn=[`class`,`method`,`getter`,`setter`,`accessor`,`field`,`value`,`get`,`set`],Tn=e=>e!==void 0&&typeof e!=`function`?_n(`Function expected`):e,En=(e,t,n,r,i)=>({kind:wn[e],name:t,metadata:r,addInitializer:e=>n._?_n(`Already initialized`):i.push(Tn(e||null))}),Dn=(e,t)=>vn(t,gn(`metadata`),e[3]),B=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r},V=(e,t,n,r,i,a)=>{var o,s,c,l,u,d=t&7,f=!!(t&8),p=!!(t&16),m=d>3?e.length+1:d?f?1:2:0,h=wn[d+5],g=d>3&&(e[m-1]=[]),_=e[m]||(e[m]=[]),v=d&&(!p&&!f&&(i=i.prototype),d<5&&(d>3||!p)&&dn(d<4?i:{get[n](){return H(this,a)},set[n](e){return An(this,a,e)}},n));d?p&&d<4&&xn(a,(d>2?`set `:d>1?`get `:``)+n):xn(i,n);for(var y=r.length-1;y>=0;y--)l=En(d,n,c={},e[3],_),d&&(l.static=f,l.private=p,u=l.access={has:p?e=>kn(i,e):e=>n in e},d^3&&(u.get=p?e=>(d^1?H:jn)(e,i,d^4?a:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>An(e,i,t,d^4?a:v.set):(e,t)=>e[n]=t)),s=(0,r[y])(d?d<4?p?a:v[h]:d>4?void 0:{get:v.get,set:v.set}:i,l),c._=1,d^4||s===void 0?Tn(s)&&(d>4?g.unshift(s):d?p?a=s:v[h]=s:i=s):typeof s!=`object`||!s?_n(`Object expected`):(Tn(o=s.get)&&(v.get=o),Tn(o=s.set)&&(v.set=o),Tn(o=s.init)&&g.unshift(o));return d||Dn(e,i),v&&ln(i,n,v),p?d^4?a:v:i},On=(e,t,n)=>t.has(e)||_n(`Cannot `+n),kn=(e,t)=>Object(t)===t?e.has(t):_n(`Cannot use the "in" operator on this value`),H=(e,t,n)=>(On(e,t,`read from private field`),n?n.call(e):t.get(e)),U=(e,t,n)=>t.has(e)?_n(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),An=(e,t,n,r)=>(On(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),jn=(e,t,n)=>(On(e,t,`access private method`),n);function Mn(e,t){return{plugin:e,options:t}}function Nn(e){return t=>Mn(e,t)}function Pn(e){return typeof e==`function`?{plugin:e,options:void 0}:e}var Fn=[L],In,Ln,Rn,W=class{constructor(e,t){this.manager=e,this.options=t,U(this,Ln,B(In,8,this,!1)),B(In,11,this),U(this,Rn,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return P(()=>this.disabled)}configure(e){this.options=e}registerEffect(e){let t=Ce(e.bind(this));return H(this,Rn).add(t),t}destroy(){H(this,Rn).forEach(e=>e())}static configure(e){return Mn(this,e)}};In=Cn(null),Ln=new WeakMap,Rn=new WeakMap,V(In,4,`disabled`,Fn,W,Ln),Dn(In,W);var zn=class extends W{},Bn,Vn=class{constructor(e){this.manager=e,this.instances=new Map,U(this,Bn,[])}get values(){return Array.from(this.instances.values())}set values(e){let t=e.map(Pn).reduce((e,t)=>{let n=e.find(({plugin:e})=>e===t.plugin);return n?(n.options=t.options,e):[...e,t]},[]),n=t.map(({plugin:e})=>e);for(let e of H(this,Bn))if(!n.includes(e)){if(e.prototype instanceof zn)continue;this.unregister(e)}for(let{plugin:e,options:n}of t)this.register(e,n);An(this,Bn,n)}get(e){return this.instances.get(e)}register(e,t){let n=this.instances.get(e);if(n)return n.options!==t&&(n.options=t),n;let r=new e(this.manager,t);return this.instances.set(e,r),r}unregister(e){let t=this.instances.get(e);t&&(t.destroy(),this.instances.delete(e))}destroy(){for(let e of this.instances.values())e.destroy();this.instances.clear()}};Bn=new WeakMap;function Hn(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}var Un=[],Wn,Gn,Kn=class extends W{constructor(e){super(e),U(this,Wn),U(this,Gn),this.computeCollisions=this.computeCollisions.bind(this),An(this,Gn,pe(Un)),this.destroy=et(()=>{let e=this.computeCollisions(),t=P(()=>this.manager.dragOperation.position.current);if(e!==Un){let e=H(this,Wn);if(An(this,Wn,t),e&&t.x==e.x&&t.y==e.y)return}else An(this,Wn,void 0);H(this,Gn).value=e},()=>{let{dragOperation:e}=this.manager;e.status.initialized&&this.forceUpdate()})}forceUpdate(e=!0){P(()=>{e?H(this,Gn).value=this.computeCollisions():An(this,Wn,void 0)})}computeCollisions(e,t){let{registry:n,dragOperation:r}=this.manager,{source:i,shape:a,status:o}=r;if(!o.initialized||!a)return Un;let s=[],c=[];for(let a of e??n.droppables){if(a.disabled||i&&!a.accepts(i))continue;let e=t??a.collisionDetector;if(!e)continue;c.push(a),a.shape;let n=P(()=>e({droppable:a,dragOperation:r}));n&&(a.collisionPriority!=null&&(n.priority=a.collisionPriority),s.push(n))}return c.length===0?Un:(s.sort(Hn),s)}get collisions(){return H(this,Gn).value}};Wn=new WeakMap,Gn=new WeakMap;var qn,Jn,Yn=[L],Xn,Zn,Qn,$n,er,tr,nr;Jn=[L],qn=[L];var rr=class e{constructor(e,t){U(this,$n,B(Qn,8,this)),B(Qn,11,this),U(this,er),U(this,tr,B(Qn,12,this)),B(Qn,15,this),U(this,nr,B(Qn,16,this)),B(Qn,19,this);let{effects:n,id:r,data:i={},disabled:a=!1,register:o=!0}=e,s=r;An(this,er,pe(r)),this.manager=t,this.data=i,this.disabled=a,this.effects=()=>[()=>{let{id:e,manager:t}=this;if(e!==s)return s=e,t?.registry.register(this),()=>t?.registry.unregister(this)},...n?.()??[]],this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),t&&o&&queueMicrotask(this.register)}get id(){let t=H(this,er).value;return e.pendingIdChanges?.get(this)??t}set id(t){t!==(e.pendingIdChanges?.get(this)??H(this,er).peek())&&(e.pendingIdChanges||(e.pendingIdChanges=new Map,queueMicrotask(()=>{var t;return jn(t=e,Xn,Zn).call(t)})),e.pendingIdChanges.set(this,t))}register(){return this.manager?.registry.register(this)}unregister(){var e;(e=this.manager)==null||e.registry.unregister(this)}destroy(){var e;(e=this.manager)==null||e.registry.unregister(this)}};Qn=Cn(null),Xn=new WeakSet,Zn=function(){let e=rr.pendingIdChanges;rr.pendingIdChanges=null,e&&M(()=>{for(let[t,n]of e)H(t,er).value=n})},$n=new WeakMap,er=new WeakMap,tr=new WeakMap,nr=new WeakMap,V(Qn,4,`manager`,Yn,rr,$n),V(Qn,4,`data`,Jn,rr,tr),V(Qn,4,`disabled`,qn,rr,nr),U(rr,Xn),Dn(Qn,rr),rr.pendingIdChanges=null;var ir=rr,ar=class{constructor(){this.map=pe(new Map),this.cleanupFunctions=new WeakMap,this.register=(e,t)=>{let n=this.map.peek(),r=n.get(e),i=()=>this.unregister(e,t);if(r===t)return i;r&&r.id===e&&(this.cleanupFunctions.get(r)?.(),this.cleanupFunctions.delete(r));let a=new Map(n);for(let[r,i]of n)if(i===t&&r!==e){a.delete(r);break}a.set(e,t),this.map.value=a;let o=et(...t.effects());return this.cleanupFunctions.set(t,o),i},this.unregister=(e,t)=>{let n=this.map.peek();if(n.get(e)!==t)return;this.cleanupFunctions.get(t)?.(),this.cleanupFunctions.delete(t);let r=new Map(n);r.delete(e),this.map.value=r}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(e){return this.map.value.has(e)}get(e){return this.map.value.get(e)}destroy(){for(let e of this)this.cleanupFunctions.get(e)?.(),e.destroy();this.map.value=new Map}},or,sr,cr,lr,ur,dr,fr,pr,mr,hr,gr,_r=class extends (fr=ir,dr=[L],ur=[L],lr=[L],cr=[R],sr=[R],or=[R],fr){constructor(e,t){var n=e,{modifiers:r,type:i,sensors:a,plugins:o,effects:s}=n,c=Sn(n,[`modifiers`,`type`,`sensors`,`plugins`,`effects`]);super(bn(yn({},c),{effects:()=>[...s?.()??[],()=>{let{manager:e,plugins:t}=this;if(e&&t)for(let n of t){let{plugin:t}=Pn(n);e.registry.plugins.register(t)}}]}),t),B(pr,5,this),U(this,mr,B(pr,8,this)),B(pr,11,this),U(this,hr,B(pr,12,this)),B(pr,15,this),U(this,gr,B(pr,16,this,this.isDragSource?`dragging`:`idle`)),B(pr,19,this),this.type=i,this.sensors=a,this.modifiers=r,this.alignment=c.alignment,this.plugins=o}pluginConfig(e){if(this.plugins)for(let t of this.plugins){let n=Pn(t);if(n.plugin===e)return n.options}}get isDropping(){return this.status===`dropping`&&this.isDragSource}get isDragging(){return this.status===`dragging`&&this.isDragSource}get isDragSource(){return this.manager?.dragOperation.source?.id===this.id}};pr=Cn(fr),mr=new WeakMap,hr=new WeakMap,gr=new WeakMap,V(pr,4,`type`,dr,_r,mr),V(pr,4,`modifiers`,ur,_r,hr),V(pr,4,`status`,lr,_r,gr),V(pr,2,`isDropping`,cr,_r),V(pr,2,`isDragging`,sr,_r),V(pr,2,`isDragSource`,or,_r),Dn(pr,_r);var vr,yr,br,xr,Sr,Cr,wr,G,Tr,Er,Dr,Or,kr,Ar=class extends (wr=ir,Cr=[L],Sr=[L],xr=[L],br=[L],yr=[L],vr=[R],wr){constructor(e,t){var n=e,{accept:r,collisionDetector:i,collisionPriority:a,type:o}=n,s=Sn(n,[`accept`,`collisionDetector`,`collisionPriority`,`type`]);super(s,t),B(G,5,this),U(this,Tr,B(G,8,this)),B(G,11,this),U(this,Er,B(G,12,this)),B(G,15,this),U(this,Dr,B(G,16,this)),B(G,19,this),U(this,Or,B(G,20,this)),B(G,23,this),U(this,kr,B(G,24,this)),B(G,27,this),this.accept=r,this.collisionDetector=i,this.collisionPriority=a,this.type=o}accepts(e){let{accept:t}=this;return t?typeof t==`function`?t(e):e.type?Array.isArray(t)?t.includes(e.type):e.type===t:!1:!0}get isDropTarget(){return this.manager?.dragOperation.target?.id===this.id}};G=Cn(wr),Tr=new WeakMap,Er=new WeakMap,Dr=new WeakMap,Or=new WeakMap,kr=new WeakMap,V(G,4,`accept`,Cr,Ar,Tr),V(G,4,`type`,Sr,Ar,Er),V(G,4,`collisionDetector`,xr,Ar,Dr),V(G,4,`collisionPriority`,br,Ar,Or),V(G,4,`shape`,yr,Ar,kr),V(G,2,`isDropTarget`,vr,Ar),Dn(G,Ar);var jr=class{constructor(){this.registry=new Map}addEventListener(e,t){let{registry:n}=this,r=new Set(n.get(e));return r.add(t),n.set(e,r),()=>this.removeEventListener(e,t)}removeEventListener(e,t){let{registry:n}=this,r=new Set(n.get(e));r.delete(t),n.set(e,r)}dispatch(e,...t){let{registry:n}=this,r=n.get(e);if(r)for(let e of r)e(...t)}},Mr=class extends jr{constructor(e){super(),this.manager=e}dispatch(e,t){let n=[t,this.manager];super.dispatch(e,...n)}};function Nr(e,t=!0){let n=!1;return bn(yn({},e),{cancelable:t,get defaultPrevented(){return n},preventDefault(){t&&(n=!0)}})}var Pr=class extends zn{constructor(e){super(e);let t=(e,t)=>e.map(({id:e})=>e).join(``)===t.map(({id:e})=>e).join(``),n=[];this.destroy=et(()=>{let{dragOperation:t,collisionObserver:r}=e;t.status.initializing&&(n=[],r.enable())},()=>{let{collisionObserver:r,monitor:i}=e,{collisions:a}=r;if(r.isDisabled()||ir.pendingIdChanges)return;let o=Nr({collisions:a});if(i.dispatch(`collision`,o),o.defaultPrevented||t(a,n))return;n=a;let[s]=a;P(()=>{s?.id!==e.dragOperation.target?.id&&(r.disable(),e.actions.setDropTarget(s?.id).then(()=>{r.enable()}))})})}},Fr=(e=>(e[e.Lowest=0]=`Lowest`,e[e.Low=1]=`Low`,e[e.Normal=2]=`Normal`,e[e.High=3]=`High`,e[e.Highest=4]=`Highest`,e))(Fr||{}),Ir=(e=>(e[e.Collision=0]=`Collision`,e[e.ShapeIntersection=1]=`ShapeIntersection`,e[e.PointerIntersection=2]=`PointerIntersection`,e))(Ir||{}),Lr,Rr,zr,Br,Vr,Hr,Ur=[L],Wr,Gr;Hr=[R],Vr=[R],Br=[R],zr=[R],Rr=[R],Lr=[R];var Kr=class{constructor(){B(Wr,5,this),U(this,Gr,B(Wr,8,this,`idle`)),B(Wr,11,this)}get current(){return this.value}get idle(){return this.value===`idle`}get initializing(){return this.value===`initializing`}get initialized(){let{value:e}=this;return e!==`idle`&&e!==`initialization-pending`}get dragging(){return this.value===`dragging`}get dropped(){return this.value===`dropped`}set(e){this.value=e}};Wr=Cn(null),Gr=new WeakMap,V(Wr,4,`value`,Ur,Kr,Gr),V(Wr,2,`current`,Hr,Kr),V(Wr,2,`idle`,Vr,Kr),V(Wr,2,`initializing`,Br,Kr),V(Wr,2,`initialized`,zr,Kr),V(Wr,2,`dragging`,Rr,Kr),V(Wr,2,`dropped`,Lr,Kr),Dn(Wr,Kr);var qr=class{constructor(e){this.manager=e}setDragSource(e){let{dragOperation:t}=this.manager;t.sourceIdentifier=typeof e==`string`||typeof e==`number`?e:e.id}setDropTarget(e){return P(()=>{let{dragOperation:t}=this.manager,n=e??null;if(t.targetIdentifier===n)return Promise.resolve(!1);t.targetIdentifier=n;let r=Nr({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch(`dragover`,r),this.manager.renderer.rendering.then(()=>r.defaultPrevented)})}start(e){return P(()=>{let{dragOperation:t}=this.manager;if(e.source!=null&&this.setDragSource(e.source),!t.source)throw Error(`Cannot start a drag operation without a drag source`);if(!t.status.idle)throw Error(`Cannot start a drag operation while another is active`);let n=new AbortController,{event:r,coordinates:i}=e;M(()=>{t.status.set(`initialization-pending`),t.shape=null,t.canceled=!1,t.activatorEvent=r??null,t.position.reset(i)});let a=Nr({operation:t.snapshot()});return this.manager.monitor.dispatch(`beforedragstart`,a),a.defaultPrevented?(t.reset(),n.abort(),n):(t.status.set(`initializing`),t.controller=n,this.manager.renderer.rendering.then(()=>{if(n.signal.aborted)return;let{status:e}=t;e.current===`initializing`&&M(()=>{t.status.set(`dragging`),this.manager.monitor.dispatch(`dragstart`,{nativeEvent:r,operation:t.snapshot(),cancelable:!1})})}),n)})}move(e){return P(()=>{let{dragOperation:t}=this.manager,{status:n,controller:r}=t;if(!n.dragging||!r||r.signal.aborted)return;let i=Nr({nativeEvent:e.event,operation:t.snapshot(),by:e.by,to:e.to},e.cancelable??!0);(e.propagate??!0)&&this.manager.monitor.dispatch(`dragmove`,i),queueMicrotask(()=>{if(i.defaultPrevented)return;let n=e.to??{x:t.position.current.x+(e.by?.x??0),y:t.position.current.y+(e.by?.y??0)};t.position.current=n})})}stop(e={}){return P(()=>{let{dragOperation:t}=this.manager,{controller:n}=t;if(!n||n.signal.aborted)return;let r,i=()=>{let e={resume:()=>{},abort:()=>{}};return r=new Promise((t,n)=>{e.resume=t,e.abort=n}),e};n.abort();let a=()=>{this.manager.renderer.rendering.then(()=>{t.status.set(`dropped`);let e=P(()=>t.source?.status===`dropping`),r=()=>{t.controller===n&&(t.controller=void 0),t.reset()};if(e){let{source:e}=t,n=Ce(()=>{e?.status===`idle`&&(n(),r())})}else this.manager.renderer.rendering.then(r)})};t.canceled=e.canceled??!1,this.manager.monitor.dispatch(`dragend`,{nativeEvent:e.event,operation:t.snapshot(),canceled:e.canceled??!1,suspend:i}),r?r.then(a).catch(()=>t.reset()):a()})}},Jr=class extends W{constructor(e,t){super(e,t),this.manager=e,this.options=t}},Yr=class extends AbortController{constructor(e,t){super(),this.constraints=e,this.onActivate=t,this.activated=!1;for(let t of e??[])t.controller=this}onEvent(e){if(!this.activated){if(this.constraints?.length)for(let t of this.constraints)t.onEvent(e);else this.activate(e)}}activate(e){this.activated||(this.activated=!0,this.onActivate(e))}abort(e){this.activated=!1,super.abort(e)}},Xr,Zr=class{constructor(e){this.options=e,U(this,Xr)}set controller(e){An(this,Xr,e),e.signal.addEventListener(`abort`,()=>this.abort())}activate(e){var t;(t=H(this,Xr))==null||t.activate(e)}};Xr=new WeakMap;var Qr=class extends W{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},$r=class{constructor(e){this.draggables=new ar,this.droppables=new ar,this.plugins=new Vn(e),this.sensors=new Vn(e),this.modifiers=new Vn(e)}register(e,t){if(e instanceof _r)return this.draggables.register(e.id,e);if(e instanceof Ar)return this.droppables.register(e.id,e);if(e.prototype instanceof Qr)return this.modifiers.register(e,t);if(e.prototype instanceof Jr)return this.sensors.register(e,t);if(e.prototype instanceof W)return this.plugins.register(e,t);throw Error(`Invalid instance type`)}unregister(e){if(e instanceof ir)return e instanceof _r?this.draggables.unregister(e.id,e):e instanceof Ar?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof Qr)return this.modifiers.unregister(e);if(e.prototype instanceof Jr)return this.sensors.unregister(e);if(e.prototype instanceof W)return this.plugins.unregister(e);throw Error(`Invalid instance type`)}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}},ei,ti,ni,ri,ii,ai,oi,si,ci=[R],li,ui,di,K,fi,pi,mi,hi,gi,_i;si=[L],oi=[L],ai=[L],ii=[L],ri=[L],ni=[R],ti=[R],ei=[R];var vi=class{constructor(e){B(K,5,this),U(this,li),U(this,ui),U(this,di,new bt(void 0,(e,t)=>e&&t?e.equals(t):e===t)),this.status=new Kr,U(this,fi,B(K,8,this,!1)),B(K,11,this),U(this,pi,B(K,12,this,null)),B(K,15,this),U(this,mi,B(K,16,this,null)),B(K,19,this),U(this,hi,B(K,20,this,null)),B(K,23,this),U(this,gi,B(K,24,this,[])),B(K,27,this),this.position=new rn({x:0,y:0}),U(this,_i,{x:0,y:0}),An(this,li,e)}get shape(){let{current:e,initial:t,previous:n}=H(this,di);return!e||!t?null:{current:e,initial:t,previous:n}}set shape(e){e?H(this,di).current=e:H(this,di).reset()}get source(){let e=this.sourceIdentifier;if(e==null)return null;let t=H(this,li).registry.draggables.get(e);return t&&An(this,ui,t),t??H(this,ui)??null}get target(){let e=this.targetIdentifier;return e==null?null:H(this,li).registry.droppables.get(e)??null}get transform(){let{x:e,y:t}=this.position.delta,n={x:e,y:t};for(let e of this.modifiers)n=e.apply(bn(yn({},this.snapshot()),{transform:n}));return An(this,_i,n),n}snapshot(){return P(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:H(this,_i),shape:this.shape?xt(this.shape):null,position:xt(this.position),status:xt(this.status),canceled:this.canceled}))}reset(){M(()=>{this.status.set(`idle`),this.sourceIdentifier=null,this.targetIdentifier=null,H(this,di).reset(),this.position.reset({x:0,y:0}),An(this,_i,{x:0,y:0}),this.modifiers=[]})}};K=Cn(null),li=new WeakMap,ui=new WeakMap,di=new WeakMap,fi=new WeakMap,pi=new WeakMap,mi=new WeakMap,hi=new WeakMap,gi=new WeakMap,_i=new WeakMap,V(K,2,`shape`,ci,vi),V(K,4,`canceled`,si,vi,fi),V(K,4,`activatorEvent`,oi,vi,pi),V(K,4,`sourceIdentifier`,ai,vi,mi),V(K,4,`targetIdentifier`,ii,vi,hi),V(K,4,`modifiers`,ri,vi,gi),V(K,2,`source`,ni,vi),V(K,2,`target`,ti,vi),V(K,2,`transform`,ei,vi),Dn(K,vi);var yi={get rendering(){return Promise.resolve()}};function bi(e,t){return typeof e==`function`?e(t):e??t}var xi=class{constructor(e){this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach(e=>e.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};let t=e??{},n=bi(t.plugins,[]),r=bi(t.sensors,[]),i=bi(t.modifiers,[]),a=t.renderer??yi,o=new Mr(this),s=new $r(this);this.registry=s,this.monitor=o,this.renderer=a,this.actions=new qr(this),this.dragOperation=new vi(this),this.collisionObserver=new Kn(this),this.plugins=[Pr,...n],this.modifiers=i,this.sensors=r;let{destroy:c}=this,l=et(()=>{let e=P(()=>this.dragOperation.modifiers),t=this.modifiers;for(let n of e)t.includes(n)||n.destroy();this.dragOperation.modifiers=(this.dragOperation.source?.modifiers)?.map(e=>{let{plugin:t,options:n}=Pn(e);return new t(this,n)})??t});this.destroy=()=>{l(),c()}}get plugins(){return this.registry.plugins.values}set plugins(e){this.registry.plugins.values=e}get modifiers(){return this.registry.modifiers.values}set modifiers(e){this.registry.modifiers.values=e}get sensors(){return this.registry.sensors.values}set sensors(e){this.registry.sensors.values=e}},Si=e=>{throw TypeError(e)},Ci=(e,t,n)=>t.has(e)||Si(`Cannot `+n),q=(e,t,n)=>(Ci(e,t,`read from private field`),t.get(e)),wi=(e,t,n)=>t.has(e)?Si(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Ti=(e,t,n,r)=>(Ci(e,t,`write to private field`),t.set(e,n),n),Ei=(e,t,n)=>(Ci(e,t,`access private method`),n);function Di(e){return e?e instanceof KeyframeEffect||`getKeyframes`in e&&typeof e.getKeyframes==`function`:!1}function Oi(e,t){let n=e.getAnimations(),r=null;for(let e of n){if(e.playState!==`running`)continue;let{effect:n}=e,i=(Di(n)?n.getKeyframes():[]).filter(t);i.length>0&&(r=[i[i.length-1],e])}return r}function ki(e){let{width:t,height:n,top:r,left:i,bottom:a,right:o}=e.getBoundingClientRect();return{width:t,height:n,top:r,left:i,bottom:a,right:o}}function Ai(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function ji(e){return`nodeType`in e}function Mi(e){return e?Ai(e)?e:ji(e)?`defaultView`in e?e.defaultView??window:e.ownerDocument?.defaultView??window:window:window}function Ni(e){let{Document:t}=Mi(e);return e instanceof t||`nodeType`in e&&e.nodeType===Node.DOCUMENT_NODE}function Pi(e){return!e||Ai(e)?!1:e instanceof Mi(e).HTMLElement||`namespaceURI`in e&&typeof e.namespaceURI==`string`&&e.namespaceURI.endsWith(`html`)}function Fi(e){return e instanceof Mi(e).SVGElement||`namespaceURI`in e&&typeof e.namespaceURI==`string`&&e.namespaceURI.endsWith(`svg`)}function Ii(e){return e?Ai(e)?e.document:ji(e)?Ni(e)?e:Pi(e)||Fi(e)?e.ownerDocument:document:document:document}function Li(e){let{documentElement:t}=Ii(e),n=Mi(e).visualViewport,r=n?.width??t.clientWidth,i=n?.height??t.clientHeight,a=n?.offsetTop??0,o=n?.offsetLeft??0;return{top:a,left:o,right:o+r,bottom:a+i,width:r,height:i}}function Ri(e,t){if(zi(e)&&e.open===!1)return!1;let{overflow:n,overflowX:r,overflowY:i}=getComputedStyle(e);return n===`visible`&&r===`visible`&&i===`visible`}function zi(e){return e.tagName===`DETAILS`}function Bi(e,t=e.getBoundingClientRect(),n=0){let r=t,{ownerDocument:i}=e,a=i.defaultView??window,o=e.parentElement;for(;o&&o!==i.documentElement;){if(!Ri(o)){let e=o.getBoundingClientRect(),t=n*(e.bottom-e.top),i=n*(e.right-e.left),a=n*(e.bottom-e.top),s=n*(e.right-e.left);r={top:Math.max(r.top,e.top-t),right:Math.min(r.right,e.right+i),bottom:Math.min(r.bottom,e.bottom+a),left:Math.max(r.left,e.left-s),width:0,height:0},r.width=r.right-r.left,r.height=r.bottom-r.top}o=o.parentElement}let s=a.visualViewport,c=s?.offsetTop??0,l=s?.offsetLeft??0,u=s?.width??a.innerWidth,d=s?.height??a.innerHeight,f=n*d,p=n*u;return r={top:Math.max(r.top,c-f),right:Math.min(r.right,l+u+p),bottom:Math.min(r.bottom,c+d+f),left:Math.max(r.left,l-p),width:0,height:0},r.width=r.right-r.left,r.height=r.bottom-r.top,r.width<0&&(r.width=0),r.height<0&&(r.height=0),r}function Vi(e){return{x:e.clientX,y:e.clientY}}var Hi=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ui(e=document,t=new Set){if(t.has(e))return[];t.add(e);let n=[e];for(let r of Array.from(e.querySelectorAll(`iframe, frame`)))try{let e=r.contentDocument;e&&!t.has(e)&&n.push(...Ui(e,t))}catch{}try{let r=e.defaultView;if(r&&r!==window.top){let i=r.parent;i&&i.document&&i.document!==e&&n.push(...Ui(i.document,t))}}catch{}return n}function Wi(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Gi(){let e=Wi()?window.visualViewport:null;return{x:e?.offsetLeft??0,y:e?.offsetTop??0}}function Ki(e){return!e||!ji(e)?!1:e instanceof Mi(e).ShadowRoot}function qi(e){if(e&&ji(e)){let t=e.getRootNode();if(Ki(t)||t instanceof Document)return t}return Ii(e)}function Ji(e){return e.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Yi(e){let t=`input, textarea, select, canvas, [contenteditable]`,n=e.cloneNode(!0),r=Array.from(e.querySelectorAll(t));return Array.from(n.querySelectorAll(t)).forEach((e,t)=>{let n=r[t];Xi(e)&&Xi(n)&&(e.type!==`file`&&(e.value=n.value),e.type===`radio`&&e.name&&(e.name=`Cloned__${e.name}`)),Zi(e)&&Zi(n)&&n.width>0&&n.height>0&&e.getContext(`2d`)?.drawImage(n,0,0)}),n}function Xi(e){return`value`in e}function Zi(e){return e.tagName===`CANVAS`}function Qi(e,{x:t,y:n}){let r=e.elementFromPoint(t,n);if($i(r)){let{contentDocument:e}=r;if(e){let{left:i,top:a}=r.getBoundingClientRect();return Qi(e,{x:t-i,y:n-a})}}return r}function $i(e){return e?.tagName===`IFRAME`}var ea=new WeakMap;function ta(e){return e.closest(`
2
2
  input:not([disabled]),
3
3
  select:not([disabled]),
4
4
  textarea:not([disabled]),
@@ -1 +1 @@
1
- import{d as e,i as t,p as n,r,s as i,u as a,v as o}from"./solid.8gBSxpeo.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.DwNv8rLL.js";import{n as g}from"./i18n.EKfvSb1v.js";import{t as _}from"./api.CM0tblEa.js";import{t as v}from"./FbIcon.uhYN8ybK.js";var y=f(`<div class="notice notice--error">`),b=f(`<div class=fb-list__toolbar><label class=fb-list__filter><span></span><select class=input><option value></option><!$><!/></select></label><input class="input fb-list__search"type=search>`),x=f(`<div class=fb-groups-table__head><span></span><span></span><span></span><span></span><span></span><span>`),S=f(`<section class="card fb-groups-table">`),ee=f(`<p class="muted fb-import-hint">`),te=f(`<div class=fb-modal-backdrop><div class=fb-modal><div class=fb-modal__header><h3></h3><button type=button class=fb-modal__close></button></div><div class=fb-modal__body><p class=muted></p><label class=fb-import-dropzone><input id=import-file-input type=file accept=.json hidden><!$><!/><span></span></label><!$><!/></div><div class=fb-modal__footer><button type=button class="btn btn-secondary"></button><button type=button class="btn btn-primary">`),C=f(`<div class=fb-list><!$><!/><div class=fb-list__header><div><span class=fb-eyebrow></span><h2></h2><p class=muted></p></div><div class=fb-list__header-actions><label class=fb-import-btn><input type=file accept=.json hidden><button type=button class="btn btn-secondary"><!$><!/> <!$><!/></button></label><a class="btn btn-primary"href=/settings/custom-fields/new>+ <!$><!/></a></div></div><!$><!/><!$><!/>`),w=f(`<p class=muted>`),T=f(`<option><!$><!/> (<!$><!/>)`),E=f(`<div class=fb-empty-groups><!$><!/><h4></h4><p class=muted></p><a class="btn btn-primary"href=/settings/custom-fields/new>`),D=f(`<div class=fb-groups-table__row role=button tabindex=0><div class=fb-groups-table__title><strong></strong><code></code></div><span class="fb-groups-table__desc muted"></span><span class=fb-groups-table__location></span><span class=fb-groups-table__count></span><span><span class=badge></span></span><div class=fb-groups-table__actions><button type=button class=fb-row-action></button><button type=button class=fb-row-action></button><button type=button class=fb-row-action></button><button type=button class=fb-row-action></button><button type=button class="fb-row-action is-danger">`);function O(){let{t:f}=g(),[p,O]=n([]),[k,A]=n([]),[j,M]=n(``),[N,ne]=n(``),[P,F]=n(!0),[I,L]=n(``);o(async()=>{try{let[e,t]=await Promise.all([_.getContentTypes(),_.getFieldGroups()]);A(e),O(t),e[0]&&M(e[0].slug)}catch(e){L(e instanceof Error?e.message:String(e))}finally{F(!1)}});let R=e=>[...new Set((e.locationRules??[]).flat().filter(e=>e.param===`content_type`&&e.operator===`eq`&&e.value).map(e=>e.value))],re=e=>{let t=R(e);return t.length===0?f(`settings.customFields.groups.allContentTypes`):t.map(e=>k().find(t=>t.slug===e)?.pluralLabel??e).join(`, `)},z=a(()=>{let e=N().trim().toLowerCase();return p().filter(e=>!e.key.startsWith(`core-fields-`)).filter(t=>{let n=R(t);return(!j()||n.length===0||n.includes(j()))&&(!e||t.title.toLowerCase().includes(e)||t.key.toLowerCase().includes(e))})}),B=e=>{window.location.href=`/settings/custom-fields/${e}`},V=async e=>{try{let t=await _.getFieldGroup(e.id);await _.createFieldGroup({...t,id:void 0,key:`${t.key}-copy-${Date.now().toString(36)}`,title:`${t.title} ${f(`settings.customFields.form.copySuffix`)}`}),await H()}catch(e){L(e instanceof Error?e.message:String(e))}},ie=async e=>{try{let t=await _.getFieldGroup(e.id);await _.updateFieldGroup(e.id,{...t,active:!e.active}),await H()}catch(e){L(e instanceof Error?e.message:String(e))}},ae=async e=>{if(window.confirm(f(`settings.customFields.actions.confirmDelete`)))try{await _.deleteFieldGroup(e.id),await H()}catch(e){L(e instanceof Error?e.message:String(e))}},H=async()=>{let e=await _.getFieldGroups();O(e)},[oe,U]=n(!1),[W,G]=n(null),[K,q]=n(!1),se=async e=>{try{let t=await _.exportFieldGroup(e.id),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`${e.key}.json`,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(n)}catch(e){L(e instanceof Error?e.message:String(e))}},J=e=>{let t=e.currentTarget;t.files&&t.files[0]&&G(t.files[0])},ce=async()=>{let e=W();if(e){q(!0);try{let t=await e.text(),n=JSON.parse(t),r=(await _.importFieldGroups(n)).results.filter(e=>!e.success);r.length>0?L(r.map(e=>`${e.key}: ${e.error}`).join(`; `)):L(``),U(!1),G(null),await H()}catch(e){L(e instanceof Error?e.message:String(e))}finally{q(!1)}}},Y=e=>f(`settings.customFields.actions.${e}`),X=e=>f(`settings.customFields.groups.${e}`);return(()=>{var n=d(C),a=n.firstChild,[o,p]=s(a.nextSibling),g=o.nextSibling,_=g.firstChild,O=_.firstChild,A=O.nextSibling,F=A.nextSibling,L=_.nextSibling.firstChild,R=L.firstChild,H=R.nextSibling,q=H.firstChild,[Z,le]=s(q.nextSibling),ue=Z.nextSibling.nextSibling,[de,fe]=s(ue.nextSibling),Q=L.nextSibling,pe=Q.firstChild.nextSibling,[me,he]=s(pe.nextSibling),ge=g.nextSibling,[$,_e]=s(ge.nextSibling),ve=$.nextSibling,[ye,be]=s(ve.nextSibling);return m(n,i(t,{get when(){return I()},get children(){var e=d(y);return m(e,I),e}}),o,p),m(O,()=>f(`settings.customFields.listEyebrow`)),m(A,()=>X(`title`)),m(F,()=>f(`settings.customFields.description`)),R.addEventListener(`change`,J),H.$$click=()=>U(!0),m(H,i(v,{name:`upload`,class:`fb-btn-icon`}),Z,le),m(H,()=>Y(`import`),de,fe),m(Q,()=>X(`new`),me,he),m(n,i(t,{get when(){return!P()},get fallback(){return(()=>{var e=d(w);return m(e,()=>f(`settings.customFields.loading`)),e})()},get children(){return[(()=>{var t=d(b),n=t.firstChild,a=n.firstChild,o=a.nextSibling,c=o.firstChild,p=c.nextSibling,[g,_]=s(p.nextSibling),v=n.nextSibling;return m(a,()=>f(`settings.customFields.contentType`)),o.addEventListener(`change`,e=>M(e.currentTarget.value)),m(c,()=>X(`allContentTypes`)),m(o,i(r,{get each(){return k()},children:t=>(()=>{var n=d(T),r=n.firstChild,[i,a]=s(r.nextSibling),o=i.nextSibling.nextSibling,[c,l]=s(o.nextSibling);return c.nextSibling,m(n,()=>t.pluralLabel,i,a),m(n,()=>t.slug,c,l),e(()=>u(n,`value`,t.slug)),n})()}),g,_),v.$$input=e=>ne(e.currentTarget.value),e(()=>l(v,`placeholder`,X(`search`))),e(()=>u(o,`value`,j())),e(()=>u(v,`value`,N())),h(),t})(),(()=>{var n=d(S);return m(n,i(t,{get when(){return z().length>0},get fallback(){return(()=>{var e=d(E),t=e.firstChild,[n,r]=s(t.nextSibling),a=n.nextSibling,o=a.nextSibling,c=o.nextSibling;return m(e,i(v,{name:`columns-3`,class:`fb-empty-icon`}),n,r),m(a,()=>X(`empty`)),m(o,()=>X(`emptyHint`)),m(c,()=>X(`new`)),e})()},get children(){return[(()=>{var e=d(x),t=e.firstChild,n=t.nextSibling,r=n.nextSibling,i=r.nextSibling,a=i.nextSibling;return m(t,()=>X(`groupName`)),m(n,()=>f(`settings.customFields.form.description`)),m(r,()=>X(`appliesTo`)),m(i,()=>X(`fields`)),m(a,()=>X(`status`)),e})(),i(r,{get each(){return z()},children:t=>(()=>{var n=d(D),r=n.firstChild,i=r.firstChild,a=i.nextSibling,o=r.nextSibling,s=o.nextSibling,l=s.nextSibling,u=l.nextSibling,f=u.firstChild,p=u.nextSibling,g=p.firstChild,_=g.nextSibling,v=_.nextSibling,y=v.nextSibling,b=y.nextSibling;return n.$$keydown=e=>{e.key===`Enter`&&B(t.id)},n.$$click=()=>B(t.id),m(i,()=>t.title),m(a,()=>t.key),m(o,()=>String(t.metadata?.description??`—`)),m(s,()=>re(t)),m(l,()=>t.fieldCount),m(f,(()=>{var e=c(()=>!!t.active);return()=>e()?X(`active`):X(`inactive`)})()),p.$$click=e=>e.stopPropagation(),g.$$click=()=>B(t.id),m(g,()=>Y(`edit`)),_.$$click=()=>void se(t),m(_,()=>Y(`export`)),v.$$click=()=>void V(t),m(v,()=>Y(`duplicate`)),y.$$click=()=>void ie(t),m(y,(()=>{var e=c(()=>!!t.active);return()=>e()?Y(`deactivate`):Y(`activate`)})()),b.$$click=()=>void ae(t),m(b,()=>Y(`delete`)),e(e=>{var n=!!t.active,r=!t.active;return n!==e.e&&f.classList.toggle(`badge-success`,e.e=n),r!==e.t&&f.classList.toggle(`badge-secondary`,e.t=r),e},{e:void 0,t:void 0}),h(),n})()})]}})),n})()]}}),$,_e),m(n,i(t,{get when(){return oe()},get children(){var n=d(te),r=n.firstChild,a=r.firstChild,o=a.firstChild,p=o.nextSibling,g=a.nextSibling,_=g.firstChild,y=_.nextSibling,b=y.firstChild,x=b.nextSibling,[S,C]=s(x.nextSibling),w=S.nextSibling,T=y.nextSibling,[E,D]=s(T.nextSibling),O=g.nextSibling.firstChild,k=O.nextSibling;return n.$$click=()=>{U(!1),G(null)},r.$$click=e=>e.stopPropagation(),m(o,()=>Y(`import`)),p.$$click=()=>{U(!1),G(null)},m(p,i(v,{name:`x`})),m(_,()=>f(`settings.customFields.import.description`)),y.$$click=()=>document.getElementById(`import-file-input`)?.click(),b.addEventListener(`change`,J),m(y,i(v,{name:`upload`,class:`fb-dropzone-icon`}),S,C),m(w,(()=>{var e=c(()=>!!W());return()=>e()?W().name:f(`settings.customFields.import.dropzone`)})()),m(g,i(t,{get when(){return W()},get children(){var e=d(ee);return m(e,()=>f(`settings.customFields.import.hint`)),e}}),E,D),O.$$click=()=>{U(!1),G(null)},m(O,()=>f(`common.cancel`)),k.$$click=ce,m(k,(()=>{var e=c(()=>!!K());return()=>e()?f(`common.loading`):Y(`import`)})()),e(e=>{var t=f(`common.close`),n=!W()||K();return t!==e.e&&l(p,`aria-label`,e.e=t),n!==e.t&&u(k,`disabled`,e.t=n),e},{e:void 0,t:void 0}),h(),n}}),ye,be),h(),n})()}p([`click`,`input`,`keydown`]);export{O as FieldGroupList};
1
+ import{d as e,i as t,p as n,r,s as i,u as a,v as o}from"./solid.8gBSxpeo.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.DwNv8rLL.js";import{n as g}from"./i18n.3zKFZ7KU.js";import{t as _}from"./api.CGA0D2A2.js";import{t as v}from"./FbIcon.uhYN8ybK.js";var y=f(`<div class="notice notice--error">`),b=f(`<div class=fb-list__toolbar><label class=fb-list__filter><span></span><select class=input><option value></option><!$><!/></select></label><input class="input fb-list__search"type=search>`),x=f(`<div class=fb-groups-table__head><span></span><span></span><span></span><span></span><span></span><span>`),S=f(`<section class="card fb-groups-table">`),ee=f(`<p class="muted fb-import-hint">`),te=f(`<div class=fb-modal-backdrop><div class=fb-modal><div class=fb-modal__header><h3></h3><button type=button class=fb-modal__close></button></div><div class=fb-modal__body><p class=muted></p><label class=fb-import-dropzone><input id=import-file-input type=file accept=.json hidden><!$><!/><span></span></label><!$><!/></div><div class=fb-modal__footer><button type=button class="btn btn-secondary"></button><button type=button class="btn btn-primary">`),C=f(`<div class=fb-list><!$><!/><div class=fb-list__header><div><span class=fb-eyebrow></span><h2></h2><p class=muted></p></div><div class=fb-list__header-actions><label class=fb-import-btn><input type=file accept=.json hidden><button type=button class="btn btn-secondary"><!$><!/> <!$><!/></button></label><a class="btn btn-primary"href=/settings/custom-fields/new>+ <!$><!/></a></div></div><!$><!/><!$><!/>`),w=f(`<p class=muted>`),T=f(`<option><!$><!/> (<!$><!/>)`),E=f(`<div class=fb-empty-groups><!$><!/><h4></h4><p class=muted></p><a class="btn btn-primary"href=/settings/custom-fields/new>`),D=f(`<div class=fb-groups-table__row role=button tabindex=0><div class=fb-groups-table__title><strong></strong><code></code></div><span class="fb-groups-table__desc muted"></span><span class=fb-groups-table__location></span><span class=fb-groups-table__count></span><span><span class=badge></span></span><div class=fb-groups-table__actions><button type=button class=fb-row-action></button><button type=button class=fb-row-action></button><button type=button class=fb-row-action></button><button type=button class=fb-row-action></button><button type=button class="fb-row-action is-danger">`);function O(){let{t:f}=g(),[p,O]=n([]),[k,A]=n([]),[j,M]=n(``),[N,ne]=n(``),[P,F]=n(!0),[I,L]=n(``);o(async()=>{try{let[e,t]=await Promise.all([_.getContentTypes(),_.getFieldGroups()]);A(e),O(t),e[0]&&M(e[0].slug)}catch(e){L(e instanceof Error?e.message:String(e))}finally{F(!1)}});let R=e=>[...new Set((e.locationRules??[]).flat().filter(e=>e.param===`content_type`&&e.operator===`eq`&&e.value).map(e=>e.value))],re=e=>{let t=R(e);return t.length===0?f(`settings.customFields.groups.allContentTypes`):t.map(e=>k().find(t=>t.slug===e)?.pluralLabel??e).join(`, `)},z=a(()=>{let e=N().trim().toLowerCase();return p().filter(e=>!e.key.startsWith(`core-fields-`)).filter(t=>{let n=R(t);return(!j()||n.length===0||n.includes(j()))&&(!e||t.title.toLowerCase().includes(e)||t.key.toLowerCase().includes(e))})}),B=e=>{window.location.href=`/settings/custom-fields/${e}`},V=async e=>{try{let t=await _.getFieldGroup(e.id);await _.createFieldGroup({...t,id:void 0,key:`${t.key}-copy-${Date.now().toString(36)}`,title:`${t.title} ${f(`settings.customFields.form.copySuffix`)}`}),await H()}catch(e){L(e instanceof Error?e.message:String(e))}},ie=async e=>{try{let t=await _.getFieldGroup(e.id);await _.updateFieldGroup(e.id,{...t,active:!e.active}),await H()}catch(e){L(e instanceof Error?e.message:String(e))}},ae=async e=>{if(window.confirm(f(`settings.customFields.actions.confirmDelete`)))try{await _.deleteFieldGroup(e.id),await H()}catch(e){L(e instanceof Error?e.message:String(e))}},H=async()=>{let e=await _.getFieldGroups();O(e)},[oe,U]=n(!1),[W,G]=n(null),[K,q]=n(!1),se=async e=>{try{let t=await _.exportFieldGroup(e.id),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`${e.key}.json`,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(n)}catch(e){L(e instanceof Error?e.message:String(e))}},J=e=>{let t=e.currentTarget;t.files&&t.files[0]&&G(t.files[0])},ce=async()=>{let e=W();if(e){q(!0);try{let t=await e.text(),n=JSON.parse(t),r=(await _.importFieldGroups(n)).results.filter(e=>!e.success);r.length>0?L(r.map(e=>`${e.key}: ${e.error}`).join(`; `)):L(``),U(!1),G(null),await H()}catch(e){L(e instanceof Error?e.message:String(e))}finally{q(!1)}}},Y=e=>f(`settings.customFields.actions.${e}`),X=e=>f(`settings.customFields.groups.${e}`);return(()=>{var n=d(C),a=n.firstChild,[o,p]=s(a.nextSibling),g=o.nextSibling,_=g.firstChild,O=_.firstChild,A=O.nextSibling,F=A.nextSibling,L=_.nextSibling.firstChild,R=L.firstChild,H=R.nextSibling,q=H.firstChild,[Z,le]=s(q.nextSibling),ue=Z.nextSibling.nextSibling,[de,fe]=s(ue.nextSibling),Q=L.nextSibling,pe=Q.firstChild.nextSibling,[me,he]=s(pe.nextSibling),ge=g.nextSibling,[$,_e]=s(ge.nextSibling),ve=$.nextSibling,[ye,be]=s(ve.nextSibling);return m(n,i(t,{get when(){return I()},get children(){var e=d(y);return m(e,I),e}}),o,p),m(O,()=>f(`settings.customFields.listEyebrow`)),m(A,()=>X(`title`)),m(F,()=>f(`settings.customFields.description`)),R.addEventListener(`change`,J),H.$$click=()=>U(!0),m(H,i(v,{name:`upload`,class:`fb-btn-icon`}),Z,le),m(H,()=>Y(`import`),de,fe),m(Q,()=>X(`new`),me,he),m(n,i(t,{get when(){return!P()},get fallback(){return(()=>{var e=d(w);return m(e,()=>f(`settings.customFields.loading`)),e})()},get children(){return[(()=>{var t=d(b),n=t.firstChild,a=n.firstChild,o=a.nextSibling,c=o.firstChild,p=c.nextSibling,[g,_]=s(p.nextSibling),v=n.nextSibling;return m(a,()=>f(`settings.customFields.contentType`)),o.addEventListener(`change`,e=>M(e.currentTarget.value)),m(c,()=>X(`allContentTypes`)),m(o,i(r,{get each(){return k()},children:t=>(()=>{var n=d(T),r=n.firstChild,[i,a]=s(r.nextSibling),o=i.nextSibling.nextSibling,[c,l]=s(o.nextSibling);return c.nextSibling,m(n,()=>t.pluralLabel,i,a),m(n,()=>t.slug,c,l),e(()=>u(n,`value`,t.slug)),n})()}),g,_),v.$$input=e=>ne(e.currentTarget.value),e(()=>l(v,`placeholder`,X(`search`))),e(()=>u(o,`value`,j())),e(()=>u(v,`value`,N())),h(),t})(),(()=>{var n=d(S);return m(n,i(t,{get when(){return z().length>0},get fallback(){return(()=>{var e=d(E),t=e.firstChild,[n,r]=s(t.nextSibling),a=n.nextSibling,o=a.nextSibling,c=o.nextSibling;return m(e,i(v,{name:`columns-3`,class:`fb-empty-icon`}),n,r),m(a,()=>X(`empty`)),m(o,()=>X(`emptyHint`)),m(c,()=>X(`new`)),e})()},get children(){return[(()=>{var e=d(x),t=e.firstChild,n=t.nextSibling,r=n.nextSibling,i=r.nextSibling,a=i.nextSibling;return m(t,()=>X(`groupName`)),m(n,()=>f(`settings.customFields.form.description`)),m(r,()=>X(`appliesTo`)),m(i,()=>X(`fields`)),m(a,()=>X(`status`)),e})(),i(r,{get each(){return z()},children:t=>(()=>{var n=d(D),r=n.firstChild,i=r.firstChild,a=i.nextSibling,o=r.nextSibling,s=o.nextSibling,l=s.nextSibling,u=l.nextSibling,f=u.firstChild,p=u.nextSibling,g=p.firstChild,_=g.nextSibling,v=_.nextSibling,y=v.nextSibling,b=y.nextSibling;return n.$$keydown=e=>{e.key===`Enter`&&B(t.id)},n.$$click=()=>B(t.id),m(i,()=>t.title),m(a,()=>t.key),m(o,()=>String(t.metadata?.description??`—`)),m(s,()=>re(t)),m(l,()=>t.fieldCount),m(f,(()=>{var e=c(()=>!!t.active);return()=>e()?X(`active`):X(`inactive`)})()),p.$$click=e=>e.stopPropagation(),g.$$click=()=>B(t.id),m(g,()=>Y(`edit`)),_.$$click=()=>void se(t),m(_,()=>Y(`export`)),v.$$click=()=>void V(t),m(v,()=>Y(`duplicate`)),y.$$click=()=>void ie(t),m(y,(()=>{var e=c(()=>!!t.active);return()=>e()?Y(`deactivate`):Y(`activate`)})()),b.$$click=()=>void ae(t),m(b,()=>Y(`delete`)),e(e=>{var n=!!t.active,r=!t.active;return n!==e.e&&f.classList.toggle(`badge-success`,e.e=n),r!==e.t&&f.classList.toggle(`badge-secondary`,e.t=r),e},{e:void 0,t:void 0}),h(),n})()})]}})),n})()]}}),$,_e),m(n,i(t,{get when(){return oe()},get children(){var n=d(te),r=n.firstChild,a=r.firstChild,o=a.firstChild,p=o.nextSibling,g=a.nextSibling,_=g.firstChild,y=_.nextSibling,b=y.firstChild,x=b.nextSibling,[S,C]=s(x.nextSibling),w=S.nextSibling,T=y.nextSibling,[E,D]=s(T.nextSibling),O=g.nextSibling.firstChild,k=O.nextSibling;return n.$$click=()=>{U(!1),G(null)},r.$$click=e=>e.stopPropagation(),m(o,()=>Y(`import`)),p.$$click=()=>{U(!1),G(null)},m(p,i(v,{name:`x`})),m(_,()=>f(`settings.customFields.import.description`)),y.$$click=()=>document.getElementById(`import-file-input`)?.click(),b.addEventListener(`change`,J),m(y,i(v,{name:`upload`,class:`fb-dropzone-icon`}),S,C),m(w,(()=>{var e=c(()=>!!W());return()=>e()?W().name:f(`settings.customFields.import.dropzone`)})()),m(g,i(t,{get when(){return W()},get children(){var e=d(ee);return m(e,()=>f(`settings.customFields.import.hint`)),e}}),E,D),O.$$click=()=>{U(!1),G(null)},m(O,()=>f(`common.cancel`)),k.$$click=ce,m(k,(()=>{var e=c(()=>!!K());return()=>e()?f(`common.loading`):Y(`import`)})()),e(e=>{var t=f(`common.close`),n=!W()||K();return t!==e.e&&l(p,`aria-label`,e.e=t),n!==e.t&&u(k,`disabled`,e.t=n),e},{e:void 0,t:void 0}),h(),n}}),ye,be),h(),n})()}p([`click`,`input`,`keydown`]);export{O as FieldGroupList};
@@ -1,4 +1,4 @@
1
- import{d as e}from"./solid.8gBSxpeo.js";import{a as t,d as n,i as r,m as i,s as a}from"./web.DwNv8rLL.js";import{n as o}from"./i18n.EKfvSb1v.js";import{t as s}from"./version.B4bPYHRP.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>
1
+ import{d as e}from"./solid.8gBSxpeo.js";import{a as t,d as n,i as r,m as i,s as a}from"./web.DwNv8rLL.js";import{n as o}from"./i18n.3zKFZ7KU.js";import{t as s}from"./version.DMCc00VQ.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%;
@@ -0,0 +1 @@
1
+ import{i as e,p as t,s as n,u as r,v as i}from"./solid.8gBSxpeo.js";import{a,c as o,i as s,m as c,s as l}from"./web.DwNv8rLL.js";import{n as u}from"./i18n.3zKFZ7KU.js";import{t as d}from"./api.CGA0D2A2.js";import{i as f,n as p,r as m,s as h}from"./src.DQwsXUur.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]=t({}),[C,w]=t(!1),[T,E]=t(``),[D,O]=t(``),[k,A]=t(!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`)}]);i(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 t=s(y),r=t.firstChild,[i,u]=a(r.nextSibling),d=i.nextSibling,[w,E]=a(d.nextSibling),O=w.nextSibling,[A,N]=a(O.nextSibling);return l(t,n(e,{get when(){return T()},get children(){var e=s(g);return l(e,T),e}}),i,u),l(t,n(e,{get when(){return D()},get children(){var e=s(_);return l(e,D),e}}),w,E),l(t,n(e,{get when(){return C()},get fallback(){return(()=>{var e=s(b);return l(e,()=>c(`settings.general.loading`)),e})()},get children(){return n(m,{get children(){var e=s(v),t=e.firstChild,r=t.nextSibling,i=r.nextSibling;return e.addEventListener(`submit`,M),l(t,()=>c(`settings.general.title`)),l(r,()=>j().map(e=>e.type===`select`?n(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})}):n(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(i,n(p,{variant:`primary`,type:`submit`,get disabled(){return k()},get loading(){return k()},get children(){return c(`settings.general.save`)}})),e}})}}),A,N),t})()}export{x as GeneralSettings};
@@ -1 +1 @@
1
- import{d as e,i as t,p as n,r,s as i,v as a}from"./solid.8gBSxpeo.js";import{a as o,c as s,d as c,f as l,i as u,m as d,r as f,s as p,u as m}from"./web.DwNv8rLL.js";import{n as h}from"./i18n.EKfvSb1v.js";import{t as g}from"./api.CM0tblEa.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]=n([]),[w,T]=n(90),[E,D]=n(``),[O,k]=n(``),[A,j]=n(``),[M,N]=n(``),[P,F]=n(!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)}};a(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 n=u(b),a=n.firstChild,[h,g]=o(a.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(n,i(t,{get when(){return A()},get children(){var e=u(_);return p(e,A),e}}),h,g),p(n,i(t,{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(t,{get when(){return!P()},get fallback(){return(()=>{var e=u(x);return p(e,()=>d(`logs.loading`)),e})()},get children(){return i(t,{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),e(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}),e(()=>l(G,`value`,w())),e(()=>l(Z,`value`,E())),e(()=>l(Q,`value`,O())),m(),n})()}f([`input`,`click`]);export{C as LogsManager};
1
+ import{d as e,i as t,p as n,r,s as i,v as a}from"./solid.8gBSxpeo.js";import{a as o,c as s,d as c,f as l,i as u,m as d,r as f,s as p,u as m}from"./web.DwNv8rLL.js";import{n as h}from"./i18n.3zKFZ7KU.js";import{t as g}from"./api.CGA0D2A2.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]=n([]),[w,T]=n(90),[E,D]=n(``),[O,k]=n(``),[A,j]=n(``),[M,N]=n(``),[P,F]=n(!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)}};a(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 n=u(b),a=n.firstChild,[h,g]=o(a.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(n,i(t,{get when(){return A()},get children(){var e=u(_);return p(e,A),e}}),h,g),p(n,i(t,{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(t,{get when(){return!P()},get fallback(){return(()=>{var e=u(x);return p(e,()=>d(`logs.loading`)),e})()},get children(){return i(t,{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),e(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}),e(()=>l(G,`value`,w())),e(()=>l(Z,`value`,E())),e(()=>l(Q,`value`,O())),m(),n})()}f([`input`,`click`]);export{C as LogsManager};
@@ -0,0 +1 @@
1
+ import{d as e,i as t,p as n,r,s as i,v as a}from"./solid.8gBSxpeo.js";import{a as o,c as s,d as c,f as l,i as u,m as d,r as f,s as p,u as ee}from"./web.DwNv8rLL.js";import{n as m}from"./i18n.3zKFZ7KU.js";import{t as h}from"./api.CGA0D2A2.js";import{a as g,i as _,n as v,o as y,s as te}from"./src.DQwsXUur.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]=n([]),[Ce,T]=n(0),[E,D]=n(1),[O,we]=n(``),[k,A]=n(``),[j,M]=n(``),[Te,N]=n(``),[Ee,P]=n(!1),[F,I]=n(null),[L,R]=n({title:``,alt:``,caption:``,description:``}),[De,z]=n(!1),[Oe,B]=n(!1),[ke,V]=n(!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))}};a(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 n=u(ae),a=n.firstChild,[m,h]=o(a.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(n,i(t,{get when(){return j()},get children(){var e=u(ne);return p(e,j),e}}),m,h),p(n,i(t,{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(n,i(t,{get when(){return C().length>0},get fallback(){return(()=>{var e=u(oe);return p(e,()=>f(`media.empty`)),e})()},get children(){var n=u(ie);return p(n,i(r,{get each(){return C()},children:n=>(()=>{var r=u(ce),a=r.firstChild,s=a.nextSibling.firstChild,l=s.nextSibling,d=l.firstChild,[f,m]=o(d.nextSibling),h=f.nextSibling.nextSibling,[g,_]=o(h.nextSibling);return r.$$click=()=>Ae(n),p(a,i(t,{get when(){return b(n)},get fallback(){return(()=>{var e=u(le);return p(e,()=>n.mime_type.split(`/`)[1]?.toUpperCase()??`FILE`),e})()},get children(){var t=u(se);return e(e=>{var r=H(n),i=n.alt??x(n);return r!==e.e&&c(t,`src`,e.e=r),i!==e.t&&c(t,`alt`,e.t=i),e},{e:void 0,t:void 0}),t}})),p(s,()=>x(n)),p(l,()=>n.filename,f,m),p(l,()=>ve(n.size),g,_),e(e=>{var t=F()?.id===n.id,i=x(n);return t!==e.e&&r.classList.toggle(`media-card--selected`,e.e=t),i!==e.t&&c(s,`title`,e.t=i),e},{e:void 0,t:void 0}),ee(),r})()})),n}}),Q,We),p(n,i(y,{get page(){return E()},limit:24,get total(){return Ce()},onPageChange:e=>{D(e),U()}}),$,Ke),p(n,i(g,{get open(){return!!F()},get title(){return s(()=>!!F())()?x(F()):f(`media.details.title`)},onClose:()=>I(null),get children(){return i(t,{get when(){return F()},children:n=>(()=>{var r=u(_e),a=r.firstChild,d=a.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=a.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(a,i(t,{get when(){return b(n())},get children(){var t=u(ue);return e(e=>{var r=H(n()),i=L().alt||x(n());return r!==e.e&&c(t,`src`,e.e=r),i!==e.t&&c(t,`alt`,e.t=i),e},{e:void 0,t:void 0}),t}}),m,h),p(a,i(t,{get when(){return ye(n())},get children(){var t=u(de);return e(()=>c(t,`src`,H(n()))),t}}),y,te),p(a,i(t,{get when(){return be(n())},get children(){var t=u(fe);return e(()=>c(t,`src`,H(n()))),t}}),re,ie),p(a,i(t,{get when(){return xe(n())},get children(){var t=u(pe);return e(e=>{var r=x(n()),i=H(n());return r!==e.e&&c(t,`title`,e.e=r),i!==e.t&&c(t,`src`,e.t=i),e},{e:void 0,t:void 0}),t}}),oe,se),p(a,i(t,{get when(){return s(()=>!(b(n())||ye(n())||be(n())))()&&!xe(n())},get children(){var e=u(me);return p(e,()=>n().mime_type.split(`/`)[1]?.toUpperCase()??`FILE`),e}}),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,()=>n().filename),p(B,()=>f(`media.details.type`)),p(V,()=>n().mime_type),p(U,()=>f(`media.details.size`)),p(W,()=>ve(n().size)),p(F,i(t,{get when(){return Se(n())},get children(){return[(()=>{var e=u(he);return p(e,()=>f(`media.details.dimensions`)),e})(),(()=>{var e=u(ge);return p(e,()=>Se(n())),e})()]}}),G,Fe),p(Ie,()=>f(`media.details.uploaded`)),p(K,(()=>{var e=s(()=>!!n().created_at);return()=>e()?new Date(n().created_at).toLocaleString():`—`})()),p(Le,()=>f(`media.details.url`)),p(q,()=>H(n())),Re.$$click=()=>void Pe(H(n())),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(n()),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),e(()=>l(Ve,`disabled`,ke())),e(()=>l(P,`value`,L().description)),ee(),r})()})}}),Je,Ye),e(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}),n})()}f([`click`,`input`]);export{C as MediaLibrary};