Compare commits

..
1 Commits
Author SHA1 Message Date
deploy-bot c63e98e91e v0.9.11 2026-12-05 17:25:54 +00:00
7 changed files with 30 additions and 11 deletions

No files matched your search

+6
View File
@@ -4,6 +4,12 @@ Every release has a section here, named after its version (for example `v0.1.0 -
heading). The release pull request to `production` is stopped by PR CI when its section is missing, and the text of
the section is the text of the release in Gitea.
## v0.9.11 - 2026-12-05
- **The help page, the system page and the picture editor are in Dutch.** Their texts were in the Dutch file of the server (`nl.json`) but not in the list the screens read (`ui/src/i18n.ts`), so in the browser they stayed English (98 texts). Now they are in both, the dates of the help page follow the language of the manager, and a test fails when a screen uses a text that has no Dutch one.
- **Iriks-IT is last in the menu of the simple face too, in any language.** The order of the headings was worked out in the browser from the English names, which failed in the simple face once it was translated (its headings came after Iriks-IT). The server now gives every item the rank of its heading (`rank`), and the menu follows it. Four headings of the simple face were also missing in the Dutch list of the screens.
- **Everyone who may use the help sees every request of the site.** The list and a request are no longer only for the one who sent it: whoever has `support.use` sees all the tickets of the site, with who sent them, and may answer. The API already keeps the tickets of one site apart from those of another.
## v0.9.10 - 2026-12-05
- **Editing an account changes everything the profile can.** The account form (full manager) now also has the look and the language of the account, next to the name and the password, so an administrator can set up an account completely. Empty means: what the site gives.
+1 -1
View File
@@ -69,7 +69,7 @@ The texts the server makes (menu, permission and section labels, theme names, au
## Help from Iriks-IT
The module `support` (on by default, `MANAGER_SUPPORT=false` turns it off) adds the page Help under the heading Iriks-IT: a form to ask a question, report a problem or share an idea, and the list of the requests of the account with Iriks-IT's answers. A request is a ticket at the IriksIT API, sent with the account of `manager.media.iriksit` (it needs the rights `tickets.write` and `tickets.read`); the answer is a number such as `IT-2026-00042`. While the manager is open the site looks every five minutes (`manager.support.poll_minutes`) whether there is news, with one question for the whole site and none at all when no ticket is open, and shows the number of answers waiting on the menu. `manager.support.site` is the name the ticket carries (default: the name of the manager or the app). Without an API account the menu item is not there. The right `support.use` decides who may ask.
The module `support` (on by default, `MANAGER_SUPPORT=false` turns it off) adds the page Help under the heading Iriks-IT: a form to ask a question, report a problem or share an idea, and the list of the requests of the whole site with Iriks-IT's answers: everyone with the right `support.use` sees every request (with the name of who sent it) and may answer it; an answer counts as read for all once someone opens it. A request is a ticket at the IriksIT API, sent with the account of `manager.media.iriksit` (it needs the rights `tickets.write` and `tickets.read`); the answer is a number such as `IT-2026-00042`. While the manager is open the site looks every five minutes (`manager.support.poll_minutes`) whether there is news, with one question for the whole site and none at all when no ticket is open, and shows the number of answers waiting on the menu. `manager.support.site` is the name the ticket carries (default: the name of the manager or the app). Without an API account the menu item is not there. The right `support.use` decides who may ask.
## System page
+3 -3
View File
@@ -1,7 +1,7 @@
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,n)=>{let r=Object.setPrototypeOf({},null);for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n&1||t(r,Symbol.toStringTag,{value:`Module`}),n&2?r:Object.preventExtensions(r)},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(let c of r(i))!a.call(e,c)&&c!==o&&(s=n(i,c),t(e,c,{get:s&&s.get&&!s.configurable?s.get:()=>i[c],enumerable:!s||s.enumerable}));return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));function u(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var d={},f=[],p=()=>{},m=()=>!1,h=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),g=e=>e.startsWith(`onUpdate:`),_=Object.assign,v=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},y=Object.prototype.hasOwnProperty,b=(e,t)=>y.call(e,t),x=Array.isArray,S=e=>ie(e)===`[object Map]`,C=e=>ie(e)===`[object Set]`,w=e=>ie(e)===`[object Date]`,ee=e=>ie(e)===`[object RegExp]`,T=e=>typeof e==`function`,E=e=>typeof e==`string`,te=e=>typeof e==`symbol`,D=e=>typeof e==`object`&&!!e,ne=e=>(D(e)||T(e))&&T(e.then)&&T(e.catch),re=Object.prototype.toString,ie=e=>re.call(e),ae=e=>ie(e).slice(8,-1),oe=e=>ie(e)===`[object Object]`,se=e=>E(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,ce=u(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),le=1e4,ue=e=>{let t=Object.create(null),n=0;return(r=>{let i=t[r];return i===void 0?(++n>le&&(t=Object.create(null),n=1),t[r]=e(r)):i})},de=/-\w/g,O=ue(e=>e.replace(de,e=>e.slice(1).toUpperCase())),fe=/\B([A-Z])/g,pe=ue(e=>e.replace(fe,`-$1`).toLowerCase()),me=ue(e=>e.charAt(0).toUpperCase()+e.slice(1)),he=ue(e=>e?`on${me(e)}`:``),ge=(e,t)=>!Object.is(e,t),_e=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ve=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ye=e=>{let t=parseFloat(e);return isNaN(t)?e:t},be=e=>{let t=E(e)?Number(e):NaN;return isNaN(t)?e:t},xe,Se=()=>xe||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},Ce=u(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function we(e){if(x(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=E(r)?Oe(r):we(r);if(i)for(let e in i)t[e]=i[e]}return t}if(E(e)||D(e))return e}var Te=/;(?![^(]*\))/g,Ee=/:([^]+)/,De=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function Oe(e){let t={};return e.replace(De,e=>e.startsWith(`/*`)?``:e).split(Te).forEach(e=>{if(e){let n=e.split(Ee);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function k(e){let t=``;if(E(e))t=e;else if(x(e))for(let n=0;n<e.length;n++){let r=k(e[n]);r&&(t+=r+` `)}else if(D(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function ke(e){if(!e)return null;let{class:t,style:n}=e;return t&&!E(t)&&(e.class=k(t)),n&&(e.style=we(n)),e}var Ae=`itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`,je=u(Ae);Ae+``;function Me(e){return!!e||e===``}function Ne(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Le(e[i],t[i],n);return r}function Pe(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Le(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function Fe(e,t,n){let r=S(e),i=S(t);if(r||i||(r=C(e),i=C(t),r||i))return r&&i?Pe(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=b(e,r),a=b(t,r);if(i&&!a||!i&&a||!Le(e[r],t[r],n))return!1}return ze(e)===ze(t)}function Ie(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Le(e,t,n){if(e===t)return!0;let r=w(e),i=w(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=te(e),i=te(t),r||i?e===t:(r=x(e),i=x(t),r||i?r&&i?Ie(e,t,n,Ne):!1:(r=D(e),i=D(t),r||i?!r||!i?!1:Ie(e,t,n,Fe):String(e)===String(t))))}function Re(e,t){return e.findIndex(e=>Le(e,t))}function ze(e){return Object.getPrototypeOf(e)===null&&e[Symbol.toPrimitive]==null&&typeof e.toString!=`function`&&typeof e.valueOf!=`function`?ie(e):String(e)}var Be=e=>!!(e&&e.__v_isRef===!0),A=e=>E(e)?e:e==null?``:x(e)||D(e)&&(e.toString===re||!T(e.toString))?Be(e)?A(e.value):JSON.stringify(e,Ve,2):String(e),Ve=(e,t)=>Be(t)?Ve(e,t.value):S(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[He(t,r)+` = Line truncated
`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
`)&&(zi(e,0)||ki(),e.textContent=t.children)}if(u){if(_||b||!o||d&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in u)if(_&&(a.endsWith(`value`)||a===`indeterminate`)||h(a)&&!ce(a)||a[0]===`.`||t&&!ce(a)||l&&l.includes(a)){if(Ii(e,a,u[a]))continue;r(e,a,null,u[a],i,n)}}else if(u.onClick)r(e,`onClick`,null,u.onClick,void 0,n);else if(d&4&&_n(u.style))for(let e in u.style)u.style[e]}let x;(x=u&&u.onVnodeBeforeMount)&&Ys(x,n,t),m&&Nr(t,null,n,`beforeMount`),((x=u&&u.onVnodeMounted)||m||c)&&ws(()=>{x&&Ys(x,n,t),c&&g.enter(e),m&&Nr(t,null,n,`mounted`)},i)}return e.nextSibling},p=(e,t,r,o,s,l,u,f)=>{u||=!!t.dynamicChildren;let p=t.children,m=p.length,h=t.type===R,g=!1;for(let t=0;t<m;t++){let _=u?p[t]:p[t]=Gs(p[t]),v=_.type===Ds;h&&e&&Ni(e)&&e.data===`]`&&(f=e),e&&e!==f?(v&&!u&&t+1<m&&Gs(p[t+1]).type===Ds&&(c(i(e.data.slice(_.children.length)),r,a(e)),e.data=_.children),e=d(e,_,o,s,l,u)):v&&!_.children?c(_.el=i(``),r,f):(g||(g=!0,zi(r,1)||ki()),n(null,_,r,f,o,s,Mi(r),l))}return e},m=(e,t,n,r,i,s)=>{let{slotScopeIds:u}=t;u&&(i=i?i.concat(u):u);let d=o(e),f=p(a(e),t,d,n,r,i,s);return f&&Ni(f)&&f.data===`]`?a(t.anchor=f):(ki(),c(t.anchor=l(`]`),d,f),f)},g=(e,t,r,i,c,l)=>{if(Vi(e,t)||ki(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)s(n);else break}}let u=a(e),d=o(e);return s(e),n(null,t,d,u,r,i,Mi(d),c),r&&r.vnode.el===e&&(r.vnode.el=t.el,No(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&Ni(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[u,d]}var Fi=new Set([`src`,`srcset`,`href`,`poster`]);function Ii(e,t,n){return Fi.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var Li=`data-allow-mismatch`,Ri={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function zi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Li);)e=e.parentElement;return Bi(e&&e.getAttribute(Li),t)}function Bi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(Ri[t])}}function Vi(e,t){return zi(e.parentElement,1)||Hi(e)||Ui(t)}function Hi(e){return e.nodeType===1&&Bi(e.getAttribute(Li),1)}function Ui({props:e}){let t=e&&e[Li];return typeof t==`string`&&Bi(t,1)}var Wi=Se().requestIdleCallback||(e=>setTimeout(e,1)),Gi=Se().cancelIdleCallback||(e=>clearTimeout(e)),Ki=(e=1e4)=>t=>{let n=Wi(t,{timeout:e});return()=>Gi(n)};function qi(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var Ji=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e),i=e=>{if(qi(e))return t(),r.disconnect(),!1;if(getComputedStyle(e).display===`contents`){for(let t=0;t<e.children.length;t++)if(i(e.children[t])===!1)return!1}r.observe(e)};return n(e=>{if(e instanceof Element)return i(e)}),()=>r.disconnect()},Yi=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Xi=(e=[])=>(t,n)=>{E(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Zi(e,t){if(Ni(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(Ni(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Qi=e=>!!e.type.__asyncLoader;function $i(e){T(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return I({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Zi(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=ec;if(Si(e),u)return()=>ea(u,e);let t=t=>{l=null,ir(t,e,13,!r,!0)};if(s&&e.suspense||sc)return p().then(t=>()=>ea(t,e)).catch(e=>(t(e),()=>r?U(r,{error:e}):null));let a=M(!1),c=M(),d=M(!!i),f,m;return Je(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted| Line truncated
`))),e[vu]=hu(i);let a=r||i.props&&i.props.type===`number`;jl(e,t?`change`:`input`,t=>{t.target.composing||e[vu](bu(e.value,n,a))}),(n||a)&&jl(e,`change`,()=>{e.value=bu(e.value,n,a)}),t||(jl(e,`compositionstart`,gu),jl(e,`compositionend`,_u),jl(e,`change`,_u))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[yu];delete e[yu],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[vu](bu(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[vu]=hu(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ye(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},xu={deep:!0,created(e,t,n){e[vu]=hu(n),jl(e,`change`,()=>{let t=e._modelValue,n=Du(e),r=e.checked,i=e[vu];if(x(t)){let e=Re(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(C(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(Ou(e,r))})},mounted:Su,beforeUpdate(e,t,n){e[vu]=hu(n),Su(e,t,n)}};function Su(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(x(t))i=Re(t,r.props.value)>-1;else if(C(t))i=t.has(r.props.value);else{if(t===n)return;i=Le(t,Ou(e,!0))}e.checked!==i&&(e.checked=i)}var Cu={created(e,{value:t},n){e.checked=Le(t,n.props.value),e[vu]=hu(n),jl(e,`change`,()=>{e[vu](Du(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[vu]=hu(r),t!==n&&(e.checked=Le(t,r.props.value))}},wu={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,jl(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ye(Du(e)):Du(e)),r=e.multiple,i=r?C(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?x(i)?t.slice():t:i];try{e[vu](i)}finally{pr(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[vu]=hu(r)},mounted(e,{value:t,modifiers:{number:n}}){Eu(e,t,n)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[vu]=hu(n)},updated(e,{value:t,modifiers:{number:n}}){let r=e._pendingValue;e._pendingValue=void 0,r&&r[0]===e.multiple&&Tu(t,r[1],r[0])||Eu(e,t,n)}};function Tu(e,t,n){if(!n||x(e))return Le(e,t);if(C(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function Eu(e,t,n=!1){let r=e.multiple,i=x(t);if(!r||i||C(t)){for(let a=0,o=e.options.length;a<o;a++){let o=e.options[a],s=Du(o);if(r){if(i){let e=typeof s;o.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(s)):Re(t,s)>-1}else o.selected=t.has(s)||n&&typeof s==`string`&&t.has(ye(s))}else if(Le(Du(o),t)){e.selectedIndex!==a&&(e.selectedIndex=a);return}}!r&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Du(e){return`_value`in e?e._value:e.value}function Ou(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var ku={created(e,t,n){ju(e,t,n,null,`created`)},mounted(e,t,n){ju(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){ju(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){ju(e,t,n,r,`updated`)}};function Au(e,t){switch(e){case`SELECT`:return wu;case`TEXTAREA`:return q;default:switch(t){case`checkbox`:return xu;case`radio`:return Cu;default:return q}}}function ju(e,t,n,r,i){let a=Au(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function Mu(){q.getSSRProps=({value:e})=>({value:e}),Cu.getSSRProps=({value:e},t)=>{if(t.props&&Le(t.props.value,e))return{checked:!0}},xu.getSSRProps=({value:e},t)=>{if(x(e)){if(t.props&&Re(e,t.props.value)>-1)return{checked:!0}}else if(C(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},ku.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=Au(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var Nu=[`ctrl`,`shift`,`alt`,`meta`],Pu={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>Nu.some(n=>e[`${n}Key`]&&!t.includes(n))},J=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=Pu[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Fu={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Iu=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`),i=n[r];if(i)return i;let a=t.some(e=>e===`left`||e===`right`);return n[r]=(n=>{if(!(`key`in n))return a?e(n):void 0;let r=pe(n.key);if(t.some(e=>e===r||Fu[e]===r))return e(n)})},Lu=_({patchProp:Ul},zc),Ru,zu=!1;function Bu(){return Ru||=$o(Lu)}function Vu(){return Ru=zu?Ru:es(Lu),zu=!0,Ru}var Hu=((...e)=>{Bu().render(...e)}),Uu=((...e)=>{Vu().hydrate(...e)}),Wu=((...e)=>{let t=Bu().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=qu(e);if(!r)return;let i=t._component;T(i)||i.render||i.template||(i.template=r.innerHTML),r.nodeType===1 Line truncated
`))),e[vu]=hu(i);let a=r||i.props&&i.props.type===`number`;jl(e,t?`change`:`input`,t=>{t.target.composing||e[vu](bu(e.value,n,a))}),(n||a)&&jl(e,`change`,()=>{e.value=bu(e.value,n,a)}),t||(jl(e,`compositionstart`,gu),jl(e,`compositionend`,_u),jl(e,`change`,_u))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[yu];delete e[yu],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[vu](bu(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[vu]=hu(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ye(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},xu={deep:!0,created(e,t,n){e[vu]=hu(n),jl(e,`change`,()=>{let t=e._modelValue,n=Du(e),r=e.checked,i=e[vu];if(x(t)){let e=Re(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(C(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(Ou(e,r))})},mounted:Su,beforeUpdate(e,t,n){e[vu]=hu(n),Su(e,t,n)}};function Su(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(x(t))i=Re(t,r.props.value)>-1;else if(C(t))i=t.has(r.props.value);else{if(t===n)return;i=Le(t,Ou(e,!0))}e.checked!==i&&(e.checked=i)}var Cu={created(e,{value:t},n){e.checked=Le(t,n.props.value),e[vu]=hu(n),jl(e,`change`,()=>{e[vu](Du(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[vu]=hu(r),t!==n&&(e.checked=Le(t,r.props.value))}},wu={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,jl(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ye(Du(e)):Du(e)),r=e.multiple,i=r?C(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?x(i)?t.slice():t:i];try{e[vu](i)}finally{pr(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[vu]=hu(r)},mounted(e,{value:t,modifiers:{number:n}}){Eu(e,t,n)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[vu]=hu(n)},updated(e,{value:t,modifiers:{number:n}}){let r=e._pendingValue;e._pendingValue=void 0,r&&r[0]===e.multiple&&Tu(t,r[1],r[0])||Eu(e,t,n)}};function Tu(e,t,n){if(!n||x(e))return Le(e,t);if(C(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function Eu(e,t,n=!1){let r=e.multiple,i=x(t);if(!r||i||C(t)){for(let a=0,o=e.options.length;a<o;a++){let o=e.options[a],s=Du(o);if(r){if(i){let e=typeof s;o.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(s)):Re(t,s)>-1}else o.selected=t.has(s)||n&&typeof s==`string`&&t.has(ye(s))}else if(Le(Du(o),t)){e.selectedIndex!==a&&(e.selectedIndex=a);return}}!r&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Du(e){return`_value`in e?e._value:e.value}function Ou(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var ku={created(e,t,n){ju(e,t,n,null,`created`)},mounted(e,t,n){ju(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){ju(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){ju(e,t,n,r,`updated`)}};function Au(e,t){switch(e){case`SELECT`:return wu;case`TEXTAREA`:return q;default:switch(t){case`checkbox`:return xu;case`radio`:return Cu;default:return q}}}function ju(e,t,n,r,i){let a=Au(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function Mu(){q.getSSRProps=({value:e})=>({value:e}),Cu.getSSRProps=({value:e},t)=>{if(t.props&&Le(t.props.value,e))return{checked:!0}},xu.getSSRProps=({value:e},t)=>{if(x(e)){if(t.props&&Re(e,t.props.value)>-1)return{checked:!0}}else if(C(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},ku.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=Au(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var Nu=[`ctrl`,`shift`,`alt`,`meta`],Pu={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>Nu.some(n=>e[`${n}Key`]&&!t.includes(n))},J=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=Pu[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Fu={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Iu=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`),i=n[r];if(i)return i;let a=t.some(e=>e===`left`||e===`right`);return n[r]=(n=>{if(!(`key`in n))return a?e(n):void 0;let r=pe(n.key);if(t.some(e=>e===r||Fu[e]===r))return e(n)})},Lu=_({patchProp:Ul},zc),Ru,zu=!1;function Bu(){return Ru||=$o(Lu)}function Vu(){return Ru=zu?Ru:es(Lu),zu=!0,Ru}var Hu=((...e)=>{Bu().render(...e)}),Uu=((...e)=>{Vu().hydrate(...e)}),Wu=((...e)=>{let t=Bu().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=qu(e);if(!r)return;let i=t._component;T(i)||i.render||i.template||(i.template=r.innerHTML),r.nodeType===1 Line truncated
`).forEach((r,a)=>{n.strokeText(r,t,i+a*e*1.2),n.fillText(r,t,i+a*e*1.2)})}n.restore()}}function gf(e,t){let n=Df(e),r=Math.max(e.width,e.height),i=Math.round(Cf(Math.min(t.from.x,t.to.x))*e.width),a=Math.round(Cf(Math.min(t.from.y,t.to.y))*e.height),o=Math.round(Cf(Math.max(t.from.x,t.to.x))*e.width)-i,s=Math.round(Cf(Math.max(t.from.y,t.to.y))*e.height)-a;if(o<2||s<2)return;let c=Cf(t.strength,1,100)/100,l=Math.max(2,(t.mode===`pixelate`?.008+c*.05:.004+c*.035)*r),u=Math.max(1,Math.round(o/l)),d=Math.max(1,Math.round(s/l)),f=Ef(o,s);for(Df(f).drawImage(e,i,a,o,s,0,0,o,s);f.width/2>=u&&f.height/2>=d;){let e=Ef(Math.max(1,Math.floor(f.width/2)),Math.max(1,Math.floor(f.height/2)));Df(e).drawImage(f,0,0,e.width,e.height),f=e}let p=Ef(u,d);if(Df(p).drawImage(f,0,0,u,d),n.save(),n.beginPath(),t.shape===`ellipse`?n.ellipse(i+o/2,a+s/2,o/2,s/2,0,0,Math.PI*2):n.rect(i,a,o,s),n.clip(),t.mode===`pixelate`)n.imageSmoothingEnabled=!1,n.drawImage(p,0,0,u,d,i,a,o,s);else{let e=Ef(Math.min(o,u*4),Math.min(s,d*4));Df(e).drawImage(p,0,0,e.width,e.height),n.drawImage(e,0,0,e.width,e.height,i,a,o,s)}n.restore()}function _f(e,t,n){let r=df(e,t.orientation,n);return mf(r,t.adjust),hf(r,t.marks),r}function vf(e,t,n){return bf(_f(e,t,af),{crop:t.crop,...t.output},n)}function yf(e,t){let n=Math.max(1,Math.round(e.width*t.crop.width)),r=Math.max(1,Math.round(e.height*t.crop.height)),i=Math.max(n,r),a=t.maxSize&&t.maxSize<i?t.maxSize/i:1;return{width:Math.max(1,Math.round(n*a)),height:Math.max(1,Math.round(r*a))}}async function bf(e,t,n){let r=Math.round(e.width*t.crop.x),i=Math.round(e.height*t.crop.y),a=Math.max(1,Math.min(e.width-r,Math.round(e.width*t.crop.width))),o=Math.max(1,Math.min(e.height-i,Math.round(e.height*t.crop.height))),s=yf(e,t),c=e,[l,u,d,f]=[r,i,a,o];for(;d/2>=s.width&&f/2>=s.height;){let e=Ef(Math.max(1,Math.floor(d/2)),Math.max(1,Math.floor(f/2)));Df(e).drawImage(c,l,u,d,f,0,0,e.width,e.height),c=e,[l,u,d,f]=[0,0,e.width,e.height]}let p=Ef(s.width,s.height),m=Df(p);t.format===`image/jpeg`&&(m.fillStyle=`#ffffff`,m.fillRect(0,0,p.width,p.height)),m.drawImage(c,l,u,d,f,0,0,p.width,p.height);let h=Math.min(100,Math.max(1,t.quality))/100,g=await new Promise(e=>p.toBlob(e,t.format,h));if(!g)throw Error(`The image could not be processed.`);let _=g.type in of?g.type:`image/png`,v=n.replace(/\.[^.]+$/,``)||`image`;return{file:new File([g],`${v}.${of[_]}`,{type:_}),width:p.width,height:p.height}}function xf(e,t){let n=e.width/e.height,r=t>=n?1:t/n,i=t>=n?n/t:1;return{x:(1-r)/2,y:(1-i)/2,width:r,height:i}}function Sf(e){return e?`${wf(e.x*100)}% ${wf(e.y*100)}%`:`50% 50%`}function Cf(e,t=0,n=1){return Math.min(n,Math.max(t,e))}function wf(e){return Math.round(e*100)/100}function Tf(e){let t=/^#([0-9a-f]{6})$/i.exec(e)?.[1];if(!t)return!0;let n=parseInt(t,16);return .2126*(n>>16)+.7152*(n>>8&255)+.0722*(n&255)>140}function Ef(e,t){let n=document.createElement(`canvas`);return n.width=Math.max(1,Math.round(e)),n.height=Math.max(1,Math.round(t)),n}function Df(e){let t=e.getContext(`2d`,{willReadFrequently:!1});if(!t)throw Error(`This browser cannot edit images.`);return t.imageSmoothingEnabled=!0,t.imageSmoothingQuality=`high`,t}var Of={class:`ie-backdrop`},kf=[`aria-label`],Af={class:`ie-header`},jf={class:`ie-title`},Mf=[`disabled`,`aria-label`,`title`],Nf=[`disabled`,`aria-label`,`title`],Pf=[`aria-label`,`title`],Ff={class:`ie-body`},If={class:`ie-stage-wrap`},Lf={key:0,class:`ie-error`,role:`alert`},Rf={key:1,class:`ie-muted ie-loading`},zf=[`onPointerdown`],Bf=[`title`],Vf=[`placeholder`,`aria-label`],Hf={class:`ie-panel`},Uf=[`aria-label`],Wf=[`aria-selected`,`onClick`],Gf={key:0,class:`ie-tool`,role:`tabpanel`},Kf={class:`ie-hint`},qf={class:`ie-options`},Jf=[`aria-pressed`,`onClick`],Yf={class:`ie-options`},Xf={class:`ie-row`},Zf=[`value`,`aria-label`],Qf={key:1,class:`ie-tool`,role:`tabpanel`},$f={class:`ie-options`},ep=[`aria-pressed`,`onClick`],tp=[`onUpdate:modelValue`],np={key:2,class:`ie-tool`,role:`tabpanel`},rp={class:`ie-hint`},ip={class:`ie-options`},ap=[`aria-pressed`,`onClick`],op={class:`ie-options ie-swatches`},sp=[`aria-label`,`aria-pressed`,`onClick`],cp=[`title`],lp=[`aria-label`],up={class:`ie-row`},dp=[`aria-label`],fp={key:3,class:`ie-tool`,role:`tabpanel`},pp={class:`ie-hint`},mp={class:`ie-options`},hp=[`aria-pressed`],gp=[`aria-pressed`],_p={class:`ie-options`},vp=[`aria-pressed`],yp=[`aria-pressed`],bp={class:`ie-row`},xp=[`aria-label`],Sp={key:4,class:`ie-tool`,role:`tabpanel`},Cp={class:`ie-options`},wp=[`aria-pressed`,`onClick`],Tp={class:`ie-row`},Ep=[`value`],Dp={value:`image/webp`},Op={value:`image/png`},kp=[`disabled`],Ap={key:0},jp=[`src`],Mp=[`src`],Np={class:`ie-result`,"aria-live":`polite`},Pp={key:1,class:`ie-muted`},Fp={class:`ie-footer`},Ip=[`disabled`],Lp=1600,Rp=.05,zp=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})(I({__name:`ImageEditor`,props:{file:{},remaining:{default:0},maxSize:{default:2400},format:{default:`image/webp`},quality:{default:82}},emits: Line truncated
`,t.selectionStart-1)+1,o=t.selectionEnd,s=n.modelValue.slice(a,o).split(`
`).map(t=>e+t).join(`
@@ -16,5 +16,5 @@ Minimum version required to store current data is: `+c+`.
`)}\n`],{type:`text/plain`}),t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`recovery-codes.txt`,t.click(),URL.revokeObjectURL(t.href)}return(e,t)=>(z(),B(`div`,dg,[r.value===`start`?(z(),B(R,{key:0},[H(`p`,fg,A(N(Z)(`Besides your password you type a code of 6 digits from an app on your phone. Then nobody can get in with only your password.`)),1),H(`ol`,pg,[H(`li`,null,A(N(Z)(`Install an authenticator app on your phone, for example Google Authenticator, Microsoft Authenticator or 2FAS.`)),1),H(`li`,null,A(N(Z)(`Press the button below and put your account in the app.`)),1),H(`li`,null,A(N(Z)(`Type the 6 digits the app shows.`)),1)]),H(`button`,{type:`button`,class:`m-btn m-btn-primary`,disabled:l.value,onClick:p},A(N(Z)(`Start`)),9,mg)],64)):r.value===`app`?(z(),B(R,{key:1},[H(`p`,hg,A(N(Z)(`Put your account in the app`)),1),H(`div`,gg,[H(`div`,_g,[H(`img`,{src:o.value,alt:``,width:`224`,height:`224`,class:`rounded-lg border border-line bg-white`},null,8,vg),H(`p`,yg,A(N(Z)(`Setup key`)),1),H(`code`,bg,A(f.value),1),H(`button`,{type:`button`,class:`mt-1 text-sm text-brand underline`,onClick:t[0]||=e=>h(a.value)},A(d.value?N(Z)(`Copied`):N(Z)(`Copy the key`)),1)]),H(`div`,xg,[H(`p`,null,A(N(Z)(`Scan this picture with the app.`)),1),H(`p`,null,A(N(Z)(`No camera, or you use a password manager such as Bitwarden? Add the setup key under the picture by hand: choose to add a key or secret, paste it, and keep the other options as they are (time based, 6 digits).`)),1),H(`p`,null,[W(A(N(Z)(`Is this the phone you have the app on? Press the button, the app opens by itself.`)),1),t[4]||=H(`br`,null,null,-1),H(`a`,{href:i.value,class:`m-btn m-btn-secondary mt-2 inline-flex`},A(N(Z)(`Open in the app`)),9,Sg)])])]),H(`form`,{class:`max-w-xs`,onSubmit:J(m,[`prevent`])},[H(`label`,Cg,A(N(Z)(`The 6 digits the app shows`)),1),F(H(`input`,{id:`tf-code`,"onUpdate:modelValue":t[1]||=e=>s.value=e,type:`text`,inputmode:`numeric`,autocomplete:`one-time-code`,maxlength:`10`,required:``,class:`m-input text-center text-xl tracking-widest`},null,512),[[q,s.value]]),c.value?(z(),B(`p`,wg,A(c.value),1)):G(``,!0),H(`button`,{type:`submit`,class:`m-btn m-btn-primary mt-3`,disabled:l.value},A(N(Z)(`Turn on`)),9,Tg)],32)],64)):(z(),B(R,{key:2},[H(`p`,Eg,A(N(Z)(`It is on. Keep these recovery codes safe.`)),1),H(`p`,Dg,A(N(Z)(`Lost your phone? Each of these codes works once instead of the 6 digits. Keep them somewhere safe, for example in a password manager. They are shown only now.`)),1),H(`ul`,Og,[(z(!0),B(R,null,L(u.value,e=>(z(),B(`li`,{key:e,class:`select-all rounded bg-text/5 px-2 py-1`},A(e),1))),128))]),H(`div`,kg,[H(`button`,{type:`button`,class:`m-btn m-btn-secondary`,onClick:t[2]||=e=>h(u.value.join(`
`))},A(d.value?N(Z)(`Copied`):N(Z)(`Copy`)),1),H(`button`,{type:`button`,class:`m-btn m-btn-secondary`,onClick:g},A(N(Z)(`Download`)),1),H(`button`,{type:`button`,class:`m-btn m-btn-primary`,onClick:t[3]||=e=>n(`done`)},A(N(Z)(`I have saved them`)),1)])],64))]))}}),jg={class:`space-y-3 rounded-lg border border-line p-4`},Mg={class:`px-1.5 text-sm font-semibold`},Ng={class:`text-sm`},Pg={class:`m-badge`},Fg={class:`m-help`},Ig={class:`flex flex-wrap gap-2`},Lg={key:0,class:`m-help`},Rg={class:`m-help`},zg={for:`tf-pw`,class:`m-label`},Bg={key:0,class:`m-error`},Vg={for:`tf-c`,class:`m-label`},Hg={key:0,class:`m-error`},Ug={class:`flex gap-2`},Wg=[`disabled`],Gg={key:2,class:`space-y-2`},Kg={class:`text-sm`},qg={class:`grid max-w-sm grid-cols-2 gap-2 font-mono text-sm`},Jg={key:0,class:`text-sm font-semibold text-red-700 dark:text-red-400`},Yg={key:1,class:`text-sm`},Xg=I({__name:`TwoFactorPanel`,setup(e){let t=M({...Y.two_factor}),n=M(`none`),r=M(``),i=M(``),a=M({}),o=M([]),s=M(!1);async function c(e,t){s.value=!0,a.value={};try{return await X[e](`${Y.base}/two-factor${t}`,{password:r.value,code:i.value})}catch(e){if(e instanceof Qu&&[403,422,429].includes(e.status))return a.value=Object.keys(e.errors).length?e.errors:{code:e.body?.message??``},null;throw e}finally{s.value=!1,r.value=i.value=``}}async function l(){let e=await c(`post`,`/recovery-codes`);e&&(o.value=e.recovery_codes,t.value={...t.value,...e})}async function u(){let e=await c(`delete`,``);e&&(t.value={...t.value,...e},n.value=`none`,$(Z(`The second step is off.`)))}function d(){window.location.reload()}return(e,c)=>(z(),B(`fieldset`,jg,[H(`legend`,Mg,A(N(Z)(`Extra safe login`)),1),t.value.enrolled?(z(),B(R,{key:0},[H(`p`,Ng,[H(`span`,Pg,A(N(Z)(`On`)),1),W(` `+A(N(Z)(`You type a code from your phone after your password.`)),1)]),H(`p`,Fg,A(N(Z)(`:count recovery codes left.`,{count:String(t.value.recovery_left)})),1),n.value===`none`?(z(),B(R,{key:0},[H(`div`,Ig,[H(`button`,{type:`button`,class:`m-btn m-btn-secondary`,onClick:c[0]||=e=>{n.value=`codes`,o.value=[]}},A(N(Z)(`New recovery codes`)),1),t.value.required?G(``,!0):(z(),B(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary`,onClick:c[1]||=e=>n.value=`off`},A(N(Z)(`Turn off`)),1))]),t.value.required?(z(),B(`p`,Lg,A(N(Z)(`You have to have this, so it cannot be turned off.`)),1)):G(``,!0)],64)):o.value.length?G(``,!0):(z(),B(`form`,{key:1,class:`max-w-xs space-y-3`,onSubmit:c[5]||=J(e=>n.value===`codes`?l():u(),[`prevent`])},[H(`p`,Rg,A(N(Z)(`To be sure it is you: your password and the 6 digits from the app.`)),1),H(`div`,null,[H(`label`,zg,A(N(Z)(`Current password`)),1),F(H(`input`,{id:`tf-pw`,"onUpdate:modelValue":c[2]||=e=>r.value=e,type:`password`,required:``,class:`m-input`,autocomplete:`current-password`},null,512),[[q,r.value]]),a.value.password?(z(),B(`p`,Bg,A(a.value.password),1)):G(``,!0)]),H(`div`,null,[H(`label`,Vg,A(N(Z)(`The 6 digits`)),1),F(H(`input`,{id:`tf-c`,"onUpdate:modelValue":c[3]||=e=>i.value=e,type:`text`,inputmode:`numeric`,autocomplete:`one-time-code`,maxlength:`40`,required:``,class:`m-input`},null,512),[[q,i.value]]),a.value.code?(z(),B(`p`,Hg,A(a.value.code),1)):G(``,!0)]),H(`div`,Ug,[H(`button`,{type:`submit`,class:k([`m-btn`,n.value===`off`?`m-btn-danger`:`m-btn-primary`]),disabled:s.value},A(n.value===`off`?N(Z)(`Turn off`):N(Z)(`Make new codes`)),11,Wg),H(`button`,{type:`button`,class:`m-btn m-btn-secondary`,onClick:c[4]||=e=>n.value=`none`},A(N(Z)(`Cancel`)),1)])],32)),o.value.length?(z(),B(`div`,Gg,[H(`p`,Kg,A(N(Z)(`Your new recovery codes. The old ones do not work any more. They are shown only now.`)),1),H(`ul`,qg,[(z(!0),B(R,null,L(o.value,e=>(z(),B(`li`,{key:e,class:`select-all rounded bg-text/5 px-2 py-1`},A(e),1))),128))]),H(`button`,{type:`button`,class:`m-btn m-btn-primary`,onClick:c[6]||=e=>{o.value=[],n.value=`none`}},A(N(Z)(`I have saved them`)),1)])):G(``,!0)],64)):(z(),B(R,{key:1},[t.value.required?(z(),B(`p`,Jg,A(t.value.days_left===null?N(Z)(`You have to set this up.`):N(Z)(`You have to set this up within :days days.`,{days:String(t.value.days_left)})),1)):(z(),B(`p`,Yg,A(N(Z)(`Not on. You can turn it on to keep your account safer.`)),1)),n.value===`setup`?(z(),V(Ag,{key:3,onDone:d})):(z(),B(`button`,{key:2,type:`button`,class:`m-btn m-btn-primary`,onClick:c[7]||=e=>n.value=`setup`},A(N(Z)(`Set up`)),1))],64))]))}}),Zg={class:`font-display mb-6 text-2xl font-bold`},Qg={for:`name`,class:`m-label`},$g={key:0,class:`m-error`},e_={class:`m-label`},t_={class:`text-sm`},n_={class:`m-label`},r_={class:`flex flex-wrap gap-1.5`},i_={key:0,class:`m-badge`},a_={key:0,class:`m-badge`},o_={key:0,class:`rounded-lg border border-line p-4`},s_={class:`px-1.5 text-sm font-semibold`},c_={class:`mt-1 flex flex-wrap gap-3`},l_=[`onUpdate:modelValue`,`value`],u_={class:`flex`},d_={key:0,class:`m-error`},f_={key:1,class:`rounded-lg border border-line p-4`},p_={class:`px-1.5 text-sm font-semibold`},m_={class:`mt-1 flex flex-wrap gap-3`},h_=[`onUpdate:modelVaLine truncated
`),u=(e,n)=>t.values[e]=n.split(`
`),d=e=>Object.values(e.items??{}),f=e=>c(e.key).push(Object.fromEntries(d(e).map(e=>[e.key,``]))),p=Y.permissions.includes(`media.view`),m=Y.view===`simple`;return(t,h)=>(z(),B(`div`,g2,[(z(!0),B(R,null,L(r.value,t=>(z(),B(`div`,{key:t.key},[t.type===`toggle`?(z(),B(`label`,_2,[F(H(`input`,{"onUpdate:modelValue":n=>e.values[t.key]=n,type:`checkbox`},null,8,v2),[[xu,e.values[t.key]]]),W(` `+A(N(Z)(i(t))),1)])):(z(),B(R,{key:1},[H(`label`,{for:n(t),class:`m-label`},[W(A(N(Z)(i(t))),1),t.required?(z(),B(`span`,b2,` *`)):G(``,!0)],8,y2),t.type===`select`?F((z(),B(`select`,{key:0,id:n(t),"onUpdate:modelValue":n=>e.values[t.key]=n,class:`m-input`},[t.required?G(``,!0):(z(),B(`option`,S2)),(z(!0),B(R,null,L(t.options,(e,t)=>(z(),B(`option`,{key:t,value:t},A(e),9,C2))),128))],8,x2)),[[wu,e.values[t.key]]]):t.type===`markdown`?(z(),V(Sm,{key:1,id:n(t),modelValue:e.values[t.key],"onUpdate:modelValue":n=>e.values[t.key]=n,required:t.required,maxlength:t.max??void 0},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`required`,`maxlength`])):t.type===`textarea`||t.type===`lines`?F((z(),B(`textarea`,{key:2,id:n(t),"onUpdate:modelValue":n=>e.values[t.key]=n,rows:t.type===`lines`?5:4,maxlength:t.max??void 0,required:t.required,class:`m-input`},null,8,w2)),[[q,e.values[t.key]]]):t.type===`media`&&m?(z(),B(`div`,T2,[e.values[t.key]?(z(),B(`img`,{key:0,src:e.values[t.key],alt:``,class:`h-28 w-auto max-w-full rounded-lg border border-line object-cover`},null,8,E2)):G(``,!0),N(p)?(z(),B(`button`,{key:1,id:n(t),type:`button`,class:`m-btn m-btn-primary`,onClick:e=>o.value=t.key},A(e.values[t.key]?N(Z)(`Use another photo`):N(Z)(`Choose a photo`)),9,D2)):G(``,!0),e.values[t.key]?(z(),B(`button`,{key:2,type:`button`,class:`m-btn m-btn-secondary`,onClick:n=>e.values[t.key]=``},A(N(Z)(`Take it away`)),9,O2)):G(``,!0)])):t.type===`media`?(z(),B(`div`,k2,[F(H(`input`,{id:n(t),"onUpdate:modelValue":n=>e.values[t.key]=n,maxlength:`2048`,class:`m-input`},null,8,A2),[[q,e.values[t.key]]]),N(p)?(z(),B(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary shrink-0`,onClick:e=>o.value=t.key},A(N(Z)(`Choose`)),9,j2)):G(``,!0)])):t.type===`list`?(z(),B(`textarea`,{key:5,id:n(t),value:l(t.key),rows:`5`,class:`m-input`,onInput:e=>u(t.key,e.target.value)},null,40,M2)):t.type===`media_list`?(z(),B(`div`,N2,[(z(!0),B(R,null,L(c(t.key),(n,r)=>(z(),B(`div`,{key:r,class:`flex items-center gap-2`},[H(`img`,{src:n,alt:``,class:k([`rounded border border-line object-cover`,m?`h-20 w-20`:`h-12 w-12`])},null,10,P2),m?G(``,!0):F((z(),B(`input`,{key:0,"onUpdate:modelValue":n=>e.values[t.key][r]=n,maxlength:`2048`,class:`m-input`,"aria-label":N(Z)(i(t))},null,8,F2)),[[q,e.values[t.key][r]]]),H(`button`,{type:`button`,class:`m-btn m-btn-secondary`,onClick:n=>e.values[t.key].splice(r,1)},A(m?N(Z)(`Take it away`):N(Z)(`Remove`)),9,I2)]))),128)),N(p)?(z(),B(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary`,onClick:e=>s.value=t.key},A(m?N(Z)(`Add photos`):N(Z)(`Add a picture`)),9,L2)):G(``,!0)])):t.type===`repeater`?(z(),B(`div`,R2,[(z(!0),B(R,null,L(c(t.key),(n,r)=>(z(),B(`div`,{key:r,class:`m-card space-y-2 p-3`},[(z(!0),B(R,null,L(d(t),e=>(z(),B(`div`,{key:e.key},[H(`label`,{class:`m-label`,for:`f-${t.key}-${r}-${e.key}`},A(N(Z)(e.label)),9,z2),e.type===`textarea`?F((z(),B(`textarea`,{key:0,id:`f-${t.key}-${r}-${e.key}`,"onUpdate:modelValue":t=>n[e.key]=t,rows:`3`,class:`m-input`},null,8,B2)),[[q,n[e.key]]]):F((z(),B(`input`,{key:1,id:`f-${t.key}-${r}-${e.key}`,"onUpdate:modelValue":t=>n[e.key]=t,class:`m-input`},null,8,V2)),[[q,n[e.key]]])]))),128)),H(`button`,{type:`button`,class:`m-btn m-btn-secondary`,onClick:n=>e.values[t.key].splice(r,1)},A(N(Z)(`Remove`)),9,H2)]))),128)),H(`button`,{type:`button`,class:`m-btn m-btn-secondary`,onClick:e=>f(t)},A(N(Z)(`Add`)),9,U2)])):F((z(),B(`input`,{key:8,id:n(t),"onUpdate:modelValue":n=>e.values[t.key]=n,type:t.type===`number`?`number`:t.type===`date`?`date`:`text`,maxlength:t.max??void 0,required:t.required,class:`m-input`},null,8,W2)),[[ku,e.values[t.key]]]),t.type===`media`&&e.values[t.key]&&!m?(z(),B(`img`,{key:9,src:e.values[t.key],alt:``,class:`mt-2 h-24 w-auto rounded-lg border border-line object-cover`},null,8,G2)):G(``,!0)],64)),t.type===`lines`||t.type===`list`?(z(),B(`p`,K2,A(N(Z)(`One per line.`)),1)):G(``,!0),a(t)?(z(),B(`p`,q2,A(N(Z)(a(t))),1)):G(``,!0),e.errors?.[(e.prefix??``)+t.key]?(z(),B(`p`,J2,A(e.errors[(e.prefix??``)+t.key]),1)):G(``,!0)]))),128)),o.value?(z(),V(cm,{key:0,onPick:h[0]||=t=>{e.values[o.value]=t,o.value=null},onClose:h[1]||=e=>o.value=null})):G(``,!0),s.value?(z(),V(cm,{key:1,many:``,onPick:h[2]||=e=>{c(s.value).push(e),s.value=null},onMany:h[3]||=e=>{c(s.value).push(...e),s.value=null},onClose:h[4]||=e=>s.value=null})):G(``,!0)]))}}),X2=[`aria-label`],Z2={class:`flex items-center justify-between gap-3`},Q2={class:`font-display text-lg font-bold`},$2=[`aria-expanded`],e4={class:`sr-only`,role:`status`,"aria-live":`polite`},t4=[`aria-label`],n4={class:`m-label`},r4={class Line truncated
`)),1)):G(``,!0)])],64))}}),sb={class:`font-display mb-2 text-2xl font-bold`},cb={class:`mb-6 text-sm text-muted`},lb={key:0,class:`m-card p-5 text-sm text-muted`},ub={key:1,class:`space-y-4`},db={class:`font-display text-lg font-bold`},fb={key:0,class:`ml-2 text-sm font-normal text-muted`},pb={key:0,class:`text-sm font-semibold`},mb={class:`mt-1 list-disc space-y-1 pl-5 text-sm`},hb=I({__name:`UpdatesList`,props:{releases:{}},setup(e){let t=e;return(e,n)=>(z(),B(R,null,[H(`h1`,sb,A(N(Z)(`Updates`)),1),H(`p`,cb,A(N(Z)(`What changed on your website`)),1),t.releases.length?(z(),B(`div`,ub,[(z(!0),B(R,null,L(t.releases,e=>(z(),B(`section`,{key:e.version,class:`m-card p-5`},[H(`h2`,db,[W(A(e.version)+` `,1),e.date?(z(),B(`span`,fb,A(e.date),1)):G(``,!0)]),(z(!0),B(R,null,L(e.sections,(e,t)=>(z(),B(`div`,{key:t,class:`mt-3`},[e.title?(z(),B(`h3`,pb,A(e.title),1)):G(``,!0),H(`ul`,mb,[(z(!0),B(R,null,L(e.items,(e,t)=>(z(),B(`li`,{key:t},A(e),1))),128))])]))),128))]))),128))])):(z(),B(`p`,lb,A(N(Z)(`No changes recorded yet.`)),1))],64))}}),gb={class:`font-display mb-2 text-2xl font-bold`},_b={class:`mb-6 text-sm text-muted`},vb={class:`m-card mb-6 divide-y divide-line`},yb={class:`font-semibold`},bb={class:`text-xs text-muted`},xb={class:`text-xs text-muted`},Sb={key:0,class:`flex gap-2`},Cb=[`onClick`],wb=[`onClick`],Tb={class:`mb-3 font-semibold`},Eb={key:0,class:`m-card p-5 text-sm text-muted`},Db={key:1,class:`m-card divide-y divide-line`},Ob={class:`min-w-0`},kb={class:`truncate font-semibold`},Ab={class:`truncate text-xs text-muted`},jb={class:`m-badge`},Mb=I({__name:`SharingPage`,props:{live:{type:Boolean},platforms:{},shares:{},notice:{}},setup(e){let t=e,n={connected:[`The account is connected.`,!1],denied:[`The network did not give permission, or it was cancelled.`,!0],failed:[`Connecting did not complete. Try again.`,!0],state:[`Connecting did not complete. Try again.`,!0]};pa(()=>{t.notice&&n[t.notice]&&$(Z(n[t.notice][0]),n[t.notice][1])});let r=e=>window.location.assign(`${Y.base}/sharing/${e}/connect`);async function i(e){window.confirm(Z(`Are you sure?`))&&(await X.delete(`${Y.base}/sharing/${e}`),$(Z(`The account is disconnected. What was shared stays where it is.`)),await f5())}return(e,n)=>(z(),B(R,null,[H(`h1`,gb,A(N(Z)(`Sharing`)),1),H(`p`,_b,A(t.live?N(Z)(`Posts are shared for real.`):N(Z)(`Dry run: nothing is sent to the networks. Turn on "Post for real" under Settings when the site is live.`)),1),H(`section`,vb,[(z(!0),B(R,null,L(t.platforms,e=>(z(),B(`div`,{key:e.platform,class:`flex flex-wrap items-center justify-between gap-3 p-4`},[H(`div`,null,[H(`p`,yb,A(e.label),1),H(`p`,bb,[e.connected?(z(),B(R,{key:0},[W(A(N(Z)(`Connected`))+A(e.account?` · `+e.account:``),1)],64)):e.can_connect?(z(),B(R,{key:1},[W(A(N(Z)(`Not connected`)),1)],64)):(z(),B(R,{key:2},[W(A(N(Z)(`Fill in under Settings:`))+` `+A(e.missing),1)],64))]),H(`p`,xb,[W(A(N(Z)(`Return address for the app`))+`: `,1),H(`code`,null,A(e.callback_url),1)])]),N(Y).permissions.includes(`sharing.manage`)?(z(),B(`div`,Sb,[e.can_connect?(z(),B(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary`,onClick:t=>r(e.platform)},A(e.connected?N(Z)(`Connect again`):N(Z)(`Connect`)),9,Cb)):G(``,!0),e.connected?(z(),B(`button`,{key:1,type:`button`,class:`m-btn m-btn-secondary`,onClick:t=>i(e.platform)},A(N(Z)(`Disconnect`)),9,wb)):G(``,!0)])):G(``,!0)]))),128))]),H(`h2`,Tb,A(N(Z)(`Recently shared`)),1),t.shares.length?(z(),B(`ul`,Db,[(z(!0),B(R,null,L(t.shares,e=>(z(),B(`li`,{key:e.id,class:`flex items-center justify-between gap-3 p-4 text-sm`},[H(`div`,Ob,[H(`p`,kb,A(e.post_title),1),H(`p`,Ab,[W(A(e.platform)+` · `+A(e.at),1),e.error?(z(),B(R,{key:0},[W(` · `+A(e.error),1)],64)):G(``,!0)])]),H(`span`,jb,A(e.dry_run?N(Z)(`Dry run`):e.status===`shared`?N(Z)(`Shared`):N(Z)(`Failed`)),1)]))),128))])):(z(),B(`p`,Eb,A(N(Z)(`Nothing has been shared yet.`)),1))],64))}}),Nb={class:`font-display mb-2 text-2xl font-bold`},Pb={class:`mb-6 text-sm text-muted`},Fb={class:`grid gap-3 sm:grid-cols-3`},Ib={class:`m-card p-4`},Lb={class:`text-muted`},Rb={class:`text-2xl font-bold`},zb={class:`text-sm text-muted`},Bb={class:`m-card p-4`},Vb={class:`text-muted`},Hb={class:`text-2xl font-bold`},Ub={class:`text-sm text-muted`},Wb={class:`m-card p-4`},Gb={class:`text-muted`},Kb={class:`text-2xl font-bold`},qb={key:0,class:`text-sm text-muted`},Jb={class:`m-card mt-3 p-4`},Yb={class:`flex justify-between`},Xb={key:0,class:`flex justify-between text-muted`},Zb={class:`mt-1 flex justify-between text-lg`},Qb={key:0,class:`mt-2 text-sm text-muted`},$b={key:1,class:`mt-1 text-sm text-muted`},e8={key:2,class:`m-card mt-6 p-5 text-sm text-muted`},t8={class:`font-display text-lg font-bold`},n8={key:0,class:`ml-2 text-sm font-normal text-muted`},r8={class:`float-right text-base`},i8={class:`mt-3 divide-y divide-line text-sm`},a8={class:`min-w-0`},o8={class:`text-muted`},s8={class:`shrink-0 text-muted`},c8={class:`mt-6 text-xs text-muted`},l8=I({__name:`CostsView`,props Line truncated
`),d=e=>Object.values(e.items??{}),f=e=>c(e.key).push(Object.fromEntries(d(e).map(e=>[e.key,``]))),p=Y.permissions.includes(`media.view`),m=Y.view===`simple`;return(t,h)=>(z(),B(`div`,g2,[(z(!0),B(R,null,L(r.value,t=>(z(),B(`div`,{key:t.key},[t.type===`toggle`?(z(),B(`label`,_2,[F(H(`input`,{"onUpdate:modelValue":n=>e.values[t.key]=n,type:`checkbox`},null,8,v2),[[xu,e.values[t.key]]]),W(` `+A(N(Z)(i(t))),1)])):(z(),B(R,{key:1},[H(`label`,{for:n(t),class:`m-label`},[W(A(N(Z)(i(t))),1),t.required?(z(),B(`span`,b2,` *`)):G(``,!0)],8,y2),t.type===`select`?F((z(),B(`select`,{key:0,id:n(t),"onUpdate:modelValue":n=>e.values[t.key]=n,class:`m-input`},[t.required?G(``,!0):(z(),B(`option`,S2)),(z(!0),B(R,null,L(t.options,(e,t)=>(z(),B(`option`,{key:t,value:t},A(e),9,C2))),128))],8,x2)),[[wu,e.values[t.key]]]):t.type===`markdown`?(z(),V(Sm,{key:1,id:n(t),modelValue:e.values[t.key],"onUpdate:modelValue":n=>e.values[t.key]=n,required:t.required,maxlength:t.max??void 0},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`required`,`maxlength`])):t.type===`textarea`||t.type===`lines`?F((z(),B(`textarea`,{key:2,id:n(t),"onUpdate:modelValue":n=>e.values[t.key]=n,rows:t.type===`lines`?5:4,maxlength:t.max??void 0,required:t.required,class:`m-input`},null,8,w2)),[[q,e.values[t.key]]]):t.type===`media`&&m?(z(),B(`div`,T2,[e.values[t.key]?(z(),B(`img`,{key:0,src:e.values[t.key],alt:``,class:`h-28 w-auto max-w-full rounded-lg border border-line object-cover`},null,8,E2)):G(``,!0),N(p)?(z(),B(`button`,{key:1,id:n(t),type:`button`,class:`m-btn m-btn-primary`,onClick:e=>o.value=t.key},A(e.values[t.key]?N(Z)(`Use another photo`):N(Z)(`Choose a photo`)),9,D2)):G(``,!0),e.values[t.key]?(z(),B(`button`,{key:2,type:`button`,class:`m-btn m-btn-secondary`,onClick:n=>e.values[t.key]=``},A(N(Z)(`Take it away`)),9,O2)):G(``,!0)])):t.type===`media`?(z(),B(`div`,k2,[F(H(`input`,{id:n(t),"onUpdate:modelValue":n=>e.values[t.key]=n,maxlength:`2048`,class:`m-input`},null,8,A2),[[q,e.values[t.key]]]),N(p)?(z(),B(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary shrink-0`,onClick:e=>o.value=t.key},A(N(Z)(`Choose`)),9,j2)):G(``,!0)])):t.type===`list`?(z(),B(`textarea`,{key:5,id:n(t),value:l(t.key),rows:`5`,class:`m-input`,onInput:e=>u(t.key,e.target.value)},null,40,M2)):t.type===`media_list`?(z(),B(`div`,N2,[(z(!0),B(R,null,L(c(t.key),(n,r)=>(z(),B(`div`,{key:r,class:`flex items-center gap-2`},[H(`img`,{src:n,alt:``,class:k([`rounded border border-line object-cover`,m?`h-20 w-20`:`h-12 w-12`])},null,10,P2),m?G(``,!0):F((z(),B(`input`,{key:0,"onUpdate:modelValue":n=>e.values[t.key][r]=n,maxlength:`2048`,class:`m-input`,"aria-label":N(Z)(i(t))},null,8,F2)),[[q,e.values[t.key][r]]]),H(`button`,{type:`button`,class:`m-btn m-btn-secondary`,onClick:n=>e.values[t.key].splice(r,1)},A(m?N(Z)(`Take it away`):N(Z)(`Remove`)),9,I2)]))),128)),N(p)?(z(),B(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary`,onClick:e=>s.value=t.key},A(m?N(Z)(`Add photos`):N(Z)(`Add a picture`)),9,L2)):G(``,!0)])):t.type===`repeater`?(z(),B(`div`,R2,[(z(!0),B(R,null,L(c(t.key),(n,r)=>(z(),B(`div`,{key:r,class:`m-card space-y-2 p-3`},[(z(!0),B(R,null,L(d(t),e=>(z(),B(`div`,{key:e.key},[H(`label`,{class:`m-label`,for:`f-${t.key}-${r}-${e.key}`},A(N(Z)(e.label)),9,z2),e.type===`textarea`?F((z(),B(`textarea`,{key:0,id:`f-${t.key}-${r}-${e.key}`,"onUpdate:modelValue":t=>n[e.key]=t,rows:`3`,class:`m-input`},null,8,B2)),[[q,n[e.key]]]):F((z(),B(`input`,{key:1,id:`f-${t.key}-${r}-${e.key}`,"onUpdate:modelValue":t=>n[e.key]=t,class:`m-input`},null,8,V2)),[[q,n[e.key]]])]))),128)),H(`button`,{type:`button`,class:`m-btn m-btn-secondary`,onClick:n=>e.values[t.key].splice(r,1)},A(N(Z)(`Remove`)),9,H2)]))),128)),H(`button`,{type:`button`,class:`m-btn m-btn-secondary`,onClick:e=>f(t)},A(N(Z)(`Add`)),9,U2)])):F((z(),B(`input`,{key:8,id:n(t),"onUpdate:modelValue":n=>e.values[t.key]=n,type:t.type===`number`?`number`:t.type===`date`?`date`:`text`,maxlength:t.max??void 0,required:t.required,class:`m-input`},null,8,W2)),[[ku,e.values[t.key]]]),t.type===`media`&&e.values[t.key]&&!m?(z(),B(`img`,{key:9,src:e.values[t.key],alt:``,class:`mt-2 h-24 w-auto rounded-lg border border-line object-cover`},null,8,G2)):G(``,!0)],64)),t.type===`lines`||t.type===`list`?(z(),B(`p`,K2,A(N(Z)(`One per line.`)),1)):G(``,!0),a(t)?(z(),B(`p`,q2,A(N(Z)(a(t))),1)):G(``,!0),e.errors?.[(e.prefix??``)+t.key]?(z(),B(`p`,J2,A(e.errors[(e.prefix??``)+t.key]),1)):G(``,!0)]))),128)),o.value?(z(),V(cm,{key:0,onPick:h[0]||=t=>{e.values[o.value]=t,o.value=null},onClose:h[1]||=e=>o.value=null})):G(``,!0),s.value?(z(),V(cm,{key:1,many:``,onPick:h[2]||=e=>{c(s.value).push(e),s.value=null},onMany:h[3]||=e=>{c(s.value).push(...e),s.value=null},onClose:h[4]||=e=>s.value=null})):G(``,!0)]))}}),X2=[`aria-label`],Z2={class:`flex items-center justify-between gap-3`},Q2={class:`font-display text-lg font-bold`},$2=[`aria-expanded`],e4={class:`sr-only`,role:`status`,"aria-live":`polite`},t4=[`aria-label`],n4={class:`m-label`},r4={class Line truncated
`)),1)):G(``,!0)])],64))}}),sb={class:`font-display mb-2 text-2xl font-bold`},cb={class:`mb-6 text-sm text-muted`},lb={key:0,class:`m-card p-5 text-sm text-muted`},ub={key:1,class:`space-y-4`},db={class:`font-display text-lg font-bold`},fb={key:0,class:`ml-2 text-sm font-normal text-muted`},pb={key:0,class:`text-sm font-semibold`},mb={class:`mt-1 list-disc space-y-1 pl-5 text-sm`},hb=I({__name:`UpdatesList`,props:{releases:{}},setup(e){let t=e;return(e,n)=>(z(),B(R,null,[H(`h1`,sb,A(N(Z)(`Updates`)),1),H(`p`,cb,A(N(Z)(`What changed on your website`)),1),t.releases.length?(z(),B(`div`,ub,[(z(!0),B(R,null,L(t.releases,e=>(z(),B(`section`,{key:e.version,class:`m-card p-5`},[H(`h2`,db,[W(A(e.version)+` `,1),e.date?(z(),B(`span`,fb,A(e.date),1)):G(``,!0)]),(z(!0),B(R,null,L(e.sections,(e,t)=>(z(),B(`div`,{key:t,class:`mt-3`},[e.title?(z(),B(`h3`,pb,A(e.title),1)):G(``,!0),H(`ul`,mb,[(z(!0),B(R,null,L(e.items,(e,t)=>(z(),B(`li`,{key:t},A(e),1))),128))])]))),128))]))),128))])):(z(),B(`p`,lb,A(N(Z)(`No changes recorded yet.`)),1))],64))}}),gb={class:`font-display mb-2 text-2xl font-bold`},_b={class:`mb-6 text-sm text-muted`},vb={class:`m-card mb-6 divide-y divide-line`},yb={class:`font-semibold`},bb={class:`text-xs text-muted`},xb={class:`text-xs text-muted`},Sb={key:0,class:`flex gap-2`},Cb=[`onClick`],wb=[`onClick`],Tb={class:`mb-3 font-semibold`},Eb={key:0,class:`m-card p-5 text-sm text-muted`},Db={key:1,class:`m-card divide-y divide-line`},Ob={class:`min-w-0`},kb={class:`truncate font-semibold`},Ab={class:`truncate text-xs text-muted`},jb={class:`m-badge`},Mb=I({__name:`SharingPage`,props:{live:{type:Boolean},platforms:{},shares:{},notice:{}},setup(e){let t=e,n={connected:[`The account is connected.`,!1],denied:[`The network did not give permission, or it was cancelled.`,!0],failed:[`Connecting did not complete. Try again.`,!0],state:[`Connecting did not complete. Try again.`,!0]};pa(()=>{t.notice&&n[t.notice]&&$(Z(n[t.notice][0]),n[t.notice][1])});let r=e=>window.location.assign(`${Y.base}/sharing/${e}/connect`);async function i(e){window.confirm(Z(`Are you sure?`))&&(await X.delete(`${Y.base}/sharing/${e}`),$(Z(`The account is disconnected. What was shared stays where it is.`)),await f5())}return(e,n)=>(z(),B(R,null,[H(`h1`,gb,A(N(Z)(`Sharing`)),1),H(`p`,_b,A(t.live?N(Z)(`Posts are shared for real.`):N(Z)(`Dry run: nothing is sent to the networks. Turn on "Post for real" under Settings when the site is live.`)),1),H(`section`,vb,[(z(!0),B(R,null,L(t.platforms,e=>(z(),B(`div`,{key:e.platform,class:`flex flex-wrap items-center justify-between gap-3 p-4`},[H(`div`,null,[H(`p`,yb,A(e.label),1),H(`p`,bb,[e.connected?(z(),B(R,{key:0},[W(A(N(Z)(`Connected`))+A(e.account?` · `+e.account:``),1)],64)):e.can_connect?(z(),B(R,{key:1},[W(A(N(Z)(`Not connected`)),1)],64)):(z(),B(R,{key:2},[W(A(N(Z)(`Fill in under Settings:`))+` `+A(e.missing),1)],64))]),H(`p`,xb,[W(A(N(Z)(`Return address for the app`))+`: `,1),H(`code`,null,A(e.callback_url),1)])]),N(Y).permissions.includes(`sharing.manage`)?(z(),B(`div`,Sb,[e.can_connect?(z(),B(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary`,onClick:t=>r(e.platform)},A(e.connected?N(Z)(`Connect again`):N(Z)(`Connect`)),9,Cb)):G(``,!0),e.connected?(z(),B(`button`,{key:1,type:`button`,class:`m-btn m-btn-secondary`,onClick:t=>i(e.platform)},A(N(Z)(`Disconnect`)),9,wb)):G(``,!0)])):G(``,!0)]))),128))]),H(`h2`,Tb,A(N(Z)(`Recently shared`)),1),t.shares.length?(z(),B(`ul`,Db,[(z(!0),B(R,null,L(t.shares,e=>(z(),B(`li`,{key:e.id,class:`flex items-center justify-between gap-3 p-4 text-sm`},[H(`div`,Ob,[H(`p`,kb,A(e.post_title),1),H(`p`,Ab,[W(A(e.platform)+` · `+A(e.at),1),e.error?(z(),B(R,{key:0},[W(` · `+A(e.error),1)],64)):G(``,!0)])]),H(`span`,jb,A(e.dry_run?N(Z)(`Dry run`):e.status===`shared`?N(Z)(`Shared`):N(Z)(`Failed`)),1)]))),128))])):(z(),B(`p`,Eb,A(N(Z)(`Nothing has been shared yet.`)),1))],64))}}),Nb={class:`font-display mb-2 text-2xl font-bold`},Pb={class:`mb-6 text-sm text-muted`},Fb={class:`grid gap-3 sm:grid-cols-3`},Ib={class:`m-card p-4`},Lb={class:`text-muted`},Rb={class:`text-2xl font-bold`},zb={class:`text-sm text-muted`},Bb={class:`m-card p-4`},Vb={class:`text-muted`},Hb={class:`text-2xl font-bold`},Ub={class:`text-sm text-muted`},Wb={class:`m-card p-4`},Gb={class:`text-muted`},Kb={class:`text-2xl font-bold`},qb={key:0,class:`text-sm text-muted`},Jb={class:`m-card mt-3 p-4`},Yb={class:`flex justify-between`},Xb={key:0,class:`flex justify-between text-muted`},Zb={class:`mt-1 flex justify-between text-lg`},Qb={key:0,class:`mt-2 text-sm text-muted`},$b={key:1,class:`mt-1 text-sm text-muted`},e8={key:2,class:`m-card mt-6 p-5 text-sm text-muted`},t8={class:`font-display text-lg font-bold`},n8={key:0,class:`ml-2 text-sm font-normal text-muted`},r8={class:`float-right text-base`},i8={class:`mt-3 divide-y divide-line text-sm`},a8={class:`min-w-0`},o8={class:`text-muted`},s8={class:`shrink-0 text-muted`},c8={class:`mt-6 text-xs text-muted`},l8=I({__name:`CostsView`,props Line truncated
+10 -1
View File
@@ -22,7 +22,7 @@ class SupportController
'available' => $this->helpdesk->available(),
'every' => $this->helpdesk->every(),
'kinds' => Helpdesk::KINDS,
'tickets' => $this->helpdesk->tickets($request->user())->map($this->row(...))->values(),
'tickets' => $this->rows($request),
]);
}
@@ -83,6 +83,15 @@ class SupportController
}
/** @return array<string, mixed> */
/** Every ticket of the site, with the name of the one who sent it. */
private function rows(Request $request): array
{
$tickets = $this->helpdesk->tickets($request->user());
$names = $request->user()::query()->whereIn($request->user()->getKeyName(), $tickets->pluck('user_id')->filter()->unique()->all())->pluck('name', $request->user()->getKeyName());
return $tickets->map(fn (SupportTicket $ticket) => $this->row($ticket) + ['by' => (string) ($names[$ticket->user_id] ?? '')])->values()->all();
}
private function row(SupportTicket $ticket): array
{
return [
+5 -5
View File
@@ -103,20 +103,20 @@ final class Helpdesk
return true;
}
/** The tickets of an account, the ones with news first. */
/** The tickets of the site, for everyone who may use the help: the ones with news first. */
public function tickets(object $user)
{
return SupportTicket::query()->where('user_id', $user->getAuthIdentifier())->orderByDesc('last_message_at')->orderByDesc('id')->limit(100)->get();
return SupportTicket::query()->orderByDesc('last_message_at')->orderByDesc('id')->limit(100)->get();
}
/** How many tickets of an account have an answer it has not read. */
/** How many tickets of the site have an answer nobody has read yet (whoever opens it reads it for all). */
public function unread(object $user): int
{
return $this->tickets($user)->filter(fn (SupportTicket $ticket) => $ticket->hasNews())->count();
}
/**
* A ticket of this account with its conversation as the API has it now; null when it is not theirs or the API does not know it.
* A ticket of the site with its conversation as the API has it now; null when the site has no such ticket or the API does not know it.
* Opening it counts as reading.
*
* @return array{ticket: SupportTicket, messages: list<array<string, mixed>>}|null
@@ -160,7 +160,7 @@ final class Helpdesk
private function own(object $user, string $number): ?SupportTicket
{
return SupportTicket::query()->where('number', $number)->where('user_id', $user->getAuthIdentifier())->first();
return SupportTicket::query()->where('number', $number)->first();
}
/**
+1
View File
@@ -73,6 +73,7 @@ final class Menu
'href' => isset($item['route']) ? route($item['route'], $item['params'] ?? [], false) : (string) $item['url'],
// Both faces fold their items away under headings; the simple one has plainer words.
'section' => $simple ? ($item['simple_section'] ?? $item['section'] ?? null) : ($item['section'] ?? null),
'rank' => $item['section_rank'] ?? null,
'hint' => $item['hint'] ?? null,
'icon' => $item['icon'] ?? null,
'new_tab' => ($item['new_tab'] ?? false) ?: null,
+4 -1
View File
@@ -155,6 +155,9 @@ final class ModuleRegistry
'Administration' => 'Who may do what',
];
/** Where a heading stands in the menu (both faces): a heading of a site comes after these, and Iriks-IT is always last. */
private const SECTION_RANK = ['Content' => 10, 'Lists' => 20, 'Visitors' => 30, 'Administration' => 40, 'Project' => 100, 'Iriks-IT' => 100];
private const ICONS = [
'pages.index' => 'layout', 'posts.index' => 'file', 'labels.index' => 'tag', 'media.index' => 'image',
'leads.index' => 'mail', 'reviews.index' => 'star', 'statistics.index' => 'chart', 'numbers.index' => 'hash', 'sharing.index' => 'share',
@@ -198,7 +201,7 @@ final class ModuleRegistry
...$item,
'label' => __($item['label']),
...(isset($item['simple_label']) && $item['simple_label'] !== null ? ['simple_label' => __($item['simple_label'])] : []),
...(isset($item['section']) ? ['section' => __($item['section']), 'simple_section' => __($item['simple_section'] ?? self::SIMPLE_SECTIONS[$item['section']] ?? $item['section'])] : []),
...(isset($item['section']) ? ['section' => __($item['section']), 'simple_section' => __($item['simple_section'] ?? self::SIMPLE_SECTIONS[$item['section']] ?? $item['section']), 'section_rank' => self::SECTION_RANK[$item['section']] ?? 50] : []),
...(isset($item['hint']) && $item['hint'] !== null ? ['hint' => __($item['hint'])] : []),
'order' => (int) ($item['order'] ?? 100),
'simple' => (bool) ($item['simple'] ?? false),