diff --git a/shaarli-pro/dist/custom_views.min.js b/shaarli-pro/dist/custom_views.min.js
index 1f97e76..5ceb60b 100644
--- a/shaarli-pro/dist/custom_views.min.js
+++ b/shaarli-pro/dist/custom_views.min.js
@@ -1 +1 @@
-!function(){"use strict";function t(t){return"undefined"!=typeof window&&"function"==typeof window.renderMarkdown?window.renderMarkdown(t):String(t||"").replace(/\n/g,"
")}function e(t,e){if("undefined"!=typeof window&&"function"==typeof window.applyKeepNoteFormatting)return window.applyKeepNoteFormatting(t,e)}document.addEventListener("DOMContentLoaded",function(){const t=new URLSearchParams(window.location.search),e=t.get("searchtags")||t.get("searchTags")||"",o=window.location.pathname.match(/\/tag\/(.+)$/),n=(e+" "+(o?decodeURIComponent(o[1]):"")).toLowerCase().split(/[\s,]+/).filter(t=>t),d=!!document.querySelector('.sidebar-link[aria-label="Notes"].active, .header-nav-link[aria-label="Notes"].active, .sidebar-link[href*="searchtags=note"].active, .sidebar-link[href*="searchtags=shaarli-note"].active')||!!document.querySelector('.sidebar-link[aria-label="'+window.ShaarliProI18n.t("Notes")+'"].active, .header-nav-link[aria-label="'+window.ShaarliProI18n.t("Notes")+'"].active'),c=!!document.querySelector('.sidebar-link[aria-label="Mes tâches"].active, .header-nav-link[aria-label="Mes tâches"].active, .sidebar-link[href*="searchtags=shaarli-todo"].active, .sidebar-link[href*="searchtags=todo"].active')||!!document.querySelector('.sidebar-link[aria-label="'+window.ShaarliProI18n.t("My tasks")+'"].active, .header-nav-link[aria-label="'+window.ShaarliProI18n.t("My tasks")+'"].active'),p=!!document.querySelector('.sidebar-link[aria-label="Archive"].active, .header-nav-link[aria-label="Archive"].active, .sidebar-link[href*="searchtags=shaarli-archive"].active, .sidebar-link[href*="searchtags=shaarli-archiver"].active')||!!document.querySelector('.sidebar-link[aria-label="'+window.ShaarliProI18n.t("Archive")+'"].active, .header-nav-link[aria-label="'+window.ShaarliProI18n.t("Archive")+'"].active'),b=Array.from(document.querySelectorAll(".search-tag-chip")).map(t=>(t.textContent||"").trim().toLowerCase()),y=t=>"shaarli-archive"===t||"shaarli-archiver"===t,v=t=>"note"===t||"shaarli-note"===t||"#note"===t,w=t=>"todo"===t||"shaarli-todo"===t||"#todo"===t,S=n.some(v)||d||b.some(v),P=n.some(w)||c||b.some(w),q=n.some(y)||p||b.some(y),$=document.getElementById("links-list"),I=document.querySelector(".content-container"),x=()=>{try{document.body.classList.remove("view-todo","view-notes","view-archive")}catch(t){}const t=document.querySelector(".content-toolbar");t&&(t.style.display="");const e=document.getElementById("links-list");e&&(e.style.display=""),document.querySelectorAll(".notes-wrapper.todo-wrapper").forEach(t=>t.remove())};window.renderMarkdown=function(t){if(!t)return"";const e=String(t).replace(/\r\n?/g,"\n"),o=t=>String(t).replace(/&/g,"&").replace(//g,">"),n=t=>String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">"),r=t=>{const e=String(t||"").trim();return e&&/^(https?:|mailto:|\/)/i.test(e)?e:""},a=t=>{let e=o(t||"");const a=[];return e=e.replace(/`([^`\n]+)`/g,(t,e)=>{const o=`__MD_CODE_${a.length}__`;return a.push(`${e}`),o}),e=e.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(t,e,o)=>{const a=r(o);return a?``:t}),e=e.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(t,e,o)=>{const a=r(o);return a?`${e}`:t}),e=e.replace(/\*\*(.+?)\*\*/g,"$1"),e=e.replace(/__(.+?)__/g,"$1"),e=e.replace(/~~(.+?)~~/g,"
$1"),e=e.replace(/\*(.+?)\*/g,"$1"),e=e.replace(/_(.+?)_/g,"$1"),e=e.replace(/<u>([\s\S]*?)<\/u>/g,"$1"),e=e.replace(/__MD_CODE_(\d+)__/g,(t,e)=>a[Number(e)]||""),e},i=e.split("\n"),l=[];let s=!1,d=!1,c=!1,u=!1,m="",p=[];const f=()=>{s&&(l.push(""),s=!1),d&&(l.push(""),d=!1),c&&(l.push(""),c=!1)};if(i.forEach(t=>{const e=t.trim(),r=e.match(/^```\s*([\w-]+)?\s*$/);if(r){if(f(),u){const t=m?` data-lang="${n(m)}"`:"";l.push(`
${o(p.join("\n"))}`),u=!1,m="",p=[]}else u=!0,m=r[1]||"",p=[];return}if(u)return void p.push(t);if(!e)return f(),void l.push('');const i=t.match(/^\s*(#{1,6})\s+(.+)$/);if(i){f();const t=i[1].length;return void l.push(`${a(h[1])}`);const g=t.match(/^\s*[-*]\s+\[( |x|X)\]\s+(.+)$/);if(g){s&&(l.push(""),s=!1),d&&(l.push(""),d=!1),c||(l.push('
${a(t)}
`)}),u){const t=m?` data-lang="${n(m)}"`:"";l.push(`${o(p.join("\n"))}`)}return f(),l.join("")},window.applyKeepNoteFormatting=function(t,e){if(!t||!e)return;const o=t.selectionStart||0,n=t.selectionEnd||0,r=String(t.value||""),a=r.slice(o,n),i=(e,o,n,a="end")=>{const i=r.slice(0,e)+n+r.slice(o);if(t.value=i,t.focus({preventScroll:!0}),"select"===a)t.setSelectionRange(e,e+n.length);else{const o=e+n.length;t.setSelectionRange(o,o)}},l=(e,i)=>{const l=a||"",s=`${e}${l}${i}`,d=r.slice(0,o)+s+r.slice(n);t.value=d;const c=o+e.length,u=c+l.length;t.focus({preventScroll:!0}),t.setSelectionRange(c,u)},s=e=>{const{lineStart:a,lineEnd:i}=(()=>{const t=r.slice(0,o),e=r.slice(n),a=t.lastIndexOf("\n")+1,i=e.indexOf("\n");return{lineStart:a,lineEnd:-1===i?r.length:n+i}})(),l=r.slice(a,i).split(/\r?\n/).map(e).join("\n"),s=r.slice(0,a)+l+r.slice(i);t.value=s,t.focus({preventScroll:!0}),t.setSelectionRange(a,a+l.length)};if("bold"===e)return l("**","**");if("italic"===e)return l("*","*");if("underline"===e)return l("","");if("strike"===e)return l("~~","~~");if("code"===e)return l("`","`");if("link"===e){const e=`[${a||"Texte du lien"}](https://)`;i(o,n,e);const r=o+e.length-1;return void t.setSelectionRange(r,r)}if("image"===e){const e=``;i(o,n,e);const r=o+e.length-1;return void t.setSelectionRange(r,r)}if("quote"===e)return s(t=>t.startsWith("> ")?t:`> ${t}`);if("ul"===e)return s(t=>{const e=t.trim();return e?/^[-*+]\s+/.test(e)?t:`- ${e}`:"- "});if("ol"===e)return s((t,e)=>{const o=t.trim();return o?/^\d+\.\s+/.test(o)?t:`${e+1}. ${o}`:`${e+1}. `});if("todo"===e)return s(t=>{const e=t.trim();return e?/^[-*]\s+\[( |x|X)\]\s+/.test(e)?t:`- [ ] ${e}`:"- [ ] "});if("codeblock"===e){return void i(o,n,`\n\`\`\`\n${a||"code"}\n\`\`\`\n`,"select")}if("h1"===e||"h2"===e||"h3"===e||"p"===e){const t="h1"===e?"# ":"h2"===e?"## ":"h3"===e?"### ":"";return s(e=>{const o=e.replace(/^\s*(#{1,6}\s+)/,"");return t?t+o:o})}if("clear"===e){if(!a)return s(t=>t.replace(/^\s*(#{1,6}\s+)/,"").replace(/^\s*>\s?/,"").replace(/^\s*[-*+]\s+\[( |x|X)\]\s+/,"").replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/__(.*?)__/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/_(.*?)_/g,"$1").replace(/`(.*?)`/g,"$1").replace(/(.*?)<\/u>/g,"$1"));const t=a.replace(/\*\*(.*?)\*\*/g,"$1").replace(/__(.*?)__/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/_(.*?)_/g,"$1").replace(/`(.*?)`/g,"$1").replace(/(.*?)<\/u>/g,"$1");i(o,n,t)}};const D=function(){if(V(),window.requestAnimationFrame(k),bt(),$&&I)if(P)try{!function(t,e){document.body.classList.add("view-todo","view-notes");const o=document.querySelector(".content-toolbar");o&&(o.style.display="none");const n=document.createElement("div");n.className="notes-wrapper todo-wrapper";const d=document.createElement("div");d.className="notes-top-bar";const c=document.createElement("div");c.className="note-input-container todo-input-container";const u=()=>{c.classList.remove("is-editing","todo-draft-mode","is-enhanced"),O(c,{color:"default",filter:"none",background:"none",fontColor:"auto"}),c.innerHTML=`\n ${window.ShaarliProI18n.t("Archived notes")}
\n `,r.appendChild(a);const i=document.createElement("div");i.className="notes-tools",i.innerHTML='\n \n \n ',r.appendChild(i),n.appendChild(r);const l=document.createElement("div");l.className="notes-content-area";const s=Array.from(t.querySelectorAll(".link-outer")),d=s.map(t=>ct(t)).filter(t=>(t.tags||[]).some(t=>"shaarli-archive"===t||"shaarli-archiver"===t));ut(l,d,"grid",!0),n.appendChild(l),t.style.display="none",t.parentNode?t.parentNode.insertBefore(n,t):e.appendChild(n);const c=document.createElement("div");c.className="note-modal-overlay",c.innerHTML='\n \n ',document.body.appendChild(c);const p=n.querySelector("#btn-view-grid"),f=n.querySelector("#btn-view-list");p.addEventListener("click",()=>{p.classList.add("active"),f.classList.remove("active"),ut(l,d,"grid",!0)}),f.addEventListener("click",()=>{f.classList.add("active"),p.classList.remove("active"),ut(l,d,"list",!0)}),c.querySelector("#note-modal-close").addEventListener("click",()=>{c.classList.remove("open")}),c.addEventListener("click",t=>{t.target===c&&c.classList.remove("open")});const h=c.querySelector("#note-modal-pin"),g=c.querySelector("#note-modal-color-btn"),b=c.querySelector("#note-modal-color-popup");g.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const e=c.querySelector(".note-modal");j({anchorEl:g,mode:"modal",entityId:e&&e.dataset.noteId||"",editUrl:e&&e.dataset.editUrl||"",currentColor:e?_(e):"default",currentFilter:e?U(e):"none",currentBackground:e?A(e):"none",currentFontColor:e?T(e):"auto",title:window.ShaarliProI18n.t("My images & colors")})}),h.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const e=c.querySelector(".note-modal"),o=e.dataset.noteId,n=e.dataset.editUrl;if(!o||!n)return;yt(o,n,h);const r=h.classList.contains("active");let a=(e.dataset.tags||"").split("||").filter(t=>t);r?a.includes("shaarli-pin")||a.push("shaarli-pin"):a=a.filter(t=>"shaarli-pin"!==t),e.dataset.tags=a.join("||"),pt(c.querySelector("#note-modal-tags"),a),c.currentNote&&(c.currentNote.isPinned=r,c.currentNote.tags=a)}),c.querySelector("#note-modal-delete").addEventListener("click",()=>{if(!confirm(window.ShaarliProI18n.t("Delete this note?")))return;const t=c.querySelector(".note-modal"),e=t.dataset.deleteUrl;t.dataset.noteId;e&&"#"!==e&&m(e).then(()=>{window.location.href="/?searchtags=shaarli-archive"}).catch(t=>{console.error("Delete failed:",t),alert(window.ShaarliProI18n.t("Error deleting."))})}),c.querySelector("#note-modal-unarchive").addEventListener("click",t=>{t.preventDefault();const e=c.querySelector(".note-modal"),o=e.dataset.noteId,n=e.dataset.editUrl;o&&n&&u(n,"shaarli-archive").then(()=>{c.currentNote&&(c.currentNote.tags=(c.currentNote.tags||[]).filter(t=>"shaarli-archive"!==t));const t=document.querySelector(`.note-card[data-id="${o}"]`);t&&t.remove();const e=d.findIndex(t=>String(t.id)===String(o));e>-1&&d.splice(e,1),c.classList.remove("open")}).catch(t=>{console.error("Error unarchiving note:",t),alert(window.ShaarliProI18n.t("Error unarchiving note."))})}),c.addEventListener("click",t=>{t.target.closest(".note-modal-color-picker")||b.classList.remove("open")}),document.addEventListener("click",t=>{t.target.closest(".note-hover-actions .palette-popup")&&!t.target.closest('.note-hover-actions [id^="palette-"]')&&document.querySelectorAll(".note-hover-actions .palette-popup.open").forEach(t=>{t.classList.remove("open")})})}($,I),f()}catch(t){console.error("[custom_views] Erreur lors de l'initialisation de la vue Archive:",t),x()}else f()};!function(){if(N)return;const t=document.documentElement;if(!t)return;let e=C();new MutationObserver(t=>{if(!t.some(t=>"data-theme"===t.attributeName))return;const o=C();o!==e&&(e=o,document.querySelectorAll(".note-card, .note-modal, .link-outer, .note-input-container").forEach(t=>{O(t,{color:_(t),filter:U(t),background:A(t),fontColor:T(t)})}),function(){document.querySelectorAll(".note-card").forEach(t=>{const e=t.querySelector(".note-hover-actions .palette-popup");if(!e)return;const o=t.dataset.id||"";if(!o)return;const n=t.querySelector('.note-hover-actions a[href*="/admin/shaare/"], .note-hover-actions a[href*="do=editlink"], .note-hover-actions a[title="Edit"]');var r;e.innerHTML=G({entityId:(r={id:o,editUrl:n&&n.href?n.href:"#",color:_(t),background:A(t)})&&r.id?r.id:"",editUrl:r&&r.editUrl?r.editUrl:"",currentColor:r&&r.color?r.color:"default",currentFilter:r&&r.filter?r.filter:"none",mode:"entity"})}),document.querySelectorAll(".link-outer").forEach(t=>{const e=t.querySelector(".bookmark-palette .palette-popup");if(!e)return;const o=t.dataset.id||t.getAttribute("data-id")||t.id;if(!o)return;const n=t.querySelector(".link-actions"),r=n?n.querySelector(`a[title="${window.ShaarliProI18n.t("Edit")}"], a[href*="/admin/shaare/"]`):null;e.innerHTML=X(o,r&&r.href?r.href:"#",_(t),A(t))});const t=h(),e=g(t);if(!t||!e)return;const o=t.querySelector(".note-modal");o&&(e.color=_(o),e.background=A(o));const n=t.querySelector(".note-modal-palette");n&&(n.innerHTML=ht(e))}())}).observe(t,{attributes:!0,attributeFilter:["data-theme"]}),N=!0}(),L().then(()=>{D()}).catch(t=>{console.error("Erreur lors du chargement des backgrounds:",t),D()})});const o=[{key:"default",label:window.ShaarliProI18n.t("Default"),light:"#f8fafc",dark:"#20293A"},{key:"red",label:window.ShaarliProI18n.t("Red"),light:"#f28b82",dark:"#9c2116"},{key:"orange",label:window.ShaarliProI18n.t("Orange"),light:"#fbbc04",dark:"#9c7a16"},{key:"yellow",label:window.ShaarliProI18n.t("Yellow"),light:"#fff475",dark:"#9c9116"},{key:"green",label:window.ShaarliProI18n.t("Green"),light:"#ccff90",dark:"#5e9c16"},{key:"teal",label:window.ShaarliProI18n.t("Mint"),light:"#a7ffeb",dark:"#169c7d"},{key:"blue",label:window.ShaarliProI18n.t("Light blue"),light:"#cbf0f8",dark:"#16849c"},{key:"darkblue",label:window.ShaarliProI18n.t("Blue"),light:"#aecbfa",dark:"#16499c"},{key:"purple",label:window.ShaarliProI18n.t("Purple"),light:"#d7aefb",dark:"#5d169c"},{key:"pink",label:window.ShaarliProI18n.t("Pink"),light:"#fdcfe8",dark:"#9c165f"},{key:"brown",label:window.ShaarliProI18n.t("Beige"),light:"#e6c9a8",dark:"#9c5d16"},{key:"grey",label:window.ShaarliProI18n.t("Gray"),light:"#e8eaed",dark:"#4e5764"},{key:"custom",label:window.ShaarliProI18n.t("Custom"),light:"#custom",dark:"#custom"}],n=[{key:"none",label:window.ShaarliProI18n.t("None"),icon:"mdi-close-circle-outline"},{key:"glass",label:window.ShaarliProI18n.t("Glass"),icon:"mdi-blur"},{key:"vignette",label:window.ShaarliProI18n.t("Vignette"),icon:"mdi-vignette"},{key:"lined",label:window.ShaarliProI18n.t("Lined"),icon:"mdi-format-align-justify"},{key:"grid",label:window.ShaarliProI18n.t("Grid"),icon:"mdi-grid"},{key:"noise",label:window.ShaarliProI18n.t("Noise"),icon:"mdi-grain"},{key:"dots",label:window.ShaarliProI18n.t("Dots"),icon:"mdi-dots-grid"},{key:"stripes",label:window.ShaarliProI18n.t("Stripes"),icon:"mdi-slash-forward"}],r=[{key:"auto",label:window.ShaarliProI18n.t("Auto"),value:"auto"},{key:"light",label:window.ShaarliProI18n.t("Light"),value:"#f5f7fb"},{key:"dark",label:window.ShaarliProI18n.t("Dark"),value:"#202124"},{key:"white",label:window.ShaarliProI18n.t("White"),value:"#ffffff"},{key:"black",label:window.ShaarliProI18n.t("Black"),value:"#000000"},{key:"custom",label:window.ShaarliProI18n.t("Custom"),value:"custom"}],a="font-",i="note-color-",l="notefilter-",s="notebg-";function d(t){if("string"!=typeof t)return!1;const e=t.trim().toLowerCase();if(!e)return!1;if("note"===e||"#note"===e)return!0;if("shaarli-note"===e)return!0;if("todo"===e||"#todo"===e)return!0;if("shaarli-todo"===e)return!0;if("shaarli-pin"===e)return!0;if("brain-dump"===e)return!0;if(e.startsWith(a))return!0;if(e.startsWith(i))return!0;if(e.startsWith(l))return!0;if(e.startsWith(s))return!0;if(e.startsWith("notefilter-"))return!0;if(e.startsWith("notebg-"))return!0;if(e.startsWith("note-color-"))return!0;if(e.startsWith("note-")){const t=e.substring(5);if(o.some(e=>e.key===t))return!0}return!1}function c({tag:t,onRemoveClass:e="tag-remove-btn",tagClass:o="tag-pill"}){const n=document.createElement("span");n.className=o,n.dataset.tag=t;const r=document.createElement("span");r.className=`${o}-text`,r.textContent=t,n.appendChild(r);if(!(!arguments[0]||!Object.prototype.hasOwnProperty.call(arguments[0],"canRemove")||!!arguments[0].canRemove))return n;const a=document.createElement("button");return a.type="button",a.className=e,a.dataset.tag=t,a.setAttribute("aria-label",`Supprimer le tag ${t}`),a.title=window.ShaarliProI18n.t("Delete"),a.innerHTML="×",n.appendChild(a),n}function u(t,e){return fetch(t).then(t=>t.text()).then(t=>{const o=(new DOMParser).parseFromString(t,"text/html").querySelector('form[name="linkform"]');if(!o)throw new Error("Could not find edit form");const n=new URLSearchParams;o.querySelectorAll("input, textarea").forEach(t=>{"checkbox"===t.type?t.checked&&n.append(t.name,t.value||"on"):t.name&&n.append(t.name,Y(t))});let r=(n.get("lf_tags")||"").split(/[\s,]+/).filter(t=>""!==t.trim());return r=r.filter(t=>t!==e),n.set("lf_tags",r.join(" ")),n.append("save_edit","1"),fetch(o.action,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()})}).then(t=>{if(!t.ok)throw new Error("Failed to update tags");return t})}function m(t){return t&&"#"!==t?fetch(t).then(t=>{if(!t.ok)throw new Error("Delete request failed");return t}):Promise.reject("Invalid delete URL")}let p=!1;function f(){p||(document.querySelectorAll(".link-tag-list .link-tag").forEach(t=>{const e=(t.dataset.tag||t.textContent||"").trim();e&&("shaarli-pin"!==e?d(e)&&t.classList.add("is-tech-tag"):t.classList.add("is-tech-tag"))}),document.addEventListener("click",function(t){const e=t.target.closest(".tag-remove-btn, .note-tag-remove-btn");if(!e)return;t.preventDefault(),t.stopPropagation();const o=(e.dataset.tag||"").trim();if(!o)return;const n=e.closest(".link-tag, .note-tag"),r=e.closest(".link-outer, .note-card, .note-modal");let a="";if(r&&r.classList.contains("note-card"))a=r.dataset.editUrl||"";else if(r&&r.classList.contains("note-modal"))a=r.dataset.editUrl||"";else{const t=r?r.querySelector(".link-actions"):null,e=t?t.querySelector('a[href*="admin/shaare"]'):null;a=e?e.href:""}a&&u(a,o).then(()=>{if(n&&n.remove(),r&&r.classList.contains("note-card")){let t=(r.dataset.tags||"").split("||").filter(t=>t);t=t.filter(t=>t!==o),r.dataset.tags=t.join("||");const e=h(),n=g(e);if(e&&n&&String(n.id)===String(r.dataset.id)){n.tags=(n.tags||[]).filter(t=>t!==o);pt(e.querySelector(".note-modal-tags"),n.tags)}}if(r&&r.classList.contains("note-modal")){let t=(r.dataset.tags||"").split("||").filter(t=>t);t=t.filter(t=>t!==o),r.dataset.tags=t.join("||");const e=h(),n=g(e);if(e&&n){n.tags=(n.tags||[]).filter(t=>t!==o);pt(e.querySelector(".note-modal-tags"),n.tags)}const a=r.dataset.noteId||r.dataset.todoId||(n&&n.id?String(n.id):""),i=a?document.querySelector(`.note-card[data-id="${a}"]`):null;if(i){const t=i.querySelector(`.note-tag[data-tag="${CSS.escape(o)}"]`);t&&t.remove();let e=(i.dataset.tags||"").split("||").filter(t=>t);e=e.filter(t=>t!==o),i.dataset.tags=e.join("||")}}}).catch(t=>{console.error("Error removing tag:",t),alert(window.ShaarliProI18n.t("Error removing tag."))})}),p=!0)}function h(){return document.querySelector(".note-modal-overlay.open")}function g(t){return t&&(t.currentTodo||t.currentNote)||null}const b=`${function(){const t=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).find(t=>t.href&&(t.href.includes("/custom_views.css")||t.href.includes("/custom_views.min.css")));if(t&&t.href){const e=new URL(t.href,window.location.origin).pathname.replace(/\/(css|dist)\/custom_views(\.min)?\.css$/,"");if(e)return e}const e=Array.from(document.querySelectorAll("script[src]")).find(t=>t.src&&(t.src.includes("/custom_views.js")||t.src.includes("/custom_views.min.js")));if(e&&e.src){const t=new URL(e.src,window.location.origin).pathname.replace(/\/(js|dist)\/custom_views(\.min)?\.js$/,"");if(t)return t}return window.shaarli&&"string"==typeof window.shaarli.assetPath&&""!==window.shaarli.assetPath.trim()?window.shaarli.assetPath.replace(/\/$/,""):"/tpl/shaarli-pro"}().replace(/\/$/,"")}/img`;let y=[],v=!1,w=null;function k(){const t=document.getElementById("links-list");if(!t)return;const e=t.querySelector(".pinned-section-head"),o=t.querySelector(".normal-section-head"),n=t.querySelector(".compact-table-head");if(!e||!o||!n)return;const r=Array.from(t.getElementsByClassName("link-outer"));if(!r.length)return;const a=t=>{if(t.classList.contains("is-sticky")||t.classList.contains("is-pinned-tag"))return!0;const e=t.querySelectorAll(".link-tag-list a, .link-tag-list .link-tag-link, .note-tag");for(const t of e){if("shaarli-pin"===(t.textContent||"").trim().toLowerCase())return!0}return!1},i=r.filter(t=>a(t)),l=r.filter(t=>!a(t));t.classList.toggle("has-pinned",i.length>0),t.classList.toggle("has-normal",l.length>0);const s=document.createDocumentFragment();s.appendChild(e),i.forEach(t=>s.appendChild(t)),s.appendChild(o),s.appendChild(n),l.forEach(t=>s.appendChild(t)),t.replaceChildren(s)}window.__shaarliCustomViewsVersion="1.0.5-inline-bg-manifest","undefined"!=typeof console&&console&&console.info,document.addEventListener("DOMContentLoaded",function(){const t=document.getElementById("links-list");if(!t)return;k(),["view-grid-btn","view-list-btn","view-compact-btn"].forEach(t=>{const e=document.getElementById(t);e&&e.addEventListener("click",()=>{window.requestAnimationFrame(k)})}),t.addEventListener("click",t=>{t.target.closest('a[href*="/pin?token="]')&&window.setTimeout(()=>{window.location.reload()},500)})});const S=[{key:"cafe",label:window.ShaarliProI18n.t("Coffee"),files:{light:"bg-light-cafe.jpg",dark:"bg-dark-cafe.jpg"}},{key:"codes",label:"Codes",files:{light:"bg-light-codes.jpg",dark:"bg-dark-codes.jpg"}},{key:"dune",label:"Dune",files:{light:"bg-light-dune.jpg",dark:"bg-dark-dune.jpg"}},{key:"feuille-ligne",label:"Feuille Ligne",files:{light:"bg-light-feuilleLigne.jpg",dark:"bg-dark-feuilleLigne.jpg"}},{key:"feuille-quadrillage",label:"Feuille Quadrillage",files:{light:"bg-light-feuilleQuadrille.jpg",dark:"bg-dark-feuilleQuadrille.jpg"}},{key:"fleurs",label:"Fleurs",files:{light:"bg-light-fleurs.jpg",dark:"bg-dark-fleurs.jpg"}},{key:"foret",label:window.ShaarliProI18n.t("Forest"),files:{light:"bg-light-foret.jpg",dark:"bg-dark-foret.jpg"}},{key:"grid",label:"Grid",files:{light:"bg-light-grid.jpg",dark:"bg-dark-grid.jpg"}},{key:"journal",label:"Journal",files:{light:"bg-light-journal.jpg",dark:"bg-dark-journal.jpg"}},{key:"lecture",label:"Lecture",files:{light:"bg-light-lecture.jpg",dark:"bg-dark-lecture.jpg"}},{key:"legumes",label:window.ShaarliProI18n.t("Vegetables"),files:{light:"bg-light-legumes.jpg",dark:"bg-dark-legumes.jpg"}},{key:"montagnes",label:"Montagnes",files:{light:"bg-light-montagnes.jpg",dark:"bg-dark-montagnes.jpg"}},{key:"ocean",label:window.ShaarliProI18n.t("Ocean"),files:{light:"bg-light-ocean.jpg",dark:"bg-dark-ocean.jpg"}},{key:"radio",label:"Radio",files:{light:"bg-light-radio.jpg",dark:"bg-dark-radio.jpg"}},{key:"sports",label:"Sports",files:{light:"bg-light-sports.jpg",dark:"bg-dark-sports.jpg"}},{key:"vague1",label:"Vague 1",files:{light:"bg-light-vague1.jpg",dark:"bg-dark-vague1.jpg"}},{key:"vague2",label:"Vague 2",files:{light:"bg-light-vague2.jpg",dark:"bg-dark-vague2.jpg"}},{key:"ville",label:"Ville",files:{light:"bg-light-ville.jpg",dark:"bg-dark-ville.jpg"}},{key:"voyage",label:"Voyage",files:{light:"bg-light-voyage.jpg",dark:"bg-dark-voyage.jpg"}}];function L(){return v?Promise.resolve(y):w||(y=function(t){const e=Array.isArray(t)?t:t&&Array.isArray(t.backgrounds)?t.backgrounds:[],o={};return e.forEach(t=>{if(!t||"object"!=typeof t)return;const e=E("string"==typeof t.key?t.key:t.label||"");if(!e)return;const n=t.files&&"object"==typeof t.files?t.files:{},r="string"==typeof n.light?n.light.trim():"",a="string"==typeof n.dark?n.dark.trim():"";(r||a)&&(o[e]||(o[e]={key:e,label:P(t.label||"",e),paths:{light:"",dark:""}}),r&&(o[e].paths.light=`note-bg-light/${r}`),a&&(o[e].paths.dark=`note-bg-dark/${a}`))}),Object.values(o).sort((t,e)=>t.label.localeCompare(e.label,"fr",{sensitivity:"base"}))}(S),v=!0,w=Promise.resolve(y),w)}function E(t){return"string"!=typeof t?"":t.trim().toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function P(t,e){return("string"==typeof t&&""!==t.trim()?t:e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\s+/g," ").trim().split(" ").filter(t=>""!==t).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function C(){return"dark"===document.documentElement.getAttribute("data-theme")?"dark":"light"}function q(t,e=C()){if(!t||"object"!=typeof t)return"";const o="dark"===e?"dark":"light",n="string"==typeof t[o]?t[o].trim():"",r="string"==typeof t.light?t.light.trim():"",a="string"==typeof t.dark?t.dark.trim():"";return n||r||a}function $(t,e=C()){const o=function(t){if("string"!=typeof t)return null;const e=t.trim(),o=/^#([0-9a-f]{3})$/i.exec(e);if(o)return{r:parseInt(o[1].charAt(0).repeat(2),16),g:parseInt(o[1].charAt(1).repeat(2),16),b:parseInt(o[1].charAt(2).repeat(2),16)};const n=/^#([0-9a-f]{6})$/i.exec(e);return n?{r:parseInt(n[1].slice(0,2),16),g:parseInt(n[1].slice(2,4),16),b:parseInt(n[1].slice(4,6),16)}:null}(t);if(!o)return"dark"===e?"#e8eaed":"#202124";return(.299*o.r+.587*o.g+.114*o.b)/255>.56?"#202124":"#f5f7fb"}function I(t=C()){const e="dark"===t?"dark":"light";return y.filter(t=>t.paths&&t.paths[e])}function x(t,e=C()){const o=E(t);if(!o)return"";const n=y.find(t=>t.key===o);if(!n||!n.paths)return"";const r="dark"===e?"dark":"light",a=n.paths[r]||"";return a?`${b}/${a}`:""}function _(t){if(!t)return"default";if("custom"===t.dataset.color&&t.dataset.customColor)return`custom:${t.dataset.customColor}`;const e=Array.from(t.classList).find(t=>t.startsWith("note-color-"));return e?e.replace("note-color-",""):t.dataset.color||"default"}function A(t){if(!t)return"none";return E(t.dataset.background||"")||"none"}function M(t){if("string"!=typeof t)return"none";const e=t.trim().toLowerCase();return n.some(t=>t.key===e)?e:"none"}function U(t){return t?M(t.dataset.filter||""):"none"}function T(t){return t&&t.dataset.fontColor||"auto"}let N=!1;function D(t){if(!t||!t.classList.contains("open"))return;t.classList.remove("open-down"),t.style.left="",t.style.right="";if(t.getBoundingClientRect().top<8){t.classList.add("open-down");t.getBoundingClientRect().bottom>window.innerHeight-8&&t.classList.remove("open-down")}let e=t.getBoundingClientRect();e.right>window.innerWidth-8&&(t.style.left="auto",t.style.right="0",e=t.getBoundingClientRect()),e.left<8&&(t.style.left="0",t.style.right="auto")}let F=!1;function H(){const t=document.getElementById("shaarli-bg-studio");t&&(t.classList.remove("open"),t.style.display="none",t.setAttribute("aria-hidden","true"),t.__anchorEl=null)}function j({anchorEl:t,mode:e,entityId:o,editUrl:n,currentColor:r,currentFilter:a,currentBackground:i,currentFontColor:l,title:s}){!function(){if(F)return;if(document.getElementById("shaarli-bg-studio"))return void(F=!0);const t=document.createElement("div");t.id="shaarli-bg-studio",t.className="bg-studio-panel",t.setAttribute("role","dialog"),t.setAttribute("aria-modal","false"),t.setAttribute("aria-hidden","true"),t.style.display="none",document.body.appendChild(t),t.addEventListener("click",t=>{const e=t.target.closest("button[data-bg-studio-action]");if(!e)return;const o=document.getElementById("shaarli-bg-studio");if(!o)return;const n=o.dataset.mode||"entity",r=o.dataset.entityId||"",a=o.dataset.editUrl||"",i=t=>{"function"==typeof o.__draftApply&&o.__draftApply(t)},l=e.dataset.bgStudioAction;if("close"!==l){if("set-color"===l){const t=e.dataset.colorKey||"default";return void("draft"===n?(o.dataset.color=t,i({color:t}),R(o)):"modal"===n?(setModalNoteColor(t),o.dataset.color=t,R(o)):(setNoteColor(r,t,a),o.dataset.color=t,R(o)))}if("set-background"===l){const t=e.dataset.bgKey||"none";return void("draft"===n?(o.dataset.background=t,i({background:t}),R(o)):"modal"===n?(setModalNoteBackground(t),o.dataset.background=t,R(o)):(setNoteBackground(r,t,a),o.dataset.background=t,R(o)))}if("set-filter"===l){const t=e.dataset.filter||"none",l=M(t||"")||"none";return void("draft"===n?(o.dataset.filter=l,i({filter:l}),R(o)):"modal"===n?(setModalNoteFilter(t),o.dataset.filter=l,R(o)):(setNoteFilter(r,t,a),o.dataset.filter=l,R(o)))}if("set-query"===l){o.dataset.query="",R(o);const t=o.querySelector(".bg-studio-search-input");return void(t&&t.focus())}if("set-defaults"!==l)if("reset-font-color"!==l)if("open-color-picker"!==l)if("open-font-color-picker"!==l){if("set-font-color"===l){const t=e.dataset.fontColorKey||"auto";return void("draft"===n?(o.dataset.fontColor=t,i({fontColor:t}),R(o)):"modal"===n?(qt(t),o.dataset.fontColor=t,R(o)):(Ct(r,t,a),o.dataset.fontColor=t,R(o)))}}else kt({mode:n,entityId:r,editUrl:a,type:"font"});else kt({mode:n,entityId:r,editUrl:a,type:"background"});else"draft"===n?(o.dataset.fontColor="auto",i({fontColor:"auto"}),R(o)):"modal"===n?(qt("auto"),o.dataset.fontColor="auto",R(o)):(Ct(r,"auto",a),o.dataset.fontColor="auto",R(o));else"draft"===n?(o.dataset.color="default",o.dataset.background="none",i({color:"default",background:"none"}),R(o)):"modal"===n?(setModalNoteColor("default"),o.dataset.color="default",o.dataset.background="none",R(o)):(setNoteColor(r,"default",a),o.dataset.color="default",o.dataset.background="none",R(o))}else H()}),t.addEventListener("keydown",e=>{const o=e.target&&e.target.closest?e.target.closest("button"):null;if(!o)return;if("Enter"===e.key||" "===e.key)return void((o.hasAttribute("data-bg-studio-action")||o.classList.contains("bg-studio-thumb")||o.classList.contains("bg-studio-swatch"))&&(e.preventDefault(),o.click()));const n=(t,e)=>{if(!t||0===t.length)return;const o=t[Math.max(0,Math.min(t.length-1,e))];o&&"function"==typeof o.focus&&o.focus()};if(o.classList.contains("bg-studio-thumb")){const r=Array.from(t.querySelectorAll(".bg-studio-gallery .bg-studio-thumb")),a=r.indexOf(o);if(-1===a)return;const i=2;return void("ArrowRight"===e.key?(e.preventDefault(),n(r,a+i)):"ArrowLeft"===e.key?(e.preventDefault(),n(r,a-i)):"ArrowDown"===e.key?(e.preventDefault(),n(r,a+1)):"ArrowUp"===e.key&&(e.preventDefault(),n(r,a-1)))}if(o.classList.contains("bg-studio-swatch")){const r=Array.from(t.querySelectorAll(".bg-studio-swatches .bg-studio-swatch")),a=r.indexOf(o);if(-1===a)return;return void("ArrowRight"===e.key?(e.preventDefault(),n(r,a+1)):"ArrowLeft"===e.key&&(e.preventDefault(),n(r,a-1)))}}),t.addEventListener("input",t=>{const e=t.target&&t.target.matches(".bg-studio-search-input")?t.target:null;if(!e)return;const o=document.getElementById("shaarli-bg-studio");o&&(o.dataset.query=e.value||"",window.clearTimeout(o.__searchTimer),o.__searchTimer=window.setTimeout(()=>{R(o)},150))}),F=!0}();const d=document.getElementById("shaarli-bg-studio");d&&(d.dataset.mode=e||"entity",d.dataset.entityId=o||"",d.dataset.editUrl=n||"",d.dataset.color=r||"default",d.dataset.filter=M(a||"")||"none",d.dataset.background=E(i||"")||"none",d.dataset.fontColor=l||d.dataset.fontColor||"auto",d.dataset.query=d.dataset.query||"",d.dataset.title=s||window.ShaarliProI18n.t("My images & colors"),d.__anchorEl=t||null,R(d),d.style.display="block",d.classList.add("open"),d.setAttribute("aria-hidden","false"),function(t,e){if(!t)return;const o=12,n=e&&e.getBoundingClientRect?e.getBoundingClientRect():null;t.style.left="",t.style.top="",t.style.right="",t.style.bottom="";const r=t.getBoundingClientRect(),a=n?n.top-r.height-10:o,i=n?n.left:o;let l=a;l${e}`),o}),e=e.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(t,e,o)=>{const a=r(o);return a?`${o(p.join("\n"))}`),u=!1,m="",p=[]}else u=!0,m=r[1]||"",p=[];return}if(u)return void p.push(t);if(!e)return f(),void l.push('');const i=t.match(/^\s*(#{1,6})\s+(.+)$/);if(i){f();const t=i[1].length;return void l.push(`${a(h[1])}`);const g=t.match(/^\s*[-*]\s+\[( |x|X)\]\s+(.+)$/);if(g){s&&(l.push(""),s=!1),d&&(l.push(""),d=!1),c||(l.push('
${a(t)}
`)}),u){const t=m?` data-lang="${n(m)}"`:"";l.push(`${o(p.join("\n"))}`)}return f(),l.join("")},window.applyKeepNoteFormatting=function(t,e){if(!t||!e)return;const o=t.selectionStart||0,n=t.selectionEnd||0,r=String(t.value||""),a=r.slice(o,n),i=(e,o,n,a="end")=>{const i=r.slice(0,e)+n+r.slice(o);if(t.value=i,t.focus({preventScroll:!0}),"select"===a)t.setSelectionRange(e,e+n.length);else{const o=e+n.length;t.setSelectionRange(o,o)}},l=(e,i)=>{const l=a||"",s=`${e}${l}${i}`,d=r.slice(0,o)+s+r.slice(n);t.value=d;const c=o+e.length,u=c+l.length;t.focus({preventScroll:!0}),t.setSelectionRange(c,u)},s=e=>{const{lineStart:a,lineEnd:i}=(()=>{const t=r.slice(0,o),e=r.slice(n),a=t.lastIndexOf("\n")+1,i=e.indexOf("\n");return{lineStart:a,lineEnd:-1===i?r.length:n+i}})(),l=r.slice(a,i).split(/\r?\n/).map(e).join("\n"),s=r.slice(0,a)+l+r.slice(i);t.value=s,t.focus({preventScroll:!0}),t.setSelectionRange(a,a+l.length)};if("bold"===e)return l("**","**");if("italic"===e)return l("*","*");if("underline"===e)return l("","");if("strike"===e)return l("~~","~~");if("code"===e)return l("`","`");if("link"===e){const e=`[${a||"Texte du lien"}](https://)`;i(o,n,e);const r=o+e.length-1;return void t.setSelectionRange(r,r)}if("image"===e){const e=``;i(o,n,e);const r=o+e.length-1;return void t.setSelectionRange(r,r)}if("quote"===e)return s(t=>t.startsWith("> ")?t:`> ${t}`);if("ul"===e)return s(t=>{const e=t.trim();return e?/^[-*+]\s+/.test(e)?t:`- ${e}`:"- "});if("ol"===e)return s((t,e)=>{const o=t.trim();return o?/^\d+\.\s+/.test(o)?t:`${e+1}. ${o}`:`${e+1}. `});if("todo"===e)return s(t=>{const e=t.trim();return e?/^[-*]\s+\[( |x|X)\]\s+/.test(e)?t:`- [ ] ${e}`:"- [ ] "});if("codeblock"===e){return void i(o,n,`\n\`\`\`\n${a||"code"}\n\`\`\`\n`,"select")}if("h1"===e||"h2"===e||"h3"===e||"p"===e){const t="h1"===e?"# ":"h2"===e?"## ":"h3"===e?"### ":"";return s(e=>{const o=e.replace(/^\s*(#{1,6}\s+)/,"");return t?t+o:o})}if("clear"===e){if(!a)return s(t=>t.replace(/^\s*(#{1,6}\s+)/,"").replace(/^\s*>\s?/,"").replace(/^\s*[-*+]\s+\[( |x|X)\]\s+/,"").replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/__(.*?)__/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/_(.*?)_/g,"$1").replace(/`(.*?)`/g,"$1").replace(/(.*?)<\/u>/g,"$1"));const t=a.replace(/\*\*(.*?)\*\*/g,"$1").replace(/__(.*?)__/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/_(.*?)_/g,"$1").replace(/`(.*?)`/g,"$1").replace(/(.*?)<\/u>/g,"$1");i(o,n,t)}};const D=function(){if(V(),window.requestAnimationFrame(k),bt(),q&&I)if(E)try{!function(t,e){document.body.classList.add("view-todo","view-notes");const o=document.querySelector(".content-toolbar");o&&(o.style.display="none");const n=document.createElement("div");n.className="notes-wrapper todo-wrapper";const d=document.createElement("div");d.className="notes-top-bar";const c=document.createElement("div");c.className="note-input-container todo-input-container";const u=()=>{c.classList.remove("is-editing","todo-draft-mode","is-enhanced"),O(c,{color:"default",filter:"none",background:"none",fontColor:"auto"}),c.innerHTML=`\n ${window.ShaarliProI18n.t("Archived notes")}
\n `,r.appendChild(a);const i=document.createElement("div");i.className="notes-tools",i.innerHTML=`\n \n \n `,r.appendChild(i),n.appendChild(r);const l=document.createElement("div");l.className="notes-content-area";const s=Array.from(t.querySelectorAll(".link-outer")),d=s.map(t=>ct(t)).filter(t=>(t.tags||[]).some(t=>"shaarli-archive"===t||"shaarli-archiver"===t));ut(l,d,"grid",!0),n.appendChild(l),t.style.display="none",t.parentNode?t.parentNode.insertBefore(n,t):e.appendChild(n);const c=document.createElement("div");c.className="note-modal-overlay",c.innerHTML=`\n \n `,document.body.appendChild(c);const p=n.querySelector("#btn-view-grid"),f=n.querySelector("#btn-view-list");p.addEventListener("click",()=>{p.classList.add("active"),f.classList.remove("active"),ut(l,d,"grid",!0)}),f.addEventListener("click",()=>{f.classList.add("active"),p.classList.remove("active"),ut(l,d,"list",!0)}),c.querySelector("#note-modal-close").addEventListener("click",()=>{c.classList.remove("open")}),c.addEventListener("click",t=>{t.target===c&&c.classList.remove("open")});const h=c.querySelector("#note-modal-pin"),g=c.querySelector("#note-modal-color-btn"),b=c.querySelector("#note-modal-color-popup");g.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const e=c.querySelector(".note-modal");j({anchorEl:g,mode:"modal",entityId:e&&e.dataset.noteId||"",editUrl:e&&e.dataset.editUrl||"",currentColor:e?_(e):"default",currentFilter:e?U(e):"none",currentBackground:e?A(e):"none",currentFontColor:e?T(e):"auto",title:window.ShaarliProI18n.t("My images & colors")})}),h.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const e=c.querySelector(".note-modal"),o=e.dataset.noteId,n=e.dataset.editUrl;if(!o||!n)return;yt(o,n,h);const r=h.classList.contains("active");let a=(e.dataset.tags||"").split("||").filter(t=>t);r?a.includes("shaarli-pin")||a.push("shaarli-pin"):a=a.filter(t=>"shaarli-pin"!==t),e.dataset.tags=a.join("||"),pt(c.querySelector("#note-modal-tags"),a),c.currentNote&&(c.currentNote.isPinned=r,c.currentNote.tags=a)}),c.querySelector("#note-modal-delete").addEventListener("click",()=>{if(!confirm(window.ShaarliProI18n.t("Delete this note?")))return;const t=c.querySelector(".note-modal"),e=t.dataset.deleteUrl;t.dataset.noteId;e&&"#"!==e&&m(e).then(()=>{window.location.href="/?searchtags=shaarli-archive"}).catch(t=>{console.error("Delete failed:",t),alert(window.ShaarliProI18n.t("Error deleting."))})}),c.querySelector("#note-modal-unarchive").addEventListener("click",t=>{t.preventDefault();const e=c.querySelector(".note-modal"),o=e.dataset.noteId,n=e.dataset.editUrl;o&&n&&u(n,"shaarli-archive").then(()=>{c.currentNote&&(c.currentNote.tags=(c.currentNote.tags||[]).filter(t=>"shaarli-archive"!==t));const t=document.querySelector(`.note-card[data-id="${o}"]`);t&&t.remove();const e=d.findIndex(t=>String(t.id)===String(o));e>-1&&d.splice(e,1),c.classList.remove("open")}).catch(t=>{console.error("Error unarchiving note:",t),alert(window.ShaarliProI18n.t("Error unarchiving note."))})}),c.addEventListener("click",t=>{t.target.closest(".note-modal-color-picker")||b.classList.remove("open")}),document.addEventListener("click",t=>{t.target.closest(".note-hover-actions .palette-popup")&&!t.target.closest('.note-hover-actions [id^="palette-"]')&&document.querySelectorAll(".note-hover-actions .palette-popup.open").forEach(t=>{t.classList.remove("open")})})}(q,I),f()}catch(t){console.error("[custom_views] Erreur lors de l'initialisation de la vue Archive:",t),x()}else f()};!function(){if(N)return;const t=document.documentElement;if(!t)return;let e=P();new MutationObserver(t=>{if(!t.some(t=>"data-theme"===t.attributeName))return;const o=P();o!==e&&(e=o,document.querySelectorAll(".note-card, .note-modal, .link-outer, .note-input-container").forEach(t=>{O(t,{color:_(t),filter:U(t),background:A(t),fontColor:T(t)})}),function(){document.querySelectorAll(".note-card").forEach(t=>{const e=t.querySelector(".note-hover-actions .palette-popup");if(!e)return;const o=t.dataset.id||"";if(!o)return;const n=t.querySelector('.note-hover-actions a[href*="/admin/shaare/"], .note-hover-actions a[href*="do=editlink"], .note-hover-actions a[title="Edit"]');var r;e.innerHTML=G({entityId:(r={id:o,editUrl:n&&n.href?n.href:"#",color:_(t),background:A(t)})&&r.id?r.id:"",editUrl:r&&r.editUrl?r.editUrl:"",currentColor:r&&r.color?r.color:"default",currentFilter:r&&r.filter?r.filter:"none",mode:"entity"})}),document.querySelectorAll(".link-outer").forEach(t=>{const e=t.querySelector(".bookmark-palette .palette-popup");if(!e)return;const o=t.dataset.id||t.getAttribute("data-id")||t.id;if(!o)return;const n=t.querySelector(".link-actions"),r=n?n.querySelector(`a[title="${window.ShaarliProI18n.t("Edit")}"], a[href*="/admin/shaare/"]`):null;e.innerHTML=X(o,r&&r.href?r.href:"#",_(t),A(t))});const t=h(),e=g(t);if(!t||!e)return;const o=t.querySelector(".note-modal");o&&(e.color=_(o),e.background=A(o));const n=t.querySelector(".note-modal-palette");n&&(n.innerHTML=ht(e))}())}).observe(t,{attributes:!0,attributeFilter:["data-theme"]}),N=!0}(),$().then(()=>{D()}).catch(t=>{console.error("Erreur lors du chargement des backgrounds:",t),D()})});const o=[{key:"default",label:window.ShaarliProI18n.t("Default"),light:"#f8fafc",dark:"#20293A"},{key:"red",label:window.ShaarliProI18n.t("Red"),light:"#f28b82",dark:"#9c2116"},{key:"orange",label:window.ShaarliProI18n.t("Orange"),light:"#fbbc04",dark:"#9c7a16"},{key:"yellow",label:window.ShaarliProI18n.t("Yellow"),light:"#fff475",dark:"#9c9116"},{key:"green",label:window.ShaarliProI18n.t("Green"),light:"#ccff90",dark:"#5e9c16"},{key:"teal",label:window.ShaarliProI18n.t("Mint"),light:"#a7ffeb",dark:"#169c7d"},{key:"blue",label:window.ShaarliProI18n.t("Light blue"),light:"#cbf0f8",dark:"#16849c"},{key:"darkblue",label:window.ShaarliProI18n.t("Blue"),light:"#aecbfa",dark:"#16499c"},{key:"purple",label:window.ShaarliProI18n.t("Purple"),light:"#d7aefb",dark:"#5d169c"},{key:"pink",label:window.ShaarliProI18n.t("Pink"),light:"#fdcfe8",dark:"#9c165f"},{key:"brown",label:window.ShaarliProI18n.t("Beige"),light:"#e6c9a8",dark:"#9c5d16"},{key:"grey",label:window.ShaarliProI18n.t("Gray"),light:"#e8eaed",dark:"#4e5764"},{key:"custom",label:window.ShaarliProI18n.t("Custom"),light:"#custom",dark:"#custom"}],n=[{key:"none",label:window.ShaarliProI18n.t("None"),icon:"mdi-close-circle-outline"},{key:"glass",label:window.ShaarliProI18n.t("Glass"),icon:"mdi-blur"},{key:"vignette",label:window.ShaarliProI18n.t("Vignette"),icon:"mdi-vignette"},{key:"lined",label:window.ShaarliProI18n.t("Lined"),icon:"mdi-format-align-justify"},{key:"grid",label:window.ShaarliProI18n.t("Grid"),icon:"mdi-grid"},{key:"noise",label:window.ShaarliProI18n.t("Noise"),icon:"mdi-grain"},{key:"dots",label:window.ShaarliProI18n.t("Dots"),icon:"mdi-dots-grid"},{key:"stripes",label:window.ShaarliProI18n.t("Stripes"),icon:"mdi-slash-forward"}],r=[{key:"auto",label:window.ShaarliProI18n.t("Auto"),value:"auto"},{key:"light",label:window.ShaarliProI18n.t("Light"),value:"#f5f7fb"},{key:"dark",label:window.ShaarliProI18n.t("Dark"),value:"#202124"},{key:"white",label:window.ShaarliProI18n.t("White"),value:"#ffffff"},{key:"black",label:window.ShaarliProI18n.t("Black"),value:"#000000"},{key:"custom",label:window.ShaarliProI18n.t("Custom"),value:"custom"}],a="font-",i="note-color-",l="notefilter-",s="notebg-";function d(t){if("string"!=typeof t)return!1;const e=t.trim().toLowerCase();if(!e)return!1;if("note"===e||"#note"===e)return!0;if("shaarli-note"===e)return!0;if("todo"===e||"#todo"===e)return!0;if("shaarli-todo"===e)return!0;if("shaarli-pin"===e)return!0;if("brain-dump"===e)return!0;if(e.startsWith(a))return!0;if(e.startsWith(i))return!0;if(e.startsWith(l))return!0;if(e.startsWith(s))return!0;if(e.startsWith("notefilter-"))return!0;if(e.startsWith("notebg-"))return!0;if(e.startsWith("note-color-"))return!0;if(e.startsWith("note-")){const t=e.substring(5);if(o.some(e=>e.key===t))return!0}return!1}function c({tag:t,onRemoveClass:e="tag-remove-btn",tagClass:o="tag-pill"}){const n=document.createElement("span");n.className=o,n.dataset.tag=t;const r=document.createElement("span");r.className=`${o}-text`,r.textContent=t,n.appendChild(r);if(!(!arguments[0]||!Object.prototype.hasOwnProperty.call(arguments[0],"canRemove")||!!arguments[0].canRemove))return n;const a=document.createElement("button");return a.type="button",a.className=e,a.dataset.tag=t,a.setAttribute("aria-label",`Supprimer le tag ${t}`),a.title=window.ShaarliProI18n.t("Delete"),a.innerHTML="×",n.appendChild(a),n}function u(t,e){return fetch(t).then(t=>t.text()).then(t=>{const o=(new DOMParser).parseFromString(t,"text/html").querySelector('form[name="linkform"]');if(!o)throw new Error("Could not find edit form");const n=new URLSearchParams;o.querySelectorAll("input, textarea").forEach(t=>{"checkbox"===t.type?t.checked&&n.append(t.name,t.value||"on"):t.name&&n.append(t.name,Y(t))});let r=(n.get("lf_tags")||"").split(/[\s,]+/).filter(t=>""!==t.trim());return r=r.filter(t=>t!==e),n.set("lf_tags",r.join(" ")),n.append("save_edit","1"),fetch(o.action,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()})}).then(t=>{if(!t.ok)throw new Error("Failed to update tags");return t})}function m(t){return t&&"#"!==t?fetch(t).then(t=>{if(!t.ok)throw new Error("Delete request failed");return t}):Promise.reject("Invalid delete URL")}let p=!1;function f(){p||(document.querySelectorAll(".link-tag-list .link-tag").forEach(t=>{const e=(t.dataset.tag||t.textContent||"").trim();e&&("shaarli-pin"!==e?d(e)&&t.classList.add("is-tech-tag"):t.classList.add("is-tech-tag"))}),document.addEventListener("click",function(t){const e=t.target.closest(".tag-remove-btn, .note-tag-remove-btn");if(!e)return;t.preventDefault(),t.stopPropagation();const o=(e.dataset.tag||"").trim();if(!o)return;const n=e.closest(".link-tag, .note-tag"),r=e.closest(".link-outer, .note-card, .note-modal");let a="";if(r&&r.classList.contains("note-card"))a=r.dataset.editUrl||"";else if(r&&r.classList.contains("note-modal"))a=r.dataset.editUrl||"";else{const t=r?r.querySelector(".link-actions"):null,e=t?t.querySelector('a[href*="admin/shaare"]'):null;a=e?e.href:""}a&&u(a,o).then(()=>{if(n&&n.remove(),r&&r.classList.contains("note-card")){let t=(r.dataset.tags||"").split("||").filter(t=>t);t=t.filter(t=>t!==o),r.dataset.tags=t.join("||");const e=h(),n=g(e);if(e&&n&&String(n.id)===String(r.dataset.id)){n.tags=(n.tags||[]).filter(t=>t!==o);pt(e.querySelector(".note-modal-tags"),n.tags)}}if(r&&r.classList.contains("note-modal")){let t=(r.dataset.tags||"").split("||").filter(t=>t);t=t.filter(t=>t!==o),r.dataset.tags=t.join("||");const e=h(),n=g(e);if(e&&n){n.tags=(n.tags||[]).filter(t=>t!==o);pt(e.querySelector(".note-modal-tags"),n.tags)}const a=r.dataset.noteId||r.dataset.todoId||(n&&n.id?String(n.id):""),i=a?document.querySelector(`.note-card[data-id="${a}"]`):null;if(i){const t=i.querySelector(`.note-tag[data-tag="${CSS.escape(o)}"]`);t&&t.remove();let e=(i.dataset.tags||"").split("||").filter(t=>t);e=e.filter(t=>t!==o),i.dataset.tags=e.join("||")}}}).catch(t=>{console.error("Error removing tag:",t),alert(window.ShaarliProI18n.t("Error removing tag."))})}),p=!0)}function h(){return document.querySelector(".note-modal-overlay.open")}function g(t){return t&&(t.currentTodo||t.currentNote)||null}const b=`${function(){const t=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).find(t=>t.href&&(t.href.includes("/custom_views.css")||t.href.includes("/custom_views.min.css")));if(t&&t.href){const e=new URL(t.href,window.location.origin).pathname.replace(/\/(css|dist)\/custom_views(\.min)?\.css$/,"");if(e)return e}const e=Array.from(document.querySelectorAll("script[src]")).find(t=>t.src&&(t.src.includes("/custom_views.js")||t.src.includes("/custom_views.min.js")));if(e&&e.src){const t=new URL(e.src,window.location.origin).pathname.replace(/\/(js|dist)\/custom_views(\.min)?\.js$/,"");if(t)return t}return window.shaarli&&"string"==typeof window.shaarli.assetPath&&""!==window.shaarli.assetPath.trim()?window.shaarli.assetPath.replace(/\/$/,""):"/tpl/shaarli-pro"}().replace(/\/$/,"")}/img`;let y=[],v=!1,w=null;function k(){const t=document.getElementById("links-list");if(!t)return;const e=t.querySelector(".pinned-section-head"),o=t.querySelector(".normal-section-head"),n=t.querySelector(".compact-table-head");if(!e||!o||!n)return;const r=Array.from(t.getElementsByClassName("link-outer"));if(!r.length)return;const a=t=>{if(t.classList.contains("is-sticky")||t.classList.contains("is-pinned-tag"))return!0;const e=t.querySelectorAll(".link-tag-list a, .link-tag-list .link-tag-link, .note-tag");for(const t of e){if("shaarli-pin"===(t.textContent||"").trim().toLowerCase())return!0}return!1},i=r.filter(t=>a(t)),l=r.filter(t=>!a(t));t.classList.toggle("has-pinned",i.length>0),t.classList.toggle("has-normal",l.length>0);const s=document.createDocumentFragment();s.appendChild(e),i.forEach(t=>s.appendChild(t)),s.appendChild(o),s.appendChild(n),l.forEach(t=>s.appendChild(t)),t.replaceChildren(s)}window.__shaarliCustomViewsVersion="1.0.5-inline-bg-manifest","undefined"!=typeof console&&console&&console.info,document.addEventListener("DOMContentLoaded",function(){const t=document.getElementById("links-list");if(!t)return;k(),["view-grid-btn","view-list-btn","view-compact-btn"].forEach(t=>{const e=document.getElementById(t);e&&e.addEventListener("click",()=>{window.requestAnimationFrame(k)})}),t.addEventListener("click",t=>{t.target.closest('a[href*="/pin?token="]')&&window.setTimeout(()=>{window.location.reload()},500)})});const S=[{key:"cafe",label:window.ShaarliProI18n.t("Coffee"),files:{light:"bg-light-cafe.jpg",dark:"bg-dark-cafe.jpg"}},{key:"codes",label:"Codes",files:{light:"bg-light-codes.jpg",dark:"bg-dark-codes.jpg"}},{key:"dune",label:"Dune",files:{light:"bg-light-dune.jpg",dark:"bg-dark-dune.jpg"}},{key:"feuille-ligne",label:"Feuille Ligne",files:{light:"bg-light-feuilleLigne.jpg",dark:"bg-dark-feuilleLigne.jpg"}},{key:"feuille-quadrillage",label:"Feuille Quadrillage",files:{light:"bg-light-feuilleQuadrille.jpg",dark:"bg-dark-feuilleQuadrille.jpg"}},{key:"fleurs",label:"Fleurs",files:{light:"bg-light-fleurs.jpg",dark:"bg-dark-fleurs.jpg"}},{key:"foret",label:window.ShaarliProI18n.t("Forest"),files:{light:"bg-light-foret.jpg",dark:"bg-dark-foret.jpg"}},{key:"grid",label:"Grid",files:{light:"bg-light-grid.jpg",dark:"bg-dark-grid.jpg"}},{key:"journal",label:"Journal",files:{light:"bg-light-journal.jpg",dark:"bg-dark-journal.jpg"}},{key:"lecture",label:"Lecture",files:{light:"bg-light-lecture.jpg",dark:"bg-dark-lecture.jpg"}},{key:"legumes",label:window.ShaarliProI18n.t("Vegetables"),files:{light:"bg-light-legumes.jpg",dark:"bg-dark-legumes.jpg"}},{key:"montagnes",label:"Montagnes",files:{light:"bg-light-montagnes.jpg",dark:"bg-dark-montagnes.jpg"}},{key:"ocean",label:window.ShaarliProI18n.t("Ocean"),files:{light:"bg-light-ocean.jpg",dark:"bg-dark-ocean.jpg"}},{key:"radio",label:"Radio",files:{light:"bg-light-radio.jpg",dark:"bg-dark-radio.jpg"}},{key:"sports",label:"Sports",files:{light:"bg-light-sports.jpg",dark:"bg-dark-sports.jpg"}},{key:"vague1",label:"Vague 1",files:{light:"bg-light-vague1.jpg",dark:"bg-dark-vague1.jpg"}},{key:"vague2",label:"Vague 2",files:{light:"bg-light-vague2.jpg",dark:"bg-dark-vague2.jpg"}},{key:"ville",label:"Ville",files:{light:"bg-light-ville.jpg",dark:"bg-dark-ville.jpg"}},{key:"voyage",label:"Voyage",files:{light:"bg-light-voyage.jpg",dark:"bg-dark-voyage.jpg"}}];function $(){return v?Promise.resolve(y):w||(y=function(t){const e=Array.isArray(t)?t:t&&Array.isArray(t.backgrounds)?t.backgrounds:[],o={};return e.forEach(t=>{if(!t||"object"!=typeof t)return;const e=L("string"==typeof t.key?t.key:t.label||"");if(!e)return;const n=t.files&&"object"==typeof t.files?t.files:{},r="string"==typeof n.light?n.light.trim():"",a="string"==typeof n.dark?n.dark.trim():"";(r||a)&&(o[e]||(o[e]={key:e,label:E(t.label||"",e),paths:{light:"",dark:""}}),r&&(o[e].paths.light=`note-bg-light/${r}`),a&&(o[e].paths.dark=`note-bg-dark/${a}`))}),Object.values(o).sort((t,e)=>t.label.localeCompare(e.label,"fr",{sensitivity:"base"}))}(S),v=!0,w=Promise.resolve(y),w)}function L(t){return"string"!=typeof t?"":t.trim().toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function E(t,e){return("string"==typeof t&&""!==t.trim()?t:e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\s+/g," ").trim().split(" ").filter(t=>""!==t).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function P(){return"dark"===document.documentElement.getAttribute("data-theme")?"dark":"light"}function C(t,e=P()){if(!t||"object"!=typeof t)return"";const o="dark"===e?"dark":"light",n="string"==typeof t[o]?t[o].trim():"",r="string"==typeof t.light?t.light.trim():"",a="string"==typeof t.dark?t.dark.trim():"";return n||r||a}function q(t,e=P()){const o=function(t){if("string"!=typeof t)return null;const e=t.trim(),o=/^#([0-9a-f]{3})$/i.exec(e);if(o)return{r:parseInt(o[1].charAt(0).repeat(2),16),g:parseInt(o[1].charAt(1).repeat(2),16),b:parseInt(o[1].charAt(2).repeat(2),16)};const n=/^#([0-9a-f]{6})$/i.exec(e);return n?{r:parseInt(n[1].slice(0,2),16),g:parseInt(n[1].slice(2,4),16),b:parseInt(n[1].slice(4,6),16)}:null}(t);if(!o)return"dark"===e?"#e8eaed":"#202124";return(.299*o.r+.587*o.g+.114*o.b)/255>.56?"#202124":"#f5f7fb"}function I(t=P()){const e="dark"===t?"dark":"light";return y.filter(t=>t.paths&&t.paths[e])}function x(t,e=P()){const o=L(t);if(!o)return"";const n=y.find(t=>t.key===o);if(!n||!n.paths)return"";const r="dark"===e?"dark":"light",a=n.paths[r]||"";return a?`${b}/${a}`:""}function _(t){if(!t)return"default";if("custom"===t.dataset.color&&t.dataset.customColor)return`custom:${t.dataset.customColor}`;const e=Array.from(t.classList).find(t=>t.startsWith("note-color-"));return e?e.replace("note-color-",""):t.dataset.color||"default"}function A(t){if(!t)return"none";return L(t.dataset.background||"")||"none"}function M(t){if("string"!=typeof t)return"none";const e=t.trim().toLowerCase();return n.some(t=>t.key===e)?e:"none"}function U(t){return t?M(t.dataset.filter||""):"none"}function T(t){return t&&t.dataset.fontColor||"auto"}let N=!1;function D(t){if(!t||!t.classList.contains("open"))return;t.classList.remove("open-down"),t.style.left="",t.style.right="";if(t.getBoundingClientRect().top<8){t.classList.add("open-down");t.getBoundingClientRect().bottom>window.innerHeight-8&&t.classList.remove("open-down")}let e=t.getBoundingClientRect();e.right>window.innerWidth-8&&(t.style.left="auto",t.style.right="0",e=t.getBoundingClientRect()),e.left<8&&(t.style.left="0",t.style.right="auto")}let F=!1;function H(){const t=document.getElementById("shaarli-bg-studio");t&&(t.classList.remove("open"),t.style.display="none",t.setAttribute("aria-hidden","true"),t.__anchorEl=null)}function j({anchorEl:t,mode:e,entityId:o,editUrl:n,currentColor:r,currentFilter:a,currentBackground:i,currentFontColor:l,title:s}){!function(){if(F)return;if(document.getElementById("shaarli-bg-studio"))return void(F=!0);const t=document.createElement("div");t.id="shaarli-bg-studio",t.className="bg-studio-panel",t.setAttribute("role","dialog"),t.setAttribute("aria-modal","false"),t.setAttribute("aria-hidden","true"),t.style.display="none",document.body.appendChild(t),t.addEventListener("click",t=>{const e=t.target.closest("button[data-bg-studio-action]");if(!e)return;const o=document.getElementById("shaarli-bg-studio");if(!o)return;const n=o.dataset.mode||"entity",r=o.dataset.entityId||"",a=o.dataset.editUrl||"",i=t=>{"function"==typeof o.__draftApply&&o.__draftApply(t)},l=e.dataset.bgStudioAction;if("close"!==l){if("set-color"===l){const t=e.dataset.colorKey||"default";return void("draft"===n?(o.dataset.color=t,i({color:t}),R(o)):"modal"===n?(setModalNoteColor(t),o.dataset.color=t,R(o)):(setNoteColor(r,t,a),o.dataset.color=t,R(o)))}if("set-background"===l){const t=e.dataset.bgKey||"none";return void("draft"===n?(o.dataset.background=t,i({background:t}),R(o)):"modal"===n?(setModalNoteBackground(t),o.dataset.background=t,R(o)):(setNoteBackground(r,t,a),o.dataset.background=t,R(o)))}if("set-filter"===l){const t=e.dataset.filter||"none",l=M(t||"")||"none";return void("draft"===n?(o.dataset.filter=l,i({filter:l}),R(o)):"modal"===n?(setModalNoteFilter(t),o.dataset.filter=l,R(o)):(setNoteFilter(r,t,a),o.dataset.filter=l,R(o)))}if("set-query"===l){o.dataset.query="",R(o);const t=o.querySelector(".bg-studio-search-input");return void(t&&t.focus())}if("set-defaults"!==l)if("reset-font-color"!==l)if("open-color-picker"!==l)if("open-font-color-picker"!==l){if("set-font-color"===l){const t=e.dataset.fontColorKey||"auto";return void("draft"===n?(o.dataset.fontColor=t,i({fontColor:t}),R(o)):"modal"===n?(Ct(t),o.dataset.fontColor=t,R(o)):(Pt(r,t,a),o.dataset.fontColor=t,R(o)))}}else kt({mode:n,entityId:r,editUrl:a,type:"font"});else kt({mode:n,entityId:r,editUrl:a,type:"background"});else"draft"===n?(o.dataset.fontColor="auto",i({fontColor:"auto"}),R(o)):"modal"===n?(Ct("auto"),o.dataset.fontColor="auto",R(o)):(Pt(r,"auto",a),o.dataset.fontColor="auto",R(o));else"draft"===n?(o.dataset.color="default",o.dataset.background="none",i({color:"default",background:"none"}),R(o)):"modal"===n?(setModalNoteColor("default"),o.dataset.color="default",o.dataset.background="none",R(o)):(setNoteColor(r,"default",a),o.dataset.color="default",o.dataset.background="none",R(o))}else H()}),t.addEventListener("keydown",e=>{const o=e.target&&e.target.closest?e.target.closest("button"):null;if(!o)return;if("Enter"===e.key||" "===e.key)return void((o.hasAttribute("data-bg-studio-action")||o.classList.contains("bg-studio-thumb")||o.classList.contains("bg-studio-swatch"))&&(e.preventDefault(),o.click()));const n=(t,e)=>{if(!t||0===t.length)return;const o=t[Math.max(0,Math.min(t.length-1,e))];o&&"function"==typeof o.focus&&o.focus()};if(o.classList.contains("bg-studio-thumb")){const r=Array.from(t.querySelectorAll(".bg-studio-gallery .bg-studio-thumb")),a=r.indexOf(o);if(-1===a)return;const i=2;return void("ArrowRight"===e.key?(e.preventDefault(),n(r,a+i)):"ArrowLeft"===e.key?(e.preventDefault(),n(r,a-i)):"ArrowDown"===e.key?(e.preventDefault(),n(r,a+1)):"ArrowUp"===e.key&&(e.preventDefault(),n(r,a-1)))}if(o.classList.contains("bg-studio-swatch")){const r=Array.from(t.querySelectorAll(".bg-studio-swatches .bg-studio-swatch")),a=r.indexOf(o);if(-1===a)return;return void("ArrowRight"===e.key?(e.preventDefault(),n(r,a+1)):"ArrowLeft"===e.key&&(e.preventDefault(),n(r,a-1)))}}),t.addEventListener("input",t=>{const e=t.target&&t.target.matches(".bg-studio-search-input")?t.target:null;if(!e)return;const o=document.getElementById("shaarli-bg-studio");o&&(o.dataset.query=e.value||"",window.clearTimeout(o.__searchTimer),o.__searchTimer=window.setTimeout(()=>{R(o)},150))}),F=!0}();const d=document.getElementById("shaarli-bg-studio");d&&(d.dataset.mode=e||"entity",d.dataset.entityId=o||"",d.dataset.editUrl=n||"",d.dataset.color=r||"default",d.dataset.filter=M(a||"")||"none",d.dataset.background=L(i||"")||"none",d.dataset.fontColor=l||d.dataset.fontColor||"auto",d.dataset.query=d.dataset.query||"",d.dataset.title=s||window.ShaarliProI18n.t("My images & colors"),d.__anchorEl=t||null,R(d),d.style.display="block",d.classList.add("open"),d.setAttribute("aria-hidden","false"),function(t,e){if(!t)return;const o=12,n=e&&e.getBoundingClientRect?e.getBoundingClientRect():null;t.style.left="",t.style.top="",t.style.right="",t.style.bottom="";const r=t.getBoundingClientRect(),a=n?n.top-r.height-10:o,i=n?n.left:o;let l=a;l