@oktis-works/admin 0.5.4 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/_astro/{ActivityWidget.BNFwjO71.js → ActivityWidget.CLFjbNJf.js} +1 -1
- package/dist/client/_astro/{AdminBar.DRgRB1PC.js → AdminBar.CKYNoMCz.js} +1 -1
- package/dist/client/_astro/{AtGlanceWidget.h60KI_JU.js → AtGlanceWidget.DZLDbAfC.js} +1 -1
- package/dist/client/_astro/{BaseLayout.Du3LchRX.css → BaseLayout.Cb-QSCvc.css} +1 -1
- package/dist/client/_astro/{ContentEditor.BDb6qSSI.js → ContentEditor.BmpwqkNT.js} +1 -1
- package/dist/client/_astro/ContentEditor.saSUoKf0.js +1 -0
- package/dist/client/_astro/ContentTypeWorkspace.00bHkcJD.js +1 -0
- package/dist/client/_astro/{DashboardHome.1vPxu78E.js → DashboardHome.DCz0EiH2.js} +1 -1
- package/dist/client/_astro/DashboardLayout.DH1KnS2w.css +1 -0
- 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
- package/dist/client/_astro/{FieldGroupEditor.C9U6-zxk.js → FieldGroupEditor.Bdm2FW0L.js} +1 -1
- package/dist/client/_astro/{FieldGroupList.DYFBUBY7.js → FieldGroupList.BaNTs6an.js} +1 -1
- package/dist/client/_astro/{Footer.BwLmoHuk.js → Footer.B3_EZU5m.js} +1 -1
- package/dist/client/_astro/GeneralSettings.BH-f6pL0.js +1 -0
- package/dist/client/_astro/{LogsManager.CBwBkCUP.js → LogsManager.1c_AlgX8.js} +1 -1
- package/dist/client/_astro/MediaLibrary.DH7eqign.js +1 -0
- package/dist/client/_astro/{MenuManager.BhYhygsR.js → MenuManager.CLPv5Ths.js} +1 -1
- package/dist/client/_astro/{PluginManager.DxAKvMfM.js → PluginManager.Duzn64IF.js} +1 -1
- package/dist/client/_astro/{PostTypesManager.DLymaQPT.js → PostTypesManager.BHKbIEwD.js} +1 -1
- package/dist/client/_astro/{QuickDraftWidget.CfUR8qmY.js → QuickDraftWidget.MBRACUqB.js} +1 -1
- package/dist/client/_astro/{ResourceHubs.BnINa0O3.js → ResourceHubs.CL3KxW6a.js} +1 -1
- package/dist/client/_astro/{TaxonomiesManager.1EZYO2u5.js → TaxonomiesManager.DEwFIIP9.js} +1 -1
- package/dist/client/_astro/{TaxonomyTermsManager.YXbuam33.js → TaxonomyTermsManager.DWljfgZH.js} +1 -1
- package/dist/client/_astro/{ThemeManager.EFMZJdmx.js → ThemeManager.CAGeBTsz.js} +1 -1
- package/dist/client/_astro/{UserCreateForm.C_m7ovUU.js → UserCreateForm.wCOVD_YS.js} +1 -1
- package/dist/client/_astro/UsersManager.RHbgYhoE.js +1 -0
- package/dist/client/_astro/{WebhooksManager.CKRtabi3.js → WebhooksManager.B-g7Wbit.js} +1 -1
- package/dist/client/_astro/api.CGA0D2A2.js +1 -0
- package/dist/client/_astro/extensions.CKCZC04g.js +1 -0
- package/dist/client/_astro/{i18n.EKfvSb1v.js → i18n.3zKFZ7KU.js} +1 -1
- 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
- package/dist/client/_astro/src.DQwsXUur.js +1 -0
- package/dist/client/_astro/{version.B4bPYHRP.js → version.BrTlYw56.js} +1 -1
- package/dist/server/chunks/{ContentEditor_DfYDk5IM.mjs → ContentEditor_BEGQZSwm.mjs} +525 -2
- package/dist/server/chunks/{DashboardLayout_7Gcd6oTS.mjs → DashboardLayout_BrMujuUY.mjs} +10 -7
- package/dist/server/chunks/{MediaLibrary_fu8AtNog.mjs → MediaLibrary_BnG47fd2.mjs} +2 -2
- package/dist/server/chunks/PageHeader_CBOioOjo.mjs +42 -0
- package/dist/server/chunks/{_id__BVLdyCKg.mjs → _id__CPqaq-or.mjs} +10 -5
- package/dist/server/chunks/{_slug__DG6xjEan.mjs → _slug__B53mL1bx.mjs} +6 -2
- package/dist/server/chunks/{access_B8fU0pWq.mjs → access_CtJtAQdD.mjs} +8 -8
- package/dist/server/chunks/{custom-fields_BOqCiSPQ.mjs → custom-fields_BP_aajHY.mjs} +2 -2
- package/dist/server/chunks/{dist_D98LO9y-.mjs → dist_CP9QIrJI.mjs} +2 -1394
- package/dist/server/chunks/{edit_C27RHq7N.mjs → edit_DG_K-2Qj.mjs} +8 -8
- package/dist/server/chunks/{general_TSviTaPT.mjs → general_q5AGQ36F.mjs} +8 -8
- package/dist/server/chunks/{i18n_Co0XNC0I.mjs → i18n_B-Vk5esc.mjs} +4 -1
- package/dist/server/chunks/{index_CCNhQxvS.mjs → index_C38LMbC9.mjs} +8 -8
- package/dist/server/chunks/index_CM5J56RR.mjs +32 -0
- package/dist/server/chunks/{index_t5k7sOZ8.mjs → index_CxA75vPH.mjs} +7 -10
- package/dist/server/chunks/{index_CRSTdqw0.mjs → index_FRRIyHOL.mjs} +2 -2
- package/dist/server/chunks/{index_BwaqRmvv.mjs → index_wJQJWCXJ.mjs} +8 -8
- package/dist/server/chunks/{login_DWlZa2zd.mjs → login_CNRlK7LB.mjs} +1 -1
- package/dist/server/chunks/{logs_DrjJ6S6J.mjs → logs_jnQGnqA9.mjs} +8 -8
- package/dist/server/chunks/{menus_DjfOcrez.mjs → menus_D5Vn-oIS.mjs} +2 -2
- package/dist/server/chunks/{new_B484WwaA.mjs → new_7JMkKLJt.mjs} +9 -9
- package/dist/server/chunks/{new_DNNbQ1Zw.mjs → new_CBhCftFl.mjs} +8 -8
- package/dist/server/chunks/{node_CECPlmah.mjs → node_kWZa8y--.mjs} +1 -1
- package/dist/server/chunks/{plugins_Bhuk-oUR.mjs → plugins_CfwZhokZ.mjs} +5 -4
- package/dist/server/chunks/{post-types_BtisIanW.mjs → post-types_isCYbGpy.mjs} +10 -5
- package/dist/server/chunks/semver_WbqCUY_o.mjs +1395 -0
- package/dist/server/chunks/{sharp_DQfjpH-u.mjs → sharp_37gnUicY.mjs} +2 -2
- package/dist/server/chunks/{taxonomies_CHJK2gT1.mjs → taxonomies_3rdILM-c.mjs} +10 -5
- package/dist/server/chunks/{taxonomy_DboKpEOu.mjs → taxonomy_APMNQqQ0.mjs} +9 -7
- package/dist/server/chunks/{themes_MC8vERGL.mjs → themes_CmKm5Q2f.mjs} +5 -4
- package/dist/server/chunks/{upload_BMoVV-rt.mjs → upload_5PzqW0LU.mjs} +8 -8
- package/dist/server/chunks/{webhooks_EHN9q7Yv.mjs → webhooks_CuZ4P9Yb.mjs} +8 -8
- package/dist/server/entry.mjs +25 -25
- package/dist/server/virtual_astro_middleware.mjs +1 -1
- package/package.json +5 -5
- package/dist/client/_astro/ContentEditor.QGAstGzA.js +0 -1
- package/dist/client/_astro/ContentTypeWorkspace.K35mfD2P.js +0 -1
- package/dist/client/_astro/DashboardLayout.C1OQ0r8H.css +0 -1
- package/dist/client/_astro/GeneralSettings.EU3z_sSD.js +0 -1
- package/dist/client/_astro/MediaLibrary.D56bkgPF.js +0 -1
- package/dist/client/_astro/UsersManager.t4-9GwDK.js +0 -1
- package/dist/client/_astro/api.CM0tblEa.js +0 -1
- package/dist/client/_astro/dist.D-evrPNi.js +0 -1
- package/dist/client/_astro/extensions.OpEcHTzv.js +0 -1
- package/dist/server/chunks/index_40l_yCUu.mjs +0 -27
- /package/dist/server/chunks/{BaseLayout_CHj9u5wO.mjs → BaseLayout_vNs_yXMd.mjs} +0 -0
|
@@ -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.
|
|
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.
|
|
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.BrTlYw56.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.
|
|
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};
|
|
@@ -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";var v=f(`<div class=wp-menu-empty-level>`),y=f(`<div class=wp-menu-tree><!$><!/><!$><!/>`),b=f(`<article class=wp-menu-item><div class=wp-menu-item__header><span class=wp-menu-drag draggable=true>⠿⠿⠿</span><span class=wp-menu-item__label><strong></strong><small></small></span><div class=wp-menu-item__actions><button type=button class="btn btn-sm">↑</button><button type=button class="btn btn-sm">↓</button><button type=button class="btn btn-sm">→</button><button type=button class="btn btn-sm">←</button></div></div><details class=wp-menu-item__details><summary></summary><div class=wp-menu-item__fields><label><!$><!/><input class=input></label><label><!$><!/><input class=input></label><label><!$><!/><input class=input></label><label><!$><!/><input class=input></label><label><!$><!/><select class=input><option value=_self></option><option value=_blank></option></select></label><label><!$><!/><input class=input></label><label class=wp-menu-item__wide><!$><!/><textarea class=input rows=2></textarea></label><button type=button class="btn btn-danger btn-sm"></button></div></details><!$><!/>`),x=f(`<p class=muted>`),S=f(`<details class=wp-menu-box><summary></summary><div class=wp-menu-box__body><!$><!/><!$><!/>`),C=f(`<div class="notice notice--error">`),w=f(`<div class=notice>`),T=f(`<div class="menus-manager wp-menus-manager"><!$><!/><!$><!/><!$><!/><style>.wp-menu-editor__top,.wp-structure-heading,.wp-menu-editor__identity,.wp-menu-item__header,.wp-menu-item__actions,.form-actions{display:flex;align-items:center;gap:.7rem}.wp-menu-editor__top,.wp-structure-heading{justify-content:space-between}.wp-menu-editor__top{margin-bottom:1rem}.wp-menu-editor__top h3{margin:.25rem 0 0}.wp-eyebrow{display:block;margin-top:.7rem;font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;color:var(--color-muted)}.wp-menu-editor__identity{margin-bottom:1rem;align-items:end}.wp-menu-editor__identity label{display:grid;gap:.35rem;flex:1}.wp-menu-editor__columns{display:grid;grid-template-columns:330px minmax(0,1fr);gap:1.2rem;align-items:start}.wp-menu-sources,.wp-menu-structure{min-width:0}.wp-menu-sources>h4,.wp-structure-heading h4{margin:0}.wp-menu-box{background:var(--color-surface,#fff);border:1px solid var(--color-border,#ddd);margin-bottom:.7rem}.wp-menu-box summary{cursor:pointer;padding:.8rem;font-weight:600}.wp-menu-box__body{padding:0 .8rem .8rem;display:grid;gap:.6rem}.wp-menu-box__body p{margin:0}.wp-source-list{display:grid;gap:.35rem;max-height:220px;overflow:auto;border:1px solid var(--color-border,#ddd);padding:.45rem}.wp-source-row{display:flex!important;align-items:start;gap:.45rem!important;padding:.3rem}.wp-source-row span,.wp-source-link{display:grid;gap:.12rem;text-align:left}.wp-source-row small,.wp-source-link small,.wp-menu-item__label small{color:var(--color-muted);font-size:.75rem}.wp-source-link{border:0;background:none;color:inherit;padding:.35rem;width:100%;cursor:pointer}.wp-source-link:hover{background:var(--color-surface-muted,#f5f5f5)}.wp-taxonomy-source{display:grid;gap:.2rem;border-top:1px solid var(--color-border,#ddd);padding-top:.5rem}.wp-taxonomy-source:first-child{border-top:0;padding-top:0}.wp-menu-structure{background:var(--color-surface-muted,#f7f7f7);padding:1rem}.wp-menu-structure .wp-structure-heading{margin-bottom:1rem}.wp-menu-tree{display:grid;gap:.55rem}.wp-menu-tree[data-depth="1"]{margin:.55rem 0 0 2rem}.wp-menu-item{background:var(--color-surface,#fff);border:1px solid var(--color-border,#dcdcde);box-shadow:0 1px 1px rgba(0,0,0,.04)}.wp-menu-item__header{padding:.55rem .7rem}.wp-menu-drag{cursor:grab;letter-spacing:-.2rem;width:1.4rem;color:var(--color-muted);user-select:none}.wp-menu-item__label{display:grid;gap:.15rem;flex:1;min-width:0}.wp-menu-item__label small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-menu-item__actions{margin-left:auto}.wp-menu-item__details{border-top:1px solid var(--color-border,#ddd)}.wp-menu-item__details summary{padding:.5rem .7rem;cursor:pointer;color:var(--color-muted);font-size:.85rem}.wp-menu-item__fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem;padding:.7rem;border-top:1px solid var(--color-border,#ddd)}.wp-menu-item__fields label{display:grid;gap:.3rem}.wp-menu-item__wide{grid-column:1/-1}.wp-menu-empty,.wp-menu-empty-level{text-align:center;padding:2rem;color:var(--color-muted)}.wp-menu-empty-level{border:1px dashed var(--color-border,#ccc);padding:1rem}.wp-menu-settings{margin-top:1rem}.wp-menu-settings h4{margin-top:0}.wp-menu-settings p{margin-bottom:0}.wp-menus-manager .menu-actions{white-space:nowrap;text-align:right}@media(max-width:850px){.wp-menu-editor__columns{grid-template-columns:1fr}.wp-menu-sources{order:2}.wp-menu-structure{order:1}.wp-menu-editor__identity,.wp-menu-editor__top{align-items:stretch;display:grid}.wp-menu-item__fields{grid-template-columns:1fr}.wp-menu-item__wide{grid-column:auto}}`),E=f(`<div class=skeleton>`),ee=f(`<div class=manager-toolbar><p class=muted></p><button class="btn btn-primary"type=button>+ <!$><!/>`),D=f(`<table class=table><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody>`),te=f(`<section class=card>`),O=f(`<p class="muted empty-state">`),k=f(`<tr><td><strong></strong></td><td><code></code></td><td></td><td class=menu-actions><button class="btn btn-secondary btn-sm"type=button></button> <button class="btn btn-danger btn-sm"type=button>`),ne=f(`<input class=input>`),A=f(`<div class=wp-source-list>`),j=f(`<button type=button class="btn btn-secondary btn-sm">`),re=f(`<label><!$><!/><input class=input placeholder=https://>`),ie=f(`<label><!$><!/><input class=input>`),ae=f(`<form class=wp-menu-editor><div class=wp-menu-editor__top><div><button type=button class="btn btn-secondary btn-sm">← <!$><!/></button><span class=wp-eyebrow></span><h3></h3></div><div class=form-actions><button class="btn btn-secondary"type=button></button><button class="btn btn-primary"type=submit></button></div></div><div class="wp-menu-editor__identity card"><label><!$><!/><input class=input required></label><label><!$><!/><input class=input></label></div><div class=wp-menu-editor__columns><aside class=wp-menu-sources><h4></h4><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/></aside><main class=wp-menu-structure><div class=wp-structure-heading><div><h4></h4><p class=muted></p></div><span class=badge><!$><!/> <!$><!/></span></div><!$><!/><section class="card wp-menu-settings"><h4></h4><label class=checkbox-label><input type=checkbox> <!$><!/></label><p class=muted>`),oe=f(`<label class=wp-source-row><input type=checkbox><span><!$><!/><small>/<!$><!/>`),se=f(`<label class=wp-source-row><input type=checkbox><span><!$><!/><small>/post/<!$><!/>`),M=f(`<div class=wp-taxonomy-source><strong></strong><!$><!/>`),N=f(`<button type=button class=wp-source-link><!$><!/><small>/<!$><!/>/<!$><!/>`),ce=f(`<button type=button class=wp-source-link><!$><!/><small>/<!$><!/>`),le=f(`<div class="wp-menu-empty card">`);function P(e){return`${e}_${typeof globalThis.crypto?.randomUUID==`function`?globalThis.crypto.randomUUID():Math.random().toString(36).slice(2)}`}function F(e){return e.toLowerCase().normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/(^-|-$)/g,``)}function I(e,t=null){let n=e.id||P(`item`);return{...e,id:n,clientId:n,parentId:t??e.parentId??null,children:[]}}function ue(e){let t=(Array.isArray(e)?e:[]).map(e=>I(e)),n=new Map(t.map(e=>[e.id,e])),r=[];for(let e of t){let t=e.parentId?n.get(e.parentId):void 0;t&&t.id!==e.id?t.children.push(e):r.push(e)}let i=e=>(e.sort((e,t)=>(e.order??0)-(t.order??0)),e.forEach(e=>i(e.children)),e);return i(r)}function L(e,t=null){let n=[];return e.forEach((e,r)=>{let{clientId:i,children:a,...o}=e;n.push({...o,id:e.id,parentId:t,order:r}),n.push(...L(a,e.id))}),n}function R(e){return e.map(e=>({...e,children:R(e.children)}))}function z(e,t){return e.id===t||e.children.some(e=>z(e,t))}function B(e,t){let n=e.findIndex(e=>e.id===t);if(n>=0){let t=[...e],[r]=t.splice(n,1);return{items:t,removed:r}}for(let n=0;n<e.length;n+=1){let r=B(e[n].children,t);if(r.removed){let t=[...e];return t[n]={...t[n],children:r.items},{items:t,removed:r.removed}}}return{items:e}}function V(e,t,n){let r=e.findIndex(e=>e.id===t);if(r>=0){let t=[...e];return t.splice(r,0,n),{items:t,inserted:!0}}for(let r=0;r<e.length;r+=1){let i=V(e[r].children,t,n);if(i.inserted){let t=[...e];return t[r]={...t[r],children:i.items},{items:t,inserted:!0}}}return{items:e,inserted:!1}}function H(e,t,n){for(let r=0;r<e.length;r+=1){let i=e[r];if(i.id===t){let t=[...e];return t[r]={...i,children:[...i.children,n]},{items:t,inserted:!0}}let a=H(i.children,t,n);if(a.inserted){let t=[...e];return t[r]={...i,children:a.items},{items:t,inserted:!0}}}return{items:e,inserted:!1}}function U(e,t,n){return e.map(e=>e.id===t?{...e,...n}:{...e,children:U(e.children,t,n)})}function de(e,t){return B(e,t).items}function fe(e,t,n){if(t===n||e.some(e=>e.id===t&&z(e,n)))return e;let r=B(e,t);if(!r.removed)return e;let i=V(r.items,n,r.removed);return i.inserted?i.items:e}function pe(e,t,n){if(t===n||e.some(e=>e.id===t&&z(e,n)))return e;let r=B(e,t);if(!r.removed)return e;let i=H(r.items,n,r.removed);return i.inserted?i.items:e}function W(e,t,n){let r=e.findIndex(e=>e.id===t);if(r>=0)return{siblings:e,index:r,parent:n};for(let n of e){let e=W(n.children,t,n);if(e)return e}return null}function me(e,t,n){let r=R(e),i=W(r,t);if(!i)return e;let a=i.index+n;return a<0||a>=i.siblings.length?e:([i.siblings[i.index],i.siblings[a]]=[i.siblings[a],i.siblings[i.index]],r)}function he(e,t){let n=R(e),r=W(n,t);return!r||r.index===0?e:pe(n,t,r.siblings[r.index-1].id)}function ge(e,t){let n=R(e),r=W(n,t);return r?.parent?fe(n,t,r.parent.id):e}function _e(e){let t=P(`item`);return{id:t,clientId:t,type:e.type,label:e.label,url:e.url,objectId:e.objectId,objectType:e.objectType,parentId:null,order:0,target:`_self`,children:[]}}function ve(a){let[o,c]=n(null);return(()=>{var n=d(y),f=n.firstChild,[p,g]=s(f.nextSibling),_=p.nextSibling,[x,S]=s(_.nextSibling);return m(n,i(r,{get each(){return a.items},children:n=>(()=>{var r=d(b),f=r.firstChild,p=f.firstChild,g=p.nextSibling,_=g.firstChild,v=_.nextSibling,y=g.nextSibling.firstChild,x=y.nextSibling,S=x.nextSibling,C=S.nextSibling,w=f.nextSibling,T=w.firstChild,E=T.nextSibling.firstChild,ee=E.firstChild,[D,te]=s(ee.nextSibling),O=D.nextSibling,k=E.nextSibling,ne=k.firstChild,[A,j]=s(ne.nextSibling),re=A.nextSibling,ie=k.nextSibling,ae=ie.firstChild,[oe,se]=s(ae.nextSibling),M=oe.nextSibling,N=ie.nextSibling,ce=N.firstChild,[le,P]=s(ce.nextSibling),F=le.nextSibling,I=N.nextSibling,ue=I.firstChild,[L,R]=s(ue.nextSibling),z=L.nextSibling,B=z.firstChild,V=B.nextSibling,H=I.nextSibling,pe=H.firstChild,[W,_e]=s(pe.nextSibling),G=W.nextSibling,K=H.nextSibling,q=K.firstChild,[J,ye]=s(q.nextSibling),Y=J.nextSibling,be=K.nextSibling,xe=w.nextSibling,[Se,Ce]=s(xe.nextSibling);return r.addEventListener(`drop`,e=>{e.preventDefault();let t=o()??e.dataTransfer?.getData(`text/plain`);t&&a.onChange(fe(a.items,t,n.id)),c(null)}),r.addEventListener(`dragover`,e=>e.preventDefault()),p.addEventListener(`dragend`,()=>c(null)),p.addEventListener(`dragstart`,e=>{c(n.id),e.dataTransfer?.setData(`text/plain`,n.id)}),m(_,()=>n.label||a.t(`menus.editor.untitled`)),m(v,()=>n.url||a.t(`menus.editor.noUrl`)),y.$$click=()=>a.onChange(me(a.items,n.id,-1)),x.$$click=()=>a.onChange(me(a.items,n.id,1)),S.$$click=()=>a.onChange(he(a.items,n.id)),C.$$click=()=>a.onChange(ge(a.items,n.id)),m(T,()=>a.t(`menus.editor.itemSettings`)),m(E,()=>a.t(`menus.editor.navigationLabel`),D,te),O.$$input=e=>a.onChange(U(a.items,n.id,{label:e.currentTarget.value})),m(k,()=>a.t(`menus.editor.url`),A,j),re.$$input=e=>a.onChange(U(a.items,n.id,{url:e.currentTarget.value})),m(ie,()=>a.t(`menus.editor.titleAttribute`),oe,se),M.$$input=e=>a.onChange(U(a.items,n.id,{attrTitle:e.currentTarget.value})),m(N,()=>a.t(`menus.editor.cssClasses`),le,P),F.$$input=e=>a.onChange(U(a.items,n.id,{cssClasses:e.currentTarget.value})),m(I,()=>a.t(`menus.editor.target`),L,R),z.addEventListener(`change`,e=>a.onChange(U(a.items,n.id,{target:e.currentTarget.value}))),m(B,()=>a.t(`menus.editor.sameWindow`)),m(V,()=>a.t(`menus.editor.newWindow`)),m(H,()=>a.t(`menus.editor.xfn`),W,_e),G.$$input=e=>a.onChange(U(a.items,n.id,{xfn:e.currentTarget.value})),m(K,()=>a.t(`menus.editor.description`),J,ye),Y.$$input=e=>a.onChange(U(a.items,n.id,{description:e.currentTarget.value})),be.$$click=()=>a.onChange(de(a.items,n.id)),m(be,()=>a.t(`menus.editor.remove`)),m(r,i(t,{get when(){return n.children.length>0},get children(){return i(ve,{get items(){return n.children},get depth(){return(a.depth??0)+1},get t(){return a.t},onChange:e=>a.onChange(U(a.items,n.id,{children:e}))})}}),Se,Ce),e(e=>{var t=a.t(`menus.editor.drag`),n=a.t(`menus.editor.up`),r=a.t(`menus.editor.down`),i=a.t(`menus.editor.indent`),o=a.t(`menus.editor.outdent`);return t!==e.e&&l(p,`title`,e.e=t),n!==e.t&&l(y,`title`,e.t=n),r!==e.a&&l(x,`title`,e.a=r),i!==e.o&&l(S,`title`,e.o=i),o!==e.i&&l(C,`title`,e.i=o),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),e(()=>u(O,`value`,n.label)),e(()=>u(re,`value`,n.url??``)),e(()=>u(M,`value`,n.attrTitle??``)),e(()=>u(F,`value`,n.cssClasses??``)),e(()=>u(z,`value`,n.target??`_self`)),e(()=>u(G,`value`,n.xfn??``)),e(()=>u(Y,`value`,n.description??``)),h(),r})()}),p,g),m(n,i(t,{get when(){return a.items.length===0},get children(){var e=d(v);return m(e,()=>a.t(`menus.editor.emptyLevel`)),e}}),x,S),e(()=>l(n,`data-depth`,a.depth??0)),n})()}function G(n){return(()=>{var r=d(S),a=r.firstChild,o=a.nextSibling,c=o.firstChild,[l,f]=s(c.nextSibling),p=l.nextSibling,[h,g]=s(p.nextSibling);return m(a,()=>n.title),m(o,i(t,{get when(){return n.description},get children(){var e=d(x);return m(e,()=>n.description),e}}),l,f),m(o,()=>n.children,h,g),e(()=>u(r,`open`,n.open)),r})()}function K(){let{t:f}=g(),[p,v]=n([]),[y,b]=n(null),[x,S]=n([]),[I,R]=n([]),[z,B]=n({}),[V,H]=n([]),[U,de]=n([]),[fe,pe]=n({}),[W,me]=n(``),[he,ge]=n(``),[K,q]=n([]),[J,ye]=n(``),[Y,be]=n(``),[xe,Se]=n(!0),[Ce,we]=n(!1),[Te,X]=n(``),[Ee,Z]=n(``),De=async()=>{Se(!0),X(``);try{let[e,t,n,r,i]=await Promise.all([_.getMenus(),_.getContent({type:`page`,status:`PUBLISHED`,limit:100}),_.getContent({type:`post`,status:`PUBLISHED`,limit:100}),_.getContentTypes(),_.getTaxonomies()]);v(e),S(t.data),R(n.data),H(r),de(i);let a=await Promise.all(r.filter(e=>e.slug!==`page`&&e.slug!==`post`&&!e.singleton).map(async e=>[e.slug,(await _.getContent({type:e.slug,status:`PUBLISHED`,limit:100})).data]));B(Object.fromEntries(a));let o=await Promise.all(i.map(async e=>[e.slug,await _.getTaxonomyTerms(e.slug)]));pe(Object.fromEntries(o))}catch(e){X(e instanceof Error?e.message:String(e))}finally{Se(!1)}};o(De);let Oe=e=>{b({id:e?.id,name:e?.name??``,slug:e?.slug??``,items:ue(e?.items),settings:{...e?.settings??{}}}),q([]),X(``),Z(``)},Q=e=>{let t=y();t&&b({...t,...e})},$=e=>{let t=y();t&&Q({items:[...t.items,_e(e)]})},ke=e=>{let t=new Set(K()),n=y();n&&(Q({items:[...n.items,...e.filter(e=>t.has(e.id)).map(_e)]}),q([]))},Ae=()=>{J().trim()&&Y().trim()&&($({id:P(`custom`),type:`custom`,label:Y().trim(),url:J().trim()}),ye(``),be(``))},je=async e=>{e.preventDefault();let t=y();if(t){if(!t.name.trim()){X(f(`menus.nameRequired`));return}we(!0),X(``);try{let e={name:t.name.trim(),slug:t.slug.trim()||F(t.name),items:L(t.items),settings:t.settings};t.id?await _.updateMenu(t.id,e):await _.createMenu(e),b(null),Z(f(`menus.saved`)),await De()}catch(e){X(e instanceof Error?e.message:String(e))}finally{we(!1)}}},Me=async e=>{if(e.id&&confirm(f(`menus.confirmDelete`,{name:e.name})))try{await _.deleteMenu(e.id),Z(f(`menus.deleted`)),await De()}catch(e){X(e instanceof Error?e.message:String(e))}},Ne=a(()=>x().filter(e=>!W()||`${e.title} ${e.slug}`.toLowerCase().includes(W().toLowerCase()))),Pe=a(()=>I().filter(e=>!he()||`${e.title} ${e.slug}`.toLowerCase().includes(he().toLowerCase()))),Fe=e=>({id:`page:${e.id}`,type:`page`,label:e.title,url:`/${e.slug}`,objectId:e.id,objectType:`page`}),Ie=e=>({id:`post:${e.id}`,type:`post`,label:e.title,url:`/post/${e.slug}`,objectId:e.id,objectType:`post`}),Le=e=>({id:`content:${e.type}:${e.id}`,type:`content`,label:e.title,url:`/${e.type}/${e.slug}`,objectId:e.id,objectType:e.type});return(()=>{var n=d(T),a=n.firstChild,[o,g]=s(a.nextSibling),_=o.nextSibling,[v,x]=s(_.nextSibling),S=v.nextSibling,[P,I]=s(S.nextSibling);return P.nextSibling,m(n,i(t,{get when(){return Te()},get children(){var e=d(C);return m(e,Te),e}}),o,g),m(n,i(t,{get when(){return Ee()},get children(){var e=d(w);return m(e,Ee),e}}),v,x),m(n,i(t,{get when(){return!xe()},get fallback(){return(()=>{var e=d(E);return m(e,()=>f(`common.loading`)),e})()},get children(){return i(t,{get when(){return y()},get fallback(){return[(()=>{var e=d(ee),t=e.firstChild,n=t.nextSibling,r=n.firstChild.nextSibling,[i,a]=s(r.nextSibling);return m(t,()=>f(`menus.hint`)),n.$$click=()=>Oe(),m(n,()=>f(`menus.new`),i,a),h(),e})(),(()=>{var e=d(te);return m(e,i(t,{get when(){return p().length>0},get fallback(){return(()=>{var e=d(O);return m(e,()=>f(`menus.empty`)),e})()},get children(){var e=d(D),t=e.firstChild,n=t.firstChild.firstChild,a=n.nextSibling,o=a.nextSibling,s=t.nextSibling;return m(n,()=>f(`menus.name`)),m(a,()=>f(`menus.slug`)),m(o,()=>f(`menus.items`)),m(s,i(r,{get each(){return p()},children:e=>(()=>{var t=d(k),n=t.firstChild,r=n.firstChild,i=n.nextSibling,a=i.firstChild,o=i.nextSibling,s=o.nextSibling.firstChild,c=s.nextSibling.nextSibling;return m(r,()=>e.name),m(a,()=>e.slug),m(o,()=>e.items?.length??0),s.$$click=()=>Oe(e),m(s,()=>f(`common.edit`)),c.$$click=()=>void Me(e),m(c,()=>f(`common.delete`)),h(),t})()})),e}})),e})()]},children:n=>(()=>{var a=d(ae),o=a.firstChild,p=o.firstChild,g=p.firstChild,_=g.firstChild.nextSibling,[v,y]=s(_.nextSibling),x=g.nextSibling,S=x.nextSibling,C=p.nextSibling.firstChild,w=C.nextSibling,T=o.nextSibling,E=T.firstChild,ee=E.firstChild,[D,te]=s(ee.nextSibling),O=D.nextSibling,k=E.nextSibling,P=k.firstChild,[I,ue]=s(P.nextSibling),L=I.nextSibling,R=T.nextSibling.firstChild,B=R.firstChild,H=B.nextSibling,[de,pe]=s(H.nextSibling),_e=de.nextSibling,[xe,Se]=s(_e.nextSibling),we=xe.nextSibling,[Te,X]=s(we.nextSibling),Ee=Te.nextSibling,[Z,De]=s(Ee.nextSibling),Oe=Z.nextSibling,[Me,Re]=s(Oe.nextSibling),ze=Me.nextSibling,[Be,Ve]=s(ze.nextSibling),He=Be.nextSibling,[Ue,We]=s(He.nextSibling),Ge=R.nextSibling,Ke=Ge.firstChild,qe=Ke.firstChild,Je=qe.firstChild,Ye=Je.nextSibling,Xe=qe.nextSibling,Ze=Xe.firstChild,[Qe,$e]=s(Ze.nextSibling),et=Qe.nextSibling.nextSibling,[tt,nt]=s(et.nextSibling),rt=Ke.nextSibling,[it,at]=s(rt.nextSibling),ot=it.nextSibling.firstChild,st=ot.nextSibling,ct=st.firstChild,lt=ct.nextSibling.nextSibling,[ut,dt]=s(lt.nextSibling),ft=st.nextSibling;return a.addEventListener(`submit`,je),g.$$click=()=>b(null),m(g,()=>f(`menus.back`),v,y),m(x,()=>f(`menus.editor.eyebrow`)),m(S,(()=>{var e=c(()=>!!n().id);return()=>e()?f(`menus.edit`):f(`menus.create`)})()),C.$$click=()=>b(null),m(C,()=>f(`common.cancel`)),m(w,(()=>{var e=c(()=>!!Ce());return()=>e()?f(`common.loading`):f(`common.save`)})()),m(E,()=>f(`menus.name`),D,te),O.$$input=e=>Q({name:e.currentTarget.value}),m(k,()=>f(`menus.slug`),I,ue),L.$$input=e=>Q({slug:e.currentTarget.value}),m(B,()=>f(`menus.editor.addItems`)),m(R,i(G,{get title(){return f(`menus.sources.pages`)},open:!0,get children(){return[(()=>{var t=d(ne);return t.$$input=e=>me(e.currentTarget.value),e(()=>l(t,`placeholder`,f(`menus.editor.search`))),e(()=>u(t,`value`,W())),h(),t})(),(()=>{var t=d(A);return m(t,i(r,{get each(){return Ne()},children:t=>(()=>{var n=d(oe),r=n.firstChild,i=r.nextSibling,a=i.firstChild,[o,c]=s(a.nextSibling),l=o.nextSibling,f=l.firstChild.nextSibling,[p,h]=s(f.nextSibling);return r.addEventListener(`change`,e=>q(e.currentTarget.checked?[...K(),`page:${t.id}`]:K().filter(e=>e!==`page:${t.id}`))),m(i,()=>t.title,o,c),m(l,()=>t.slug,p,h),e(()=>u(r,`checked`,K().includes(`page:${t.id}`))),n})()})),t})(),(()=>{var e=d(j);return e.$$click=()=>ke(Ne().map(Fe)),m(e,()=>f(`menus.editor.addSelected`)),h(),e})()]}}),de,pe),m(R,i(G,{get title(){return f(`menus.sources.posts`)},get children(){return[(()=>{var t=d(ne);return t.$$input=e=>ge(e.currentTarget.value),e(()=>l(t,`placeholder`,f(`menus.editor.search`))),e(()=>u(t,`value`,he())),h(),t})(),(()=>{var t=d(A);return m(t,i(r,{get each(){return Pe()},children:t=>(()=>{var n=d(se),r=n.firstChild,i=r.nextSibling,a=i.firstChild,[o,c]=s(a.nextSibling),l=o.nextSibling,f=l.firstChild.nextSibling,[p,h]=s(f.nextSibling);return r.addEventListener(`change`,e=>q(e.currentTarget.checked?[...K(),`post:${t.id}`]:K().filter(e=>e!==`post:${t.id}`))),m(i,()=>t.title,o,c),m(l,()=>t.slug,p,h),e(()=>u(r,`checked`,K().includes(`post:${t.id}`))),n})()})),t})(),(()=>{var e=d(j);return e.$$click=()=>ke(Pe().map(Ie)),m(e,()=>f(`menus.editor.addSelected`)),h(),e})()]}}),xe,Se),m(R,i(G,{get title(){return f(`menus.sources.contentTypes`)},get children(){return i(r,{get each(){return V().filter(e=>e.slug!==`page`&&e.slug!==`post`&&!e.singleton)},children:e=>(()=>{var t=d(M),n=t.firstChild,a=n.nextSibling,[o,c]=s(a.nextSibling);return m(n,()=>e.pluralLabel),m(t,i(r,{get each(){return z()[e.slug]??[]},children:t=>(()=>{var n=d(N),r=n.firstChild,[i,a]=s(r.nextSibling),o=i.nextSibling,c=o.firstChild.nextSibling,[l,u]=s(c.nextSibling),f=l.nextSibling.nextSibling,[p,g]=s(f.nextSibling);return n.$$click=()=>$(Le(t)),m(n,()=>t.title,i,a),m(o,()=>e.slug,l,u),m(o,()=>t.slug,p,g),h(),n})()}),o,c),t})()})}}),Te,X),m(R,i(G,{get title(){return f(`menus.sources.custom`)},get description(){return f(`menus.sources.customHint`)},get children(){return[(()=>{var t=d(re),n=t.firstChild,[r,i]=s(n.nextSibling),a=r.nextSibling;return m(t,()=>f(`menus.editor.url`),r,i),a.$$input=e=>ye(e.currentTarget.value),e(()=>u(a,`value`,J())),h(),t})(),(()=>{var t=d(ie),n=t.firstChild,[r,i]=s(n.nextSibling),a=r.nextSibling;return m(t,()=>f(`menus.editor.navigationLabel`),r,i),a.$$input=e=>be(e.currentTarget.value),e(()=>u(a,`value`,Y())),h(),t})(),(()=>{var e=d(j);return e.$$click=Ae,m(e,()=>f(`menus.editor.addToMenu`)),h(),e})()]}}),Z,De),m(R,i(G,{get title(){return f(`menus.sources.home`)},get children(){var e=d(j);return e.$$click=()=>$({id:`home`,type:`home`,label:f(`menus.sources.home`),url:`/`}),m(e,()=>f(`menus.editor.addToMenu`)),h(),e}}),Me,Re),m(R,i(G,{get title(){return f(`menus.sources.archives`)},get children(){var e=d(A);return m(e,i(r,{get each(){return V().filter(e=>e.hasArchive)},children:e=>(()=>{var t=d(ce),n=t.firstChild,[r,i]=s(n.nextSibling),a=r.nextSibling,o=a.firstChild.nextSibling,[c,l]=s(o.nextSibling);return t.$$click=()=>$({id:`archive:${e.slug}`,type:`archive`,label:e.pluralLabel,url:`/${e.slug}`,objectType:e.slug}),m(t,()=>e.pluralLabel,r,i),m(a,()=>e.slug,c,l),h(),t})()})),e}}),Be,Ve),m(R,i(G,{get title(){return f(`menus.sources.taxonomies`)},get children(){return i(r,{get each(){return U()},children:e=>(()=>{var t=d(M),n=t.firstChild,a=n.nextSibling,[o,c]=s(a.nextSibling);return m(n,()=>e.name),m(t,i(r,{get each(){return fe()[e.slug]??[]},children:t=>(()=>{var n=d(N),r=n.firstChild,[i,a]=s(r.nextSibling),o=i.nextSibling,c=o.firstChild.nextSibling,[l,u]=s(c.nextSibling),f=l.nextSibling.nextSibling,[p,g]=s(f.nextSibling);return n.$$click=()=>$({id:`term:${e.slug}:${t.slug}`,type:`taxonomy`,label:t.name,url:`/${e.slug}/${t.slug}`,objectId:t.id,objectType:e.slug}),m(n,()=>t.name,i,a),m(o,()=>e.slug,l,u),m(o,()=>t.slug,p,g),h(),n})()}),o,c),t})()})}}),Ue,We),m(Je,()=>f(`menus.editor.structure`)),m(Ye,()=>f(`menus.editor.structureHint`)),m(Xe,()=>n().items.length,Qe,$e),m(Xe,()=>f(`menus.items`),tt,nt),m(Ge,i(t,{get when(){return n().items.length>0},get fallback(){return(()=>{var e=d(le);return m(e,()=>f(`menus.editor.empty`)),e})()},get children(){return i(ve,{get items(){return n().items},t:f,onChange:e=>Q({items:e})})}}),it,at),m(ot,()=>f(`menus.editor.settings`)),ct.addEventListener(`change`,e=>Q({settings:{...n().settings,autoAddNewPages:e.currentTarget.checked}})),m(st,()=>f(`menus.editor.autoAddPages`),ut,dt),m(ft,()=>f(`menus.editor.autoAddPagesHint`)),e(e=>{var t=Ce(),r=F(n().name);return t!==e.e&&u(w,`disabled`,e.e=t),r!==e.t&&l(L,`placeholder`,e.t=r),e},{e:void 0,t:void 0}),e(()=>u(O,`value`,n().name)),e(()=>u(L,`value`,n().slug)),e(()=>u(ct,`checked`,n().settings.autoAddNewPages===!0)),h(),a})()})}}),P,I),n})()}p([`click`,`input`]);export{K as MenuManager};
|
|
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";var v=f(`<div class=wp-menu-empty-level>`),y=f(`<div class=wp-menu-tree><!$><!/><!$><!/>`),b=f(`<article class=wp-menu-item><div class=wp-menu-item__header><span class=wp-menu-drag draggable=true>⠿⠿⠿</span><span class=wp-menu-item__label><strong></strong><small></small></span><div class=wp-menu-item__actions><button type=button class="btn btn-sm">↑</button><button type=button class="btn btn-sm">↓</button><button type=button class="btn btn-sm">→</button><button type=button class="btn btn-sm">←</button></div></div><details class=wp-menu-item__details><summary></summary><div class=wp-menu-item__fields><label><!$><!/><input class=input></label><label><!$><!/><input class=input></label><label><!$><!/><input class=input></label><label><!$><!/><input class=input></label><label><!$><!/><select class=input><option value=_self></option><option value=_blank></option></select></label><label><!$><!/><input class=input></label><label class=wp-menu-item__wide><!$><!/><textarea class=input rows=2></textarea></label><button type=button class="btn btn-danger btn-sm"></button></div></details><!$><!/>`),x=f(`<p class=muted>`),S=f(`<details class=wp-menu-box><summary></summary><div class=wp-menu-box__body><!$><!/><!$><!/>`),C=f(`<div class="notice notice--error">`),w=f(`<div class=notice>`),T=f(`<div class="menus-manager wp-menus-manager"><!$><!/><!$><!/><!$><!/><style>.wp-menu-editor__top,.wp-structure-heading,.wp-menu-editor__identity,.wp-menu-item__header,.wp-menu-item__actions,.form-actions{display:flex;align-items:center;gap:.7rem}.wp-menu-editor__top,.wp-structure-heading{justify-content:space-between}.wp-menu-editor__top{margin-bottom:1rem}.wp-menu-editor__top h3{margin:.25rem 0 0}.wp-eyebrow{display:block;margin-top:.7rem;font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;color:var(--color-muted)}.wp-menu-editor__identity{margin-bottom:1rem;align-items:end}.wp-menu-editor__identity label{display:grid;gap:.35rem;flex:1}.wp-menu-editor__columns{display:grid;grid-template-columns:330px minmax(0,1fr);gap:1.2rem;align-items:start}.wp-menu-sources,.wp-menu-structure{min-width:0}.wp-menu-sources>h4,.wp-structure-heading h4{margin:0}.wp-menu-box{background:var(--color-surface,#fff);border:1px solid var(--color-border,#ddd);margin-bottom:.7rem}.wp-menu-box summary{cursor:pointer;padding:.8rem;font-weight:600}.wp-menu-box__body{padding:0 .8rem .8rem;display:grid;gap:.6rem}.wp-menu-box__body p{margin:0}.wp-source-list{display:grid;gap:.35rem;max-height:220px;overflow:auto;border:1px solid var(--color-border,#ddd);padding:.45rem}.wp-source-row{display:flex!important;align-items:start;gap:.45rem!important;padding:.3rem}.wp-source-row span,.wp-source-link{display:grid;gap:.12rem;text-align:left}.wp-source-row small,.wp-source-link small,.wp-menu-item__label small{color:var(--color-muted);font-size:.75rem}.wp-source-link{border:0;background:none;color:inherit;padding:.35rem;width:100%;cursor:pointer}.wp-source-link:hover{background:var(--color-surface-muted,#f5f5f5)}.wp-taxonomy-source{display:grid;gap:.2rem;border-top:1px solid var(--color-border,#ddd);padding-top:.5rem}.wp-taxonomy-source:first-child{border-top:0;padding-top:0}.wp-menu-structure{background:var(--color-surface-muted,#f7f7f7);padding:1rem}.wp-menu-structure .wp-structure-heading{margin-bottom:1rem}.wp-menu-tree{display:grid;gap:.55rem}.wp-menu-tree[data-depth="1"]{margin:.55rem 0 0 2rem}.wp-menu-item{background:var(--color-surface,#fff);border:1px solid var(--color-border,#dcdcde);box-shadow:0 1px 1px rgba(0,0,0,.04)}.wp-menu-item__header{padding:.55rem .7rem}.wp-menu-drag{cursor:grab;letter-spacing:-.2rem;width:1.4rem;color:var(--color-muted);user-select:none}.wp-menu-item__label{display:grid;gap:.15rem;flex:1;min-width:0}.wp-menu-item__label small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-menu-item__actions{margin-left:auto}.wp-menu-item__details{border-top:1px solid var(--color-border,#ddd)}.wp-menu-item__details summary{padding:.5rem .7rem;cursor:pointer;color:var(--color-muted);font-size:.85rem}.wp-menu-item__fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem;padding:.7rem;border-top:1px solid var(--color-border,#ddd)}.wp-menu-item__fields label{display:grid;gap:.3rem}.wp-menu-item__wide{grid-column:1/-1}.wp-menu-empty,.wp-menu-empty-level{text-align:center;padding:2rem;color:var(--color-muted)}.wp-menu-empty-level{border:1px dashed var(--color-border,#ccc);padding:1rem}.wp-menu-settings{margin-top:1rem}.wp-menu-settings h4{margin-top:0}.wp-menu-settings p{margin-bottom:0}.wp-menus-manager .menu-actions{white-space:nowrap;text-align:right}@media(max-width:850px){.wp-menu-editor__columns{grid-template-columns:1fr}.wp-menu-sources{order:2}.wp-menu-structure{order:1}.wp-menu-editor__identity,.wp-menu-editor__top{align-items:stretch;display:grid}.wp-menu-item__fields{grid-template-columns:1fr}.wp-menu-item__wide{grid-column:auto}}`),E=f(`<div class=skeleton>`),ee=f(`<div class=manager-toolbar><p class=muted></p><button class="btn btn-primary"type=button>+ <!$><!/>`),D=f(`<table class=table><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody>`),te=f(`<section class=card>`),O=f(`<p class="muted empty-state">`),k=f(`<tr><td><strong></strong></td><td><code></code></td><td></td><td class=menu-actions><button class="btn btn-secondary btn-sm"type=button></button> <button class="btn btn-danger btn-sm"type=button>`),ne=f(`<input class=input>`),A=f(`<div class=wp-source-list>`),j=f(`<button type=button class="btn btn-secondary btn-sm">`),re=f(`<label><!$><!/><input class=input placeholder=https://>`),ie=f(`<label><!$><!/><input class=input>`),ae=f(`<form class=wp-menu-editor><div class=wp-menu-editor__top><div><button type=button class="btn btn-secondary btn-sm">← <!$><!/></button><span class=wp-eyebrow></span><h3></h3></div><div class=form-actions><button class="btn btn-secondary"type=button></button><button class="btn btn-primary"type=submit></button></div></div><div class="wp-menu-editor__identity card"><label><!$><!/><input class=input required></label><label><!$><!/><input class=input></label></div><div class=wp-menu-editor__columns><aside class=wp-menu-sources><h4></h4><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/></aside><main class=wp-menu-structure><div class=wp-structure-heading><div><h4></h4><p class=muted></p></div><span class=badge><!$><!/> <!$><!/></span></div><!$><!/><section class="card wp-menu-settings"><h4></h4><label class=checkbox-label><input type=checkbox> <!$><!/></label><p class=muted>`),oe=f(`<label class=wp-source-row><input type=checkbox><span><!$><!/><small>/<!$><!/>`),se=f(`<label class=wp-source-row><input type=checkbox><span><!$><!/><small>/post/<!$><!/>`),M=f(`<div class=wp-taxonomy-source><strong></strong><!$><!/>`),N=f(`<button type=button class=wp-source-link><!$><!/><small>/<!$><!/>/<!$><!/>`),ce=f(`<button type=button class=wp-source-link><!$><!/><small>/<!$><!/>`),le=f(`<div class="wp-menu-empty card">`);function P(e){return`${e}_${typeof globalThis.crypto?.randomUUID==`function`?globalThis.crypto.randomUUID():Math.random().toString(36).slice(2)}`}function F(e){return e.toLowerCase().normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/(^-|-$)/g,``)}function I(e,t=null){let n=e.id||P(`item`);return{...e,id:n,clientId:n,parentId:t??e.parentId??null,children:[]}}function ue(e){let t=(Array.isArray(e)?e:[]).map(e=>I(e)),n=new Map(t.map(e=>[e.id,e])),r=[];for(let e of t){let t=e.parentId?n.get(e.parentId):void 0;t&&t.id!==e.id?t.children.push(e):r.push(e)}let i=e=>(e.sort((e,t)=>(e.order??0)-(t.order??0)),e.forEach(e=>i(e.children)),e);return i(r)}function L(e,t=null){let n=[];return e.forEach((e,r)=>{let{clientId:i,children:a,...o}=e;n.push({...o,id:e.id,parentId:t,order:r}),n.push(...L(a,e.id))}),n}function R(e){return e.map(e=>({...e,children:R(e.children)}))}function z(e,t){return e.id===t||e.children.some(e=>z(e,t))}function B(e,t){let n=e.findIndex(e=>e.id===t);if(n>=0){let t=[...e],[r]=t.splice(n,1);return{items:t,removed:r}}for(let n=0;n<e.length;n+=1){let r=B(e[n].children,t);if(r.removed){let t=[...e];return t[n]={...t[n],children:r.items},{items:t,removed:r.removed}}}return{items:e}}function V(e,t,n){let r=e.findIndex(e=>e.id===t);if(r>=0){let t=[...e];return t.splice(r,0,n),{items:t,inserted:!0}}for(let r=0;r<e.length;r+=1){let i=V(e[r].children,t,n);if(i.inserted){let t=[...e];return t[r]={...t[r],children:i.items},{items:t,inserted:!0}}}return{items:e,inserted:!1}}function H(e,t,n){for(let r=0;r<e.length;r+=1){let i=e[r];if(i.id===t){let t=[...e];return t[r]={...i,children:[...i.children,n]},{items:t,inserted:!0}}let a=H(i.children,t,n);if(a.inserted){let t=[...e];return t[r]={...i,children:a.items},{items:t,inserted:!0}}}return{items:e,inserted:!1}}function U(e,t,n){return e.map(e=>e.id===t?{...e,...n}:{...e,children:U(e.children,t,n)})}function de(e,t){return B(e,t).items}function fe(e,t,n){if(t===n||e.some(e=>e.id===t&&z(e,n)))return e;let r=B(e,t);if(!r.removed)return e;let i=V(r.items,n,r.removed);return i.inserted?i.items:e}function pe(e,t,n){if(t===n||e.some(e=>e.id===t&&z(e,n)))return e;let r=B(e,t);if(!r.removed)return e;let i=H(r.items,n,r.removed);return i.inserted?i.items:e}function W(e,t,n){let r=e.findIndex(e=>e.id===t);if(r>=0)return{siblings:e,index:r,parent:n};for(let n of e){let e=W(n.children,t,n);if(e)return e}return null}function me(e,t,n){let r=R(e),i=W(r,t);if(!i)return e;let a=i.index+n;return a<0||a>=i.siblings.length?e:([i.siblings[i.index],i.siblings[a]]=[i.siblings[a],i.siblings[i.index]],r)}function he(e,t){let n=R(e),r=W(n,t);return!r||r.index===0?e:pe(n,t,r.siblings[r.index-1].id)}function ge(e,t){let n=R(e),r=W(n,t);return r?.parent?fe(n,t,r.parent.id):e}function _e(e){let t=P(`item`);return{id:t,clientId:t,type:e.type,label:e.label,url:e.url,objectId:e.objectId,objectType:e.objectType,parentId:null,order:0,target:`_self`,children:[]}}function ve(a){let[o,c]=n(null);return(()=>{var n=d(y),f=n.firstChild,[p,g]=s(f.nextSibling),_=p.nextSibling,[x,S]=s(_.nextSibling);return m(n,i(r,{get each(){return a.items},children:n=>(()=>{var r=d(b),f=r.firstChild,p=f.firstChild,g=p.nextSibling,_=g.firstChild,v=_.nextSibling,y=g.nextSibling.firstChild,x=y.nextSibling,S=x.nextSibling,C=S.nextSibling,w=f.nextSibling,T=w.firstChild,E=T.nextSibling.firstChild,ee=E.firstChild,[D,te]=s(ee.nextSibling),O=D.nextSibling,k=E.nextSibling,ne=k.firstChild,[A,j]=s(ne.nextSibling),re=A.nextSibling,ie=k.nextSibling,ae=ie.firstChild,[oe,se]=s(ae.nextSibling),M=oe.nextSibling,N=ie.nextSibling,ce=N.firstChild,[le,P]=s(ce.nextSibling),F=le.nextSibling,I=N.nextSibling,ue=I.firstChild,[L,R]=s(ue.nextSibling),z=L.nextSibling,B=z.firstChild,V=B.nextSibling,H=I.nextSibling,pe=H.firstChild,[W,_e]=s(pe.nextSibling),G=W.nextSibling,K=H.nextSibling,q=K.firstChild,[J,ye]=s(q.nextSibling),Y=J.nextSibling,be=K.nextSibling,xe=w.nextSibling,[Se,Ce]=s(xe.nextSibling);return r.addEventListener(`drop`,e=>{e.preventDefault();let t=o()??e.dataTransfer?.getData(`text/plain`);t&&a.onChange(fe(a.items,t,n.id)),c(null)}),r.addEventListener(`dragover`,e=>e.preventDefault()),p.addEventListener(`dragend`,()=>c(null)),p.addEventListener(`dragstart`,e=>{c(n.id),e.dataTransfer?.setData(`text/plain`,n.id)}),m(_,()=>n.label||a.t(`menus.editor.untitled`)),m(v,()=>n.url||a.t(`menus.editor.noUrl`)),y.$$click=()=>a.onChange(me(a.items,n.id,-1)),x.$$click=()=>a.onChange(me(a.items,n.id,1)),S.$$click=()=>a.onChange(he(a.items,n.id)),C.$$click=()=>a.onChange(ge(a.items,n.id)),m(T,()=>a.t(`menus.editor.itemSettings`)),m(E,()=>a.t(`menus.editor.navigationLabel`),D,te),O.$$input=e=>a.onChange(U(a.items,n.id,{label:e.currentTarget.value})),m(k,()=>a.t(`menus.editor.url`),A,j),re.$$input=e=>a.onChange(U(a.items,n.id,{url:e.currentTarget.value})),m(ie,()=>a.t(`menus.editor.titleAttribute`),oe,se),M.$$input=e=>a.onChange(U(a.items,n.id,{attrTitle:e.currentTarget.value})),m(N,()=>a.t(`menus.editor.cssClasses`),le,P),F.$$input=e=>a.onChange(U(a.items,n.id,{cssClasses:e.currentTarget.value})),m(I,()=>a.t(`menus.editor.target`),L,R),z.addEventListener(`change`,e=>a.onChange(U(a.items,n.id,{target:e.currentTarget.value}))),m(B,()=>a.t(`menus.editor.sameWindow`)),m(V,()=>a.t(`menus.editor.newWindow`)),m(H,()=>a.t(`menus.editor.xfn`),W,_e),G.$$input=e=>a.onChange(U(a.items,n.id,{xfn:e.currentTarget.value})),m(K,()=>a.t(`menus.editor.description`),J,ye),Y.$$input=e=>a.onChange(U(a.items,n.id,{description:e.currentTarget.value})),be.$$click=()=>a.onChange(de(a.items,n.id)),m(be,()=>a.t(`menus.editor.remove`)),m(r,i(t,{get when(){return n.children.length>0},get children(){return i(ve,{get items(){return n.children},get depth(){return(a.depth??0)+1},get t(){return a.t},onChange:e=>a.onChange(U(a.items,n.id,{children:e}))})}}),Se,Ce),e(e=>{var t=a.t(`menus.editor.drag`),n=a.t(`menus.editor.up`),r=a.t(`menus.editor.down`),i=a.t(`menus.editor.indent`),o=a.t(`menus.editor.outdent`);return t!==e.e&&l(p,`title`,e.e=t),n!==e.t&&l(y,`title`,e.t=n),r!==e.a&&l(x,`title`,e.a=r),i!==e.o&&l(S,`title`,e.o=i),o!==e.i&&l(C,`title`,e.i=o),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),e(()=>u(O,`value`,n.label)),e(()=>u(re,`value`,n.url??``)),e(()=>u(M,`value`,n.attrTitle??``)),e(()=>u(F,`value`,n.cssClasses??``)),e(()=>u(z,`value`,n.target??`_self`)),e(()=>u(G,`value`,n.xfn??``)),e(()=>u(Y,`value`,n.description??``)),h(),r})()}),p,g),m(n,i(t,{get when(){return a.items.length===0},get children(){var e=d(v);return m(e,()=>a.t(`menus.editor.emptyLevel`)),e}}),x,S),e(()=>l(n,`data-depth`,a.depth??0)),n})()}function G(n){return(()=>{var r=d(S),a=r.firstChild,o=a.nextSibling,c=o.firstChild,[l,f]=s(c.nextSibling),p=l.nextSibling,[h,g]=s(p.nextSibling);return m(a,()=>n.title),m(o,i(t,{get when(){return n.description},get children(){var e=d(x);return m(e,()=>n.description),e}}),l,f),m(o,()=>n.children,h,g),e(()=>u(r,`open`,n.open)),r})()}function K(){let{t:f}=g(),[p,v]=n([]),[y,b]=n(null),[x,S]=n([]),[I,R]=n([]),[z,B]=n({}),[V,H]=n([]),[U,de]=n([]),[fe,pe]=n({}),[W,me]=n(``),[he,ge]=n(``),[K,q]=n([]),[J,ye]=n(``),[Y,be]=n(``),[xe,Se]=n(!0),[Ce,we]=n(!1),[Te,X]=n(``),[Ee,Z]=n(``),De=async()=>{Se(!0),X(``);try{let[e,t,n,r,i]=await Promise.all([_.getMenus(),_.getContent({type:`page`,status:`PUBLISHED`,limit:100}),_.getContent({type:`post`,status:`PUBLISHED`,limit:100}),_.getContentTypes(),_.getTaxonomies()]);v(e),S(t.data),R(n.data),H(r),de(i);let a=await Promise.all(r.filter(e=>e.slug!==`page`&&e.slug!==`post`&&!e.singleton).map(async e=>[e.slug,(await _.getContent({type:e.slug,status:`PUBLISHED`,limit:100})).data]));B(Object.fromEntries(a));let o=await Promise.all(i.map(async e=>[e.slug,await _.getTaxonomyTerms(e.slug)]));pe(Object.fromEntries(o))}catch(e){X(e instanceof Error?e.message:String(e))}finally{Se(!1)}};o(De);let Oe=e=>{b({id:e?.id,name:e?.name??``,slug:e?.slug??``,items:ue(e?.items),settings:{...e?.settings??{}}}),q([]),X(``),Z(``)},Q=e=>{let t=y();t&&b({...t,...e})},$=e=>{let t=y();t&&Q({items:[...t.items,_e(e)]})},ke=e=>{let t=new Set(K()),n=y();n&&(Q({items:[...n.items,...e.filter(e=>t.has(e.id)).map(_e)]}),q([]))},Ae=()=>{J().trim()&&Y().trim()&&($({id:P(`custom`),type:`custom`,label:Y().trim(),url:J().trim()}),ye(``),be(``))},je=async e=>{e.preventDefault();let t=y();if(t){if(!t.name.trim()){X(f(`menus.nameRequired`));return}we(!0),X(``);try{let e={name:t.name.trim(),slug:t.slug.trim()||F(t.name),items:L(t.items),settings:t.settings};t.id?await _.updateMenu(t.id,e):await _.createMenu(e),b(null),Z(f(`menus.saved`)),await De()}catch(e){X(e instanceof Error?e.message:String(e))}finally{we(!1)}}},Me=async e=>{if(e.id&&confirm(f(`menus.confirmDelete`,{name:e.name})))try{await _.deleteMenu(e.id),Z(f(`menus.deleted`)),await De()}catch(e){X(e instanceof Error?e.message:String(e))}},Ne=a(()=>x().filter(e=>!W()||`${e.title} ${e.slug}`.toLowerCase().includes(W().toLowerCase()))),Pe=a(()=>I().filter(e=>!he()||`${e.title} ${e.slug}`.toLowerCase().includes(he().toLowerCase()))),Fe=e=>({id:`page:${e.id}`,type:`page`,label:e.title,url:`/${e.slug}`,objectId:e.id,objectType:`page`}),Ie=e=>({id:`post:${e.id}`,type:`post`,label:e.title,url:`/post/${e.slug}`,objectId:e.id,objectType:`post`}),Le=e=>({id:`content:${e.type}:${e.id}`,type:`content`,label:e.title,url:`/${e.type}/${e.slug}`,objectId:e.id,objectType:e.type});return(()=>{var n=d(T),a=n.firstChild,[o,g]=s(a.nextSibling),_=o.nextSibling,[v,x]=s(_.nextSibling),S=v.nextSibling,[P,I]=s(S.nextSibling);return P.nextSibling,m(n,i(t,{get when(){return Te()},get children(){var e=d(C);return m(e,Te),e}}),o,g),m(n,i(t,{get when(){return Ee()},get children(){var e=d(w);return m(e,Ee),e}}),v,x),m(n,i(t,{get when(){return!xe()},get fallback(){return(()=>{var e=d(E);return m(e,()=>f(`common.loading`)),e})()},get children(){return i(t,{get when(){return y()},get fallback(){return[(()=>{var e=d(ee),t=e.firstChild,n=t.nextSibling,r=n.firstChild.nextSibling,[i,a]=s(r.nextSibling);return m(t,()=>f(`menus.hint`)),n.$$click=()=>Oe(),m(n,()=>f(`menus.new`),i,a),h(),e})(),(()=>{var e=d(te);return m(e,i(t,{get when(){return p().length>0},get fallback(){return(()=>{var e=d(O);return m(e,()=>f(`menus.empty`)),e})()},get children(){var e=d(D),t=e.firstChild,n=t.firstChild.firstChild,a=n.nextSibling,o=a.nextSibling,s=t.nextSibling;return m(n,()=>f(`menus.name`)),m(a,()=>f(`menus.slug`)),m(o,()=>f(`menus.items`)),m(s,i(r,{get each(){return p()},children:e=>(()=>{var t=d(k),n=t.firstChild,r=n.firstChild,i=n.nextSibling,a=i.firstChild,o=i.nextSibling,s=o.nextSibling.firstChild,c=s.nextSibling.nextSibling;return m(r,()=>e.name),m(a,()=>e.slug),m(o,()=>e.items?.length??0),s.$$click=()=>Oe(e),m(s,()=>f(`common.edit`)),c.$$click=()=>void Me(e),m(c,()=>f(`common.delete`)),h(),t})()})),e}})),e})()]},children:n=>(()=>{var a=d(ae),o=a.firstChild,p=o.firstChild,g=p.firstChild,_=g.firstChild.nextSibling,[v,y]=s(_.nextSibling),x=g.nextSibling,S=x.nextSibling,C=p.nextSibling.firstChild,w=C.nextSibling,T=o.nextSibling,E=T.firstChild,ee=E.firstChild,[D,te]=s(ee.nextSibling),O=D.nextSibling,k=E.nextSibling,P=k.firstChild,[I,ue]=s(P.nextSibling),L=I.nextSibling,R=T.nextSibling.firstChild,B=R.firstChild,H=B.nextSibling,[de,pe]=s(H.nextSibling),_e=de.nextSibling,[xe,Se]=s(_e.nextSibling),we=xe.nextSibling,[Te,X]=s(we.nextSibling),Ee=Te.nextSibling,[Z,De]=s(Ee.nextSibling),Oe=Z.nextSibling,[Me,Re]=s(Oe.nextSibling),ze=Me.nextSibling,[Be,Ve]=s(ze.nextSibling),He=Be.nextSibling,[Ue,We]=s(He.nextSibling),Ge=R.nextSibling,Ke=Ge.firstChild,qe=Ke.firstChild,Je=qe.firstChild,Ye=Je.nextSibling,Xe=qe.nextSibling,Ze=Xe.firstChild,[Qe,$e]=s(Ze.nextSibling),et=Qe.nextSibling.nextSibling,[tt,nt]=s(et.nextSibling),rt=Ke.nextSibling,[it,at]=s(rt.nextSibling),ot=it.nextSibling.firstChild,st=ot.nextSibling,ct=st.firstChild,lt=ct.nextSibling.nextSibling,[ut,dt]=s(lt.nextSibling),ft=st.nextSibling;return a.addEventListener(`submit`,je),g.$$click=()=>b(null),m(g,()=>f(`menus.back`),v,y),m(x,()=>f(`menus.editor.eyebrow`)),m(S,(()=>{var e=c(()=>!!n().id);return()=>e()?f(`menus.edit`):f(`menus.create`)})()),C.$$click=()=>b(null),m(C,()=>f(`common.cancel`)),m(w,(()=>{var e=c(()=>!!Ce());return()=>e()?f(`common.loading`):f(`common.save`)})()),m(E,()=>f(`menus.name`),D,te),O.$$input=e=>Q({name:e.currentTarget.value}),m(k,()=>f(`menus.slug`),I,ue),L.$$input=e=>Q({slug:e.currentTarget.value}),m(B,()=>f(`menus.editor.addItems`)),m(R,i(G,{get title(){return f(`menus.sources.pages`)},open:!0,get children(){return[(()=>{var t=d(ne);return t.$$input=e=>me(e.currentTarget.value),e(()=>l(t,`placeholder`,f(`menus.editor.search`))),e(()=>u(t,`value`,W())),h(),t})(),(()=>{var t=d(A);return m(t,i(r,{get each(){return Ne()},children:t=>(()=>{var n=d(oe),r=n.firstChild,i=r.nextSibling,a=i.firstChild,[o,c]=s(a.nextSibling),l=o.nextSibling,f=l.firstChild.nextSibling,[p,h]=s(f.nextSibling);return r.addEventListener(`change`,e=>q(e.currentTarget.checked?[...K(),`page:${t.id}`]:K().filter(e=>e!==`page:${t.id}`))),m(i,()=>t.title,o,c),m(l,()=>t.slug,p,h),e(()=>u(r,`checked`,K().includes(`page:${t.id}`))),n})()})),t})(),(()=>{var e=d(j);return e.$$click=()=>ke(Ne().map(Fe)),m(e,()=>f(`menus.editor.addSelected`)),h(),e})()]}}),de,pe),m(R,i(G,{get title(){return f(`menus.sources.posts`)},get children(){return[(()=>{var t=d(ne);return t.$$input=e=>ge(e.currentTarget.value),e(()=>l(t,`placeholder`,f(`menus.editor.search`))),e(()=>u(t,`value`,he())),h(),t})(),(()=>{var t=d(A);return m(t,i(r,{get each(){return Pe()},children:t=>(()=>{var n=d(se),r=n.firstChild,i=r.nextSibling,a=i.firstChild,[o,c]=s(a.nextSibling),l=o.nextSibling,f=l.firstChild.nextSibling,[p,h]=s(f.nextSibling);return r.addEventListener(`change`,e=>q(e.currentTarget.checked?[...K(),`post:${t.id}`]:K().filter(e=>e!==`post:${t.id}`))),m(i,()=>t.title,o,c),m(l,()=>t.slug,p,h),e(()=>u(r,`checked`,K().includes(`post:${t.id}`))),n})()})),t})(),(()=>{var e=d(j);return e.$$click=()=>ke(Pe().map(Ie)),m(e,()=>f(`menus.editor.addSelected`)),h(),e})()]}}),xe,Se),m(R,i(G,{get title(){return f(`menus.sources.contentTypes`)},get children(){return i(r,{get each(){return V().filter(e=>e.slug!==`page`&&e.slug!==`post`&&!e.singleton)},children:e=>(()=>{var t=d(M),n=t.firstChild,a=n.nextSibling,[o,c]=s(a.nextSibling);return m(n,()=>e.pluralLabel),m(t,i(r,{get each(){return z()[e.slug]??[]},children:t=>(()=>{var n=d(N),r=n.firstChild,[i,a]=s(r.nextSibling),o=i.nextSibling,c=o.firstChild.nextSibling,[l,u]=s(c.nextSibling),f=l.nextSibling.nextSibling,[p,g]=s(f.nextSibling);return n.$$click=()=>$(Le(t)),m(n,()=>t.title,i,a),m(o,()=>e.slug,l,u),m(o,()=>t.slug,p,g),h(),n})()}),o,c),t})()})}}),Te,X),m(R,i(G,{get title(){return f(`menus.sources.custom`)},get description(){return f(`menus.sources.customHint`)},get children(){return[(()=>{var t=d(re),n=t.firstChild,[r,i]=s(n.nextSibling),a=r.nextSibling;return m(t,()=>f(`menus.editor.url`),r,i),a.$$input=e=>ye(e.currentTarget.value),e(()=>u(a,`value`,J())),h(),t})(),(()=>{var t=d(ie),n=t.firstChild,[r,i]=s(n.nextSibling),a=r.nextSibling;return m(t,()=>f(`menus.editor.navigationLabel`),r,i),a.$$input=e=>be(e.currentTarget.value),e(()=>u(a,`value`,Y())),h(),t})(),(()=>{var e=d(j);return e.$$click=Ae,m(e,()=>f(`menus.editor.addToMenu`)),h(),e})()]}}),Z,De),m(R,i(G,{get title(){return f(`menus.sources.home`)},get children(){var e=d(j);return e.$$click=()=>$({id:`home`,type:`home`,label:f(`menus.sources.home`),url:`/`}),m(e,()=>f(`menus.editor.addToMenu`)),h(),e}}),Me,Re),m(R,i(G,{get title(){return f(`menus.sources.archives`)},get children(){var e=d(A);return m(e,i(r,{get each(){return V().filter(e=>e.hasArchive)},children:e=>(()=>{var t=d(ce),n=t.firstChild,[r,i]=s(n.nextSibling),a=r.nextSibling,o=a.firstChild.nextSibling,[c,l]=s(o.nextSibling);return t.$$click=()=>$({id:`archive:${e.slug}`,type:`archive`,label:e.pluralLabel,url:`/${e.slug}`,objectType:e.slug}),m(t,()=>e.pluralLabel,r,i),m(a,()=>e.slug,c,l),h(),t})()})),e}}),Be,Ve),m(R,i(G,{get title(){return f(`menus.sources.taxonomies`)},get children(){return i(r,{get each(){return U()},children:e=>(()=>{var t=d(M),n=t.firstChild,a=n.nextSibling,[o,c]=s(a.nextSibling);return m(n,()=>e.name),m(t,i(r,{get each(){return fe()[e.slug]??[]},children:t=>(()=>{var n=d(N),r=n.firstChild,[i,a]=s(r.nextSibling),o=i.nextSibling,c=o.firstChild.nextSibling,[l,u]=s(c.nextSibling),f=l.nextSibling.nextSibling,[p,g]=s(f.nextSibling);return n.$$click=()=>$({id:`term:${e.slug}:${t.slug}`,type:`taxonomy`,label:t.name,url:`/${e.slug}/${t.slug}`,objectId:t.id,objectType:e.slug}),m(n,()=>t.name,i,a),m(o,()=>e.slug,l,u),m(o,()=>t.slug,p,g),h(),n})()}),o,c),t})()})}}),Ue,We),m(Je,()=>f(`menus.editor.structure`)),m(Ye,()=>f(`menus.editor.structureHint`)),m(Xe,()=>n().items.length,Qe,$e),m(Xe,()=>f(`menus.items`),tt,nt),m(Ge,i(t,{get when(){return n().items.length>0},get fallback(){return(()=>{var e=d(le);return m(e,()=>f(`menus.editor.empty`)),e})()},get children(){return i(ve,{get items(){return n().items},t:f,onChange:e=>Q({items:e})})}}),it,at),m(ot,()=>f(`menus.editor.settings`)),ct.addEventListener(`change`,e=>Q({settings:{...n().settings,autoAddNewPages:e.currentTarget.checked}})),m(st,()=>f(`menus.editor.autoAddPages`),ut,dt),m(ft,()=>f(`menus.editor.autoAddPagesHint`)),e(e=>{var t=Ce(),r=F(n().name);return t!==e.e&&u(w,`disabled`,e.e=t),r!==e.t&&l(L,`placeholder`,e.t=r),e},{e:void 0,t:void 0}),e(()=>u(O,`value`,n().name)),e(()=>u(L,`value`,n().slug)),e(()=>u(ct,`checked`,n().settings.autoAddNewPages===!0)),h(),a})()})}}),P,I),n})()}p([`click`,`input`]);export{K as MenuManager};
|
|
@@ -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{a,c as o,d as s,f as c,i as l,m as u,n as d,r as f,s as p,u as m}from"./web.DwNv8rLL.js";import{n as h}from"./i18n.
|
|
1
|
+
import{d as e,p as t,r as n,s as r,v as i}from"./solid.8gBSxpeo.js";import{a,c as o,d as s,f as c,i as l,m as u,n as d,r as f,s as p,u as m}from"./web.DwNv8rLL.js";import{n as h}from"./i18n.3zKFZ7KU.js";import{t as g}from"./api.CGA0D2A2.js";var _=u(`<div class=plugin-manager><div class=page-header><h2></h2><p class=page-description></p><p class=page-hint></p></div><!$><!/><!$><!/><!$><!/><style>
|
|
2
2
|
.page-header {
|
|
3
3
|
margin-bottom: 1.5rem;
|
|
4
4
|
}
|
|
@@ -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.
|
|
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";var v=f(`<div class="notice notice--error">`),y=f(`<button type=button class="btn btn-secondary">`),b=f(`<div class=post-types-manager><!$><!/><form class=card><h3></h3><div class=form-grid><label><!$><!/><input class=input required pattern=[a-z0-9_]+></label><label><!$><!/><input class=input required></label><label><!$><!/><input class=input required></label><label><!$><!/><input class=input placeholder=box><small class=muted></small></label></div><fieldset class=supports><legend></legend><!$><!/><label><input type=checkbox> <!$><!/></label><label><input type=checkbox> <!$><!/></label></fieldset><button type=submit class="btn btn-primary"></button><!$><!/></form><table class=table><thead><tr><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th></tr></thead><tbody>`),x=f(`<label><input type=checkbox> <!$><!/>`),ee=f(`<button type=button class="btn btn-danger">`),te=f(`<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td><button type=button class="btn btn-secondary"></button> <!$><!/>`);function S(){let{t:f}=g(),[p,S]=n([]),[C,w]=n(``),[ne,T]=n(!1),[E,D]=n(null),re=a(()=>[{value:`title`,label:f(`settings.postTypes.form.supportsOptions.title`)},{value:`editor`,label:f(`settings.postTypes.form.supportsOptions.editor`)},{value:`thumbnail`,label:f(`settings.postTypes.form.supportsOptions.thumbnail`)},{value:`excerpt`,label:f(`settings.postTypes.form.supportsOptions.excerpt`)},{value:`revisions`,label:f(`settings.postTypes.form.supportsOptions.revisions`)}]),[O,k]=n({name:``,slug:``,singularLabel:``,pluralLabel:``,hasArchive:!1,singleton:!1,menuIcon:`box`,supports:[`title`,`editor`]}),A=()=>{D(null),k({name:``,slug:``,singularLabel:``,pluralLabel:``,hasArchive:!1,singleton:!1,menuIcon:`box`,supports:[`title`,`editor`]})},j=async()=>{try{S(await _.getContentTypes())}catch(e){w(e instanceof Error?e.message:String(e))}};o(j);let ie=async e=>{e.preventDefault(),w(``),T(!0);try{let e={name:O().name||O().slug,slug:O().slug,singularLabel:O().singularLabel,pluralLabel:O().pluralLabel,hasArchive:O().hasArchive,singleton:O().singleton,menuIcon:O().menuIcon||`box`,supports:O().supports};E()?await _.updateContentType(E(),e):await _.createContentType(e),A(),await j(),window.dispatchEvent(new Event(`okcms:content-models-changed`))}catch(e){w(e instanceof Error?e.message:String(e))}finally{T(!1)}},ae=e=>{D(e.slug),k({name:e.name,slug:e.slug,singularLabel:e.singularLabel,pluralLabel:e.pluralLabel,hasArchive:e.hasArchive??!1,singleton:e.singleton??!1,menuIcon:e.menuIcon??`box`,supports:[...e.supports??[`title`,`editor`]]})},oe=async e=>{try{await _.deleteContentType(e),await j(),window.dispatchEvent(new Event(`okcms:content-models-changed`))}catch(e){w(e instanceof Error?e.message:String(e))}};return(()=>{var n=d(b),a=n.firstChild,[o,g]=s(a.nextSibling),_=o.nextSibling,S=_.firstChild,w=S.nextSibling,T=w.firstChild,D=T.firstChild,[j,se]=s(D.nextSibling),M=j.nextSibling,N=T.nextSibling,ce=N.firstChild,[P,le]=s(ce.nextSibling),F=P.nextSibling,I=N.nextSibling,ue=I.firstChild,[L,de]=s(ue.nextSibling),R=L.nextSibling,z=I.nextSibling,fe=z.firstChild,[B,pe]=s(fe.nextSibling),V=B.nextSibling,me=V.nextSibling,H=w.nextSibling,U=H.firstChild,he=U.nextSibling,[W,ge]=s(he.nextSibling),G=W.nextSibling,K=G.firstChild,_e=K.nextSibling.nextSibling,[ve,ye]=s(_e.nextSibling),q=G.nextSibling,J=q.firstChild,be=J.nextSibling.nextSibling,[xe,Se]=s(be.nextSibling),Y=H.nextSibling,Ce=Y.nextSibling,[we,Te]=s(Ce.nextSibling),X=_.nextSibling.firstChild,Z=X.firstChild.firstChild,Q=Z.nextSibling,$=Q.nextSibling,Ee=$.nextSibling,De=Ee.nextSibling,Oe=De.nextSibling,ke=Oe.nextSibling,Ae=ke.nextSibling,je=X.nextSibling;return m(n,i(t,{get when(){return C()},get children(){var e=d(v);return m(e,C),e}}),o,g),_.addEventListener(`submit`,ie),m(S,(()=>{var e=c(()=>!!E());return()=>e()?f(`settings.postTypes.form.editTitle`):f(`settings.postTypes.form.title`)})()),m(T,()=>f(`settings.postTypes.form.slug`),j,se),M.$$input=e=>k({...O(),slug:e.currentTarget.value}),m(N,()=>f(`settings.postTypes.form.singular`),P,le),F.$$input=e=>k({...O(),singularLabel:e.currentTarget.value}),m(I,()=>f(`settings.postTypes.form.plural`),L,de),R.$$input=e=>k({...O(),pluralLabel:e.currentTarget.value}),m(z,()=>f(`settings.postTypes.form.icon`),B,pe),V.$$input=e=>k({...O(),menuIcon:e.currentTarget.value}),m(me,()=>f(`settings.postTypes.form.iconHint`)),m(U,()=>f(`settings.postTypes.form.supports`)),m(H,i(r,{get each(){return re()},children:t=>(()=>{var n=d(x),r=n.firstChild,i=r.nextSibling.nextSibling,[a,o]=s(i.nextSibling);return r.addEventListener(`change`,e=>k({...O(),supports:e.currentTarget.checked?[...O().supports,t.value]:O().supports.filter(e=>e!==t.value)})),m(n,()=>t.label,a,o),e(()=>u(r,`checked`,O().supports.includes(t.value))),n})()}),W,ge),K.addEventListener(`change`,e=>k({...O(),hasArchive:e.currentTarget.checked})),m(G,()=>f(`settings.postTypes.form.hasArchive`),ve,ye),J.addEventListener(`change`,e=>k({...O(),singleton:e.currentTarget.checked})),m(q,()=>f(`settings.postTypes.form.singleton`),xe,Se),m(Y,(()=>{var e=c(()=>!!E());return()=>e()?f(`settings.postTypes.form.update`):f(`settings.postTypes.form.create`)})()),m(_,i(t,{get when(){return E()},get children(){var e=d(y);return e.$$click=A,m(e,()=>f(`settings.postTypes.form.cancel`)),h(),e}}),we,Te),m(Z,()=>f(`settings.postTypes.table.slug`)),m(Q,()=>f(`settings.postTypes.table.singular`)),m($,()=>f(`settings.postTypes.table.plural`)),m(Ee,()=>f(`settings.postTypes.table.source`)),m(De,()=>f(`settings.postTypes.table.supports`)),m(Oe,()=>f(`settings.postTypes.table.archive`)),m(ke,()=>f(`settings.postTypes.table.mode`)),m(Ae,()=>f(`settings.postTypes.table.icon`)),m(je,i(r,{get each(){return p()},children:e=>(()=>{var n=d(te),r=n.firstChild,a=r.nextSibling,o=a.nextSibling,l=o.nextSibling,u=l.nextSibling,p=u.nextSibling,g=p.nextSibling,_=g.nextSibling,v=_.nextSibling,y=v.firstChild,b=y.nextSibling.nextSibling,[x,S]=s(b.nextSibling);return m(r,()=>e.slug),m(a,()=>e.singularLabel),m(o,()=>e.pluralLabel),m(l,()=>e.source??f(`settings.postTypes.sources.admin`)),m(u,()=>(e.supports??[]).join(`, `)),m(p,(()=>{var t=c(()=>!!e.hasArchive);return()=>t()?f(`common.yes`):f(`common.no`)})()),m(g,(()=>{var t=c(()=>!!e.singleton);return()=>t()?f(`settings.postTypes.table.singleton`):f(`settings.postTypes.table.collection`)})()),m(_,()=>e.menuIcon??`box`),y.$$click=()=>ae(e),m(y,()=>f(`settings.postTypes.table.actions.edit`)),m(v,i(t,{get when(){return e.source!==`CORE`},get children(){var t=d(ee);return t.$$click=()=>oe(e.slug),m(t,()=>f(`settings.postTypes.table.actions.remove`)),h(),t}}),x,S),h(),n})()})),e(e=>{var t=f(`settings.postTypes.form.slugHint`),n=ne();return t!==e.e&&l(M,`title`,e.e=t),n!==e.t&&u(Y,`disabled`,e.t=n),e},{e:void 0,t:void 0}),e(()=>u(M,`value`,O().slug)),e(()=>u(F,`value`,O().singularLabel)),e(()=>u(R,`value`,O().pluralLabel)),e(()=>u(V,`value`,O().menuIcon)),e(()=>u(K,`checked`,O().hasArchive)),e(()=>u(J,`checked`,O().singleton)),h(),n})()}p([`input`,`click`]);export{S as PostTypesManager};
|
|
@@ -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{a,c as o,d as s,f as c,i as l,m as u,r as d,s as f,u as p}from"./web.DwNv8rLL.js";import{n as m}from"./i18n.
|
|
1
|
+
import{d as e,p as t,r as n,s as r,v as i}from"./solid.8gBSxpeo.js";import{a,c as o,d as s,f as c,i as l,m as u,r as d,s as f,u as p}from"./web.DwNv8rLL.js";import{n as m}from"./i18n.3zKFZ7KU.js";import{t as h}from"./api.CGA0D2A2.js";import{DashboardWidget as g}from"./AtGlanceWidget.DZLDbAfC.js";var _=u(`<div class=quick-draft-wrapper><div class=quick-draft-content-wrapper>`),v=u(`<style>
|
|
2
2
|
.quick-draft-form { display: flex; flex-direction: column; gap: 1rem; }
|
|
3
3
|
.form-group textarea { min-height: 100px; resize: vertical; font-family: inherit; }
|
|
4
4
|
.drafts-list h4 { margin-bottom: 1rem; }
|
|
@@ -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,f as c,i as l,m as u,r as d,s as f,u as p}from"./web.DwNv8rLL.js";import{n as m}from"./i18n.
|
|
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,f as c,i as l,m as u,r as d,s as f,u as p}from"./web.DwNv8rLL.js";import{n as m}from"./i18n.3zKFZ7KU.js";import{t as h}from"./api.CGA0D2A2.js";var g=u(`<div class="notice notice--error">`),_=u(`<div class=resource-hub><!$><!/><div class=access-grid><section class=card><h3></h3><button class="btn btn-primary"type=button>+ <!$><!/></button><!$><!/><table class=table><tbody></tbody></table></section><section class=card><h3></h3><button class="btn btn-primary"type=button>+ <!$><!/></button><!$><!/><table class=table><tbody>`),v=u(`<form class=resource-form><input class=input required><input class=input required><input class=input><button class="btn btn-primary"type=submit>`),y=u(`<button class="btn btn-danger"type=button>`),b=u(`<tr><td></td><td></td><td><button class=btn type=button></button><!$><!/>`),x=u(`<tr><td></td><td></td><td></td><td><button class=btn type=button></button><button class="btn btn-danger"type=button>`);function S(){let{t:u}=m(),[d,S]=n([]),[C,w]=n([]),[T,E]=n(null),[D,O]=n(null),[k,A]=n(``),j=async()=>{try{S(await h.listRoles()),w((await h.listTenants({limit:100})).data??[])}catch(e){A(e instanceof Error?e.message:String(e))}};return a(j),(()=>{var n=l(_),a=n.firstChild,[m,S]=o(a.nextSibling),w=m.nextSibling.firstChild,M=w.firstChild,N=M.nextSibling,P=N.firstChild.nextSibling,[F,I]=o(P.nextSibling),L=N.nextSibling,[R,z]=o(L.nextSibling),B=R.nextSibling.firstChild,V=w.nextSibling,H=V.firstChild,U=H.nextSibling,W=U.firstChild.nextSibling,[G,K]=o(W.nextSibling),q=U.nextSibling,[J,Y]=o(q.nextSibling),X=J.nextSibling.firstChild;return f(n,i(t,{get when(){return k()},get children(){var e=l(g);return f(e,k),e}}),m,S),f(M,()=>u(`access.roles`)),N.$$click=()=>E({name:``,slug:``,permissions:[]}),f(N,()=>u(`common.create`),F,I),f(w,i(t,{get when(){return T()},children:t=>(()=>{var n=l(v),r=n.firstChild,i=r.nextSibling,a=i.nextSibling,o=a.nextSibling;return n.addEventListener(`submit`,e=>{e.preventDefault(),(t().id?h.updateRole(t().id,t()):h.createRole(t())).then(()=>(E(null),j())).catch(e=>A(e instanceof Error?e.message:String(e)))}),r.$$input=e=>E({...t(),name:e.currentTarget.value}),i.$$input=e=>E({...t(),slug:e.currentTarget.value}),a.$$input=e=>E({...t(),permissions:e.currentTarget.value.split(`,`).map(e=>e.trim()).filter(Boolean)}),f(o,()=>u(`common.save`)),e(e=>{var t=u(`resources.name`),n=u(`resources.slug`),o=u(`access.permissions`);return t!==e.e&&s(r,`placeholder`,e.e=t),n!==e.t&&s(i,`placeholder`,e.t=n),o!==e.a&&s(a,`placeholder`,e.a=o),e},{e:void 0,t:void 0,a:void 0}),e(()=>c(r,`value`,t().name??``)),e(()=>c(i,`value`,t().slug??``)),e(()=>c(a,`value`,(t().permissions??[]).join(`, `))),p(),n})()}),R,z),f(B,i(r,{get each(){return d()},children:e=>(()=>{var n=l(b),r=n.firstChild,a=r.nextSibling,s=a.nextSibling,c=s.firstChild,d=c.nextSibling,[m,g]=o(d.nextSibling);return f(r,()=>e.name),f(a,()=>e.slug),c.$$click=()=>E(e),f(c,()=>u(`common.edit`)),f(s,i(t,{get when(){return!e.is_system},get children(){var t=l(y);return t.$$click=()=>void h.deleteRole(e.id).then(j),f(t,()=>u(`common.delete`)),p(),t}}),m,g),p(),n})()})),f(H,()=>u(`access.tenants`)),U.$$click=()=>O({name:``,slug:``}),f(U,()=>u(`common.create`),G,K),f(V,i(t,{get when(){return D()},children:t=>(()=>{var n=l(v),r=n.firstChild,i=r.nextSibling,a=i.nextSibling,o=a.nextSibling;return n.addEventListener(`submit`,e=>{e.preventDefault(),(t().id?h.updateTenant(t().id,t()):h.createTenant(t())).then(()=>(O(null),j())).catch(e=>A(e instanceof Error?e.message:String(e)))}),r.$$input=e=>O({...t(),name:e.currentTarget.value}),i.$$input=e=>O({...t(),slug:e.currentTarget.value}),a.$$input=e=>O({...t(),domain:e.currentTarget.value}),f(o,()=>u(`common.save`)),e(e=>{var t=u(`resources.name`),n=u(`resources.slug`),o=u(`access.domain`);return t!==e.e&&s(r,`placeholder`,e.e=t),n!==e.t&&s(i,`placeholder`,e.t=n),o!==e.a&&s(a,`placeholder`,e.a=o),e},{e:void 0,t:void 0,a:void 0}),e(()=>c(r,`value`,t().name??``)),e(()=>c(i,`value`,t().slug??``)),e(()=>c(a,`value`,t().domain??``)),p(),n})()}),J,Y),f(X,i(r,{get each(){return C()},children:e=>(()=>{var t=l(x),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,a=i.nextSibling.firstChild,o=a.nextSibling;return f(n,()=>e.name),f(r,()=>e.slug),f(i,()=>e.status),a.$$click=()=>O(e),f(a,()=>u(`common.edit`)),o.$$click=()=>e.id&&void h.deleteTenant(e.id).then(j),f(o,()=>u(`common.delete`)),p(),t})()})),p(),n})()}d([`click`,`input`]);export{S as AccessManager};
|
|
@@ -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.
|
|
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=taxonomies-manager><!$><!/><form class=card><h3></h3><div class=form-grid><label><!$><!/><input class=input required></label><label><!$><!/><input class=input pattern=[a-z0-9_]*></label><label><input type=checkbox> <!$><!/></label></div><fieldset><legend></legend><!$><!/></fieldset><button type=submit class="btn btn-primary"></button></form><table class=table><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody>`),y=d(`<label><input type=checkbox> <!$><!/> (<!$><!/>)`),b=d(`<button type=button class="btn btn-danger">`),x=d(`<tr><td><!$><!/> (<!$><!/>)</td><td></td><td></td><td>`),ee=d(`<label style=margin-right:0.75rem><input type=checkbox> <!$><!/>`);function S(){let{t:d}=h(),[f,S]=n([]),[C,w]=n([]),[T,E]=n(``),[D,O]=n(!1),[k,A]=n({name:``,slug:``,hierarchical:!1,attachTo:[]}),j=async()=>{try{let[e,t]=await Promise.all([g.getTaxonomies(),g.getContentTypes()]);S(e),w(t)}catch(e){E(e instanceof Error?e.message:String(e))}};a(j);let M=async e=>{e.preventDefault(),E(``),O(!0);try{await g.createTaxonomy({name:k().name,slug:k().slug||void 0,hierarchical:k().hierarchical,attachTo:k().attachTo,labels:{singular_name:k().name}}),A({name:``,slug:``,hierarchical:!1,attachTo:[]}),await j(),window.dispatchEvent(new Event(`okcms:content-models-changed`))}catch(e){E(e instanceof Error?e.message:String(e))}finally{O(!1)}},N=async(e,t)=>{let n=e.attachTo?.includes(t);try{n?await g.detachTaxonomy(e.slug,t):await g.attachTaxonomy(e.slug,t),await j(),window.dispatchEvent(new Event(`okcms:content-models-changed`))}catch(e){E(e instanceof Error?e.message:String(e))}},P=async e=>{try{await g.deleteTaxonomy(e),await j(),window.dispatchEvent(new Event(`okcms:content-models-changed`))}catch(e){E(e instanceof Error?e.message:String(e))}};return(()=>{var n=u(v),a=n.firstChild,[h,g]=o(a.nextSibling),S=h.nextSibling,w=S.firstChild,E=w.nextSibling,O=E.firstChild,j=O.firstChild,[F,I]=o(j.nextSibling),L=F.nextSibling,R=O.nextSibling,z=R.firstChild,[B,V]=o(z.nextSibling),H=B.nextSibling,U=R.nextSibling,W=U.firstChild,G=W.nextSibling.nextSibling,[K,q]=o(G.nextSibling),J=E.nextSibling,Y=J.firstChild,te=Y.nextSibling,[ne,re]=o(te.nextSibling),X=J.nextSibling,Z=S.nextSibling.firstChild,Q=Z.firstChild.firstChild,$=Q.nextSibling,ie=$.nextSibling,ae=Z.nextSibling;return p(n,i(t,{get when(){return T()},get children(){var e=u(_);return p(e,T),e}}),h,g),S.addEventListener(`submit`,M),p(w,()=>d(`settings.taxonomies.form.title`)),p(O,()=>d(`settings.taxonomies.form.name`),F,I),L.$$input=e=>A({...k(),name:e.currentTarget.value}),p(R,()=>d(`settings.taxonomies.form.slug`),B,V),H.$$input=e=>A({...k(),slug:e.currentTarget.value}),W.addEventListener(`change`,e=>A({...k(),hierarchical:e.currentTarget.checked})),p(U,()=>d(`settings.taxonomies.form.hierarchical`),K,q),p(Y,()=>d(`settings.taxonomies.form.attachTo`)),p(J,i(r,{get each(){return C()},children:t=>(()=>{var n=u(y),r=n.firstChild,i=r.nextSibling.nextSibling,[a,s]=o(i.nextSibling),c=a.nextSibling.nextSibling,[d,f]=o(c.nextSibling);return d.nextSibling,r.addEventListener(`change`,e=>A({...k(),attachTo:e.currentTarget.checked?[...k().attachTo,t.slug]:k().attachTo.filter(e=>e!==t.slug)})),p(n,()=>t.pluralLabel,a,s),p(n,()=>t.slug,d,f),e(()=>l(r,`checked`,k().attachTo.includes(t.slug))),n})()}),ne,re),p(X,()=>d(`settings.taxonomies.form.create`)),p(Q,()=>d(`settings.taxonomies.table.taxonomy`)),p($,()=>d(`settings.taxonomies.table.hierarchical`)),p(ie,()=>d(`settings.taxonomies.table.attachedTypes`)),p(ae,i(r,{get each(){return f()},children:n=>(()=>{var a=u(x),c=a.firstChild,f=c.firstChild,[h,g]=o(f.nextSibling),_=h.nextSibling.nextSibling,[v,y]=o(_.nextSibling);v.nextSibling;var S=c.nextSibling,w=S.nextSibling,T=w.nextSibling;return p(c,()=>n.name,h,g),p(c,()=>n.slug,v,y),p(S,(()=>{var e=s(()=>!!n.hierarchical);return()=>e()?d(`common.yes`):d(`common.no`)})()),p(w,i(r,{get each(){return C()},children:t=>(()=>{var r=u(ee),i=r.firstChild,a=i.nextSibling.nextSibling,[s,c]=o(a.nextSibling);return i.addEventListener(`change`,()=>N(n,t.slug)),p(r,()=>t.slug,s,c),e(()=>l(i,`checked`,n.attachTo?.includes(t.slug)??!1)),r})()})),p(T,i(t,{get when(){return n.source!==`CORE`},get children(){var e=u(b);return e.$$click=()=>P(n.slug),p(e,()=>d(`settings.taxonomies.table.actions.remove`)),m(),e}})),a})()})),e(e=>{var t=d(`settings.taxonomies.form.slugHint`),n=D();return t!==e.e&&c(H,`title`,e.e=t),n!==e.t&&l(X,`disabled`,e.t=n),e},{e:void 0,t:void 0}),e(()=>l(L,`value`,k().name)),e(()=>l(H,`value`,k().slug)),e(()=>l(W,`checked`,k().hierarchical)),m(),n})()}f([`input`,`click`]);export{S as TaxonomiesManager};
|