Loheide-eu-mitarbeiterplatt.../public/build/assets/Editor-B7hXNWek.js
Friederich Loheide 11123fecc0
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m0s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m11s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m7s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m52s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 3m2s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 2m31s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 2m27s
CI / Build-Artefakte aktuell (pull_request) Successful in 53s
Formulare, WordPress-Import und E-Mail-Versand
- Formular-Plugin: Baukasten mit 13 Feldtypen, Bedingungen, Vorbelegung
  aus dem Profil, Datei-Uploads (geschützt), anonyme Formulare, „nur einmal“,
  Einsendeschluss, Sichtbarkeit, Löschfrist; Einsendungen im Backend und per
  Mail (optional ohne Angaben, Kopie an die Person); Rechte je Formular und
  Rolle für Ansehen/Export und Löschen; CSV für Excel; Pagebuilder-Block
- WordPress-Import (Plugin): WXR-Datei einlesen, Kategorien/Personen zuordnen,
  Beiträge mit Status, Datum, Beitragsbild und Bildern im Text übernehmen,
  optional Seiten mit Hierarchie; in Portionen, wiederholbar ohne Doppelungen
- E-Mail-Versand im Admin (SMTP, verschlüsseltes Passwort, Test-Mail)
- Speichertest unabhängig vom Verbrauch der Test-Suite

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 09:20:54 +00:00

1 line
No EOL
98 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{$ as e,B as t,D as n,E as r,Ft as i,Ht as a,J as o,L as s,On as c,St as l,Tn as u,Yt as d,Zn as f,_ as p,b as m,bt as h,ct as g,ft as _,g as v,gn as y,gt as b,it as x,k as S,mt as C,o as w,qt as T,tr as E,tt as ee,un as D,v as O,vn as k,wt as te,y as A}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as ne,x as re,y as ie}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as ae,n as oe,t as se}from"./app-qaQo9ARB.js";import{A as ce,j}from"./utils-DfNUDixG.js";import{t as le}from"./arrow-left-CeYKHQbE.js";import{a as ue,i as de,n as fe,r as pe}from"./RichTextEditor-SFePC83k.js";import{t as me}from"./icons-6gNUNtiS.js";import{t as he}from"./calendar-clock-CwsI-C0a.js";import{t as ge}from"./calendar-days-Cq3ZXY-S.js";import{B as _e,F as ve,I as ye,M as be,P as xe,R as Se,U as Ce,W as we,a as Te,c as Ee,d as De,f as Oe,g as ke,h as Ae,i as je,l as Me,m as Ne,n as M,o as Pe,p as Fe,r as Ie,s as N,t as Le,u as Re,z as ze}from"./PersonAvatar-CD4S56En.js";import{t as Be}from"./clipboard-list-DLZt3Hel.js";import{t as Ve}from"./eye-off-D9ExUiqn.js";import{i as He}from"./VisuallyHiddenInput-DHw-iIzi.js";import{t as Ue}from"./image-B2vtsdro.js";import{t as We}from"./lock-DtEIVsTL.js";import{t as Ge}from"./message-square-warning-CzxLG9ol.js";import{t as Ke}from"./play-BqfGHciU.js";import{t as qe}from"./plus-CGTHU-CI.js";import{n as Je,t as Ye}from"./NativeSelect-BmmO8Miz.js";import{t as Xe}from"./smartphone-DJgIx-KL.js";import{t as Ze}from"./trash-B6D7gfwo.js";import{n as Qe,t as $e}from"./DialogHeader-C1ondDDq.js";import{t as et}from"./Switch-Bijyy0EE.js";import{t as tt}from"./button-BVLATeqq.js";import{t as P}from"./Input-DE5SwW-e.js";import{t as nt}from"./Textarea-_u9EqblO.js";import{i as rt,n as it,r as at,t as ot}from"./dialog-BS_OCxOd.js";import{t as st}from"./NewPageDialog-D3AfoYKZ.js";import{n as ct,t as lt}from"./PageContent-CzvPEtOi.js";var ut=j({name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]}),dt=j({name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]}),ft=j({name:`box`,size:24,node:[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]}),pt=j({name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]}),mt=j({name:`cloud-alert`,size:24,node:[[`path`,{d:`M12 12v4`,key:`tww15h`}],[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.128 16.949A7 7 0 1 1 15.71 8h1.79a1 1 0 0 1 0 9h-1.642`,key:`1namsd`}]]}),ht=j({name:`columns-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]],aliases:[`panels-left-right`]}),gt=j({name:`contact`,size:24,node:[[`path`,{d:`M16 2v2`,key:`scm5qe`}],[`path`,{d:`M7 21v-2a2 2 0 012-2h6a2 2 0 012 2v2`,key:`k82dct`}],[`path`,{d:`M8 2v2`,key:`pbkmx`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]}),F=j({name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]}),_t=j({name:`ellipsis-vertical`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]],aliases:[`more-vertical`]}),vt=j({name:`file-down`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}],[`path`,{d:`m9 15 3 3 3-3`,key:`1npd3o`}]]}),yt=j({name:`file-plus-corner`,size:24,node:[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]],aliases:[`file-plus-2`]}),bt=j({name:`folder-tree`,size:24,node:[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]}),xt=j({name:`gallery-horizontal-end`,size:24,node:[[`path`,{d:`M2 7v10`,key:`a2pl2d`}],[`path`,{d:`M6 5v14`,key:`1kq3d7`}],[`rect`,{width:`12`,height:`18`,x:`10`,y:`3`,rx:`2`,key:`13i7bc`}]]}),St=j({name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]}),Ct=j({name:`heading`,size:24,node:[[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M6 20V4`,key:`1w1bmo`}],[`path`,{d:`M18 20V4`,key:`o2hl4u`}]]}),wt=j({name:`images`,size:24,node:[[`path`,{d:`m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16`,key:`9kzy35`}],[`path`,{d:`M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2`,key:`1t0f0t`}],[`circle`,{cx:`13`,cy:`7`,r:`1`,fill:`currentColor`,key:`1obus6`}],[`rect`,{x:`8`,y:`2`,width:`14`,height:`14`,rx:`2`,key:`1gvhby`}]]}),Tt=j({name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]}),Et=j({name:`list-collapse`,size:24,node:[[`path`,{d:`M10 5h11`,key:`1hkqpe`}],[`path`,{d:`M10 12h11`,key:`6m4ad9`}],[`path`,{d:`M10 19h11`,key:`14g2nv`}],[`path`,{d:`m3 10 3-3-3-3`,key:`i7pm08`}],[`path`,{d:`m3 20 3-3-3-3`,key:`20gx1n`}]]}),Dt=j({name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]}),Ot=j({name:`mouse-pointer-click`,size:24,node:[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]}),kt=j({name:`move-vertical`,size:24,node:[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m8 18 4 4 4-4`,key:`bh5tu3`}],[`path`,{d:`m8 6 4-4 4 4`,key:`ybng9g`}]]}),At=j({name:`panel-top`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]}),jt=j({name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]}),Mt=j({name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]}),Nt=j({name:`square-dashed`,size:24,node:[[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`,key:`1j7049`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M9 3h1`,key:`1yesri`}],[`path`,{d:`M9 21h1`,key:`15o7lz`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M14 21h1`,key:`v9vybs`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M21 9v1`,key:`mxsmne`}],[`path`,{d:`M3 14v1`,key:`vnatye`}],[`path`,{d:`M21 14v1`,key:`169vum`}]],aliases:[`box-select`]}),Pt=j({name:`table`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]}),Ft=j({name:`tablet`,size:24,node:[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]}),It=j({name:`text-align-start`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]],aliases:[`text`,`align-left`]}),Lt=j({name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]}),Rt=Object.defineProperty,zt=Object.getOwnPropertySymbols,Bt=Object.prototype.hasOwnProperty,Vt=Object.prototype.propertyIsEnumerable,Ht=(e,t,n)=>t in e?Rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ut=(e,t)=>{for(var n in t||={})Bt.call(t,n)&&Ht(e,n,t[n]);if(zt)for(var n of zt(t))Vt.call(t,n)&&Ht(e,n,t[n]);return e},Wt=(e,t)=>{var n={};for(var r in e)Bt.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zt)for(var r of zt(e))t.indexOf(r)<0&&Vt.call(e,r)&&(n[r]=e[r]);return n},Gt=`[vue-draggable-plus]: `;function Kt(e){console.warn(Gt+e)}function qt(e){console.error(Gt+e)}function Jt(e,t,n){return n>=0&&n<e.length&&e.splice(n,0,e.splice(t,1)[0]),e}function Yt(e){return e.replace(/-(\w)/g,(e,t)=>t?t.toUpperCase():``)}function Xt(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[Yt(n)]=e[n]),t),{})}function Zt(e,t){return Array.isArray(e)&&e.splice(t,1),e}function Qt(e,t,n){return Array.isArray(e)&&e.splice(t,0,n),e}function $t(e){return e===void 0}function en(e){return typeof e==`string`}function tn(e,t,n){let r=e.children[n];e.insertBefore(t,r)}function nn(e){e.parentNode&&e.parentNode.removeChild(e)}function rn(e,t=document){let n=null;return n=typeof t?.querySelector==`function`?(t?.querySelector)?.call(t,e):document.querySelector(e),n||Kt(`Element not found: ${e}`),n}function an(e,t,n=null){return function(...r){return e.apply(n,r),t.apply(n,r)}}function on(e,t){let n=Ut({},e);return Object.keys(t).forEach(r=>{n[r]?n[r]=an(e[r],t[r]):n[r]=t[r]}),n}function sn(e){return e instanceof HTMLElement}function cn(e,t){Object.keys(e).forEach(n=>{t(n,e[n])})}function ln(e){return e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97)}var un=Object.assign;function dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dn(Object(n),!0).forEach(function(t){mn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pn(e){"@babel/helpers - typeof";return pn=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},pn(e)}function mn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hn(){return hn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hn.apply(this,arguments)}function gn(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function _n(e,t){if(e==null)return{};var n=gn(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var vn=`1.15.2`;function yn(e){if(typeof window<`u`&&window.navigator)return!!navigator.userAgent.match(e)}var bn=yn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),xn=yn(/Edge/i),Sn=yn(/firefox/i),Cn=yn(/safari/i)&&!yn(/chrome/i)&&!yn(/android/i),wn=yn(/iP(ad|od|hone)/i),Tn=yn(/chrome/i)&&yn(/android/i),En={capture:!1,passive:!1};function I(e,t,n){e.addEventListener(t,n,!bn&&En)}function L(e,t,n){e.removeEventListener(t,n,!bn&&En)}function Dn(e,t){if(t){if(t[0]===`>`&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function On(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function kn(e,t,n,r){if(e){n||=document;do{if(t!=null&&(t[0]===`>`?e.parentNode===n&&Dn(e,t):Dn(e,t))||r&&e===n)return e;if(e===n)break}while(e=On(e))}return null}var An=/\s+/g;function R(e,t,n){e&&t&&(e.classList?e.classList[n?`add`:`remove`](t):e.className=((` `+e.className+` `).replace(An,` `).replace(` `+t+` `,` `)+(n?` `+t:``)).replace(An,` `))}function z(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,``):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf(`webkit`)===-1&&(t=`-webkit-`+t),r[t]=n+(typeof n==`string`?``:`px`)}}function jn(e,t){var n=``;if(typeof e==`string`)n=e;else do{var r=z(e,`transform`);r&&r!==`none`&&(n=r+` `+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Mn(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,a=r.length;if(n)for(;i<a;i++)n(r[i],i);return r}return[]}function Nn(){return document.scrollingElement||document.documentElement}function B(e,t,n,r,i){if(e.getBoundingClientRect||e===window){var a,o,s,c,l,u,d;if(e!==window&&e.parentNode&&e!==Nn()?(a=e.getBoundingClientRect(),o=a.top,s=a.left,c=a.bottom,l=a.right,u=a.height,d=a.width):(o=0,s=0,c=window.innerHeight,l=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(i||=e.parentNode,!bn))do if(i&&i.getBoundingClientRect&&(z(i,`transform`)!==`none`||n&&z(i,`position`)!==`static`)){var f=i.getBoundingClientRect();o-=f.top+parseInt(z(i,`border-top-width`)),s-=f.left+parseInt(z(i,`border-left-width`)),c=o+a.height,l=s+a.width;break}while(i=i.parentNode);if(r&&e!==window){var p=jn(i||e),m=p&&p.a,h=p&&p.d;p&&(o/=h,s/=m,d/=m,u/=h,c=o+u,l=s+d)}return{top:o,left:s,bottom:c,right:l,width:d,height:u}}}function Pn(e,t,n){for(var r=Bn(e,!0),i=B(e)[t];r;){var a=B(r)[n],o=void 0;if(o=i>=a,!o)return r;if(r===Nn())break;r=Bn(r,!1)}return!1}function Fn(e,t,n,r){for(var i=0,a=0,o=e.children;a<o.length;){if(o[a].style.display!==`none`&&o[a]!==Q.ghost&&(r||o[a]!==Q.dragged)&&kn(o[a],n.draggable,e,!1)){if(i===t)return o[a];i++}a++}return null}function In(e,t){for(var n=e.lastElementChild;n&&(n===Q.ghost||z(n,`display`)===`none`||t&&!Dn(n,t));)n=n.previousElementSibling;return n||null}function Ln(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!==`TEMPLATE`&&e!==Q.clone&&(!t||Dn(e,t))&&n++;return n}function Rn(e){var t=0,n=0,r=Nn();if(e)do{var i=jn(e),a=i.a,o=i.d;t+=e.scrollLeft*a,n+=e.scrollTop*o}while(e!==r&&(e=e.parentNode));return[t,n]}function zn(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n)}return-1}function Bn(e,t){if(!e||!e.getBoundingClientRect)return Nn();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=z(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX==`auto`||i.overflowX==`scroll`)||n.clientHeight<n.scrollHeight&&(i.overflowY==`auto`||i.overflowY==`scroll`)){if(!n.getBoundingClientRect||n===document.body)return Nn();if(r||t)return n;r=!0}}while(n=n.parentNode);return Nn()}function Vn(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function Hn(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var Un;function Wn(e,t){return function(){if(!Un){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),Un=setTimeout(function(){Un=void 0},t)}}}function Gn(){clearTimeout(Un),Un=void 0}function Kn(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function qn(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function Jn(e,t,n){var r={};return Array.from(e.children).forEach(function(i){if(kn(i,t.draggable,e,!1)&&!i.animated&&i!==n){var a=B(i);r.left=Math.min(r.left??1/0,a.left),r.top=Math.min(r.top??1/0,a.top),r.right=Math.max(r.right??-1/0,a.right),r.bottom=Math.max(r.bottom??-1/0,a.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var V=`Sortable`+new Date().getTime();function Yn(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){if(z(t,`display`)!==`none`&&t!==Q.ghost){e.push({target:t,rect:B(t)});var n=fn({},e[e.length-1].rect);if(t.thisAnimationDuration){var r=jn(t,!0);r&&(n.top-=r.f,n.left-=r.e)}t.fromRect=n}})},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(zn(e,{target:t}),1)},animateAll:function(n){var r=this;if(!this.options.animation){clearTimeout(t),typeof n==`function`&&n();return}var i=!1,a=0;e.forEach(function(e){var t=0,n=e.target,o=n.fromRect,s=B(n),c=n.prevFromRect,l=n.prevToRect,u=e.rect,d=jn(n,!0);d&&(s.top-=d.f,s.left-=d.e),n.toRect=s,n.thisAnimationDuration&&Hn(c,s)&&!Hn(o,s)&&(u.top-s.top)/(u.left-s.left)===(o.top-s.top)/(o.left-s.left)&&(t=Zn(u,c,l,r.options)),Hn(s,o)||(n.prevFromRect=o,n.prevToRect=s,t||=r.options.animation,r.animate(n,u,s,t)),t&&(i=!0,a=Math.max(a,t),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},t),n.thisAnimationDuration=t)}),clearTimeout(t),i?t=setTimeout(function(){typeof n==`function`&&n()},a):typeof n==`function`&&n(),e=[]},animate:function(e,t,n,r){if(r){z(e,`transition`,``),z(e,`transform`,``);var i=jn(this.el),a=i&&i.a,o=i&&i.d,s=(t.left-n.left)/(a||1),c=(t.top-n.top)/(o||1);e.animatingX=!!s,e.animatingY=!!c,z(e,`transform`,`translate3d(`+s+`px,`+c+`px,0)`),this.forRepaintDummy=Xn(e),z(e,`transition`,`transform `+r+`ms`+(this.options.easing?` `+this.options.easing:``)),z(e,`transform`,`translate3d(0,0,0)`),typeof e.animated==`number`&&clearTimeout(e.animated),e.animated=setTimeout(function(){z(e,`transition`,``),z(e,`transform`,``),e.animated=!1,e.animatingX=!1,e.animatingY=!1},r)}}}}function Xn(e){return e.offsetWidth}function Zn(e,t,n,r){return Math.sqrt((t.top-e.top)**2+(t.left-e.left)**2)/Math.sqrt((t.top-n.top)**2+(t.left-n.left)**2)*r.animation}var Qn=[],$n={initializeByDefault:!0},er={mount:function(e){for(var t in $n)$n.hasOwnProperty(t)&&!(t in e)&&(e[t]=$n[t]);Qn.forEach(function(t){if(t.pluginName===e.pluginName)throw`Sortable: Cannot mount plugin ${e.pluginName} more than once`}),Qn.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var i=e+`Global`;Qn.forEach(function(r){t[r.pluginName]&&(t[r.pluginName][i]&&t[r.pluginName][i](fn({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](fn({sortable:t},n)))})},initializePlugins:function(e,t,n,r){for(var i in Qn.forEach(function(r){var i=r.pluginName;if(e.options[i]||r.initializeByDefault){var a=new r(e,t,e.options);a.sortable=e,a.options=e.options,e[i]=a,hn(n,a.defaults)}}),e.options)if(e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);a!==void 0&&(e.options[i]=a)}},getEventProperties:function(e,t){var n={};return Qn.forEach(function(r){typeof r.eventProperties==`function`&&hn(n,r.eventProperties.call(t[r.pluginName],e))}),n},modifyOption:function(e,t,n){var r;return Qn.forEach(function(i){e[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[t]==`function`&&(r=i.optionListeners[t].call(e[i.pluginName],n))}),r}};function tr(e){var t=e.sortable,n=e.rootEl,r=e.name,i=e.targetEl,a=e.cloneEl,o=e.toEl,s=e.fromEl,c=e.oldIndex,l=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,f=e.originalEvent,p=e.putSortable,m=e.extraEventProperties;if(t||=n&&n[V],t){var h,g=t.options,_=`on`+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!bn&&!xn?h=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(h=document.createEvent(`Event`),h.initEvent(r,!0,!0)),h.to=o||n,h.from=s||n,h.item=i||n,h.clone=a,h.oldIndex=c,h.newIndex=l,h.oldDraggableIndex=u,h.newDraggableIndex=d,h.originalEvent=f,h.pullMode=p?p.lastPutMode:void 0;var v=fn(fn({},m),er.getEventProperties(r,t));for(var y in v)h[y]=v[y];n&&n.dispatchEvent(h),g[_]&&g[_].call(t,h)}}var nr=[`evt`],H=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,i=_n(n,nr);er.pluginEvent.bind(Q)(e,t,fn({dragEl:W,parentEl:G,ghostEl:K,rootEl:q,nextEl:rr,lastDownEl:ir,cloneEl:J,cloneHidden:ar,dragStarted:yr,putSortable:X,activeSortable:Q.active,originalEvent:r,oldIndex:or,oldDraggableIndex:sr,newIndex:Y,newDraggableIndex:cr,hideGhostForTarget:Lr,unhideGhostForTarget:Rr,cloneNowHidden:function(){ar=!0},cloneNowShown:function(){ar=!1},dispatchSortableEvent:function(e){U({sortable:t,name:e,originalEvent:r})}},i))};function U(e){tr(fn({putSortable:X,cloneEl:J,targetEl:W,rootEl:q,oldIndex:or,oldDraggableIndex:sr,newIndex:Y,newDraggableIndex:cr},e))}var W,G,K,q,rr,ir,J,ar,or,Y,sr,cr,lr,X,ur=!1,dr=!1,fr=[],pr,mr,hr,gr,_r,vr,yr,br,xr,Sr=!1,Cr=!1,wr,Z,Tr=[],Er=!1,Dr=[],Or=typeof document<`u`,kr=wn,Ar=xn||bn?`cssFloat`:`float`,jr=Or&&!Tn&&!wn&&`draggable`in document.createElement(`div`),Mr=function(){if(Or){if(bn)return!1;var e=document.createElement(`x`);return e.style.cssText=`pointer-events:auto`,e.style.pointerEvents===`auto`}}(),Nr=function(e,t){var n=z(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=Fn(e,0,t),a=Fn(e,1,t),o=i&&z(i),s=a&&z(a),c=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+B(i).width,l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+B(a).width;if(n.display===`flex`)return n.flexDirection===`column`||n.flexDirection===`column-reverse`?`vertical`:`horizontal`;if(n.display===`grid`)return n.gridTemplateColumns.split(` `).length<=1?`vertical`:`horizontal`;if(i&&o.float&&o.float!==`none`){var u=o.float===`left`?`left`:`right`;return a&&(s.clear===`both`||s.clear===u)?`vertical`:`horizontal`}return i&&(o.display===`block`||o.display===`flex`||o.display===`table`||o.display===`grid`||c>=r&&n[Ar]===`none`||a&&n[Ar]===`none`&&c+l>r)?`vertical`:`horizontal`},Pr=function(e,t,n){var r=n?e.left:e.top,i=n?e.right:e.bottom,a=n?e.width:e.height,o=n?t.left:t.top,s=n?t.right:t.bottom,c=n?t.width:t.height;return r===o||i===s||r+a/2===o+c/2},Fr=function(e,t){var n;return fr.some(function(r){var i=r[V].options.emptyInsertThreshold;if(i&&!In(r)){var a=B(r),o=e>=a.left-i&&e<=a.right+i,s=t>=a.top-i&&t<=a.bottom+i;if(o&&s)return n=r}}),n},Ir=function(e){function t(e,n){return function(r,i,a,o){var s=r.options.group.name&&i.options.group.name&&r.options.group.name===i.options.group.name;if(e==null&&(n||s))return!0;if(e==null||e===!1)return!1;if(n&&e===`clone`)return e;if(typeof e==`function`)return t(e(r,i,a,o),n)(r,i,a,o);var c=(n?r:i).options.group.name;return e===!0||typeof e==`string`&&e===c||e.join&&e.indexOf(c)>-1}}var n={},r=e.group;(!r||pn(r)!=`object`)&&(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},Lr=function(){!Mr&&K&&z(K,`display`,`none`)},Rr=function(){!Mr&&K&&z(K,`display`,``)};Or&&!Tn&&document.addEventListener(`click`,function(e){if(dr)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),dr=!1,!1},!0);var zr=function(e){if(W){e=e.touches?e.touches[0]:e;var t=Fr(e.clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[V]._onDragOver(n)}}},Br=function(e){W&&W.parentNode[V]._isOutsideThisEl(e.target)};function Q(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw`Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;this.el=e,this.options=t=hn({},t),e[V]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?`>li`:`>*`,swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Nr(e,this.options)},ghostClass:`sortable-ghost`,chosenClass:`sortable-chosen`,dragClass:`sortable-drag`,ignore:`a, img`,filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData(`Text`,t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:`data-id`,delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:`sortable-fallback`,fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Q.supportPointer!==!1&&`PointerEvent`in window&&!Cn,emptyInsertThreshold:5};for(var r in er.initializePlugins(this,e,n),n)!(r in t)&&(t[r]=n[r]);for(var i in Ir(t),this)i.charAt(0)===`_`&&typeof this[i]==`function`&&(this[i]=this[i].bind(this));this.nativeDraggable=!t.forceFallback&&jr,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?I(e,`pointerdown`,this._onTapStart):(I(e,`mousedown`,this._onTapStart),I(e,`touchstart`,this._onTapStart)),this.nativeDraggable&&(I(e,`dragover`,this),I(e,`dragenter`,this)),fr.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),hn(this,Yn())}Q.prototype={constructor:Q,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(br=null)},_getDirection:function(e,t){return typeof this.options.direction==`function`?this.options.direction.call(this,e,t,W):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,a=e.type,o=e.touches&&e.touches[0]||e.pointerType&&e.pointerType===`touch`&&e,s=(o||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,l=r.filter;if(Xr(n),!W&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Cn&&s&&s.tagName.toUpperCase()===`SELECT`)&&(s=kn(s,r.draggable,n,!1),!(s&&s.animated)&&ir!==s)){if(or=Ln(s),sr=Ln(s,r.draggable),typeof l==`function`){if(l.call(this,e,s,this)){U({sortable:t,rootEl:c,name:`filter`,targetEl:s,toEl:n,fromEl:n}),H(`filter`,t,{evt:e}),i&&e.cancelable&&e.preventDefault();return}}else if(l&&(l=l.split(`,`).some(function(r){if(r=kn(c,r.trim(),n,!1),r)return U({sortable:t,rootEl:r,name:`filter`,targetEl:s,fromEl:n,toEl:n}),H(`filter`,t,{evt:e}),!0}),l)){i&&e.cancelable&&e.preventDefault();return}r.handle&&!kn(c,r.handle,n,!1)||this._prepareDragStart(e,o,s)}}},_prepareDragStart:function(e,t,n){var r=this,i=r.el,a=r.options,o=i.ownerDocument,s;if(n&&!W&&n.parentNode===i){var c=B(n);if(q=i,W=n,G=W.parentNode,rr=W.nextSibling,ir=n,lr=a.group,Q.dragged=W,pr={target:W,clientX:(t||e).clientX,clientY:(t||e).clientY},_r=pr.clientX-c.left,vr=pr.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,W.style[`will-change`]=`all`,s=function(){if(H(`delayEnded`,r,{evt:e}),Q.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!Sn&&r.nativeDraggable&&(W.draggable=!0),r._triggerDragStart(e,t),U({sortable:r,name:`choose`,originalEvent:e}),R(W,a.chosenClass,!0)},a.ignore.split(`,`).forEach(function(e){Mn(W,e.trim(),Ur)}),I(o,`dragover`,zr),I(o,`mousemove`,zr),I(o,`touchmove`,zr),I(o,`mouseup`,r._onDrop),I(o,`touchend`,r._onDrop),I(o,`touchcancel`,r._onDrop),Sn&&this.nativeDraggable&&(this.options.touchStartThreshold=4,W.draggable=!0),H(`delayStart`,this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(xn||bn))){if(Q.eventCanceled){this._onDrop();return}I(o,`mouseup`,r._disableDelayedDrag),I(o,`touchend`,r._disableDelayedDrag),I(o,`touchcancel`,r._disableDelayedDrag),I(o,`mousemove`,r._delayedDragTouchMoveHandler),I(o,`touchmove`,r._delayedDragTouchMoveHandler),a.supportPointer&&I(o,`pointermove`,r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){W&&Ur(W),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;L(e,`mouseup`,this._disableDelayedDrag),L(e,`touchend`,this._disableDelayedDrag),L(e,`touchcancel`,this._disableDelayedDrag),L(e,`mousemove`,this._delayedDragTouchMoveHandler),L(e,`touchmove`,this._delayedDragTouchMoveHandler),L(e,`pointermove`,this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t||=e.pointerType==`touch`&&e,!this.nativeDraggable||t?this.options.supportPointer?I(document,`pointermove`,this._onTouchMove):t?I(document,`touchmove`,this._onTouchMove):I(document,`mousemove`,this._onTouchMove):(I(W,`dragend`,this),I(q,`dragstart`,this._onDragStart));try{document.selection?Zr(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(ur=!1,q&&W){H(`dragStarted`,this,{evt:t}),this.nativeDraggable&&I(document,`dragover`,Br);var n=this.options;!e&&R(W,n.dragClass,!1),R(W,n.ghostClass,!0),Q.active=this,e&&this._appendGhost(),U({sortable:this,name:`start`,originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(mr){this._lastX=mr.clientX,this._lastY=mr.clientY,Lr();for(var e=document.elementFromPoint(mr.clientX,mr.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(mr.clientX,mr.clientY),e!==t);)t=e;if(W.parentNode[V]._isOutsideThisEl(e),t)do{if(t[V]){var n=void 0;if(n=t[V]._onDragOver({clientX:mr.clientX,clientY:mr.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Rr()}},_onTouchMove:function(e){if(pr){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,a=K&&jn(K,!0),o=K&&a&&a.a,s=K&&a&&a.d,c=kr&&Z&&Rn(Z),l=(i.clientX-pr.clientX+r.x)/(o||1)+(c?c[0]-Tr[0]:0)/(o||1),u=(i.clientY-pr.clientY+r.y)/(s||1)+(c?c[1]-Tr[1]:0)/(s||1);if(!Q.active&&!ur){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(K){a?(a.e+=l-(hr||0),a.f+=u-(gr||0)):a={a:1,b:0,c:0,d:1,e:l,f:u};var d=`matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;z(K,`webkitTransform`,d),z(K,`mozTransform`,d),z(K,`msTransform`,d),z(K,`transform`,d),hr=l,gr=u,mr=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!K){var e=this.options.fallbackOnBody?document.body:q,t=B(W,!0,kr,!0,e),n=this.options;if(kr){for(Z=e;z(Z,`position`)===`static`&&z(Z,`transform`)===`none`&&Z!==document;)Z=Z.parentNode;Z!==document.body&&Z!==document.documentElement?(Z===document&&(Z=Nn()),t.top+=Z.scrollTop,t.left+=Z.scrollLeft):Z=Nn(),Tr=Rn(Z)}K=W.cloneNode(!0),R(K,n.ghostClass,!1),R(K,n.fallbackClass,!0),R(K,n.dragClass,!0),z(K,`transition`,``),z(K,`transform`,``),z(K,`box-sizing`,`border-box`),z(K,`margin`,0),z(K,`top`,t.top),z(K,`left`,t.left),z(K,`width`,t.width),z(K,`height`,t.height),z(K,`opacity`,`0.8`),z(K,`position`,kr?`absolute`:`fixed`),z(K,`zIndex`,`100000`),z(K,`pointerEvents`,`none`),Q.ghost=K,e.appendChild(K),z(K,`transform-origin`,_r/parseInt(K.style.width)*100+`% `+vr/parseInt(K.style.height)*100+`%`)}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,i=n.options;if(H(`dragStart`,this,{evt:e}),Q.eventCanceled){this._onDrop();return}H(`setupClone`,this),Q.eventCanceled||(J=qn(W),J.removeAttribute(`id`),J.draggable=!1,J.style[`will-change`]=``,this._hideClone(),R(J,this.options.chosenClass,!1),Q.clone=J),n.cloneId=Zr(function(){H(`clone`,n),!Q.eventCanceled&&(n.options.removeCloneOnHide||q.insertBefore(J,W),n._hideClone(),U({sortable:n,name:`clone`}))}),!t&&R(W,i.dragClass,!0),t?(dr=!0,n._loopId=setInterval(n._emulateDragOver,50)):(L(document,`mouseup`,n._onDrop),L(document,`touchend`,n._onDrop),L(document,`touchcancel`,n._onDrop),r&&(r.effectAllowed=`move`,i.setData&&i.setData.call(n,r,W)),I(document,`drop`,n),z(W,`transform`,`translateZ(0)`)),ur=!0,n._dragStartId=Zr(n._dragStarted.bind(n,t,e)),I(document,`selectstart`,n),yr=!0,Cn&&z(document.body,`user-select`,`none`)},_onDragOver:function(e){var t=this.el,n=e.target,r,i,a,o=this.options,s=o.group,c=Q.active,l=lr===s,u=o.sort,d=X||c,f,p=this,m=!1;if(Er)return;function h(o,s){H(o,p,fn({evt:e,isOwner:l,axis:f?`vertical`:`horizontal`,revert:a,dragRect:r,targetRect:i,canSort:u,fromSortable:d,target:n,completed:_,onMove:function(n,i){return Hr(q,t,W,r,n,B(n),e,i)},changed:v},s))}function g(){h(`dragOverAnimationCapture`),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function _(r){return h(`dragOverCompleted`,{insertion:r}),r&&(l?c._hideClone():c._showClone(p),p!==d&&(R(W,X?X.options.ghostClass:c.options.ghostClass,!1),R(W,o.ghostClass,!0)),X!==p&&p!==Q.active?X=p:p===Q.active&&X&&(X=null),d===p&&(p._ignoreWhileAnimating=n),p.animateAll(function(){h(`dragOverAnimationComplete`),p._ignoreWhileAnimating=null}),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(n===W&&!W.animated||n===t&&!n.animated)&&(br=null),!o.dragoverBubble&&!e.rootEl&&n!==document&&(W.parentNode[V]._isOutsideThisEl(e.target),!r&&zr(e)),!o.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function v(){Y=Ln(W),cr=Ln(W,o.draggable),U({sortable:p,name:`change`,toEl:t,newIndex:Y,newDraggableIndex:cr,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=kn(n,o.draggable,t,!0),h(`dragOver`),Q.eventCanceled)return m;if(W.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||p._ignoreWhileAnimating===n)return _(!1);if(dr=!1,c&&!o.disabled&&(l?u||(a=G!==q):X===this||(this.lastPutMode=lr.checkPull(this,c,W,e))&&s.checkPut(this,c,W,e))){if(f=this._getDirection(e,n)===`vertical`,r=B(W),h(`dragOverValid`),Q.eventCanceled)return m;if(a)return G=q,g(),this._hideClone(),h(`revert`),Q.eventCanceled||(rr?q.insertBefore(W,rr):q.appendChild(W)),_(!0);var y=In(t,o.draggable);if(!y||Kr(e,f,this)&&!y.animated){if(y===W)return _(!1);if(y&&t===e.target&&(n=y),n&&(i=B(n)),Hr(q,t,W,r,n,i,e,!!n)!==!1)return g(),y&&y.nextSibling?t.insertBefore(W,y.nextSibling):t.appendChild(W),G=t,v(),_(!0)}else if(y&&Gr(e,f,this)){var b=Fn(t,0,o,!0);if(b===W)return _(!1);if(n=b,i=B(n),Hr(q,t,W,r,n,i,e,!1)!==!1)return g(),t.insertBefore(W,b),G=t,v(),_(!0)}else if(n.parentNode===t){i=B(n);var x=0,S,C=W.parentNode!==t,w=!Pr(W.animated&&W.toRect||r,n.animated&&n.toRect||i,f),T=f?`top`:`left`,E=Pn(n,`top`,`top`)||Pn(W,`top`,`top`),ee=E?E.scrollTop:void 0;br!==n&&(S=i[T],Sr=!1,Cr=!w&&o.invertSwap||C),x=qr(e,n,i,f,w?1:o.swapThreshold,o.invertedSwapThreshold==null?o.swapThreshold:o.invertedSwapThreshold,Cr,br===n);var D;if(x!==0){var O=Ln(W);do O-=x,D=G.children[O];while(D&&(z(D,`display`)===`none`||D===K))}if(x===0||D===n)return _(!1);br=n,xr=x;var k=n.nextElementSibling,te=!1;te=x===1;var A=Hr(q,t,W,r,n,i,e,te);if(A!==!1)return(A===1||A===-1)&&(te=A===1),Er=!0,setTimeout(Wr,30),g(),te&&!k?t.appendChild(W):n.parentNode.insertBefore(W,te?k:n),E&&Kn(E,0,ee-E.scrollTop),G=W.parentNode,S!==void 0&&!Cr&&(wr=Math.abs(S-B(n)[T])),v(),_(!0)}if(t.contains(W))return _(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){L(document,`mousemove`,this._onTouchMove),L(document,`touchmove`,this._onTouchMove),L(document,`pointermove`,this._onTouchMove),L(document,`dragover`,zr),L(document,`mousemove`,zr),L(document,`touchmove`,zr)},_offUpEvents:function(){var e=this.el.ownerDocument;L(e,`mouseup`,this._onDrop),L(e,`touchend`,this._onDrop),L(e,`pointerup`,this._onDrop),L(e,`touchcancel`,this._onDrop),L(document,`selectstart`,this)},_onDrop:function(e){var t=this.el,n=this.options;if(Y=Ln(W),cr=Ln(W,n.draggable),H(`drop`,this,{evt:e}),G=W&&W.parentNode,Y=Ln(W),cr=Ln(W,n.draggable),Q.eventCanceled){this._nulling();return}ur=!1,Cr=!1,Sr=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Qr(this.cloneId),Qr(this._dragStartId),this.nativeDraggable&&(L(document,`drop`,this),L(t,`dragstart`,this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Cn&&z(document.body,`user-select`,``),z(W,`transform`,``),e&&(yr&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),K&&K.parentNode&&K.parentNode.removeChild(K),(q===G||X&&X.lastPutMode!==`clone`)&&J&&J.parentNode&&J.parentNode.removeChild(J),W&&(this.nativeDraggable&&L(W,`dragend`,this),Ur(W),W.style[`will-change`]=``,yr&&!ur&&R(W,X?X.options.ghostClass:this.options.ghostClass,!1),R(W,this.options.chosenClass,!1),U({sortable:this,name:`unchoose`,toEl:G,newIndex:null,newDraggableIndex:null,originalEvent:e}),q===G?Y!==or&&Y>=0&&(U({sortable:this,name:`update`,toEl:G,originalEvent:e}),U({sortable:this,name:`sort`,toEl:G,originalEvent:e})):(Y>=0&&(U({rootEl:G,name:`add`,toEl:G,fromEl:q,originalEvent:e}),U({sortable:this,name:`remove`,toEl:G,originalEvent:e}),U({rootEl:G,name:`sort`,toEl:G,fromEl:q,originalEvent:e}),U({sortable:this,name:`sort`,toEl:G,originalEvent:e})),X&&X.save()),Q.active&&((Y==null||Y===-1)&&(Y=or,cr=sr),U({sortable:this,name:`end`,toEl:G,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){H(`nulling`,this),q=W=G=K=rr=J=ir=ar=pr=mr=yr=Y=cr=or=sr=br=xr=X=lr=Q.dragged=Q.ghost=Q.clone=Q.active=null,Dr.forEach(function(e){e.checked=!0}),Dr.length=hr=gr=0},handleEvent:function(e){switch(e.type){case`drop`:case`dragend`:this._onDrop(e);break;case`dragenter`:case`dragover`:W&&(this._onDragOver(e),Vr(e));break;case`selectstart`:e.preventDefault()}},toArray:function(){for(var e=[],t,n=this.el.children,r=0,i=n.length,a=this.options;r<i;r++)t=n[r],kn(t,a.draggable,this.el,!1)&&e.push(t.getAttribute(a.dataIdAttr)||Yr(t));return e},sort:function(e,t){var n={},r=this.el;this.toArray().forEach(function(e,t){var i=r.children[t];kn(i,this.options.draggable,r,!1)&&(n[e]=i)},this),t&&this.captureAnimationState(),e.forEach(function(e){n[e]&&(r.removeChild(n[e]),r.appendChild(n[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return kn(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var r=er.modifyOption(this,e,t);n[e]=r===void 0?t:r,e===`group`&&Ir(n)},destroy:function(){H(`destroy`,this);var e=this.el;e[V]=null,L(e,`mousedown`,this._onTapStart),L(e,`touchstart`,this._onTapStart),L(e,`pointerdown`,this._onTapStart),this.nativeDraggable&&(L(e,`dragover`,this),L(e,`dragenter`,this)),Array.prototype.forEach.call(e.querySelectorAll(`[draggable]`),function(e){e.removeAttribute(`draggable`)}),this._onDrop(),this._disableDelayedDragEvents(),fr.splice(fr.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!ar){if(H(`hideClone`,this),Q.eventCanceled)return;z(J,`display`,`none`),this.options.removeCloneOnHide&&J.parentNode&&J.parentNode.removeChild(J),ar=!0}},_showClone:function(e){if(e.lastPutMode!==`clone`){this._hideClone();return}if(ar){if(H(`showClone`,this),Q.eventCanceled)return;W.parentNode==q&&!this.options.group.revertClone?q.insertBefore(J,W):rr?q.insertBefore(J,rr):q.appendChild(J),this.options.group.revertClone&&this.animate(W,J),z(J,`display`,``),ar=!1}}};function Vr(e){e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),e.cancelable&&e.preventDefault()}function Hr(e,t,n,r,i,a,o,s){var c,l=e[V],u=l.options.onMove,d;return window.CustomEvent&&!bn&&!xn?c=new CustomEvent(`move`,{bubbles:!0,cancelable:!0}):(c=document.createEvent(`Event`),c.initEvent(`move`,!0,!0)),c.to=t,c.from=e,c.dragged=n,c.draggedRect=r,c.related=i||t,c.relatedRect=a||B(t),c.willInsertAfter=s,c.originalEvent=o,e.dispatchEvent(c),u&&(d=u.call(l,c,o)),d}function Ur(e){e.draggable=!1}function Wr(){Er=!1}function Gr(e,t,n){var r=B(Fn(n.el,0,n.options,!0)),i=Jn(n.el,n.options,K),a=10;return t?e.clientX<i.left-a||e.clientY<r.top&&e.clientX<r.right:e.clientY<i.top-a||e.clientY<r.bottom&&e.clientX<r.left}function Kr(e,t,n){var r=B(In(n.el,n.options.draggable)),i=Jn(n.el,n.options,K),a=10;return t?e.clientX>i.right+a||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>i.bottom+a||e.clientX>r.right&&e.clientY>r.top}function qr(e,t,n,r,i,a,o,s){var c=r?e.clientY:e.clientX,l=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!o){if(s&&wr<l*i){if(!Sr&&(xr===1?c>u+l*a/2:c<d-l*a/2)&&(Sr=!0),Sr)f=!0;else if(xr===1?c<u+wr:c>d-wr)return-xr}else if(c>u+l*(1-i)/2&&c<d-l*(1-i)/2)return Jr(t)}return f||=o,f&&(c<u+l*a/2||c>d-l*a/2)?c>u+l/2?1:-1:0}function Jr(e){return Ln(W)<Ln(e)?1:-1}function Yr(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function Xr(e){Dr.length=0;for(var t=e.getElementsByTagName(`input`),n=t.length;n--;){var r=t[n];r.checked&&Dr.push(r)}}function Zr(e){return setTimeout(e,0)}function Qr(e){return clearTimeout(e)}Or&&I(document,`touchmove`,function(e){(Q.active||ur)&&e.cancelable&&e.preventDefault()}),Q.utils={on:I,off:L,css:z,find:Mn,is:function(e,t){return!!kn(e,t,e,!1)},extend:Vn,throttle:Wn,closest:kn,toggleClass:R,clone:qn,index:Ln,nextTick:Zr,cancelNextTick:Qr,detectDirection:Nr,getChild:Fn},Q.get=function(e){return e[V]},Q.mount=function(){var e=[...arguments];e[0].constructor===Array&&(e=e[0]),e.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw`Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;e.utils&&(Q.utils=fn(fn({},Q.utils),e.utils)),er.mount(e)})},Q.create=function(e,t){return new Q(e,t)},Q.version=vn;var $=[],$r,ei,ti=!1,ni,ri,ii,ai;function oi(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)e.charAt(0)===`_`&&typeof this[e]==`function`&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?I(document,`dragover`,this._handleAutoScroll):this.options.supportPointer?I(document,`pointermove`,this._handleFallbackAutoScroll):t.touches?I(document,`touchmove`,this._handleFallbackAutoScroll):I(document,`mousemove`,this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;!this.options.dragOverBubble&&!t.rootEl&&this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?L(document,`dragover`,this._handleAutoScroll):(L(document,`pointermove`,this._handleFallbackAutoScroll),L(document,`touchmove`,this._handleFallbackAutoScroll),L(document,`mousemove`,this._handleFallbackAutoScroll)),ci(),si(),Gn()},nulling:function(){ii=ei=$r=ti=ai=ni=ri=null,$.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,a=document.elementFromPoint(r,i);if(ii=e,t||this.options.forceAutoScrollFallback||xn||bn||Cn){li(e,this.options,a,t);var o=Bn(a,!0);ti&&(!ai||r!==ni||i!==ri)&&(ai&&ci(),ai=setInterval(function(){var a=Bn(document.elementFromPoint(r,i),!0);a!==o&&(o=a,si()),li(e,n.options,a,t)},10),ni=r,ri=i)}else{if(!this.options.bubbleScroll||Bn(a,!0)===Nn()){si();return}li(e,this.options,Bn(a,!1),!1)}}},hn(e,{pluginName:`scroll`,initializeByDefault:!0})}function si(){$.forEach(function(e){clearInterval(e.pid)}),$=[]}function ci(){clearInterval(ai)}var li=Wn(function(e,t,n,r){if(t.scroll){var i=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,o=t.scrollSensitivity,s=t.scrollSpeed,c=Nn(),l=!1,u;ei!==n&&(ei=n,si(),$r=t.scroll,u=t.scrollFn,$r===!0&&($r=Bn(n,!0)));var d=0,f=$r;do{var p=f,m=B(p),h=m.top,g=m.bottom,_=m.left,v=m.right,y=m.width,b=m.height,x=void 0,S=void 0,C=p.scrollWidth,w=p.scrollHeight,T=z(p),E=p.scrollLeft,ee=p.scrollTop;p===c?(x=y<C&&(T.overflowX===`auto`||T.overflowX===`scroll`||T.overflowX===`visible`),S=b<w&&(T.overflowY===`auto`||T.overflowY===`scroll`||T.overflowY===`visible`)):(x=y<C&&(T.overflowX===`auto`||T.overflowX===`scroll`),S=b<w&&(T.overflowY===`auto`||T.overflowY===`scroll`));var D=x&&(Math.abs(v-i)<=o&&E+y<C)-(Math.abs(_-i)<=o&&!!E),O=S&&(Math.abs(g-a)<=o&&ee+b<w)-(Math.abs(h-a)<=o&&!!ee);if(!$[d])for(var k=0;k<=d;k++)$[k]||($[k]={});($[d].vx!=D||$[d].vy!=O||$[d].el!==p)&&($[d].el=p,$[d].vx=D,$[d].vy=O,clearInterval($[d].pid),(D!=0||O!=0)&&(l=!0,$[d].pid=setInterval(function(){r&&this.layer===0&&Q.active._onTouchMove(ii);var t=$[this.layer].vy?$[this.layer].vy*s:0,n=$[this.layer].vx?$[this.layer].vx*s:0;typeof u==`function`&&u.call(Q.dragged.parentNode[V],n,t,e,ii,$[this.layer].el)!==`continue`||Kn($[this.layer].el,n,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==c&&(f=Bn(f,!1)));ti=l}},30),ui=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,o=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var c=n||i;o();var l=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(l.clientX,l.clientY);s(),c&&!c.el.contains(u)&&(a(`spill`),this.onSpill({dragEl:r,putSortable:n}))}};function di(){}di.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=Fn(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:ui},hn(di,{pluginName:`revertOnSpill`});function fi(){}fi.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:ui},hn(fi,{pluginName:`removeOnSpill`}),Q.mount(new oi),Q.mount(fi,di);function pi(e){return e==null?e:JSON.parse(JSON.stringify(e))}function mi(e){s()&&_(e)}function hi(e){s()?g(e):ee(e)}var gi=null,_i=null;function vi(e=null,t=null){gi=e,_i=t}function yi(){return{data:gi,clonedData:_i}}var bi=Symbol(`cloneElement`);function xi(...e){let t=s()?.proxy,n=null,r=e[0],[,i,o]=e;Array.isArray(c(i))||(o=i,i=null);let l=null,{immediate:u=!0,clone:d=pi,forceFallback:f,fallbackOnBody:p,customUpdate:m}=c(o)??{};function h(e){let{from:t,oldIndex:r,item:a}=e,o=Array.from(t.childNodes);n=f&&!p?o.slice(0,-1):o;let s=c(c(i)?.[r]),l=d(s);vi(s,l),a[bi]=l}function g(e){let t=e.item[bi];if(!$t(t)){if(nn(e.item),D(i)){let n=[...c(i)];i.value=Qt(n,e.newDraggableIndex,t);return}Qt(c(i),e.newDraggableIndex,t)}}function _(e){let{from:t,item:n,oldIndex:r,oldDraggableIndex:a,pullMode:o,clone:s}=e;if(tn(t,n,r),o===`clone`){nn(s);return}if(D(i)){let e=[...c(i)];i.value=Zt(e,a);return}Zt(c(i),a)}function v(e){if(m){m(e);return}let{from:t,item:n,oldIndex:r,oldDraggableIndex:a,newDraggableIndex:o}=e;if(nn(n),tn(t,n,r),D(i)){let e=[...c(i)];i.value=Jt(e,a,o);return}Jt(c(i),a,o)}function y(e){let{newIndex:t,oldIndex:r,from:i,to:a}=e,o=null,s=t===r&&i===a;try{if(s){let e=null;n?.some((t,r)=>{if(e&&n?.length!==a.childNodes.length)return i.insertBefore(e,t.nextSibling),!0;let o=a.childNodes[r];e=a?.replaceChild(t,o)})}}catch(e){o=e}finally{n=null}ee(()=>{if(vi(),o)throw o})}let b={onUpdate:v,onStart:h,onAdd:g,onRemove:_,onEnd:y};function x(e){let n=c(r);return e||=en(n)?rn(n,t?.$el):n,e&&!sn(e)&&(e=e.$el),e||qt(`Root element not found`),e}function S(){let e=c(o)??{},{immediate:t,clone:n}=e,r=Wt(e,[`immediate`,`clone`]);return cn(r,(e,t)=>{ln(e)&&(r[e]=(e,...n)=>(un(e,yi()),t(e,...n)))}),on(i===null?{}:b,r)}let C=e=>{e=x(e),l&&w.destroy(),l=new Q(e,S())};a(()=>o,()=>{l&&cn(S(),(e,t)=>{l?.option(e,t)})},{deep:!0});let w={option:(e,t)=>l?.option(e,t),destroy:()=>{l?.destroy(),l=null},save:()=>l?.save(),toArray:()=>l?.toArray(),closest:(...e)=>l?.closest(...e)};return hi(()=>{u&&C()}),mi(w.destroy),Ut({start:C,pause:()=>w?.option(`disabled`,!0),resume:()=>w?.option(`disabled`,!1)},w)}var Si=[`update`,`start`,`add`,`remove`,`choose`,`unchoose`,`end`,`sort`,`filter`,`clone`,`move`,`change`],Ci=[`clone`,`animation`,`ghostClass`,`group`,`sort`,`disabled`,`store`,`handle`,`draggable`,`swapThreshold`,`invertSwap`,`invertedSwapThreshold`,`removeCloneOnHide`,`direction`,`chosenClass`,`dragClass`,`ignore`,`filter`,`preventOnFilter`,`easing`,`setData`,`dropBubble`,`dragoverBubble`,`dataIdAttr`,`delay`,`delayOnTouchOnly`,`touchStartThreshold`,`forceFallback`,`fallbackClass`,`fallbackOnBody`,`fallbackTolerance`,`fallbackOffset`,`supportPointer`,`emptyInsertThreshold`,`scroll`,`forceAutoScrollFallback`,`scrollSensitivity`,`scrollSpeed`,`bubbleScroll`,`modelValue`,`tag`,`target`,`customUpdate`,...Si.map(e=>`on${e.replace(/^\S/,e=>e.toUpperCase())}`)],wi=S({name:`VueDraggable`,model:{prop:`modelValue`,event:`update:modelValue`},props:Ci,emits:[`update:modelValue`,...Si],setup(e,{slots:n,emit:r,expose:i,attrs:a}){let o=Si.reduce((e,t)=>{let n=`on${t.replace(/^\S/,e=>e.toUpperCase())}`;return e[n]=(...e)=>r(t,...e),e},{}),s=v(()=>{let t=u(e),{modelValue:n}=t,r=Wt(t,[`modelValue`]),i=Object.entries(r).reduce((e,[t,n])=>{let r=c(n);return r!==void 0&&(e[t]=r),e},{});return Ut(Ut({},o),Xt(Ut(Ut({},a),i)))}),l=v({get:()=>e.modelValue,set:e=>r(`update:modelValue`,e)}),d=k(),f=y(xi(e.target||d,l,s));return i(f),()=>t(e.tag||`div`,{ref:d},(n?.default)?.call(n,f))}}),Ti={mounted:`mounted`,unmounted:`unmounted`};Ti.mounted,Ti.unmounted;var Ei={"square-dashed":Nt,"columns-3":ht,"panel-top":At,"list-collapse":Et,"message-square-warning":Ge,heading:Ct,text:It,quote:de,"mouse-pointer-click":Ot,"list-checks":Tt,table:Pt,minus:Dt,"move-vertical":kt,image:Ue,images:wt,play:Ke,panorama:xt,contact:gt,"file-down":vt,"folder-tree":bt,newspaper:ze,"calendar-days":ge,"clipboard-list":Be};function Di(e){return Ei[e]??ft}function Oi(){return Math.random().toString(36).slice(2,8)+Date.now().toString(36).slice(-6)}function ki(e){return JSON.parse(JSON.stringify(e))}function Ai(e,t){return e.container?e.key===`columns`?(t.layout??`1-1`).split(`-`).length:e.key===`tabs`?2:e.key===`accordion`?3:e.container.min:0}function ji(e){let t=ki(e.defaults??{}),n={id:Oi(),type:e.key,data:t};return e.container&&(n.items=Array.from({length:Ai(e,t)},(t,n)=>({id:Oi(),title:e.container.titled?`${e.container.label} ${n+1}`:void 0,blocks:[]}))),n}function Mi(e){let t=ki(e),n=e=>{e.id=Oi(),(e.items??[]).forEach(e=>{e.id=Oi(),e.blocks.forEach(n)})};return n(t),t}function Ni(e,t,n=null){for(let r=0;r<e.length;r++){let i=e[r];if(i.id===t)return{block:i,list:e,index:r,parent:n};for(let e of i.items??[]){let n=Ni(e.blocks,t,i);if(n)return n}}return null}function Pi(e,t){for(let n of e)t(n),(n.items??[]).forEach(e=>Pi(e.blocks,t))}function Fi(e){let t=(e.data.layout??`1-1`).split(`-`).length;for(;e.items.length<t;)e.items.push({id:Oi(),blocks:[]});if(e.items.length>t){let n=e.items.splice(t).flatMap(e=>e.blocks);e.items[t-1].blocks.push(...n)}}var Ii={class:`grid gap-4`},Li={class:`mb-2 text-xs font-semibold tracking-wide text-muted-foreground uppercase`},Ri=[`title`,`disabled`,`onClick`],zi={class:`truncate`},Bi={__name:`BlockPalette`,props:{compact:{type:Boolean,default:!1}},emits:[`pick`],setup(e,{emit:t}){let r=t,i=o(`pagebuilder:editor`),a=v(()=>Object.entries(i.groups).map(([e,t])=>({key:e,label:t,types:Object.values(i.types).filter(t=>t.group===e)})).filter(e=>e.types.length));return(t,o)=>(C(),m(`div`,Ii,[(C(!0),m(w,null,h(a.value,t=>(C(),m(`section`,{key:t.key},[p(`h3`,Li,E(t.label),1),n(c(wi),{"model-value":t.types,group:{name:`pagebuilder`,pull:`clone`,put:!1},clone:e=>c(ji)(e),sort:!1,disabled:e.compact||c(i).readOnly.value,class:`grid grid-cols-2 gap-2`},{default:T(()=>[(C(!0),m(w,null,h(t.types,t=>(C(),m(`button`,{key:t.key,type:`button`,class:f([`flex items-center gap-2 rounded-md border bg-card px-2.5 py-2 text-left text-[13px] font-medium transition-colors hover:border-brand-300 hover:bg-brand-soft/60`,e.compact?``:`cursor-grab active:cursor-grabbing`]),title:t.description||t.label,disabled:c(i).readOnly.value,onClick:e=>r(`pick`,t)},[(C(),O(te(c(Di)(t.icon)),{class:`size-4 shrink-0 text-brand-text`})),p(`span`,zi,E(t.label),1)],10,Ri))),128))]),_:2},1032,[`model-value`,`clone`,`disabled`])]))),128))]))}},Vi={class:`grid gap-1.5`},Hi=[`for`],Ui=[`for`],Wi={key:8,class:`grid grid-cols-6 gap-1.5`},Gi=[`title`,`aria-pressed`,`onClick`],Ki={key:9,class:`grid gap-2`},qi={key:0,class:`relative overflow-hidden rounded-md border bg-muted`},Ji=[`src`],Yi=[`disabled`],Xi={key:10,class:`grid gap-2`},Zi={key:0,class:`grid gap-1`},Qi={class:`min-w-0 flex-1 truncate text-[13px]`},$i=[`onClick`],ea=[`onClick`],ta={class:`relative`},na={key:0,class:`absolute inset-x-0 top-full z-30 mt-1 max-h-60 overflow-y-auto rounded-md border bg-popover p-1 shadow-md`},ra=[`onClick`],ia={class:`min-w-0`},aa={class:`block truncate font-medium`},oa={class:`block truncate text-xs text-muted-foreground`},sa={key:11,class:`grid gap-2`},ca={class:`overflow-x-auto rounded-md border`},la={class:`w-full text-[13px]`},ua=[`value`,`aria-label`,`onInput`],da={class:`w-7 p-0 text-center`},fa=[`onClick`],pa=[`onClick`],ma={class:`flex gap-2`},ha={key:12,class:`grid gap-2`},ga=[`open`],_a={class:`flex cursor-pointer list-none items-center gap-2 px-3 py-2 text-[13px] font-medium`},va={class:`min-w-0 flex-1 truncate`},ya=[`onClick`],ba=[`onClick`],xa=[`onClick`],Sa={class:`grid gap-3 border-t px-3 py-3`},Ca={key:13,class:`grid gap-2`},wa={key:0,class:`grid gap-1`},Ta={class:`min-w-0 flex-1 truncate`},Ea={key:0,class:`shrink-0 text-xs text-muted-foreground`},Da=[`onClick`],Oa=[`onClick`],ka=[`disabled`],Aa={key:14,class:`text-xs text-muted-foreground`},ja={__name:`FieldInput`,props:e({field:{type:Object,required:!0},id:{type:String,required:!0}},{modelValue:{default:null},modelModifiers:{}}),emits:e([`image-uploaded`],[`update:modelValue`]),setup(e,{emit:t}){let s=e,u=i(e,`modelValue`),d=o(`pagebuilder:editor`),g=t,_=k(!1),y=k(null);async function b(e){let t=e.target.files?.[0];if(e.target.value=``,t){_.value=!0;try{let e=await d.uploadImage(t);u.value=e.path,g(`image-uploaded`,e)}catch(e){N.error(e.fieldErrors?.image??e.message)}finally{_.value=!1}}}let x=k(``),S=k([]),T=d.peopleCache,ee;if(a(x,e=>{if(clearTimeout(ee),e.trim().length<2){S.value=[];return}ee=setTimeout(async()=>{let t=await M.get(`/personen/suche?q=${encodeURIComponent(e.trim())}`);t.people.forEach(e=>T[e.id]=e),S.value=t.people.filter(e=>!(u.value??[]).includes(e.id))},250)}),s.field.type===`people`&&(u.value??[]).some(e=>!T[e])){let e=u.value.filter(e=>!T[e]);M.get(`/personen/suche?${e.map(e=>`ids[]=${e}`).join(`&`)}`).then(e=>e.people.forEach(e=>T[e.id]=e))}function D(e){u.value=[...u.value??[],e.id],x.value=``,S.value=[]}function re(e,t,n){let r=t+n;if(r<0||r>=e.length)return;let i=[...e];[i[t],i[r]]=[i[r],i[t]],u.value=i}function ie(e){u.value=u.value.filter((t,n)=>n!==e)}function ae(){let e=Object.fromEntries(s.field.fields.map(e=>[e.name,structuredClone(e.default??(e.type===`toggle`?!1:e.type===`repeater`?[]:``))]));u.value=[...u.value??[],e]}let oe=v(()=>u.value??[[``]]);function se(e,t,n){let r=oe.value.map(e=>[...e]);r[e][t]=n,u.value=r}function j(){u.value=[...oe.value,Array(oe.value[0]?.length??1).fill(``)]}function le(){u.value=oe.value.map(e=>[...e,``])}function de(e){oe.value.length>1&&(u.value=oe.value.filter((t,n)=>n!==e))}function pe(e){(oe.value[0]?.length??1)>1&&(u.value=oe.value.map(t=>t.filter((t,n)=>n!==e)))}let he=k(null),ge=v(()=>Object.fromEntries(d.files.value.map(e=>[e.id,e])));async function _e(e){let t=[...e.target.files??[]];e.target.value=``,_.value=!0;try{for(let e of t){let t=await d.uploadFile(e);u.value=[...u.value??[],t.id]}}catch(e){N.error(e.fieldErrors?.file??e.message)}finally{_.value=!1}}let ye=v(()=>d.files.value.filter(e=>!(u.value??[]).includes(e.id))),be=e=>e>1048576?`${(e/1024/1024).toFixed(1).replace(`.`,`,`)} MB`:`${Math.max(1,Math.round(e/1024))} KB`,xe=v(()=>(s.field.choices??[]).map(e=>({...e,icon:me[e.value]})));return(t,i)=>{let a=l(`FieldInput`,!0);return C(),m(`div`,Vi,[e.field.type===`toggle`?A(``,!0):(C(),m(`label`,{key:0,for:e.id,class:`text-[13px] font-medium`},E(e.field.label),9,Hi)),e.field.type===`text`?(C(),O(c(P),{key:1,id:e.id,modelValue:u.value,"onUpdate:modelValue":i[0]||=e=>u.value=e,maxlength:e.field.max,placeholder:e.field.placeholder??``},null,8,[`id`,`modelValue`,`maxlength`,`placeholder`])):e.field.type===`url`?(C(),O(c(P),{key:2,id:e.id,modelValue:u.value,"onUpdate:modelValue":i[1]||=e=>u.value=e,type:`text`,inputmode:`url`,placeholder:`https://… oder /seiten/…`},null,8,[`id`,`modelValue`])):e.field.type===`textarea`?(C(),O(c(nt),{key:3,id:e.id,modelValue:u.value,"onUpdate:modelValue":i[2]||=e=>u.value=e,maxlength:e.field.max,rows:`3`},null,8,[`id`,`modelValue`,`maxlength`])):e.field.type===`html`?(C(),O(fe,{key:4,modelValue:u.value,"onUpdate:modelValue":i[3]||=e=>u.value=e,bordered:``,"min-height":`[&_.tiptap]:min-h-24`},null,8,[`modelValue`])):e.field.type===`number`?(C(),O(c(P),{key:5,id:e.id,modelValue:u.value,"onUpdate:modelValue":i[4]||=e=>u.value=e,modelModifiers:{number:!0},type:`number`,min:e.field.min,max:e.field.max},null,8,[`id`,`modelValue`,`min`,`max`])):e.field.type===`select`?(C(),O(Ye,{key:6,id:e.id,modelValue:u.value,"onUpdate:modelValue":i[5]||=e=>u.value=e,options:e.field.choices},null,8,[`id`,`modelValue`,`options`])):e.field.type===`toggle`?(C(),m(`label`,{key:7,for:e.id,class:`flex items-center justify-between gap-3 py-0.5 text-[13px] font-medium`},[r(E(e.field.label)+` `,1),n(c(et),{id:e.id,modelValue:u.value,"onUpdate:modelValue":i[6]||=e=>u.value=e},null,8,[`id`,`modelValue`])],8,Ui)):e.field.type===`icon`?(C(),m(`div`,Wi,[(C(!0),m(w,null,h(xe.value,e=>(C(),m(`button`,{key:e.value,type:`button`,class:f([`grid aspect-square place-items-center rounded-md border transition-colors`,u.value===e.value?`border-brand-400 bg-brand-soft text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent`]),title:e.label,"aria-pressed":u.value===e.value,onClick:t=>u.value=e.value},[(C(),O(te(e.icon),{class:`size-4`}))],10,Gi))),128))])):e.field.type===`image`?(C(),m(`div`,Ki,[u.value?(C(),m(`div`,qi,[p(`img`,{src:c(d).imageUrl(u.value),alt:``,class:`aspect-video w-full object-cover`},null,8,Ji),p(`button`,{type:`button`,class:`absolute top-1.5 right-1.5 grid size-7 place-items-center rounded-md bg-card/90 shadow-sm hover:bg-card`,title:`Bild entfernen`,onClick:i[7]||=e=>u.value=null},[n(c(ve),{class:`size-4`})])])):A(``,!0),p(`button`,{type:`button`,class:`flex h-9 items-center justify-center gap-2 rounded-md border border-dashed text-[13px] font-medium text-muted-foreground hover:border-brand-300 hover:text-foreground`,disabled:_.value,onClick:i[8]||=e=>y.value?.click()},[_.value?(C(),O(c(ce),{key:0,class:`size-4 animate-spin`})):(C(),O(c(ue),{key:1,class:`size-4`})),r(` `+E(u.value?`Anderes Bild wählen`:`Bild hochladen`),1)],8,Yi),p(`input`,{ref_key:`imageInput`,ref:y,type:`file`,accept:`image/jpeg,image/png,image/webp,image/gif`,class:`hidden`,onChange:b},null,544)])):e.field.type===`people`?(C(),m(`div`,Xi,[(u.value??[]).length?(C(),m(`ul`,Zi,[(C(!0),m(w,null,h(u.value,(e,t)=>(C(),m(`li`,{key:e,class:`flex items-center gap-2 rounded-md border bg-card px-2 py-1.5`},[c(T)[e]?(C(),O(Le,{key:0,person:c(T)[e],class:`size-7 text-[10px]`},null,8,[`person`])):A(``,!0),p(`span`,Qi,E(c(T)[e]?.name??`…`),1),p(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Nach oben`,onClick:e=>re(u.value,t,-1)},[n(c(dt),{class:`size-3.5`})],8,$i),p(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Entfernen`,onClick:e=>ie(t)},[n(c(ve),{class:`size-3.5`})],8,ea)]))),128))])):A(``,!0),p(`div`,ta,[n(c(Se),{class:`pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),n(c(P),{id:e.id,modelValue:x.value,"onUpdate:modelValue":i[9]||=e=>x.value=e,class:`pl-8`,placeholder:`Person suchen …`,autocomplete:`off`},null,8,[`id`,`modelValue`]),S.value.length?(C(),m(`ul`,na,[(C(!0),m(w,null,h(S.value,e=>(C(),m(`li`,{key:e.id},[p(`button`,{type:`button`,class:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[13px] hover:bg-accent`,onClick:t=>D(e)},[n(Le,{person:e,class:`size-7 text-[10px]`},null,8,[`person`]),p(`span`,ia,[p(`span`,aa,E(e.name),1),p(`span`,oa,E(e.job_title),1)])],8,ra)]))),128))])):A(``,!0)])])):e.field.type===`table`?(C(),m(`div`,sa,[p(`div`,ca,[p(`table`,la,[p(`tbody`,null,[(C(!0),m(w,null,h(oe.value,(e,t)=>(C(),m(`tr`,{key:t,class:`border-b last:border-0`},[(C(!0),m(w,null,h(e,(e,n)=>(C(),m(`td`,{key:n,class:`border-r p-0 last:border-r-0`},[p(`input`,{value:e,class:`h-8 w-full min-w-20 bg-transparent px-2 focus:bg-brand-soft/50 focus:outline-none`,"aria-label":`Zeile ${t+1}, Spalte ${n+1}`,onInput:e=>se(t,n,e.target.value)},null,40,ua)]))),128)),p(`td`,da,[p(`button`,{type:`button`,class:`grid size-7 place-items-center text-muted-foreground hover:text-destructive`,title:`Zeile entfernen`,onClick:e=>de(t)},[n(c(ve),{class:`size-3.5`})],8,fa)])]))),128)),p(`tr`,null,[(C(!0),m(w,null,h(oe.value[0],(e,t)=>(C(),m(`td`,{key:t,class:`p-0 text-center`},[p(`button`,{type:`button`,class:`mx-auto grid size-7 place-items-center text-muted-foreground hover:text-destructive`,title:`Spalte entfernen`,onClick:e=>pe(t)},[n(c(ve),{class:`size-3.5`})],8,pa)]))),128)),i[12]||=p(`td`,null,null,-1)])])])]),p(`div`,ma,[p(`button`,{type:`button`,class:`inline-flex items-center gap-1 text-[13px] font-medium text-brand-text hover:underline`,onClick:j},[n(c(qe),{class:`size-3.5`}),i[13]||=r(` Zeile`,-1)]),p(`button`,{type:`button`,class:`inline-flex items-center gap-1 text-[13px] font-medium text-brand-text hover:underline`,onClick:le},[n(c(qe),{class:`size-3.5`}),i[14]||=r(` Spalte`,-1)])])])):e.field.type===`repeater`?(C(),m(`div`,ha,[(C(!0),m(w,null,h(u.value??[],(t,r)=>(C(),m(`details`,{key:r,class:`group rounded-md border bg-card`,open:r===(u.value??[]).length-1},[p(`summary`,_a,[p(`span`,va,E(t.label||t.title||t.alt||`${e.field.itemLabel} ${r+1}`),1),p(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Nach oben`,onClick:ne(e=>re(u.value,r,-1),[`prevent`])},[n(c(dt),{class:`size-3.5`})],8,ya),p(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Nach unten`,onClick:ne(e=>re(u.value,r,1),[`prevent`])},[n(c(ut),{class:`size-3.5`})],8,ba),p(`button`,{type:`button`,class:`grid size-6 place-items-center rounded text-destructive hover:bg-destructive/10`,title:`Entfernen`,onClick:ne(e=>ie(r),[`prevent`])},[n(c(Ze),{class:`size-3.5`})],8,xa)]),p(`div`,Sa,[(C(!0),m(w,null,h(e.field.fields,n=>(C(),O(a,{id:`${e.id}-${r}-${n.name}`,key:n.name,modelValue:t[n.name],"onUpdate:modelValue":e=>t[n.name]=e,field:n},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`field`]))),128))])],8,ga))),128)),(u.value??[]).length<e.field.max?(C(),m(`button`,{key:0,type:`button`,class:`flex h-8 items-center justify-center gap-1.5 rounded-md border border-dashed text-[13px] font-medium text-muted-foreground hover:border-brand-300 hover:text-foreground`,onClick:ae},[n(c(qe),{class:`size-3.5`}),r(` `+E(e.field.itemLabel)+` hinzufügen `,1)])):A(``,!0)])):e.field.type===`ids`&&e.field.kind===`page-file`?(C(),m(`div`,Ca,[(u.value??[]).length?(C(),m(`ul`,wa,[(C(!0),m(w,null,h(u.value,(e,t)=>(C(),m(`li`,{key:e,class:`flex items-center gap-2 rounded-md border bg-card px-2 py-1.5 text-[13px]`},[n(c(vt),{class:`size-4 shrink-0 text-muted-foreground`}),p(`span`,Ta,E(ge.value[e]?.name??`Datei nicht mehr vorhanden`),1),ge.value[e]?(C(),m(`span`,Ea,E(be(ge.value[e].size)),1)):A(``,!0),p(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Nach oben`,onClick:e=>re(u.value,t,-1)},[n(c(dt),{class:`size-3.5`})],8,Da),p(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Entfernen`,onClick:e=>ie(t)},[n(c(ve),{class:`size-3.5`})],8,Oa)]))),128))])):A(``,!0),p(`button`,{type:`button`,class:`flex h-9 items-center justify-center gap-2 rounded-md border border-dashed text-[13px] font-medium text-muted-foreground hover:border-brand-300 hover:text-foreground`,disabled:_.value,onClick:i[10]||=e=>he.value?.click()},[_.value?(C(),O(c(ce),{key:0,class:`size-4 animate-spin`})):(C(),O(c(Lt),{key:1,class:`size-4`})),i[15]||=r(` Dateien hochladen `,-1)],8,ka),p(`input`,{ref_key:`fileInput`,ref:he,type:`file`,multiple:``,class:`hidden`,onChange:_e},null,544),ye.value.length?(C(),O(Ye,{key:1,"model-value":null,options:ye.value.map(e=>({value:e.id,label:e.name})),placeholder:`Bereits hochgeladene Datei wählen …`,"onUpdate:modelValue":i[11]||=e=>e&&(u.value=[...u.value??[],e])},null,8,[`options`])):A(``,!0)])):A(``,!0),e.field.help?(C(),m(`p`,Aa,E(e.field.help),1)):A(``,!0)])}}},Ma={key:0,class:`grid gap-5`},Na={class:`flex items-start gap-3`},Pa={class:`grid size-9 shrink-0 place-items-center rounded-md bg-brand-soft text-brand-text`},Fa={class:`min-w-0`},Ia={class:`font-semibold`},La={key:0,class:`text-xs text-muted-foreground`},Ra={key:0,class:`rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground`},za={key:1,class:`grid gap-2`},Ba={class:`text-[13px] font-medium`},Va={key:1,class:`flex-1 text-[13px]`},Ha=[`onClick`],Ua=[`onClick`],Wa=[`disabled`,`onClick`],Ga=[`open`],Ka={class:`flex cursor-pointer items-center gap-2 px-3 py-2 text-[13px] font-medium`},qa={key:0,class:`ml-auto rounded bg-amber-100 px-1.5 py-0.5 text-[11px] text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`},Ja={class:`grid gap-3 border-t px-3 py-3`},Ya={class:`mb-1 text-xs font-semibold text-muted-foreground`},Xa={class:`grid max-h-36 gap-0.5 overflow-y-auto`},Za=[`checked`,`onChange`],Qa={__name:`BlockSettings`,props:{block:{type:Object,required:!0}},setup(e){let t=e,i=o(`pagebuilder:editor`),s=v(()=>i.types[t.block.type]),l=v(()=>(s.value?.fields??[]).filter(e=>e.type!==`html`));a(()=>t.block.data.layout,()=>{t.block.type===`columns`&&Fi(t.block)});function u(){t.block.items.push({id:Oi(),title:`${s.value.container.label} ${t.block.items.length+1}`,blocks:[]})}function d(e,n){let r=t.block.items,i=e+n;i>=0&&i<r.length&&([r[e],r[i]]=[r[i],r[e]])}function f(e){let n=t.block.items[e];(!n.blocks.length||window.confirm(`„${n.title||s.value.container.label}“ enthält Inhalte. Trotzdem entfernen?`))&&t.block.items.splice(e,1)}let g=v(()=>t.block.visibility??{}),_=v(()=>Object.values(g.value).some(e=>e?.length));function y(e,n){let r=new Set(g.value[e]??[]);r.has(n)?r.delete(n):r.add(n),t.block.visibility={...g.value,[e]:[...r]}}let b=v(()=>[{key:`role`,label:`Rollen`,options:i.audienceOptions.role},{key:`department`,label:`Abteilungen`,options:i.audienceOptions.department.map(e=>({value:e,label:e}))},{key:`location`,label:`Standorte`,options:i.audienceOptions.location.map(e=>({value:e,label:e}))}].filter(e=>e.options.length));return(t,i)=>s.value?(C(),m(`div`,Ma,[p(`header`,Na,[p(`span`,Pa,[(C(),O(te(c(Di)(s.value.icon)),{class:`size-4.5`}))]),p(`div`,Fa,[p(`h2`,Ia,E(s.value.label),1),s.value.description?(C(),m(`p`,La,E(s.value.description),1)):A(``,!0)])]),s.value.fields.some(e=>e.type===`html`)?(C(),m(`p`,Ra,` Den Text bearbeiten Sie direkt im Block. Markieren Sie Text für Fettdruck, Links und Listen. `)):A(``,!0),(C(!0),m(w,null,h(l.value,t=>(C(),O(ja,{id:`field-${e.block.id}-${t.name}`,key:`${e.block.id}-${t.name}`,modelValue:e.block.data[t.name],"onUpdate:modelValue":n=>e.block.data[t.name]=n,field:t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`field`]))),128)),s.value.container&&s.value.container.max>1&&s.value.key!==`columns`?(C(),m(`section`,za,[p(`h3`,Ba,E(s.value.container.label)+`s`,1),(C(!0),m(w,null,h(e.block.items,(t,r)=>(C(),m(`div`,{key:t.id,class:`flex items-center gap-1`},[s.value.container.titled?(C(),O(c(P),{key:0,modelValue:t.title,"onUpdate:modelValue":e=>t.title=e,class:`h-8`,"aria-label":`Titel ${r+1}`,maxlength:`120`},null,8,[`modelValue`,`onUpdate:modelValue`,`aria-label`])):(C(),m(`span`,Va,E(s.value.container.label)+` `+E(r+1),1)),p(`button`,{type:`button`,class:`grid size-7 shrink-0 place-items-center rounded hover:bg-accent`,title:`Nach oben`,onClick:e=>d(r,-1)},[n(c(dt),{class:`size-3.5`})],8,Ha),p(`button`,{type:`button`,class:`grid size-7 shrink-0 place-items-center rounded hover:bg-accent`,title:`Nach unten`,onClick:e=>d(r,1)},[n(c(ut),{class:`size-3.5`})],8,Ua),p(`button`,{type:`button`,class:`grid size-7 shrink-0 place-items-center rounded text-destructive hover:bg-destructive/10 disabled:opacity-30`,title:`Entfernen`,disabled:e.block.items.length<=s.value.container.min,onClick:e=>f(r)},[n(c(Ze),{class:`size-3.5`})],8,Wa)]))),128)),e.block.items.length<s.value.container.max?(C(),m(`button`,{key:0,type:`button`,class:`flex h-8 items-center justify-center gap-1.5 rounded-md border border-dashed text-[13px] font-medium text-muted-foreground hover:border-brand-300 hover:text-foreground`,onClick:u},[n(c(qe),{class:`size-3.5`}),r(` `+E(s.value.container.label)+` hinzufügen `,1)])):A(``,!0)])):A(``,!0),b.value.length?(C(),m(`details`,{key:2,class:`rounded-md border`,open:_.value},[p(`summary`,Ka,[n(c(Ve),{class:`size-4 text-muted-foreground`}),i[0]||=r(` Sichtbarkeit `,-1),_.value?(C(),m(`span`,qa,`eingeschränkt`)):A(``,!0)]),p(`div`,Ja,[i[1]||=p(`p`,{class:`text-xs text-muted-foreground`},`Leer = für alle, die die Seite sehen. Sonst nur für Personen, die mindestens eine Angabe erfüllen.`,-1),(C(!0),m(w,null,h(b.value,e=>(C(),m(`fieldset`,{key:e.key,class:`grid gap-1`},[p(`legend`,Ya,E(e.label),1),p(`div`,Xa,[(C(!0),m(w,null,h(e.options,t=>(C(),m(`label`,{key:t.value,class:`flex items-center gap-2 rounded px-1 py-0.5 text-[13px] hover:bg-accent`},[p(`input`,{type:`checkbox`,class:`size-4 accent-[var(--brand)]`,checked:(g.value[e.key]??[]).includes(t.value),onChange:n=>y(e.key,t.value)},null,40,Za),r(` `+E(t.label),1)]))),128))])]))),128))])],8,Ga)):A(``,!0)])):A(``,!0)}},$a=[`data-block-id`],eo={class:`pb-handle flex cursor-grab items-center gap-1 rounded px-1 py-0.5 font-medium text-muted-foreground active:cursor-grabbing`,title:`Ziehen zum Verschieben`},to={key:2,class:`rounded-md border border-dashed p-4 text-sm text-muted-foreground`},no={__name:`EditorBlock`,props:{block:{type:Object,required:!0}},setup(e){let t=e,i=o(`pagebuilder:editor`),a=v(()=>i.types[t.block.type]),s=v(()=>i.selectedId.value===t.block.id),l=v(()=>i.hoveredId.value===t.block.id),u=v(()=>Object.values(t.block.visibility??{}).some(e=>e?.length)),d=v(()=>({...t.block,props:i.previews[t.block.id]??t.block.props}));return(t,o)=>(C(),m(`div`,{class:f([`relative rounded-md outline-offset-4 transition-[outline-color]`,[s.value?`outline-2 outline-brand-500`:l.value?`outline-1 outline-brand-300`:`outline-1 outline-transparent`,a.value?``:`opacity-60`]]),"data-block-id":e.block.id,onClick:o[5]||=ne(t=>c(i).select(e.block.id),[`stop`]),onMouseover:o[6]||=ne(t=>c(i).hoveredId.value=e.block.id,[`stop`]),onMouseleave:o[7]||=t=>c(i).hoveredId.value===e.block.id&&(c(i).hoveredId.value=null)},[(s.value||l.value)&&!c(i).readOnly.value?(C(),m(`div`,{key:0,class:`absolute -top-3.5 right-2 z-20 flex items-center gap-0.5 rounded-md border bg-card px-1 py-0.5 text-xs shadow-sm`,onClick:o[4]||=ne(()=>{},[`stop`])},[p(`span`,eo,[n(c(St),{class:`size-3.5`}),(C(),O(te(c(Di)(a.value?.icon)),{class:`size-3.5`})),r(` `+E(a.value?.label??e.block.type),1)]),u.value?(C(),O(c(Ve),{key:0,class:`mx-1 size-3.5 text-amber-600`,title:`Nur für bestimmte Personen sichtbar`})):A(``,!0),o[8]||=p(`span`,{class:`mx-0.5 h-4 w-px bg-border`},null,-1),p(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Nach oben`,onClick:o[0]||=t=>c(i).move(e.block.id,-1)},[n(c(pt),{class:`size-3.5`})]),p(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Nach unten`,onClick:o[1]||=t=>c(i).move(e.block.id,1)},[n(c(we),{class:`size-3.5`})]),p(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Duplizieren`,onClick:o[2]||=t=>c(i).duplicate(e.block.id)},[n(c(F),{class:`size-3.5`})]),p(`button`,{type:`button`,class:`grid size-6 place-items-center rounded text-destructive hover:bg-destructive/10`,title:`Entfernen`,onClick:o[3]||=t=>c(i).remove(e.block.id)},[n(c(Ze),{class:`size-3.5`})])])):A(``,!0),a.value&&c(ct)(a.value.component)?(C(),O(te(c(ct)(a.value.component)),{key:1,block:d.value},null,8,[`block`])):(C(),m(`div`,to,` Dieser Block (`+E(e.block.type)+`) ist nicht verfügbar – vermutlich ist das zugehörige Plugin deaktiviert. Er wird nicht angezeigt. `,1))],42,$a))}},ro={key:0,class:`pointer-events-none text-center text-xs text-muted-foreground`},io={__name:`EditorBlockList`,props:{item:{type:Object,required:!0},root:{type:Boolean,default:!1}},setup(e){let t=e,i=o(`pagebuilder:editor`),a=v(()=>t.root||i.containsActive(t.item));return(t,o)=>(C(),m(`div`,{class:f([`grid`,e.root?`gap-6`:`gap-4`])},[n(c(wi),{modelValue:e.item.blocks,"onUpdate:modelValue":o[0]||=t=>e.item.blocks=t,group:{name:`pagebuilder`},handle:`.pb-handle`,animation:150,disabled:c(i).readOnly.value,"ghost-class":`pb-ghost`,class:f([`grid min-h-6`,[e.root?`gap-6`:`gap-4`,e.item.blocks.length?``:`rounded-md border border-dashed border-border bg-muted/40 p-3`]]),onAdd:o[1]||=t=>c(i).select(e.item.blocks[t.newIndex]?.id)},{default:T(()=>[(C(!0),m(w,null,h(e.item.blocks,e=>(C(),O(no,{key:e.id,block:e},null,8,[`block`]))),128)),e.item.blocks.length?A(``,!0):(C(),m(`p`,ro,E(e.root?`Noch keine Inhalte. Blöcke aus der rechten Spalte hierher ziehen oder hinzufügen.`:`Blöcke hierher ziehen`),1))]),_:1},8,[`modelValue`,`disabled`,`class`]),!c(i).readOnly.value&&(a.value||!e.item.blocks.length)?(C(),O(c(Te),{key:0},{default:T(()=>[n(c(Ie),{class:`flex h-8 items-center justify-center gap-1.5 rounded-md border border-dashed text-xs font-medium text-muted-foreground transition-colors hover:border-brand-300 hover:bg-brand-soft hover:text-brand-soft-foreground`,onClick:o[2]||=ne(()=>{},[`stop`])},{default:T(()=>[n(c(qe),{class:`size-3.5`}),o[5]||=r(` Block hinzufügen `,-1)]),_:1}),n(c(je),{class:`max-h-[70vh] w-[22rem] overflow-y-auto p-3`,align:`center`,onClick:o[4]||=ne(()=>{},[`stop`])},{default:T(()=>[n(Bi,{compact:``,onPick:o[3]||=t=>c(i).insert(e.item.blocks,e.item.blocks.length,t)})]),_:1})]),_:1})):A(``,!0)],2))}},ao={key:0,class:`rounded-md bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:bg-amber-950/50 dark:text-amber-100`},oo={class:`grid gap-2`},so={class:`flex cursor-pointer items-start gap-3 rounded-md border p-3 has-checked:border-brand-400 has-checked:bg-brand-soft/60`},co={class:`flex cursor-pointer items-start gap-3 rounded-md border p-3 has-checked:border-brand-400 has-checked:bg-brand-soft/60`},lo={class:`grid flex-1 gap-2`},uo={__name:`PublishDialog`,props:e({scheduledAt:{type:String,default:null}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:e([`publish`],[`update:open`]),setup(e,{emit:t}){let o=e,s=i(e,`open`),l=t,u=k(`now`),f=k(``),h=k(!1);function g(e){let t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`}a(s,e=>{if(e){u.value=`now`;let e=new Date(Date.now()+864e5);e.setHours(7,0,0,0),f.value=g(e),h.value=!1}});async function _(){h.value=!0,l(`publish`,u.value===`later`?new Date(f.value).toISOString():null),setTimeout(()=>h.value=!1,800)}return(e,t)=>(C(),O(c(rt),{open:s.value,"onUpdate:open":t[4]||=e=>s.value=e},{default:T(()=>[n(c(at),{class:`sm:max-w-md`},{default:T(()=>[n(c($e),null,{default:T(()=>[n(c(ot),null,{default:T(()=>[...t[5]||=[r(`Seite veröffentlichen`,-1)]]),_:1}),n(c(Qe),null,{default:T(()=>[...t[6]||=[r(`Der aktuelle Stand wird für alle sichtbar, die die Seite sehen dürfen. Frühere Stände bleiben unter „Versionen“ erhalten.`,-1)]]),_:1})]),_:1}),o.scheduledAt?(C(),m(`p`,ao,` Es ist bereits eine Veröffentlichung geplant. Sie wird durch diese ersetzt. `)):A(``,!0),p(`fieldset`,oo,[t[9]||=p(`legend`,{class:`sr-only`},`Zeitpunkt`,-1),p(`label`,so,[d(p(`input`,{"onUpdate:modelValue":t[0]||=e=>u.value=e,type:`radio`,value:`now`,class:`mt-1 accent-[var(--brand)]`},null,512),[[ie,u.value]]),t[7]||=p(`span`,null,[p(`span`,{class:`block text-sm font-medium`},`Jetzt veröffentlichen`),p(`span`,{class:`block text-xs text-muted-foreground`},`Sofort sichtbar.`)],-1)]),p(`label`,co,[d(p(`input`,{"onUpdate:modelValue":t[1]||=e=>u.value=e,type:`radio`,value:`later`,class:`mt-1 accent-[var(--brand)]`},null,512),[[ie,u.value]]),p(`span`,lo,[t[8]||=p(`span`,null,[p(`span`,{class:`block text-sm font-medium`},`Zeitgesteuert`),p(`span`,{class:`block text-xs text-muted-foreground`},`Der aktuelle Stand geht zum gewählten Zeitpunkt online.`)],-1),u.value===`later`?(C(),O(c(P),{key:0,modelValue:f.value,"onUpdate:modelValue":t[2]||=e=>f.value=e,type:`datetime-local`,min:g(new Date),"aria-label":`Zeitpunkt der Veröffentlichung`},null,8,[`modelValue`,`min`])):A(``,!0)])])]),n(c(it),null,{default:T(()=>[n(c(tt),{variant:`outline`,onClick:t[3]||=e=>s.value=!1},{default:T(()=>[...t[10]||=[r(`Abbrechen`,-1)]]),_:1}),n(c(tt),{disabled:h.value||u.value===`later`&&!f.value,onClick:_},{default:T(()=>[u.value===`later`?(C(),O(c(he),{key:0})):(C(),O(c(Je),{key:1})),r(` `+E(u.value===`later`?`Planen`:`Veröffentlichen`),1)]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]))}},fo={class:`flex min-h-0 flex-1`},po={class:`w-64 shrink-0 overflow-y-auto border-r p-2`},mo={key:0,class:`grid place-items-center py-10`},ho={key:1,class:`px-3 py-6 text-center text-sm text-muted-foreground`},go=[`onClick`],_o={class:`block text-sm font-medium`},vo={class:`block truncate text-xs text-muted-foreground`},yo={class:`flex min-w-0 flex-1 flex-col`},bo={class:`min-h-0 flex-1 overflow-y-auto bg-background p-6`},xo={key:0,class:`grid place-items-center py-16`},So={class:`mb-6 text-2xl font-semibold tracking-tight`},Co={key:0,class:`flex items-center justify-between gap-3 border-t px-5 py-3`},wo={class:`text-xs text-muted-foreground`},To={__name:`RevisionsDialog`,props:e({base:{type:String,required:!0},readOnly:{type:Boolean,default:!1}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:e([`restored`],[`update:open`]),setup(e,{emit:t}){let o=e,s=i(e,`open`),l=t,u=k(null),d=k(null),g=k(null),_=k(!1);a(s,async e=>{e&&(u.value=null,g.value=null,d.value=null,u.value=(await M.get(`${o.base}/versionen`)).revisions,u.value.length&&v(u.value[0]))});async function v(e){d.value=e,_.value=!0;try{g.value=await M.get(`${o.base}/versionen/${e.id}`)}finally{_.value=!1}}async function y(){try{l(`restored`,await M.post(`${o.base}/versionen/${d.value.id}/wiederherstellen`))}catch(e){N.error(e.message)}}return(t,i)=>(C(),O(c(rt),{open:s.value,"onUpdate:open":i[0]||=e=>s.value=e},{default:T(()=>[n(c(at),{class:`flex h-[85vh] max-w-5xl flex-col gap-0 p-0 sm:max-w-5xl`},{default:T(()=>[n(c($e),{class:`border-b px-5 py-4`},{default:T(()=>[n(c(ot),null,{default:T(()=>[...i[1]||=[r(`Versionen`,-1)]]),_:1}),n(c(Qe),null,{default:T(()=>[...i[2]||=[r(`Jede Veröffentlichung wird gespeichert. Eine ältere Version lässt sich als Entwurf zurückholen.`,-1)]]),_:1})]),_:1}),p(`div`,fo,[p(`ul`,po,[u.value===null?(C(),m(`li`,mo,[n(c(ce),{class:`size-5 animate-spin text-muted-foreground`})])):u.value.length?A(``,!0):(C(),m(`li`,ho,`Noch keine veröffentlichten Versionen.`)),(C(!0),m(w,null,h(u.value??[],e=>(C(),m(`li`,{key:e.id},[p(`button`,{type:`button`,class:f([`w-full rounded-md px-3 py-2 text-left`,d.value?.id===e.id?`bg-brand-soft text-brand-soft-foreground`:`hover:bg-accent`]),onClick:t=>v(e)},[p(`span`,_o,E(c(be)(e.created_at)),1),p(`span`,vo,[r(E(e.action),1),e.user?(C(),m(w,{key:0},[r(` · `+E(e.user),1)],64)):A(``,!0)])],10,go)]))),128))]),p(`div`,yo,[p(`div`,bo,[_.value?(C(),m(`div`,xo,[n(c(ce),{class:`size-6 animate-spin text-muted-foreground`})])):g.value?(C(),m(w,{key:1},[p(`h1`,So,E(g.value.title),1),n(lt,{content:g.value.content},null,8,[`content`])],64)):A(``,!0)]),d.value?(C(),m(`div`,Co,[p(`span`,wo,E(new Date(d.value.created_at).toLocaleString(`de-DE`,{dateStyle:`medium`,timeStyle:`short`})),1),n(c(tt),{disabled:e.readOnly,onClick:y},{default:T(()=>[n(c(jt)),i[3]||=r(` Als Entwurf wiederherstellen`,-1)]),_:1},8,[`disabled`])])):A(``,!0)])])]),_:1})]),_:1},8,[`open`]))}},Eo={class:`grid gap-1.5`},Do={key:0,class:`text-[13px] text-destructive`},Oo={key:1,class:`text-xs text-muted-foreground`},ko={key:0,class:`flex items-center justify-between gap-3 text-[13px] font-medium`},Ao={__name:`PageSettingsDialog`,props:e({page:{type:Object,required:!0},base:{type:String,required:!0}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:e([`saved`],[`update:open`]),setup(e,{emit:t}){let o=e,s=i(e,`open`),l=t,u=k({slug:``,in_navigation:!1}),d=k({}),f=k(!1);a(s,e=>{e&&(u.value={slug:o.page.slug,in_navigation:o.page.in_navigation},d.value={})});async function h(){f.value=!0;try{l(`saved`,await M.put(`${o.base}/einstellungen`,u.value)),s.value=!1}catch(e){d.value=e.fieldErrors??{}}finally{f.value=!1}}return(t,i)=>(C(),O(c(rt),{open:s.value,"onUpdate:open":i[3]||=e=>s.value=e},{default:T(()=>[n(c(at),{class:`sm:max-w-md`},{default:T(()=>[n(c($e),null,{default:T(()=>[n(c(ot),null,{default:T(()=>[...i[4]||=[r(`Seiteneinstellungen`,-1)]]),_:1}),n(c(Qe),null,{default:T(()=>[...i[5]||=[r(`Sichtbarkeit und Rechte pflegen Sie in der Administration unter „Seiten“.`,-1)]]),_:1})]),_:1}),p(`form`,{class:`grid gap-4`,onSubmit:ne(h,[`prevent`])},[p(`label`,Eo,[i[6]||=p(`span`,{class:`text-[13px] font-medium`},`Kürzel in der Adresse`,-1),n(c(P),{modelValue:u.value.slug,"onUpdate:modelValue":i[0]||=e=>u.value.slug=e,maxlength:`120`,"aria-invalid":!!d.value.slug},null,8,[`modelValue`,`aria-invalid`]),d.value.slug?(C(),m(`span`,Do,E(d.value.slug),1)):(C(),m(`span`,Oo,`Ändert auch die Adressen aller Unterseiten. Alte Links funktionieren dann nicht mehr.`))]),e.page.can.navigation?(C(),m(`label`,ko,[i[7]||=r(` In der Hauptnavigation anzeigen `,-1),n(c(et),{modelValue:u.value.in_navigation,"onUpdate:modelValue":i[1]||=e=>u.value.in_navigation=e},null,8,[`modelValue`])])):A(``,!0),n(c(it),null,{default:T(()=>[n(c(tt),{type:`button`,variant:`outline`,onClick:i[2]||=e=>s.value=!1},{default:T(()=>[...i[8]||=[r(`Abbrechen`,-1)]]),_:1}),n(c(tt),{type:`submit`,disabled:f.value},{default:T(()=>[...i[9]||=[r(`Speichern`,-1)]]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`]))}},jo={class:`grid gap-1.5`},Mo={__name:`ReviewDialog`,props:{open:{type:Boolean,default:!1},openModifiers:{}},emits:e([`submit`],[`update:open`]),setup(e,{emit:t}){let o=i(e,`open`),s=t,l=k(``),u=k(!1);a(o,e=>e&&(l.value=``,u.value=!1));function d(){u.value=!0,s(`submit`,l.value),setTimeout(()=>u.value=!1,1500)}return(e,t)=>(C(),O(c(rt),{open:o.value,"onUpdate:open":t[2]||=e=>o.value=e},{default:T(()=>[n(c(at),{class:`sm:max-w-md`},{default:T(()=>[n(c($e),null,{default:T(()=>[n(c(ot),null,{default:T(()=>[...t[3]||=[r(`Freigabe anfordern`,-1)]]),_:1}),n(c(Qe),null,{default:T(()=>[...t[4]||=[r(`Ihre Änderungen sind als Entwurf gespeichert. Die Personen, die diese Seite veröffentlichen dürfen, werden benachrichtigt.`,-1)]]),_:1})]),_:1}),p(`label`,jo,[t[5]||=p(`span`,{class:`text-[13px] font-medium`},`Nachricht (freiwillig)`,-1),n(c(nt),{modelValue:l.value,"onUpdate:modelValue":t[0]||=e=>l.value=e,rows:`3`,maxlength:`1000`,placeholder:`z. B. Bitte bis Freitag veröffentlichen.`},null,8,[`modelValue`])]),n(c(it),null,{default:T(()=>[n(c(tt),{variant:`outline`,onClick:t[1]||=e=>o.value=!1},{default:T(()=>[...t[6]||=[r(`Abbrechen`,-1)]]),_:1}),n(c(tt),{disabled:u.value,onClick:d},{default:T(()=>[n(c(Je)),t[7]||=r(` Anfordern`,-1)]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]))}},No={class:`flex h-dvh flex-col bg-background`},Po={class:`z-30 flex h-14 shrink-0 items-center gap-2 border-b bg-card px-2 sm:px-3`},Fo={class:`min-w-0 flex-1`},Io={class:`flex items-center gap-2`},Lo={class:`truncate text-sm font-semibold`},Ro={class:`flex items-center gap-1 truncate text-xs text-muted-foreground`,"aria-live":`polite`},zo={class:`hidden items-center gap-0.5 md:flex`},Bo=[`disabled`],Vo=[`disabled`],Ho={class:`flex rounded-md border p-0.5`,role:`group`,"aria-label":`Vorschau`},Uo=[`title`,`aria-pressed`,`onClick`],Wo=[`href`],Go={key:0,class:`flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-amber-200 bg-amber-50 px-4 py-2.5 text-sm text-amber-900 dark:border-amber-900 dark:bg-amber-950/50 dark:text-amber-100`},Ko={class:`flex-1`},qo={class:`flex min-h-0 flex-1`},Jo={key:0,class:`mb-2 flex flex-wrap gap-1 text-xs text-muted-foreground`,"aria-label":`Brotkrumen`},Yo=[`readonly`],Xo={class:`@container`},Zo={class:`hidden w-[340px] shrink-0 flex-col border-l bg-card lg:flex`},Qo={class:`flex shrink-0 border-b px-2`,role:`tablist`},$o=[`aria-selected`,`disabled`,`onClick`],es={key:0,class:`absolute inset-x-2 bottom-0 h-[3px] rounded-t-full bg-brand`},ts={class:`min-h-0 flex-1 overflow-y-auto p-4`},ns={class:`fixed right-4 bottom-4 z-30 flex gap-2 lg:hidden`},rs={__name:`Editor`,props:{page:{type:Object,required:!0},working:{type:Object,required:!0},lockedBy:{type:Object,default:null},blockTypes:{type:Array,required:!0},blockGroups:{type:Object,required:!0},files:{type:Array,default:()=>[]},audienceOptions:{type:Object,required:!0},breadcrumbs:{type:Array,default:()=>[]},uploadsUrl:{type:String,required:!0}},setup(e){let t=e,i=`/redaktion/seiten/${t.page.id}`,o=Object.fromEntries(t.blockTypes.map(e=>[e.key,e])),s=k(t.page),l=y(ki(t.working)),u=k(null),_=k(null),S=y({}),ee=k(t.files),D=k(!!t.lockedBy),ie=k(t.lockedBy),j=k(`desktop`),ue=k(!1),de=k(`blocks`),fe=v(()=>u.value?Ni(l.content.blocks,u.value)?.block??null:null);a(u,e=>{de.value=e?`block`:`blocks`});function me(e){u.value=e??null}function ge(e,t,n){if(D.value)return;let r=ji(n);e.splice(t,0,r),me(r.id)}function ve(e){let t=fe.value?Ni(l.content.blocks,fe.value.id):null;t?ge(t.list,t.index+1,e):ge(l.content.blocks,l.content.blocks.length,e),ue.value=!1,requestAnimationFrame(()=>document.querySelector(`[data-block-id="${u.value}"]`)?.scrollIntoView({behavior:`smooth`,block:`center`}))}function be(e){let t=Ni(l.content.blocks,e);t&&(t.list.splice(t.index,1),u.value===e&&me(null))}function Se(e,t){let n=Ni(l.content.blocks,e),r=n?n.index+t:-1;n&&r>=0&&r<n.list.length&&n.list.splice(r,0,n.list.splice(n.index,1)[0])}function we(e){let t=Ni(l.content.blocks,e);if(!t)return;let n=Mi(t.block);t.list.splice(t.index+1,0,n),Object.assign(S,{[n.id]:S[e]}),me(n.id)}function Te(e){return[fe.value,_.value?Ni(l.content.blocks,_.value)?.block:null].filter(Boolean).some(t=>t.items?.includes(e)||Ni(e.blocks,t.id))}async function je(e){let t=new FormData;return t.append(`image`,e),M.post(`${i}/bilder`,t)}async function Ie(e){let t=new FormData;t.append(`file`,e);let n=await M.post(`${i}/dateien`,t);return ee.value=[n.file,...ee.value],n.file}let Le=y({});b(`pagebuilder:editor`,{types:o,groups:t.blockGroups,selectedId:u,hoveredId:_,previews:S,readOnly:D,files:ee,peopleCache:Le,audienceOptions:t.audienceOptions,select:me,insert:ge,remove:be,move:Se,duplicate:we,containsActive:Te,uploadImage:je,uploadFile:Ie,imageUrl:e=>`${t.uploadsUrl}/${e}`}),b(`pagebuilder:list`,io),b(`pagebuilder:types`,o),b(`pagebuilder:editing`,v(()=>!D.value));let ze={},Be;function Ve(){let e=[];Pi(l.content.blocks,t=>{if(!o[t.type]?.dynamic)return;let n=JSON.stringify(t.data);ze[t.id]!==n&&(ze[t.id]=n,e.push({id:t.id,type:t.type,data:t.data}))}),e.length&&M.post(`${i}/vorschau`,{blocks:e.slice(0,100)}).then(e=>Object.assign(S,e.props)).catch(()=>{})}let Ue=k(`saved`),Ge=k(s.value.draft_updated_at),Ke,qe=JSON.stringify(l);function Ye(){return{title:l.title,content:l.content}}async function Qe(){if(clearTimeout(Ke),D.value)return;let e=JSON.stringify(l);if(e===qe){Ue.value=`saved`;return}Ue.value=`saving`;try{let t=await M.put(`${i}/entwurf`,Ye());qe=e,s.value=t.page,Ge.value=new Date().toISOString(),Ue.value=JSON.stringify(l)===qe?`saved`:`dirty`,Ue.value===`dirty`&&$e()}catch(e){et(e),Ue.value=`error`}}function $e(e=1200){clearTimeout(Ke),Ke=setTimeout(Qe,e)}function et(e){e.status===423?(D.value=!0,ie.value=e.data.lockedBy,N.error(e.message)):e.status===422&&e.data?.errors?.title?N.error(e.data.errors.title[0]):N.error(e.message||`Speichern fehlgeschlagen. Bitte die Verbindung prüfen.`)}let P=k([]),nt=k([]),rt=JSON.stringify(l),it=!1,at;function ot(){let e=JSON.stringify(l);e!==rt&&(P.value=[...P.value.slice(-49),rt],nt.value=[],rt=e)}function ct(e){it=!0;let t=JSON.parse(e);l.title=t.title,l.content=t.content,rt=e,u.value&&!Ni(l.content.blocks,u.value)&&me(null),setTimeout(()=>it=!1)}function lt(){ot(),P.value.length&&(nt.value=[...nt.value,JSON.stringify(l)],ct(P.value.at(-1)),P.value=P.value.slice(0,-1))}function ut(){nt.value.length&&(P.value=[...P.value,JSON.stringify(l)],ct(nt.value.at(-1)),nt.value=nt.value.slice(0,-1))}a(l,()=>{D.value||(Ue.value=`dirty`,$e(),clearTimeout(Be),Be=setTimeout(Ve,500),it||(clearTimeout(at),at=setTimeout(ot,700)))},{deep:!0});function dt(e){let t=e.target.closest?.(`input, textarea, select, [contenteditable="true"]`);(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`?(e.preventDefault(),Qe()):!t&&(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`z`?(e.preventDefault(),e.shiftKey?ut():lt()):!t&&(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`y`?(e.preventDefault(),ut()):e.key===`Escape`&&!t&&me(null)}let ft;async function pt(e=!1){try{await M.post(`${i}/sperre`,{takeover:e}),e&&(D.value=!1,ie.value=null,N.success(`Sie bearbeiten die Seite jetzt.`))}catch(e){e.status===423&&(D.value=!0,ie.value=e.data.lockedBy)}}async function ht(){await pt(!0),ae.reload({only:[`working`,`page`],onSuccess:()=>Object.assign(l,ki(t.working))})}function gt(){D.value||(JSON.stringify(l)!==qe&&fetch(`${i}/entwurf`,{method:`PUT`,keepalive:!0,credentials:`same-origin`,headers:{"Content-Type":`application/json`,Accept:`application/json`,"X-XSRF-TOKEN":decodeURIComponent(document.cookie.match(/XSRF-TOKEN=([^;]*)/)?.[1]??``)},body:JSON.stringify(Ye())}),M.post(`${i}/sperre/freigeben`,{},{keepalive:!0}).catch(()=>{}))}g(()=>{Ve(),window.addEventListener(`keydown`,dt),window.addEventListener(`pagehide`,gt),ft=setInterval(()=>!D.value&&pt(),45e3)}),x(()=>{window.removeEventListener(`keydown`,dt),window.removeEventListener(`pagehide`,gt),clearInterval(ft),clearTimeout(Ke),gt()});let F=y({publish:!1,review:!1,revisions:!1,settings:!1,newPage:!1});async function vt(e){clearTimeout(Ke);try{let t=await M.post(`${i}/veroeffentlichen`,{...Ye(),scheduled_at:e||null});s.value=t.page,qe=JSON.stringify(l),Ue.value=`saved`,F.publish=!1,N.success(e?`Veröffentlichung geplant für ${new Date(e).toLocaleString(`de-DE`,{dateStyle:`medium`,timeStyle:`short`})}`:`Seite veröffentlicht`,{action:e?void 0:{label:`Ansehen`,onClick:()=>ae.visit(s.value.url)}})}catch(e){et(e)}}async function bt(e){await Qe();try{let t=await M.post(`${i}/freigabe`,{message:e});F.review=!1,N.success(`Freigabe angefordert – ${t.recipients} ${t.recipients===1?`Person wurde`:`Personen wurden`} benachrichtigt.`)}catch(e){N.error(e.message)}}async function xt(e,t,n,r){if(!n||window.confirm(n))try{let n=await M[e](t);if(n.page&&(s.value=n.page),n.working&&(ct(JSON.stringify(n.working)),qe=JSON.stringify(l)),n.redirect){ae.visit(n.redirect);return}N.success(r)}catch(e){N.error(e.message)}}function St(e){s.value=e.page,ct(JSON.stringify(e.working)),qe=JSON.stringify(l),Object.keys(ze).forEach(e=>delete ze[e]),Ve(),F.revisions=!1,N.success(`Version als Entwurf wiederhergestellt`)}let Ct=v(()=>s.value.scheduled_at?{label:`Geplant: ${new Date(s.value.scheduled_at).toLocaleString(`de-DE`,{dateStyle:`short`,timeStyle:`short`})}`,class:`bg-amber-100 text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`}:s.value.is_published?s.value.has_draft?{label:`Entwurf mit Änderungen`,class:`bg-brand-soft text-brand-soft-foreground`}:{label:`Veröffentlicht`,class:`bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200`}:{label:`Nicht veröffentlicht`,class:`bg-muted text-muted-foreground`}),wt=[{key:`desktop`,label:`Desktop`,icon:_e,width:`max-w-[1100px]`},{key:`tablet`,label:`Tablet`,icon:Ft,width:`max-w-[768px]`},{key:`mobile`,label:`Smartphone`,icon:Xe,width:`max-w-[390px]`}],Tt=v(()=>wt.find(e=>e.key===j.value).width);return(t,a)=>(C(),m(w,null,[n(c(se),{title:`Bearbeiten: ${l.title}`},null,8,[`title`]),p(`div`,No,[p(`header`,Po,[n(c(oe),{href:s.value.is_published?s.value.url:`/redaktion`,class:`grid size-9 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`,title:`Zurück`},{default:T(()=>[n(c(le),{class:`size-5`})]),_:1},8,[`href`]),p(`div`,Fo,[p(`div`,Io,[p(`span`,Lo,E(l.title||`Ohne Titel`),1),p(`span`,{class:f([`hidden shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium sm:inline`,Ct.value.class])},E(Ct.value.label),3)]),p(`p`,Ro,[D.value?(C(),m(w,{key:0},[n(c(We),{class:`size-3`}),a[21]||=r(` Nur lesen`,-1)],64)):Ue.value===`saving`?(C(),m(w,{key:1},[n(c(ce),{class:`size-3 animate-spin`}),a[22]||=r(` Speichert …`,-1)],64)):Ue.value===`error`?(C(),m(w,{key:2},[n(c(mt),{class:`size-3 text-destructive`}),a[23]||=r(` Nicht gespeichert`,-1)],64)):Ue.value===`dirty`?(C(),m(w,{key:3},[r(`Ungespeicherte Änderungen`)],64)):Ge.value?(C(),m(w,{key:4},[n(c(Ce),{class:`size-3`}),r(` Entwurf gespeichert `+E(c(xe)(Ge.value)),1)],64)):(C(),m(w,{key:5},[r(E(s.value.url),1)],64))])]),p(`div`,zo,[p(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent disabled:opacity-40`,title:`Rückgängig (Strg+Z)`,disabled:!P.value.length||D.value,onClick:lt},[n(c(ye),{class:`size-4`})],8,Bo),p(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent disabled:opacity-40`,title:`Wiederholen (Strg+Y)`,disabled:!nt.value.length||D.value,onClick:ut},[n(c(pe),{class:`size-4`})],8,Vo),a[24]||=p(`span`,{class:`mx-1 h-6 w-px bg-border`},null,-1),p(`div`,Ho,[(C(),m(w,null,h(wt,e=>p(`button`,{key:e.key,type:`button`,class:f([`grid size-8 place-items-center rounded`,j.value===e.key?`bg-brand-soft text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent`]),title:e.label,"aria-pressed":j.value===e.key,onClick:t=>j.value=e.key},[(C(),O(te(e.icon),{class:`size-4`}))],10,Uo)),64))])]),n(c(Oe),null,{default:T(()=>[n(c(Ee),{class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent`,"aria-label":`Weitere Aktionen`},{default:T(()=>[n(c(_t),{class:`size-5`})]),_:1}),n(c(De),{align:`end`,class:`w-64`},{default:T(()=>[s.value.is_published?(C(),O(c(Re),{key:0,"as-child":``},{default:T(()=>[p(`a`,{href:s.value.url,target:`_blank`},[n(c(He)),a[25]||=r(` Veröffentlichte Seite ansehen`,-1)],8,Wo)]),_:1})):A(``,!0),n(c(Re),{onSelect:a[0]||=e=>F.revisions=!0},{default:T(()=>[n(c(jt)),a[26]||=r(` Versionen`,-1)]),_:1}),s.value.can.configure?(C(),O(c(Re),{key:1,onSelect:a[1]||=e=>F.settings=!0},{default:T(()=>[n(c(Mt)),a[27]||=r(` Seiteneinstellungen`,-1)]),_:1})):A(``,!0),s.value.can.create_child?(C(),O(c(Re),{key:2,onSelect:a[2]||=e=>F.newPage=!0},{default:T(()=>[n(c(yt)),a[28]||=r(` Unterseite anlegen`,-1)]),_:1})):A(``,!0),n(c(Me)),s.value.has_draft&&s.value.is_published&&!D.value?(C(),O(c(Re),{key:3,onSelect:a[3]||=e=>xt(`delete`,`${i}/entwurf`,`Alle Änderungen seit der letzten Veröffentlichung verwerfen?`,`Entwurf verworfen`)},{default:T(()=>[n(c(ye)),a[29]||=r(` Entwurf verwerfen `,-1)]),_:1})):A(``,!0),s.value.scheduled_at&&s.value.can.publish?(C(),O(c(Re),{key:4,onSelect:a[4]||=e=>xt(`delete`,`${i}/planung`,null,`Planung aufgehoben – der Stand ist wieder ein Entwurf`)},{default:T(()=>[n(c(he)),a[30]||=r(` Geplante Veröffentlichung aufheben `,-1)]),_:1})):A(``,!0),s.value.is_published&&s.value.can.publish?(C(),O(c(Re),{key:5,onSelect:a[5]||=e=>xt(`post`,`${i}/zurueckziehen`,`Seite offline nehmen? Der Inhalt bleibt als Entwurf erhalten.`,`Seite ist offline`)},{default:T(()=>[n(c(We)),a[31]||=r(` Veröffentlichung zurückziehen `,-1)]),_:1})):A(``,!0),s.value.can.delete?(C(),O(c(Re),{key:6,class:`text-destructive`,onSelect:a[6]||=e=>xt(`delete`,i,`Seite endgültig löschen? Versionen und Dateien werden entfernt.`,`Seite gelöscht`)},{default:T(()=>[n(c(Ze)),a[32]||=r(` Seite löschen `,-1)]),_:1})):A(``,!0)]),_:1})]),_:1}),s.value.can.publish?(C(),O(c(tt),{key:0,disabled:D.value,onClick:a[7]||=e=>F.publish=!0},{default:T(()=>[n(c(Je)),a[33]||=r(),a[34]||=p(`span`,{class:`hidden sm:inline`},`Veröffentlichen`,-1)]),_:1},8,[`disabled`])):(C(),O(c(tt),{key:1,disabled:D.value,onClick:a[8]||=e=>F.review=!0},{default:T(()=>[n(c(Je)),a[35]||=r(),a[36]||=p(`span`,{class:`hidden sm:inline`},`Freigabe anfordern`,-1)]),_:1},8,[`disabled`]))]),D.value?(C(),m(`div`,Go,[n(c(We),{class:`size-4 shrink-0`}),p(`span`,Ko,E(ie.value?.name??`Jemand anderes`)+` bearbeitet diese Seite gerade. Sie sehen den zuletzt gespeicherten Stand.`,1),n(c(tt),{size:`sm`,variant:`outline`,class:`bg-card`,onClick:ht},{default:T(()=>[...a[37]||=[r(`Bearbeitung übernehmen`,-1)]]),_:1})])):A(``,!0),p(`div`,qo,[p(`main`,{class:`min-w-0 flex-1 overflow-y-auto`,onClick:a[11]||=e=>me(null)},[p(`div`,{class:f([`mx-auto px-4 py-8 transition-[max-width] duration-300 sm:px-8`,Tt.value])},[e.breadcrumbs.length?(C(),m(`nav`,Jo,[(C(!0),m(w,null,h(e.breadcrumbs,e=>(C(),m(`span`,{key:e.url},E(e.title)+` /`,1))),128))])):A(``,!0),d(p(`input`,{"onUpdate:modelValue":a[9]||=e=>l.title=e,class:`mb-6 w-full bg-transparent text-3xl font-semibold tracking-tight outline-none placeholder:text-muted-foreground/60`,placeholder:`Titel der Seite`,maxlength:`200`,"aria-label":`Titel der Seite`,readonly:D.value,onClick:a[10]||=ne(()=>{},[`stop`])},null,8,Yo),[[re,l.title]]),p(`div`,Xo,[n(io,{item:l.content,root:``},null,8,[`item`])])],2)]),p(`aside`,Zo,[p(`div`,Qo,[(C(),m(w,null,h([{key:`blocks`,label:`Blöcke`},{key:`block`,label:`Ausgewählter Block`}],e=>p(`button`,{key:e.key,type:`button`,role:`tab`,class:f([`relative px-3 py-3 text-sm font-medium disabled:opacity-40`,de.value===e.key?`text-foreground`:`text-muted-foreground hover:text-foreground`]),"aria-selected":de.value===e.key,disabled:e.key===`block`&&!fe.value,onClick:t=>de.value=e.key},[r(E(e.label)+` `,1),de.value===e.key?(C(),m(`span`,es)):A(``,!0)],10,$o)),64))]),p(`div`,ts,[de.value===`block`&&fe.value?(C(),O(Qa,{key:fe.value.id,block:fe.value},null,8,[`block`])):(C(),m(w,{key:1},[a[38]||=p(`p`,{class:`mb-4 text-xs text-muted-foreground`},`Klicken fügt den Block unter dem ausgewählten ein. Blöcke lassen sich auch an jede Stelle ziehen.`,-1),n(Bi,{onPick:ve})],64))])])]),p(`div`,ns,[n(c(tt),{variant:`outline`,class:`bg-card shadow-md`,disabled:D.value,onClick:a[12]||=e=>{de.value=`blocks`,ue.value=!0}},{default:T(()=>[...a[39]||=[r(`Block hinzufügen`,-1)]]),_:1},8,[`disabled`]),fe.value?(C(),O(c(tt),{key:0,class:`shadow-md`,onClick:a[13]||=e=>{de.value=`block`,ue.value=!0}},{default:T(()=>[...a[40]||=[r(`Einstellungen`,-1)]]),_:1})):A(``,!0)]),n(c(ke),{open:ue.value,"onUpdate:open":a[14]||=e=>ue.value=e},{default:T(()=>[n(c(Ae),{side:`right`,class:`w-[340px] overflow-y-auto p-4 sm:max-w-[340px]`},{default:T(()=>[n(c(Ne),{class:`p-0`},{default:T(()=>[n(c(Fe),null,{default:T(()=>[r(E(de.value===`block`?`Block`:`Blöcke`),1)]),_:1})]),_:1}),de.value===`block`&&fe.value?(C(),O(Qa,{key:fe.value.id,block:fe.value},null,8,[`block`])):(C(),O(Bi,{key:1,onPick:ve}))]),_:1})]),_:1},8,[`open`]),n(uo,{open:F.publish,"onUpdate:open":a[15]||=e=>F.publish=e,"scheduled-at":s.value.scheduled_at,onPublish:vt},null,8,[`open`,`scheduled-at`]),n(Mo,{open:F.review,"onUpdate:open":a[16]||=e=>F.review=e,onSubmit:bt},null,8,[`open`]),n(To,{open:F.revisions,"onUpdate:open":a[17]||=e=>F.revisions=e,base:i,"read-only":D.value,onRestored:St},null,8,[`open`,`read-only`]),n(Ao,{open:F.settings,"onUpdate:open":a[18]||=e=>F.settings=e,page:s.value,base:i,onSaved:a[19]||=e=>s.value=e.page},null,8,[`open`,`page`]),n(st,{open:F.newPage,"onUpdate:open":a[20]||=e=>F.newPage=e,"parent-id":s.value.id,"parent-title":s.value.title,onBeforeCreate:Qe},null,8,[`open`,`parent-id`,`parent-title`])]),n(c(Pe),{position:`bottom-left`})],64))}};export{rs as default};