-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy paththeme.js
More file actions
1 lines (1 loc) · 70.9 KB
/
Copy paththeme.js
File metadata and controls
1 lines (1 loc) · 70.9 KB
1
(()=>{"use strict";var n={441(n,t,e){function i(n){var t=n.toString(16);return 1===t.length?"0"+t:t}function o(n){return"#"+n.map(i).join("")}function r(n){return n?(t=n,Array.isArray(t[0])?n:[n]):[];var t}function u(n,t,e){for(var i=0;i<e.length;i++)if(s(n,t,e[i]))return!0;return!1}function s(n,t,e){switch(e.length){case 3:if(function(n,t,e){if(255!==n[t+3])return!0;if(n[t]===e[0]&&n[t+1]===e[1]&&n[t+2]===e[2])return!0;return!1}(n,t,e))return!0;break;case 4:if(function(n,t,e){if(n[t+3]&&e[3])return n[t]===e[0]&&n[t+1]===e[1]&&n[t+2]===e[2]&&n[t+3]===e[3];return n[t+3]===e[3]}(n,t,e))return!0;break;case 5:if(function(n,t,e){var i=e[0],o=e[1],r=e[2],u=e[3],s=e[4],a=n[t+3],l=c(a,u,s);if(!u)return l;if(!a&&l)return!0;if(c(n[t],i,s)&&c(n[t+1],o,s)&&c(n[t+2],r,s)&&l)return!0;return!1}(n,t,e))return!0;break;default:return!1}}function c(n,t,e){return n>=t-e&&n<=t+e}e.d(t,{t:()=>y});function a(n,t,e){for(var i={},o=e.i||24,r=e.o,s=e.step,c=[0,0,0,0,0],a=0;a<t;a+=s){var l=n[a],d=n[a+1],f=n[a+2],m=n[a+3];if(!r||!u(n,a,r)){var h=Math.round(l/o)+","+Math.round(d/o)+","+Math.round(f/o);i[h]?i[h]=[i[h][0]+l*m,i[h][1]+d*m,i[h][2]+f*m,i[h][3]+m,i[h][4]+1]:i[h]=[l*m,d*m,f*m,m,1],c[4]<i[h][4]&&(c=i[h])}}var v=c[0],b=c[1],_=c[2],p=c[3],g=c[4];return p?[Math.round(v/p),Math.round(b/p),Math.round(_/p),Math.round(p/g)]:e.u}function l(n,t,e){for(var i=0,o=0,r=0,s=0,c=0,a=e.o,l=e.step,d=0;d<t;d+=l){var f=n[d+3],m=n[d]*f,h=n[d+1]*f,v=n[d+2]*f;a&&u(n,d,a)||(i+=m,o+=h,r+=v,s+=f,c++)}return s?[Math.round(i/s),Math.round(o/s),Math.round(r/s),Math.round(s/c)]:e.u}function d(n,t,e){for(var i=0,o=0,r=0,s=0,c=0,a=e.o,l=e.step,d=0;d<t;d+=l){var f=n[d],m=n[d+1],h=n[d+2],v=n[d+3];a&&u(n,d,a)||(i+=f*f*v,o+=m*m*v,r+=h*h*v,s+=v,c++)}return s?[Math.round(Math.sqrt(i/s)),Math.round(Math.sqrt(o/s)),Math.round(Math.sqrt(r/s)),Math.round(s/c)]:e.u}function f(n){return m(n,"defaultColor",[0,0,0,0])}function m(n,t,e){return void 0===n[t]?e:n[t]}function h(n){if(b(n)){var t=n.naturalWidth,e=n.naturalHeight;return n.naturalWidth||-1===n.src.search(/\.svg(\?|$)/i)||(t=e=100),{width:t,height:e}}return function(n){return"undefined"!=typeof HTMLVideoElement&&n instanceof HTMLVideoElement}(n)?{width:n.videoWidth,height:n.videoHeight}:p(n)?{width:n.codedWidth,height:n.codedHeight}:{width:n.width,height:n.height}}function v(n){return function(n){return"undefined"!=typeof HTMLCanvasElement&&n instanceof HTMLCanvasElement}(n)?"canvas":function(n){return _&&n instanceof OffscreenCanvas}(n)?"offscreencanvas":p(n)?"videoframe":function(n){return"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap}(n)?"imagebitmap":n.src}function b(n){return"undefined"!=typeof HTMLImageElement&&n instanceof HTMLImageElement}var _="undefined"!=typeof OffscreenCanvas;function p(n){return"undefined"!=typeof VideoFrame&&n instanceof VideoFrame}var g="undefined"==typeof window;function w(n){return Error("FastAverageColor: "+n)}var y=function(){function n(){this.canvas=null,this.l=null}return n.prototype.m=function(n,t){if(!n)return Promise.reject(w("call .getColorAsync() without resource"));if("string"==typeof n){if("undefined"==typeof Image)return Promise.reject(w("resource as string is not supported in this environment"));var e=new Image;return e.crossOrigin=t&&t.crossOrigin||"",e.src=n,this.h(e,t)}if(b(n)&&!n.complete)return this.h(n,t);var i=this.v(n,t);return i.error?Promise.reject(i.error):Promise.resolve(i)},n.prototype.v=function(n,t){var e=f(t=t||{});if(!n){var i=w("call .getColor() without resource");return t.silent,this._(e,i)}var o=function(n,t){var e,i=m(t,"left",0),o=m(t,"top",0),r=m(t,"width",n.width),u=m(t,"height",n.height),s=r,c=u;return"precision"===t.mode||(r>u?(e=r/u,s=100,c=Math.round(s/e)):(e=u/r,c=100,s=Math.round(c/e)),(s>r||c>u||s<10||c<10)&&(s=r,c=u)),{p:i,M:o,k:r,C:u,S:s,O:c}}(h(n),t);if(!(o.k&&o.C&&o.S&&o.O)){i=w('incorrect sizes for resource "'.concat(v(n),'"'));return t.silent,this._(e,i)}if(!this.canvas&&(this.canvas=g?_?new OffscreenCanvas(1,1):null:document.createElement("canvas"),!this.canvas)){i=w("OffscreenCanvas is not supported in this browser");return t.silent,this._(e,i)}if(!this.l){if(this.l=this.canvas.getContext("2d",{willReadFrequently:!0}),!this.l){i=w("Canvas Context 2D is not supported in this browser");return t.silent,this._(e)}this.l.imageSmoothingEnabled=!1}this.canvas.width=o.S,this.canvas.height=o.O;try{this.l.clearRect(0,0,o.S,o.O),this.l.drawImage(n,o.p,o.M,o.k,o.C,0,0,o.S,o.O);var r=this.l.getImageData(0,0,o.S,o.O).data;return this._(this.A(r,t))}catch(o){i=w("security error (CORS) for resource ".concat(v(n),".\nDetails: https://developer.mozilla.org/en/docs/Web/HTML/CORS_enabled_image"));return t.silent,t.silent,this._(e,i)}},n.prototype.A=function(n,t){t=t||{};var e=n.length,i=f(t);if(e<4)return i;var o,u=e-e%4,s=4*(t.step||1);switch(t.algorithm||"sqrt"){case"simple":o=l;break;case"sqrt":o=d;break;case"dominant":o=a;break;default:throw w("".concat(t.algorithm," is unknown algorithm"))}return o(n,u,{u:i,o:r(t.o),step:s,i:t.i})},n.prototype._=function(n,t){var e,i=n.slice(0,3),r=[n[0],n[1],n[2],n[3]/255],u=(299*(e=n)[0]+587*e[1]+114*e[2])/1e3<128;return{value:[n[0],n[1],n[2],n[3]],I:"rgb("+i.join(",")+")",j:"rgba("+r.join(",")+")",P:o(i),$:o(n),F:u,T:!u,error:t}},n.prototype.destroy=function(){this.canvas&&(this.canvas.width=1,this.canvas.height=1,this.canvas=null),this.l=null},n.prototype.h=function(n,t){var e=this;return new Promise((function(i,o){var r=function(){c();var r=e.v(n,t);r.error?o(r.error):i(r)},u=function(){c(),o(w('Error loading image "'.concat(n.src,'"')))},s=function(){c(),o(w('Image "'.concat(n.src,'" loading aborted')))},c=function(){n.removeEventListener("load",r),n.removeEventListener("error",u),n.removeEventListener("abort",s)};n.addEventListener("load",r),n.addEventListener("error",u),n.addEventListener("abort",s)}))},n}()},12(n,t,e){var i=this&&this.__awaiter||function(n,t,e,i){return new(e||(e=Promise))((function(o,r){function u(n){try{c(i.next(n))}catch(n){r(n)}}function s(n){try{c(i.throw(n))}catch(n){r(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((i=i.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.B=function(n){return i(this,void 0,void 0,(function*(){var t,e,u;if("mouseup"!==n.type)return;l||(l=yield(0,s.L)());const d=n.target,f=d.closest(".ariaLabel");if(!f)return;const m=f.dataset.type,h=d.closest(".protyle-title__icon")||"doc"===f.dataset.type?"doc":void 0,v=c.includes(m)?m:h;if(!v)return;const b="doc"===v?null!==(t=f.parentElement.dataset.nodeId)&&void 0!==t?t:null===(u=null===(e=f.closest(".protyle"))||void 0===e?void 0:e.querySelector(".protyle-title"))||void 0===u?void 0:u.dataset.nodeId:f.dataset.nodeId;a=yield(0,r.N)("#commonMenu:not(.fn__none)"),yield new Promise((n=>setTimeout(n,0))),function(n,t){i(this,void 0,void 0,(function*(){const e="doc"===n;!function(n){i(this,void 0,void 0,(function*(){var t,e;if(!a||document.getElementById("afwdMenuItem-clear"))return;const i=a.lastChild,o=document.createElement("button");o.className="b3-menu__item";const r=document.createElement("button");r.className="b3-menu__separator";const u=`\n <button class="b3-menu__item b3-menu__item--custom" id="afwdMenuItem-on">\n <svg class="b3-menu__icon" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">\n <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="m9 12l2 2l4-4"/></g>\n </svg>\n <span class="b3-menu__label">${l["afwdMenuItem-on"]}</span>\n </button>\n <button class="b3-menu__item b3-menu__item--custom" id="afwdMenuItem-off">\n <svg class="b3-menu__icon" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">\n <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="m15 9l-6 6m0-6l6 6"/></g>\n </svg>\n <span class="b3-menu__label">${l["afwdMenuItem-off"]}</span>\n </button>\n `,s=`\n <button class="b3-menu__item b3-menu__item--custom" id="afwdMenuItem-all">\n <span class="b3-menu__label">\n <div class="fn__flex">\n <svg class="b3-menu__icon" style=""></svg>\n <span>${l["afwdMenuItem-all"]}</span>\n <span class="fn__space fn__flex-1"></span>\n <input type="checkbox" class="b3-switch fn__flex-center">\n </div>\n </span>\n </button>\n <button class="b3-menu__item b3-menu__item--custom" id="afwdMenuItem-db">\n <span class="b3-menu__label">\n <div class="fn__flex">\n <svg class="b3-menu__icon" style=""><use xlink:href="#iconDatabase"></use></svg>\n <span>${l["afwdMenuItem-db"]}</span>\n <span class="fn__space fn__flex-1"></span>\n <input type="checkbox" class="b3-switch fn__flex-center">\n </div>\n </span>\n </button>\n <button class="b3-menu__item b3-menu__item--custom" id="afwdMenuItem-t">\n <span class="b3-menu__label">\n <div class="fn__flex">\n <svg class="b3-menu__icon" style=""><use xlink:href="#iconTable"></use></svg>\n <span>${l["afwdMenuItem-t"]}</span>\n <span class="fn__space fn__flex-1"></span>\n <input type="checkbox" class="b3-switch fn__flex-center">\n </div>\n </span>\n </button>\n <button class="b3-menu__item b3-menu__item--custom" id="afwdMenuItem-p">\n <span class="b3-menu__label">\n <div class="fn__flex">\n <svg class="b3-menu__icon"><use xlink:href="#iconImage"></use></svg>\n <span>${l["afwdMenuItem-p"]}</span>\n <span class="fn__space fn__flex-1"></span>\n <input type="checkbox" class="b3-switch fn__flex-center">\n </div>\n </span>\n </button>\n <button class="b3-menu__item b3-menu__item--custom" id="afwdMenuItem-iframe">\n <span class="b3-menu__label">\n <div class="fn__flex">\n <svg class="b3-menu__icon"><use xlink:href="#iconHTML5"></use></svg>\n <span>${l["afwdMenuItem-iframe"]}</span>\n <span class="fn__space fn__flex-1"></span>\n <input type="checkbox" class="b3-switch fn__flex-center">\n </div>\n </span>\n </button>\n <button class="b3-menu__item b3-menu__item--custom" id="afwdMenuItem-sb">\n <span class="b3-menu__label">\n <div class="fn__flex">\n <svg class="b3-menu__icon"><use xlink:href="#iconSuper"></use></svg>\n <span>${l["afwdMenuItem-sb"]}</span>\n <span class="fn__space fn__flex-1"></span>\n <input type="checkbox" class="b3-switch fn__flex-center">\n </div>\n </span>\n </button>\n `,c=`\n <svg class="b3-menu__icon" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 18 18">\n <path fill="currentColor" d="m15.503 15.003l-.735.71a.75.75 0 1 0 1.042 1.078l1.886-1.82a1 1 0 0 0 0-1.44l-1.886-1.82a.75.75 0 0 0-1.042 1.079l.739.713H12.75a.75.75 0 0 0 0 1.5zM15 3a2 2 0 0 1 2 2v4.25a.75.75 0 0 1-1.5 0V5a.5.5 0 0 0-.5-.5H5a.5.5 0 0 0-.5.5v4.25a.75.75 0 0 1-1.5 0V5a2 2 0 0 1 2-2zM5.234 15.712l-.735-.71h2.752a.75.75 0 1 0 0-1.5H4.495l.739-.713a.75.75 0 0 0-1.042-1.078l-1.886 1.82a1 1 0 0 0 0 1.44l1.886 1.82a.75.75 0 0 0 1.042-1.079"/>\n </svg>\n <span class="b3-menu__label">${l.afwdDocMenuLabel}</span>\n <svg class="b3-menu__icon b3-menu__icon--small">\n <use xlink:href="#iconRight"></use>\n </svg>\n <div class="b3-menu__submenu">\n <div class="b3-menu__items">\n ${"doc"===n?s:u}\n <button class="b3-menu__separator"></button>\n <button class="b3-menu__item" id="afwdMenuItem-clear">\n <svg class="b3-menu__icon " style=""><use xlink:href="#iconTrashcan"></use></svg>\n <span class="b3-menu__label">${l["afwdMenuItem-clear"]}\n </span>\n </button>\n </div>\n </div>\n `;if(o.innerHTML=c,i.insertBefore(o,null===(t=i.lastChild)||void 0===t?void 0:t.previousSibling),i.insertBefore(r,o),"doc"!==n)return;const d=document.createElement("button");d.className="b3-menu__item";const f=`\n <svg class="b3-menu__icon" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 22 22">\n <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 5h-3m-5 0h5m-5 0v10m0-10h-1c-1.667 0-5 1-5 5s3.333 5 5 5h1m0 4v-4m5 4V5"/>\n </svg>\n <span class="b3-menu__label">${l.tdirDocMenuLabel}</span>\n <svg class="b3-menu__icon b3-menu__icon--small">\n <use xlink:href="#iconRight"></use>\n </svg>\n <div class="b3-menu__submenu">\n <div class="b3-menu__items">\n <button class="b3-menu__item b3-menu__item--custom" id="tdirMenuItem-ltr">\n <svg class="b3-menu__icon " style=""><use xlink:href="#iconLtr"></use></svg>\n <span class="b3-menu__label">${l["tdirMenuItem-ltr"]}</span>\n </button>\n <button class="b3-menu__item b3-menu__item--custom" id="tdirMenuItem-rtl">\n <svg class="b3-menu__icon " style=""><use xlink:href="#iconRtl"></use></svg>\n <span class="b3-menu__label">${l["tdirMenuItem-rtl"]}</span>\n </button> \n <button class="b3-menu__separator"></button>\n <button class="b3-menu__item" id="tdirMenuItem-clear">\n <svg class="b3-menu__icon " style=""><use xlink:href="#iconTrashcan"></use></svg>\n <span class="b3-menu__label">${l["afwdMenuItem-clear"]}\n </span>\n </button>\n </div>\n </div>\n `;d.innerHTML=f,i.insertBefore(d,null===(e=i.lastChild)||void 0===e?void 0:e.previousSibling)}))}(n);const r=yield(0,o.R)(t);let u=r["custom-afwd"],s=r["custom-tdir"];if(u||(u=""),s||(s=""),u=u.split(" "),u.length>0)if(e){if(u.forEach((n=>{const t=document.getElementById(`afwdMenuItem-${n}`);t&&(t.querySelector("input").checked=!0)})),u.includes("all")){const n=null==a?void 0:a.querySelectorAll("button[id^=afwdMenuItem]:not(#afwdMenuItem-all, #afwdMenuItem-clear)");null==n||n.forEach((n=>{n.classList.add("b3-menu__item--disabled"),n.querySelector("input").disabled=!0}))}}else{const n=document.getElementById(`afwdMenuItem-${u[0]}`);n&&n.classList.add("b3-menu__item--selected")}if(s.length&&e){const n=document.getElementById(`tdirMenuItem-${s}`);n&&n.classList.add("b3-menu__item--selected")}!function(n,t,e,i){const r=null==a?void 0:a.querySelectorAll("button[id^=afwdMenuItem]:not(#afwdMenuItem-clear)"),u=null==a?void 0:a.querySelectorAll("button[id^=tdirMenuItem]:not(#tdirMenuItem-clear)");let s=[];const c=[...r].filter((n=>"afwdMenuItem-all"!==n.id));n?(null==r||r.forEach((n=>{n.onclick=i=>{if(n.classList.contains("b3-menu__item--disabled"))return;const r=n.querySelector("input"),u=n.id.split("-")[1];let a=r.checked;i.target===r?a=!a:r.checked=!a,a?"all"===u?(c.forEach((n=>{n.classList.remove("b3-menu__item--disabled"),n.querySelector("input").disabled=!1})),e=s.length>0?s:[]):e=e.filter((n=>n!==u)):"all"===u?(e.includes("all")||(s=e),e=["all"],c.forEach((n=>{n.classList.add("b3-menu__item--disabled"),n.querySelector("input").disabled=!0}))):e.push(u),(0,o.D)(t,{"custom-afwd":e.join(" ")||""})}})),null==u||u.forEach(((n,e,r)=>{n.onclick=()=>{const u=n.id.split("-")[1];n.classList.contains("b3-menu__item--selected")?(n.classList.remove("b3-menu__item--selected"),i=[]):(i=[u],n.classList.add("b3-menu__item--selected"),r[1-e].classList.remove("b3-menu__item--selected")),(0,o.D)(t,{"custom-tdir":`${i.join("")}`})}}))):null==r||r.forEach(((n,i,r)=>{n.onclick=()=>{const u=n.id.split("-")[1];n.classList.contains("b3-menu__item--selected")?(e=[],n.classList.remove("b3-menu__item--selected")):(e=[u],n.classList.add("b3-menu__item--selected"),r[1-i].classList.remove("b3-menu__item--selected")),(0,o.D)(t,{"custom-afwd":(null==e?void 0:e.join(" "))||""})}}));const l=document.getElementById("afwdMenuItem-clear");if(!l)return;if(l.onclick=()=>{e=[],s=[],(0,o.D)(t,{"custom-afwd":""}),r.forEach((t=>{if(t.classList.remove("b3-menu__item--disabled"),t.classList.remove("b3-menu__item--selected"),n){const n=t.querySelector("input");n.disabled=!1,n.checked=!1}}))},!n)return;const d=document.getElementById("tdirMenuItem-clear");if(!d)return;d.onclick=()=>{i=[],(0,o.D)(t,{"custom-tdir":""}),u.forEach((n=>{n.classList.remove("b3-menu__item--selected")}))}}(e,t,u,s)}))}(v,b)}))},t.V=function(){null===u.G||void 0===u.G||u.G.forEach((n=>{(n.querySelector(".file-tree")?[]:n.querySelectorAll(".protyle-wysiwyg")).forEach((n=>{n.style.removeProperty("--protyle-spacing"),n.dataset.H=void 0}))}))};const o=e(613),r=e(629),u=e(937),s=e(689),c=["NodeParagraph","NodeTable","NodeAttributeView","NodeSuperBlock","NodeVideo","NodeWidget","NodeIFrame"];let a,l=s.i18n},202(n,t,e){var i=this&&this.__awaiter||function(n,t,e,i){return new(e||(e=Promise))((function(o,r){function u(n){try{c(i.next(n))}catch(n){r(n)}}function s(n){try{c(i.throw(n))}catch(n){r(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((i=i.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.q=void 0,t.W=function(){return i(this,void 0,void 0,(function*(){yield(0,o.getFile)("/data/snippets/Asri.config.json").then((n=>n&&200===n.status?n.json():null)).then((n=>{var e,i,o;if(!n)return;for(let e in t.q)e in n||(n[e]=t.q[e]);const s=["light","dark"];for(const r of s)t.q[r].followSysAccentColor=!!n[r].followSysAccentColor,t.q[r].followCoverImgColor=!!n[r].followCoverImgColor,t.q[r].chroma=null!==(e=n[r].chroma)&&void 0!==e?e:"1",t.q[r].userCustomColor=null!==(i=n[r].userCustomColor)&&void 0!==i?i:"#3478f6",t.q[r].presetPalette=null!==(o=n[r].presetPalette)&&void 0!==o?o:"";t.q.features=n.features,(0,u.U)(!!n[r.K.J].followSysAccentColor)}))}))},t.Y=function(){return i(this,void 0,void 0,(function*(){yield(0,o.X)("/data/snippets/Asri.config.json",JSON.stringify(t.q,void 0,4))}))};const o=e(613),r=e(49),u=e(8);t.q={light:{followSysAccentColor:!1,followCoverImgColor:!1,chroma:"1",userCustomColor:"#3478f6",presetPalette:""},dark:{followSysAccentColor:!1,followCoverImgColor:!1,chroma:"1",userCustomColor:"#3478f6",presetPalette:""},features:{tfp:""}}},138(n,t,e){var i=this&&this.__awaiter||function(n,t,e,i){return new(e||(e=Promise))((function(o,r){function u(n){try{c(i.next(n))}catch(n){r(n)}}function s(n){try{c(i.throw(n))}catch(n){r(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((i=i.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Z=function(){return i(this,void 0,void 0,(function*(){if((0,c.nn)(o.K.J),yield(0,u.W)(),!o.K.tn)return;if(o.K.rn||o.K.un||o.K.sn||!c.followSysAccentColor&&!u.q[c.cn].followCoverImgColor&&!u.q[c.cn].presetPalette?(a.an.setProperty("--asri-user-custom-accent",u.q[c.cn].userCustomColor),a.an.removeProperty("--asri-cover-dominant"),(0,c.ln)(!u.q[c.cn].followCoverImgColor&&!u.q[c.cn].presetPalette&&(0,d.dn)(u.q[c.cn].userCustomColor)),(0,d.fn)(u.q[c.cn].userCustomColor)):(a.an.removeProperty("--asri-user-custom-accent"),(0,c.ln)(!1),u.q[c.cn].followCoverImgColor&&a.an.removeProperty("--asri-cover-dominant")),u.q[c.cn].presetPalette){const n=u.q[c.cn].presetPalette,t=s.mn[n][c.cn];document.documentElement.classList.forEach((n=>{n.startsWith("asri-palette-")&&document.documentElement.classList.remove(n)})),document.documentElement.classList.add(`asri-palette-${n.split("-")[2]}`),(0,c.U)(!1),a.an.setProperty("--asri-user-custom-accent",t.primary),a.an.setProperty("--asri-c-factor",t.chroma),a.an.removeProperty("--asri-cover-dominant"),(0,c.ln)("0"===t.chroma),(0,d.hn)(t.chroma),(0,d.fn)(t.primary)}else u.q[c.cn].followCoverImgColor?(a.an.setProperty("--asri-c-factor",u.q[c.cn].chroma),(0,c.ln)(!1),document.documentElement.classList.forEach((n=>{n.startsWith("asri-palette-")&&document.documentElement.classList.remove(n)})),(0,f.vn)()):(a.an.setProperty("--asri-c-factor",u.q[c.cn].chroma),document.documentElement.classList.forEach((n=>{n.startsWith("asri-palette-")&&document.documentElement.classList.remove(n)})),(0,c.ln)((0,d.dn)(u.q[c.cn].userCustomColor)),(0,d.hn)(u.q[c.cn].chroma));(0,l.bn)(),u.q.features.tfp&&!o.K.un&&document.body.classList.add("asri-tfp","asri-tfp-"+u.q.features.tfp)}))},t._n=function(){a.an.pn(),f.gn.pn(),document.body.classList.remove("asri-c-0"),document.querySelectorAll(".asri-config").forEach((n=>n.remove())),document.documentElement.classList.forEach((n=>{n.startsWith("asri-palette-")&&document.documentElement.classList.remove(n)}))},t.wn=function(){return i(this,void 0,void 0,(function*(){const n=yield(0,r.L)();return(0,c.yn)(n),n}))};const o=e(49),r=e(105),u=e(202),s=e(929),c=e(8),a=e(406),l=e(217),d=e(425),f=e(640)},640(n,t,e){var i=this&&this.__awaiter||function(n,t,e,i){return new(e||(e=Promise))((function(o,r){function u(n){try{c(i.next(n))}catch(n){r(n)}}function s(n){try{c(i.throw(n))}catch(n){r(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((i=i.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.gn=void 0,t.Mn=m,t.vn=function(n){return i(this,void 0,void 0,(function*(){var t,e;const i=yield m(n),o=c.an.kn().get("--asri-cover-dominant");let u,d;i?(u=i,d=(null===(e=(0,r.xn)(i))||void 0===e?void 0:e.Cn)||0):o?(u=o,d=(null===(t=(0,r.xn)(o))||void 0===t?void 0:t.Cn)||0):(u=s.q[a.cn].userCustomColor,d=parseFloat(s.q[a.cn].chroma)||0),c.an.setProperty("--asri-cover-dominant",u);const f="0.000"===d.toFixed(3);(0,a.Sn)(f),(f||"0"===s.q[a.cn].chroma)&&(d=0),(0,l.hn)(d),(0,l.fn)(u)}))};const o=e(441),r=e(379),u=e(629),s=e(202),c=e(406),a=e(8),l=e(425),d=new o.t;class f{constructor(){}static On(){return f.An||(f.An=new f),f.An}In(n){return i(this,void 0,void 0,(function*(){const t=(yield(0,u.Pn)(n,!0)).jn;let e=null;if(!t)return e;const i=t.querySelector(".protyle-background__img:not(.fn__none)");if(!i)return e;const o=i.querySelector("&>img"),s=i.querySelector("&>video");if(o.style){const n=o.style;if(n.backgroundColor)return{type:"css",source:(0,r.$n)(n.backgroundColor)};if(n.backgroundImage){const t=n.backgroundImage;return{type:"css",source:(0,r.Fn)(t)||"#3478f6"}}}return s?{type:"vid",source:s}:o?{type:"img",source:o}:e}))}Tn(n){return document.querySelector(`.protyle:not(.fn__none)[data-id="${n}] .protyle-background__img:not(.fn__none)> img`)||null}Bn(n){return document.querySelector(`.protyle:not(.fn__none)[data-id="${n}] .protyle-background__img:not(.fn__none)> video`)||null}Ln(n){return i(this,arguments,void 0,(function*(n,t={algorithm:"dominant"}){if(!n)return;return(yield d.m(n,t)).P}))}Nn(n,t={algorithm:"dominant"}){if(!n)return;return d.v(n,t).P}pn(){d.destroy(),f.An=null}}function m(n){return i(this,void 0,void 0,(function*(){const e=yield t.gn.In(n);if(e)return"css"===e.type?e.source:"vid"===e.type?t.gn.Nn(e.source):"img"===e.type?yield t.gn.Ln(e.source):void 0}))}f.An=null,t.gn=f.On()},406(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.an=t.Rn=void 0;class e{constructor(){this.Dn=null;const n=document.getElementById("snippetCSS-asri-root-vars");n?(this.Vn=n,this.En=this.Gn()):(this.Vn=document.createElement("style"),this.Vn.id="snippetCSS-asri-root-vars",document.head.appendChild(this.Vn),this.En=new Map),this.zn=new Map}Gn(){const n=new Map,t=this.Vn.textContent;if(!t)return n;const e=t.match(/:root\s*{([^}]*)}/);if(e){const t=e[1].split(";");for(const e of t){const[t,i]=e.split(":").map((n=>n.trim()));t&&i&&n.set(t,i)}}return n}static On(){return e.An||(e.An=new e),e.An}setProperty(n,t){this.zn.set(n,t),this.Hn()}removeProperty(n){this.zn.set(n,""),this.Hn()}Hn(){null!==this.Dn&&cancelAnimationFrame(this.Dn),this.Dn=requestAnimationFrame((()=>this.qn()))}qn(){if(0===this.zn.size)return;let n=":root {";new Map([...this.En,...this.zn]).forEach(((t,e)=>{""===t?this.En.delete(e):(n+=`${e}: ${t};`,this.En.set(e,t))})),n+="}",this.Vn.textContent=n,this.zn.clear(),this.Dn=null}kn(){return new Map(this.En)}pn(){this.Vn.remove(),e.An=null}}t.Rn=e,e.An=null,t.an=e.On()},848(n,t,e){var i=this&&this.__awaiter||function(n,t,e,i){return new(e||(e=Promise))((function(o,r){function u(n){try{c(i.next(n))}catch(n){r(n)}}function s(n){try{c(i.throw(n))}catch(n){r(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((i=i.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Wn=t.Un=void 0,t.Jn=function(){if(!(d.Kn&&d.Yn&&d.Qn&&d.Xn&&d.Zn))return;u.K.rn||u.K.un||u.K.sn?d.Kn.classList.add("fn__none"):d.Kn.addEventListener("click",b);d.Yn.addEventListener("mouseup",p),d.Xn.addEventListener("input",w),d.Xn.addEventListener("change",y),d.Qn.addEventListener("input",M),d.Zn.addEventListener("click",_)};const o=e(796),r=e(629),u=e(49),s=e(288),c=e(406),a=e(202),l=e(929),d=e(8),f=e(217),m=e(425),h=e(640);function v(n=a.q[d.cn].userCustomColor){(0,d.ln)(!d.followSysAccentColor&&!a.q[d.cn].followCoverImgColor&&!a.q[d.cn].presetPalette&&(0,m.dn)(n))}function b(){d.followSysAccentColor||(0,s.nt)(600,(()=>{k(!1),document.querySelectorAll(".asri-config.b3-menu__item--selected").forEach((n=>n.classList.remove("b3-menu__item--selected"))),(0,d.U)(!0),d.Kn.classList.add("b3-menu__item--selected"),c.an.removeProperty("--asri-user-custom-accent"),c.an.removeProperty("--asri-cover-dominant"),(0,d.ln)(!1),a.q[d.cn].followSysAccentColor=!0,a.q[d.cn].followCoverImgColor=!1,(0,f.bn)(),(0,a.Y)()}))}function _(){a.q[d.cn].followCoverImgColor||(0,s.nt)(600,(()=>i(this,void 0,void 0,(function*(){k(),(0,d.U)(!1),document.querySelectorAll(".asri-config.b3-menu__item--selected").forEach((n=>n.classList.remove("b3-menu__item--selected"))),d.Zn.classList.add("b3-menu__item--selected"),a.q[d.cn].followCoverImgColor=!0,a.q[d.cn].followSysAccentColor=!1,(0,d.ln)(!1),(0,h.vn)(),(0,a.Y)()}))))}function p(n){(0,s.nt)(600,(()=>{k(),document.documentElement.getAttribute("--asri-user-custom-accent")||((0,d.U)(!1),document.querySelectorAll(".asri-config.b3-menu__item--selected").forEach((n=>n.classList.remove("b3-menu__item--selected"))),d.Yn.classList.add("b3-menu__item--selected"),c.an.setProperty("--asri-user-custom-accent",a.q[d.cn].userCustomColor),c.an.removeProperty("--asri-cover-dominant"),a.q[d.cn].userCustomColor=a.q[d.cn].userCustomColor,a.q[d.cn].followSysAccentColor=!1,a.q[d.cn].followCoverImgColor=!1,v(),(0,m.hn)(a.q[d.cn].chroma),(0,m.fn)(a.q[d.cn].userCustomColor),(0,a.Y)())}))}const g=(0,r.tt)((n=>{requestAnimationFrame((()=>{c.an.setProperty("--asri-user-custom-accent",n),v(n),(0,m.hn)(a.q[d.cn].chroma),(0,m.fn)(n)}))}),400);function w(){const n=d.Xn.value;g(n)}function y(){d.Kn.classList.remove("b3-menu__item--selected"),d.Yn.classList.add("b3-menu__item--selected"),(0,m.fn)(d.Xn.value),a.q[d.cn].userCustomColor=d.Xn.value,(0,d.U)(!1),a.q[d.cn].followSysAccentColor=!1,a.q[d.cn].followCoverImgColor=!1,v(d.Xn.value),(0,m.hn)(a.q[d.cn].chroma),(0,a.Y)()}function M(){const n=this.value;requestAnimationFrame((()=>{c.an.setProperty("--asri-c-factor",n),this.parentElement.ariaLabel=d.i18n.asriChroma+n,a.q[d.cn].chroma=n,v(),(0,m.hn)(n)})),(0,r.et)(a.Y,200)()}function k(n=!0){var t,e,i;const o=(null===(t=document.documentElement.classList.toString().split(" ").find((n=>n.startsWith("asri-palette-"))))||void 0===t?void 0:t.split("-")[2])||null;null!==o&&(document.documentElement.classList.forEach((n=>{n.startsWith("asri-palette-")&&document.documentElement.classList.remove(n)})),a.q[d.cn].presetPalette="",null===(e=document.getElementById(`prst-palette-${o}`))||void 0===e||e.classList.remove("b3-menu__item--selected"),null===(i=document.getElementById("asriChroma"))||void 0===i||i.classList.remove("b3-menu__item--disabled"),c.an.setProperty("--asri-c-factor",a.q[d.cn].chroma),v())}t.Un=new o.it((function(n){const t=n.target.closest('[id^="tfp-"]');if(!t)return;const e=document.querySelectorAll('[id^="tfp-"]');"tfp-disable"===t.id?(document.body.classList.remove("asri-tfp-acrylic","asri-tfp-progressive","asri-tfp","asri-tfp-luminous"),e.forEach((n=>{n.classList.remove("b3-menu__item--selected")})),a.q.features.tfp=""):(t.classList.contains("b3-menu__item--selected")?(document.body.classList.remove("asri-tfp",t.id.replace("tfp-","asri-tfp-")),a.q.features.tfp=""):(e.forEach((n=>{n.classList.remove("b3-menu__item--selected")})),document.body.classList.remove("asri-tfp-acrylic","asri-tfp-progressive","asri-tfp-luminous"),document.body.classList.add("asri-tfp",t.id.replace("tfp-","asri-tfp-")),a.q.features.tfp=t.id.replace("tfp-","")),t.classList.toggle("b3-menu__item--selected"));(0,a.Y)()})),t.Wn=new o.it((function(n){return i(this,void 0,void 0,(function*(){const t=n.target.closest('[id^="prst-palette-"]');if(!t)return;const e=document.getElementById("asriChroma"),i=t.id,o=l.mn[i][d.cn];a.q[d.cn].presetPalette!==i&&(0,s.nt)(600,(()=>{document.querySelectorAll(".asri-config.b3-menu__item--selected").forEach((n=>n.classList.remove("b3-menu__item--selected"))),null==e||e.classList.add("b3-menu__item--disabled"),t.classList.add("b3-menu__item--selected"),document.documentElement.classList.forEach((n=>{n.startsWith("asri-palette-")&&document.documentElement.classList.remove(n)})),document.documentElement.classList.add(`asri-palette-${i.split("-")[2]}`),(0,d.U)(!1),d.Kn.classList.remove("b3-menu__item--selected"),d.Yn.classList.remove("b3-menu__item--selected"),c.an.setProperty("--asri-user-custom-accent",o.primary),c.an.setProperty("--asri-c-factor",o.chroma),c.an.removeProperty("--asri-cover-dominant"),(0,d.ln)("0"===o.chroma),a.q[d.cn].presetPalette=i,a.q[d.cn].followSysAccentColor=!1,a.q[d.cn].followCoverImgColor=!1,(0,m.hn)(o.chroma),(0,m.fn)(o.primary),(0,a.Y)()}))}))}))},105(n,t,e){var i=this&&this.__awaiter||function(n,t,e,i){return new(e||(e=Promise))((function(o,r){function u(n){try{c(i.next(n))}catch(n){r(n)}}function s(n){try{c(i.throw(n))}catch(n){r(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((i=i.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.L=function(){return i(this,void 0,void 0,(function*(){let n;try{n=["zh-CN","zh-TW","en","ar"].includes(o.K.lang)?yield fetch(`/appearance/themes/Asri/i18n/${r[o.K.lang]}.json`):yield fetch("/appearance/themes/Asri/i18n/en_US.json");return yield n.json()}catch(n){throw n}}))};const o=e(49),r={"zh-CN":"zh_CN","zh-TW":"zh_CHT",en:"en_US",ar:"ar_SA"}},689(n,t,e){var i=this&&this.__createBinding||(Object.create?function(n,t,e,i){void 0===i&&(i=e);var o=Object.getOwnPropertyDescriptor(t,e);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(n,i,o)}:function(n,t,e,i){void 0===i&&(i=e),n[i]=t[e]}),o=this&&this.__exportStar||function(n,t){for(var e in n)"default"===e||Object.prototype.hasOwnProperty.call(t,e)||i(t,n,e)},r=this&&this.__awaiter||function(n,t,e,i){return new(e||(e=Promise))((function(o,r){function u(n){try{c(i.next(n))}catch(n){r(n)}}function s(n){try{c(i.throw(n))}catch(n){r(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((i=i.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.L=t.Wn=t.Un=t.Jn=t.ot=t.rt=t.bn=t.mn=t.Y=t.ut=t.q=t.Rn=t.an=t.wn=t._n=t.Z=void 0,t.st=function(){return r(this,void 0,void 0,(function*(){return yield(0,h.wn)()}))};var u=e(138);Object.defineProperty(t,"Z",{enumerable:!0,get:function(){return u.Z}}),Object.defineProperty(t,"_n",{enumerable:!0,get:function(){return u._n}}),Object.defineProperty(t,"wn",{enumerable:!0,get:function(){return u.wn}});var s=e(406);Object.defineProperty(t,"an",{enumerable:!0,get:function(){return s.an}}),Object.defineProperty(t,"Rn",{enumerable:!0,get:function(){return s.Rn}});var c=e(202);Object.defineProperty(t,"q",{enumerable:!0,get:function(){return c.q}}),Object.defineProperty(t,"ut",{enumerable:!0,get:function(){return c.W}}),Object.defineProperty(t,"Y",{enumerable:!0,get:function(){return c.Y}});var a=e(929);Object.defineProperty(t,"mn",{enumerable:!0,get:function(){return a.mn}}),o(e(8),t);var l=e(217);Object.defineProperty(t,"bn",{enumerable:!0,get:function(){return l.bn}});var d=e(276);Object.defineProperty(t,"rt",{enumerable:!0,get:function(){return d.rt}}),Object.defineProperty(t,"ot",{enumerable:!0,get:function(){return d.ot}});var f=e(848);Object.defineProperty(t,"Jn",{enumerable:!0,get:function(){return f.Jn}}),Object.defineProperty(t,"Un",{enumerable:!0,get:function(){return f.Un}}),Object.defineProperty(t,"Wn",{enumerable:!0,get:function(){return f.Wn}});var m=e(105);Object.defineProperty(t,"L",{enumerable:!0,get:function(){return m.L}});const h=e(138)},276(n,t,e){var i=this&&this.__awaiter||function(n,t,e,i){return new(e||(e=Promise))((function(o,r){function u(n){try{c(i.next(n))}catch(n){r(n)}}function s(n){try{c(i.throw(n))}catch(n){r(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((i=i.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.rt=function(n){return i(this,void 0,void 0,(function*(){var t,e;if("mouseup"!==n.type)return;if(!n.target.closest(".toolbar__item"))return;if(document.querySelector(".asri-config"))return;let i=yield(0,o.N)('#commonMenu[data-name="barmode"] .b3-menu__items',document,2,0);if(!i)return;const l=`\n <button class="b3-menu__separator asri-config"></button>\n <div class="menu-item__subtitle" style="user-select: none;">${c.i18n["palette-presets"]}</div>\n ${Object.keys(s.mn).map((n=>(n=>{const t=c.i18n[n]||n;return`<button class="b3-menu__item asri-config" id="${n}"><svg class="b3-menu__icon" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M19 3h-4a2 2 0 0 0-2 2v12a4 4 0 0 0 8 0V5a2 2 0 0 0-2-2"/><path d="m13 7.35l-2-2a2 2 0 0 0-2.828 0L5.344 8.178a2 2 0 0 0 0 2.828l9 9"/><path d="M7.3 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h12m0-4v.01"/></g></svg><span class="b3-menu__label">${t}</span></button>`})(n))).join("")}\n <button class="b3-menu__separator asri-config"></button>\n <button class="b3-menu__item asri-config" id="pickColor">\n <svg class="b3-menu__icon"></svg>\n <input id="asriColorPicker" type="color" value="${r.q[c.cn].userCustomColor}">\n <label for="asriColorPicker" class="be-menu__label">${c.i18n.pickColor}</label>\n </button>\n <button class="b3-menu__item asri-config" id="followSysAccent">\n <svg class="b3-menu__icon"></svg>\n <label for="" class="be-menu__label">${c.i18n.followSysAccent}</label>\n </button>\n <button class="b3-menu__item asri-config" id="followCoverImgColor">\n <svg class="b3-menu__icon"></svg>\n <label for="" class="be-menu__label">${c.i18n.followCoverImgColor||"follow cover img color"}</label>\n </button>\n <button class="b3-menu__item asri-config" data-type="nobg" id="asriChroma">\n <svg class="b3-menu__icon" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">\n <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 11l-8-8l-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0zM5 2l5 5m-8 6h15m5 7a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4c.3 1.6 2 2.4 2 4" />\n </svg>\n <div aria-label="${c.i18n.asriChroma+(null!==(e=null!==(t=null===c.Qn||void 0===c.Qn?void 0:c.Qn.value)&&void 0!==t?t:r.q[c.cn].chroma)&&void 0!==e?e:"1")}" class="b3-tooltips b3-tooltips__n">\n <input style="box-sizing: border-box" type="range" id="asriChromaSlider" class="b3-slider fn__block" min="0" max="5" step="0.1" value="1">\n </div>\n </button>\n \x3c!-- <button class="b3-menu__separator asri-config"></button>\n <button class="b3-menu__item asri-config" id="topbarFusionPlus"></button> --\x3e\n`,d=document.createRange().createContextualFragment(l);i.appendChild(d),(0,c.ct)(document.getElementById("followSysAccent")),(0,c.lt)(document.getElementById("followCoverImgColor")),(0,c.dt)(document.getElementById("pickColor")),(0,c.ft)(document.getElementById("asriChromaSlider")),(0,c.ht)(c.Yn.querySelector("input")),c.Kn&&c.Yn&&c.Qn&&c.Xn&&(a(),(0,u.Jn)())}))},t.ot=a;const o=e(629),r=e(202),u=e(848),s=e(929),c=e(8);function a(){const n=document.getElementById("asriChroma");if((0,c.vt)(document.getElementById("tfp-progressive")),(0,c.bt)(document.getElementById("tfp-acrylic")),(0,c._t)(document.getElementById("tfp-luminous")),(0,c.lt)(document.getElementById("followCoverImgColor")),c.Kn.classList.toggle("b3-menu__item--selected",!r.q[c.cn].presetPalette&&c.followSysAccentColor),c.Zn.classList.toggle("b3-menu__item--selected",r.q[c.cn].followCoverImgColor&&!r.q[c.cn].presetPalette&&!c.followSysAccentColor),c.Yn.classList.toggle("b3-menu__item--selected",!r.q[c.cn].presetPalette&&!c.followSysAccentColor&&!r.q[c.cn].followCoverImgColor),c.Qn.value=r.q[c.cn].chroma||"1",c.Qn.parentElement.ariaLabel=c.i18n.asriChroma+r.q[c.cn].chroma,r.q[c.cn].presetPalette){const t=document.getElementById(`${r.q[c.cn].presetPalette}`);null==n||n.classList.add("b3-menu__item--disabled"),null==t||t.classList.add("b3-menu__item--selected")}[c.gt,c.wt,c.yt].forEach((n=>{if(n){const t=n.id.replace("tfp-","");n.classList.toggle("b3-menu__item--selected",r.q.features.tfp===t)}}))}},929(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.mn=void 0,t.mn={"prst-palette-auriflow":{dark:{primary:"#D2B983",chroma:"0.3",followSysAccentColor:!1},light:{primary:"#F4D18B",chroma:"0",followSysAccentColor:!1}},"prst-palette-everbliss":{dark:{primary:"#13012a",chroma:"1.5",followSysAccentColor:!1},light:{primary:"#F4CA57",chroma:"2.8",followSysAccentColor:!1}},"prst-palette-aerisland":{dark:{primary:"#111a3f",chroma:"2",followSysAccentColor:!1},light:{primary:"#e6f9db",chroma:"2",followSysAccentColor:!1}},"prst-palette-zerith":{dark:{primary:"#ABC3D9",chroma:"2.4",followSysAccentColor:!1},light:{primary:"#C2E2DF",chroma:"0.7",followSysAccentColor:!1}},"prst-palette-polar":{dark:{primary:"#E6E9EF",chroma:"0",followSysAccentColor:!1},light:{primary:"#1B1C1D",chroma:"0",followSysAccentColor:!1}},"prst-palette-stellula":{dark:{primary:"#3B2731",chroma:"0.6",followSysAccentColor:!1},light:{primary:"#FFF4EB",chroma:"2.5",followSysAccentColor:!1}},"prst-palette-vael":{dark:{primary:"#96c4df",chroma:"2.5",followSysAccentColor:!1},light:{primary:"#FFFCF3",chroma:"1.2",followSysAccentColor:!1}}}},8(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t._t=t.bt=t.vt=t.Mt=t.ht=t.ft=t.dt=t.lt=t.ct=t.U=t.Sn=t.ln=t.kt=t.xt=t.yn=t.nn=t.yt=t.wt=t.gt=t.Ct=t.Xn=t.Qn=t.Yn=t.Zn=t.Kn=t.followSysAccentColor=t.St=t.Ot=t.At=t.It=t.i18n=t.cn=void 0,t.At=!1,t.Ot=!1,t.St=!1,t.followSysAccentColor=!1;t.nn=n=>{t.cn=n};t.yn=n=>{t.i18n=n};t.xt=n=>{t.It=n};t.kt=n=>{t.At=n};t.ln=n=>{t.Ot=n};t.Sn=n=>{t.St=n};t.U=n=>{t.followSysAccentColor=n};t.ct=n=>{t.Kn=n};t.lt=n=>{t.Zn=n};t.dt=n=>{t.Yn=n};t.ft=n=>{t.Qn=n};t.ht=n=>{t.Xn=n};t.Mt=n=>{t.Ct=n};t.vt=n=>{t.gt=n};t.bt=n=>{t.wt=n};t._t=n=>{t.yt=n}},217(n,t,e){Object.defineProperty(t,"__esModule",{value:!0}),t.bn=function(){if(r.K.rn||r.K.un||r.K.sn)return;const n="#"+i.remote.systemPreferences.getAccentColor().slice(0,6),t=(0,o.jt)(n);if(!t)return;s.It!==n&&(u.an.setProperty("--asri-sys-accent",n),t.s>.28?u.an.setProperty("--asri-sys-accent-accessible",n):u.an.removeProperty("--asri-sys-accent-accessible"),(0,s.kt)(0===t.s),(0,s.xt)(n));s.followSysAccentColor&&((0,c.hn)(t.s),(0,c.fn)(n))};const i=e(571),o=e(379),r=e(49),u=e(406),s=e(8),c=e(425)},425(n,t,e){t.Pt=void 0,t.dn=function(n){var t;return 0===(null===(t=(0,i.jt)(n))||void 0===t?void 0:t.s)},t.hn=function(n){return"0"===String(n)||s.followSysAccentColor&&s.At||s.Ot||s.St&&r.q[s.cn].followCoverImgColor?(requestAnimationFrame((()=>{u.an.setProperty("--asri-c-0","0"),document.body.classList.add("asri-c-0"),c()})),!0):(requestAnimationFrame((()=>{u.an.removeProperty("--asri-c-0"),document.body.classList.remove("asri-c-0"),a()})),!1)},t.fn=function(n){const{$t:e}=(0,i.xn)(n)||{};if(void 0===e)return;e>t.Pt?u.an.setProperty("--asri-on-primary-reverse","light"===o.K.J?".3":".2"):u.an.removeProperty("--asri-on-primary-reverse")},t.Ft=a;const i=e(379),o=e(49),r=e(202),u=e(406),s=e(8);function c(){if(window.matchMedia&&window.matchMedia("(color-gamut: p3)").matches&&!document.querySelector(".asri-hdr-support-image")&&"light"===o.K.J){const n=document.createElement("img");n.src="/appearance/themes/Asri/hdr.jpg",n.style.position="fixed",n.style.pointerEvents="none",n.style.width="1px",n.style.height="1px",n.classList.add("asri-hdr-support-image"),document.body.appendChild(n)}}function a(){const n=document.querySelector(".asri-hdr-support-image");n&&n.remove()}t.Pt="light"===o.K.J?.74:.79},818(n,t,e){var i=this&&this.__awaiter||function(n,t,e,i){return new(e||(e=Promise))((function(o,r){function u(n){try{c(i.next(n))}catch(n){r(n)}}function s(n){try{c(i.throw(n))}catch(n){r(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((i=i.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Tt=function(){return i(this,void 0,void 0,(function*(){const n=r.Lt.Bt?r.Lt.Bt:yield(0,o.N)("#dockLeft");r.Lt.Nt||(yield(0,o.N)(".layout__dockl"));const t=r.Lt.Rt;for(let e of[n,t]){let t=(0,u.Dt)(e===n?"L":"R"),i=(0,u.Vt)(e===n?"L":"R");t&&i?null==e||e.classList.add("dock-layout-expanded"):null==e||e.classList.remove("dock-layout-expanded")}}))},t.Et=function(){return i(this,void 0,void 0,(function*(){var n,t,e;if(r.K.un)return;const i=yield(0,u.Gt)(),o=!(0,u.Dt)("B")&&(0,u.Vt)("B");null===(n=r.Lt.toolbar)||void 0===n||n.nextElementSibling.classList.toggle("has-dockb",i),null===(t=r.Lt.toolbar)||void 0===t||t.nextElementSibling.classList.toggle("has-layout-dockb-float",o),null===(e=r.Lt.zt)||void 0===e||e.classList.toggle("has-layout-dockb-float",o)}))},t.Ht=function(){var n,t;null===(n=r.Lt.toolbar)||void 0===n||n.nextElementSibling.classList.remove("has-dockb"),null===(t=r.Lt.toolbar)||void 0===t||t.nextElementSibling.classList.remove("has-layout-dockb-float")},t.qt=function(){var n;null===(n=document.querySelector(".dock-layout-expanded"))||void 0===n||n.classList.remove("dock-layout-expanded")};const o=e(629),r=e(49),u=e(937)},261(n,t,e){t.Wt=function(){o.forEach((({Ut:n,className:t})=>{n&&document.body.classList.add(t)})),document.body.classList.add("asri-global-backdrop-blur"),document.documentElement.classList.remove("asri-mode-dark","asri-mode-light","is-rtl-lang"),document.documentElement.classList.add("asri-mode-"+(window.siyuan.config.appearance.mode>0?"dark":"light")),("ar"===i.K.lang||"he"===i.K.lang)&&document.documentElement.classList.add("is-rtl-lang")},t.Jt=function(){o.forEach((({className:n})=>{document.body.classList.remove(n)})),document.body.classList.remove("asri-global-backdrop-blur"),document.documentElement.classList.remove("asri-mode-dark","asri-mode-light","is-rtl-lang")};const i=e(49),o=[{Ut:i.K.Kt,className:"body-asri--mac"},{Ut:i.K.sn,className:"body-asri--linux"},{Ut:i.K.un,className:"body-asri--mobile"},{Ut:i.K.rn,className:"body-asri--browser"},{Ut:i.K.Yt,className:"body-asri--android"},{Ut:i.K.Qt,className:"body-asri--iosApp"},{Ut:i.K.Xt,className:"body-asri--readOnly"},{Ut:i.K.Zt,className:"body-asri--safari"}]},829(n,t){t.ne=function(){setTimeout((()=>{for(const{id:n,enabled:t,te:o}of e)t&&i(n,o)}),300)},t.ee=function(){for(const{id:n}of e)o(n)};const e=[{id:"asri-filter-sticker-white",enabled:!0,te:'\n<svg width="0" height="0" style="position:absolute;overflow:hidden" aria-hidden="true">\n <defs>\n <filter x="-30%" y="-30%" width="160%" height="160%" color-interpolation-filters="sRGB">\n <feGaussianBlur in="SourceAlpha" stdDeviation="2.5" result="blur"/>\n <feColorMatrix in="blur" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 200 -1" result="mask"/>\n <feFlood flood-color="#ffffff" flood-opacity="1" result="paint"/>\n <feComposite in="paint" in2="mask" operator="in" result="outline"/>\n <feMerge>\n <feMergeNode in="outline"/>\n <feMergeNode in="SourceGraphic"/>\n </feMerge>\n </filter>\n </defs>\n</svg>'},{id:"asri-filter-sticker-light",enabled:!1,te:'\n<svg width="0" height="0" style="position:absolute;overflow:hidden" aria-hidden="true">\n <defs>\n <filter x="-30%" y="-30%" width="160%" height="160%" color-interpolation-filters="sRGB">\n \x3c!-- 轮廓mask --\x3e\n <feGaussianBlur in="SourceAlpha" stdDeviation="2.5" result="mask_blur"/>\n <feColorMatrix in="mask_blur" type="matrix"\n values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 200 -1"\n result="outline_mask"/>\n \x3c!-- 颜色:大模糊 → 调饱和度 → 提亮+alpha=1 --\x3e\n <feGaussianBlur in="SourceGraphic" stdDeviation="16" result="color_blur"/>\n <feColorMatrix in="color_blur" type="saturate" values="1.5" result="color_sat"/>\n <feColorMatrix in="color_sat" type="matrix"\n values="0.1 0 0 0 0.9 0 0.1 0 0 0.9 0 0 0.1 0 0.9 0 0 0 0 1"\n result="outline_color"/>\n \x3c!-- 裁剪 + 合成 --\x3e\n <feComposite in="outline_color" in2="outline_mask" operator="in" result="outline"/>\n <feMerge>\n <feMergeNode in="outline"/>\n <feMergeNode in="SourceGraphic"/>\n </feMerge>\n </filter>\n </defs>\n</svg>'},{id:"asri-filter-sticker-dark",enabled:!0,te:'\n<svg width="0" height="0" style="position:absolute;overflow:hidden" aria-hidden="true">\n <defs>\n <filter x="-30%" y="-30%" width="160%" height="160%" color-interpolation-filters="sRGB">\n <feGaussianBlur in="SourceAlpha" stdDeviation="2.5" result="mask_blur"/>\n <feColorMatrix in="mask_blur" type="matrix"\n values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 200 -1"\n result="outline_mask"/>\n <feGaussianBlur in="SourceGraphic" stdDeviation="16" result="color_blur"/>\n <feColorMatrix in="color_blur" type="saturate" values="1.5" result="color_sat"/>\n <feColorMatrix in="color_sat" type="matrix"\n values="0.35 0 0 0 0.65 0 0.35 0 0 0.65 0 0 0.35 0 0.65 0 0 0 0 1"\n result="outline_color"/>\n <feComposite in="outline_color" in2="outline_mask" operator="in" result="outline"/>\n <feMerge>\n <feMergeNode in="outline"/>\n <feMergeNode in="SourceGraphic"/>\n </feMerge>\n </filter>\n </defs>\n</svg>'},{id:"asri-filter-gooey-text",enabled:!1,te:'\n <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" style="position: absolute; width: 0px; height: 0px; overflow: hidden;"><defs><filter><feGaussianBlur in="SourceGraphic" result="blur" stdDeviation="4"></feGaussianBlur><feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 60 -12" result="goo"></feColorMatrix><feComposite in="SourceGraphic" in2="goo" operator="atop"></feComposite></filter></defs></svg>\n '}];function i(n,t){if(document.getElementById(n))return;const e=document.createElement("div");e.innerHTML=t,e.classList.add("asri-injected-filters");const i=e.firstElementChild;i.id=n,i.querySelector("filter").id=n.replace("filter-",""),document.body.insertBefore(e,document.body.lastChild.nextSibling)}function o(n){const t=document.getElementById(n),e=null==t?void 0:t.closest(".asri-injected-filters");null==t||t.remove(),e&&!e.firstElementChild&&e.remove()}},2(n,t,e){var i=this&&this.__awaiter||function(n,t,e,i){return new(e||(e=Promise))((function(o,r){function u(n){try{c(i.next(n))}catch(n){r(n)}}function s(n){try{c(i.throw(n))}catch(n){r(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((i=i.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ie=function(){return i(this,void 0,void 0,(function*(){(0,h.Wt)(),(0,p.oe)(),(0,_.re)(),(0,v.ne)(),yield(0,l.st)(),(0,l.Z)(),j(),(0,m.Et)(),w.start(document,"mouseup"),y.start(document,"dragend"),M.start(document,"keyup",!0),k.start(window,"focus"),k.start(window,"blur"),x.observe(document.body,s.ue),l.Wn.start(document,"mouseup"),!c.K.un&&l.Un.start(document,"mouseup"),c.Lt.se||(yield(0,u.N)(".layout__center")),c.K.un||(C.observe(c.Lt.se),S.observe(document.body))}))},t.ce=function(){return i(this,arguments,void 0,(function*(n=!0){n&&(c.K.un||(yield(0,g.ae)()),(0,m.qt)(),(0,v.ee)(),(0,a.V)(),(0,m.Ht)(),(0,_.le)(),(0,h.Jt)(),(0,p.de)(),document.body.classList.remove("body-asri--fullscreen","asri-tfp","asri-tfp-acrylic","asri-tfp-progressive","asri-c-0"),(0,l._n)(),(0,f.Ft)()),w.remove(document,"mouseup"),y.remove(document,"dragend"),M.remove(document,"keyup",!0),k.remove(window,"focus"),k.remove(window,"blur"),x.disconnect(),l.Wn.remove(document,"mouseup"),l.Un.remove(document,"mouseup"),c.K.un||(C.disconnect(),S.disconnect())}))};const o=e(796),r=e(937),u=e(629),s=e(766),c=e(49),a=e(12),l=e(689),d=e(640),f=e(425),m=e(818),h=e(261),v=e(829),b=e(288),_=e(863),p=e(832),g=e(376),w=new o.it(I),y=new o.it(I),M=new o.it(I),k=new o.it((function(n){(0,r.fe)().then((()=>{j(),!c.K.Qt&&l.followSysAccentColor&&c.K.tn&&(0,l.bn)()}))})),x=new s.me((function(n,t){return i(this,void 0,void 0,(function*(){var t,e;for(let i of n){const n=i.target;if(n.classList.contains("body--blur"))return;if(n.classList.contains("item--focus")){const e=null!==(t=n.getAttribute("data-id"))&&void 0!==t?t:void 0;(0,_.re)(e),e&&l.q[l.cn].followCoverImgColor&&(0,d.vn)(e)}if(n.classList.contains("layout__wnd--active")){const t=n.querySelector(".layout__center .layout-tab-container>[data-id]:not(.fn__none)");if(!t)return;const i=null!==(e=t.getAttribute("data-id"))&&void 0!==e?e:void 0;(0,_.re)(i),i&&l.q[l.cn].followCoverImgColor&&(0,d.vn)(i)}}}))})),C=new s.he((function(n,t){})),S=new s.he((function(n,t){}));new o.it((function(n){(0,b.nt)(600,(()=>{}),200)}));let O=!1,A=0;function I(n){(0,l.rt)(n),(0,a.B)(n),j(n),(0,b.ve)(n)}function j(n){return i(this,void 0,void 0,(function*(){function t(){setTimeout((()=>i(this,void 0,void 0,(function*(){(0,m.Tt)(),yield(0,r.fe)(),(0,m.Et)(),!c.K.Qt&&l.followSysAccentColor&&c.K.tn&&(0,l.bn)()}))),0)}n?(n.type.startsWith("mouseup")||n.type.startsWith("drag")||n instanceof KeyboardEvent&&("Control"===n.key||"Alt"===n.key||"Shift"===n.key||"Meta"===n.key))&&t():t()}))}(0,u.et)((()=>{window.dispatchEvent(new Event("resize"))}),100);(0,u.et)((()=>{O=!1,(0,g.be)(),(0,r._e)(),r.pe||(0,g.ge)(),(0,g.we)(A,O,r.pe).then(g.ye),A=0}),200)},288(n,t,e){var i=this&&this.__awaiter||function(n,t,e,i){return new(e||(e=Promise))((function(o,r){function u(n){try{c(i.next(n))}catch(n){r(n)}}function s(n){try{c(i.throw(n))}catch(n){r(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((i=i.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Me=void 0,t.ve=function(n){return i(this,void 0,void 0,(function*(){if("mouseup"!==n.type)return;n.target.closest('[data-name="barmode"] .b3-menu__item:not([id])')&&(u(),o.K.ke&&(yield new Promise((n=>setTimeout(n,200))))&&(0,r.Wt)())}))},t.nt=u;const o=e(49),r=e(261);function u(){return i(this,arguments,void 0,(function*(n=600,t,e=0){if(document.startViewTransition)if(e>0){const o=n=>new Promise((t=>setTimeout(t,n)));document.startViewTransition((()=>i(this,void 0,void 0,(function*(){yield Promise.race([o(e)]),t&&t()})))).ready.then((()=>{document.documentElement.animate({opacity:[0,1]},{duration:n})}))}else{const e=document.startViewTransition(t),i=document.createElement("style");i.textContent=`\n ::view-transition-old(root),\n ::view-transition-new(root) {\n animation-duration: ${n}ms;\n }\n `,document.head.appendChild(i),yield e.finished,i.remove()}else t&&t()}))}t.Me=window.matchMedia("(prefers-color-scheme: dark)")},863(n,t,e){var i=this&&this.__awaiter||function(n,t,e,i){return new(e||(e=Promise))((function(o,r){function u(n){try{c(i.next(n))}catch(n){r(n)}}function s(n){try{c(i.throw(n))}catch(n){r(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((i=i.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.re=function(n){return i(this,void 0,void 0,(function*(){let t=(yield(0,o.Pn)(n)).xe;const e=r.Lt.status||(yield(0,o.N)("#status"));e&&e.classList.toggle("asri--non-protyle-status",!t)}))},t.le=function(){const n=r.Lt.status;if(!n)return;n.classList.remove("asri--non-protyle-status")};const o=e(629),r=e(49)},832(n,t,e){var i=this&&this.__awaiter||function(n,t,e,i){return new(e||(e=Promise))((function(o,r){function u(n){try{c(i.next(n))}catch(n){r(n)}}function s(n){try{c(i.throw(n))}catch(n){r(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((i=i.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.oe=function(){return i(this,void 0,void 0,(function*(){if(r||u)for(let n=0;n<document.styleSheets.length;n++){let t=document.styleSheets[n];try{for(let n=0;n<t.cssRules.length;n++){let e=t.cssRules[n];e.selectorText&&e.selectorText.includes("::-webkit-scrollbar")&&(e.style.width||e.style.height||e.style.backgroundColor)&&(s.push({styleSheet:t,Ce:e.cssText}),t.deleteRule(n),n--)}}catch(n){}}}))},t.de=function(){return i(this,void 0,void 0,(function*(){for(let n=0;n<s.length;n++){let t=s[n];t.styleSheet.insertRule(t.Ce,t.styleSheet.cssRules.length)}s.length=0}))};const o=e(49),{Kt:r,un:u}=o.K,s=[]},376(n,t,e){var i=this&&this.__awaiter||function(n,t,e,i){return new(e||(e=Promise))((function(o,r){function u(n){try{c(i.next(n))}catch(n){r(n)}}function s(n){try{c(i.throw(n))}catch(n){r(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((i=i.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Se=g,t.be=function(){return i(this,void 0,void 0,(function*(){r.K.Kt&&((0,u.isFullScreen)()?(v-=p?0:88,p=!0):(null==c||c.style.setProperty("width","0px"),v=yield g("initials","L"),null==c||c.style.removeProperty("width"),p=!1))}))},t.we=function(){return i(this,arguments,void 0,(function*(n=0,t=!1,e=!1){return r.K.Oe||r.K.un?{Ae:!1,Ie:0}:new Promise((u=>i(this,void 0,void 0,(function*(){const s=yield function(){return i(this,arguments,void 0,(function*(n=0,t=!1,e=!1){var i,u,s,a,l,d;t&&(b+=n),v&&b||(yield g("initials"));let w=r.Lt.se||(yield(0,o.N)(".layout__center"));f=w.getBoundingClientRect(),h=r.Lt.je.getBoundingClientRect(),m=r.Lt.Pe.getBoundingClientRect();let y=f.left,M=f.right,k=r.Lt.$e.getBoundingClientRect().left;return t||(y>v+8?(null==_||_.style.setProperty("--topbar-left-spacing","0"),r.K.Kt&&p||(yield g("initials","L")),null==c||c.classList.remove("asri-expanded")):r.K.Kt&&!r.K.rn?(_.style.setProperty("--topbar-left-spacing",y-h.right+4+"px"),null==c||c.classList.add("asri-expanded")):(_.style.setProperty("--topbar-left-spacing",y-m.right+4+"px"),null==c||c.classList.add("asri-expanded")),M<b-8&&!e?(_.style.setProperty("--topbar-right-spacing","0"),yield g("initials","R"),null===(i=r.Lt.Rt)||void 0===i||i.style.removeProperty("--avoid-topbar"),null===(u=r.Lt.Fe)||void 0===u||u.style.removeProperty("--avoid-topbar")):r.K.Kt||r.K.rn?(_.style.setProperty("--topbar-right-spacing",window.innerWidth-M+1+"px"),null===(s=r.Lt.Rt)||void 0===s||s.style.setProperty("--avoid-topbar","4px"),null===(a=r.Lt.Fe)||void 0===a||a.style.setProperty("--avoid-topbar","4px")):(_.style.setProperty("--topbar-right-spacing",k-M+6+"px"),null===(l=r.Lt.Rt)||void 0===l||l.style.setProperty("--avoid-topbar","calc(var(--toolbar-height) - 6px)"),null===(d=r.Lt.Fe)||void 0===d||d.style.setProperty("--avoid-topbar","calc(var(--toolbar-height) - 6px)"))),M}))}(n,t,e);u({Ae:!0,Ie:s})}))))}))},t.ye=function(){return i(this,arguments,void 0,(function*({Ae:n,Ie:t}={Ae:!1,Ie:0}){var e,c;n&&(l=null===(e=r.Lt.toolbar)||void 0===e?void 0:e.getBoundingClientRect(),yield g("rect"),f=null===(c=r.Lt.se)||void 0===c?void 0:c.getBoundingClientRect(),(s||(s=document.getElementById("AsriPluginsIconsDivider")))&&(t<b-8?(s.style.setProperty("--container-bg","var(--b3-border-color-trans))"),s.style.left=t+"px",s.style.right="0",s.style.removeProperty("height"),s.style.removeProperty("top"),s.style.removeProperty("width")):(s.style.setProperty("--container-bg","var(--b3-border-color-trans)"),s.style.left=d.right-10+"px",s.style.width="2px",s.style.height="21px",s.style.top="13.5px")),null===u.G||void 0===u.G||u.G.forEach((n=>i(this,void 0,void 0,(function*(){let t,e=n.querySelector('.fn__flex-column[data-type="wnd"] > .fn__flex:first-child');if(e.classList.contains("fn__none")&&(e=yield(0,o.N)('.fn__flex-column[data-type="wnd"] > .fn__flex:first-child:not(.fn__none)',n,3)),t=null==e?void 0:e.getBoundingClientRect(),!t)return;let i=t.left<d.left?d.left-t.left-4:0,u=t.right>d.right?t.right-d.right+8:0;(0,o.Te)(e,r.Lt.Be)||(0,o.Te)(e,r.Lt.toolbar)?(e.style.paddingLeft=i+"px",e.style.paddingRight=u+"px",t.right-u-240<d.left&&t.left<d.left||t.left+i+240>d.right&&t.right>d.right?(e.style.paddingTop="42px",e.style.paddingLeft="0",e.style.paddingRight="0"):e.style.removeProperty("padding-top")):(e.style.removeProperty("padding-left"),e.style.removeProperty("padding-right"),e.style.removeProperty("padding-top"))})))))}))},t.ae=function(){return i(this,void 0,void 0,(function*(){var n,t;yield(0,u.fe)(),function(){s&&s.remove();c&&(c.remove(),c=void 0);a&&(a.remove(),a=void 0)}(),null===u.G||void 0===u.G||u.G.forEach((n=>{let t=n.firstElementChild;t.style.removeProperty("padding-top"),t.style.removeProperty("padding-left"),t.style.removeProperty("padding-right")})),r.Lt.se.dataset.Le=void 0,document.body.dataset.Le=void 0,null===(n=r.Lt.Rt)||void 0===n||n.style.removeProperty("--avoid-topbar"),null===(t=r.Lt.Fe)||void 0===t||t.style.removeProperty("--avoid-topbar")}))},t.Ne=function(){if(r.K.un)return;s=w("AsriPluginsIconsDivider",void 0,r.Lt.Be),c=r.K.Kt&&!r.K.rn?w("AsriTopbarLeftSpacing",void 0,r.Lt.je):w("AsriTopbarLeftSpacing",void 0,r.Lt.Pe),a=r.K.Kt||r.K.rn?w("AsriTopbarRightSpacing"):w("AsriTopbarRightSpacing",r.Lt.$e);const n=document.createElementNS("http://www.w3.org/2000/svg","svg");null==a||a.appendChild(n.cloneNode(!0)),null==s||s.appendChild(n.cloneNode(!0)),null==c||c.appendChild(n.cloneNode(!0))},t.ge=function(){return i(this,void 0,void 0,(function*(){c&&a&&(c.style.setProperty("width","0px"),a.style.setProperty("width","0px"),yield g("initials"),c.style.removeProperty("width"),a.style.removeProperty("width"))}))};const o=e(629),r=e(49),u=e(937);let s,c,a,l,d,f,m,h,v,b,_=r.Lt.toolbar,p=!1;function g(){return i(this,arguments,void 0,(function*(n="rect",...t){const e=r.Lt.Be||(yield(0,o.N)("#drag"));return!e||r.K.Oe?-1:new Promise((i=>{"initials"===n?(t.length&&!t.includes("L")||(v=e.getBoundingClientRect().left,i(v)),t.length&&!t.includes("R")||(b=e.getBoundingClientRect().right,i(b))):(d=e.getBoundingClientRect(),i(d))}))}))}function w(n,t=void 0,e=void 0){if(document.getElementById(n))return;if(!r.Lt.toolbar)return;let i=document.createElement("div");return i.id=n,t?r.Lt.toolbar.insertBefore(i,t):e?r.Lt.toolbar.insertBefore(i,e.nextSibling):r.Lt.toolbar.appendChild(i),i}},613(n,t){var e=this&&this.__awaiter||function(n,t,e,i){return new(e||(e=Promise))((function(o,r){function u(n){try{c(i.next(n))}catch(n){r(n)}}function s(n){try{c(i.throw(n))}catch(n){r(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((i=i.apply(n,t||[])).next())}))};function i(n){return e(this,void 0,void 0,(function*(){let t=yield n;return 0===t.code?t.data:null}))}function o(n,t){return e(this,void 0,void 0,(function*(){let e=null;return yield fetch(n,{body:JSON.stringify(t),method:"POST",headers:{Authorization:"Token "}}).then((function(n){e=n.json()})),e}))}Object.defineProperty(t,"__esModule",{value:!0}),t.getFile=function(n){return e(this,void 0,void 0,(function*(){const t=yield fetch("/api/file/getFile",{method:"POST",body:JSON.stringify({path:n})});return t.ok?t:null}))},t.X=function(n,t){return e(this,arguments,void 0,(function*(n,t,e=!1,i=Date.now()){let o=new Blob([t]),r=n.split("/").pop(),u=new File([o],r),s=new FormData;s.append("path",n),s.append("file",u),s.append("isDir",String(e)),s.append("modTime",String(i));const c=yield fetch("/api/file/putFile",{body:s,method:"POST"});return c.ok?yield c.json():null}))},t.D=function(n,t){return e(this,void 0,void 0,(function*(){return i(o("/api/attr/setBlockAttrs",{id:n,attrs:t}))}))},t.R=function(n){return e(this,void 0,void 0,(function*(){return i(o("/api/attr/getBlockAttrs",{id:n}))}))}},379(n,t){function e(n){if(n.startsWith("#"))return function(n){3===(n=n.slice(1)).length&&(n=n.split("").map((n=>n+n)).join(""));4===n.length&&(n=n.split("").map((n=>n+n)).join(""));if(6===n.length||8===n.length)return"#"+n.toLowerCase();return"#000000"}(n);const t=n.match(/rgba?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)/);if(t){return i(Math.round(parseFloat(t[1])),Math.round(parseFloat(t[2])),Math.round(parseFloat(t[3])))}const e=n.match(/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)%\s*,\s*(\d+(?:\.\d+)?)%\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)/);if(e){return function(n,t,e){const o=(1-Math.abs(2*e-1))*t,r=o*(1-Math.abs(n/60%2-1)),u=e-o/2;let s=0,c=0,a=0;0<=n&&n<60?(s=o,c=r,a=0):60<=n&&n<120?(s=r,c=o,a=0):120<=n&&n<180?(s=0,c=o,a=r):180<=n&&n<240?(s=0,c=r,a=o):240<=n&&n<300?(s=r,c=0,a=o):300<=n&&n<360&&(s=o,c=0,a=r);return s=Math.round(255*(s+u)),c=Math.round(255*(c+u)),a=Math.round(255*(a+u)),i(s,c,a)}(parseFloat(e[1]),parseFloat(e[2])/100,parseFloat(e[3])/100)}const o={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",orange:"#ffa500",purple:"#800080",pink:"#ffc0cb",brown:"#a52a2a",gray:"#808080",grey:"#808080",transparent:"#00000000"},r=n.toLowerCase();return o[r]?o[r]:"#000000"}function i(n,t,e){const i=n=>{const t=Math.max(0,Math.min(255,Math.round(n))).toString(16);return 1===t.length?"0"+t:t};return`#${i(n)}${i(t)}${i(e)}`}t.Fn=function(n){if(!n)return null;const t=[/#([0-9a-fA-F]{3,8})\b/,/rgba?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)/,/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)%\s*,\s*(\d+(?:\.\d+)?)%\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)/,/\b(black|white|red|green|blue|yellow|orange|purple|pink|brown|gray|grey|transparent)\b/i];for(const i of t){const t=n.match(i);if(t)return e(t[0])}return null},t.$n=e,t.jt=function(n){if(!n)return;const t=parseInt(n.substring(1,3),16)/255,e=parseInt(n.substring(3,5),16)/255,i=parseInt(n.substring(5,7),16)/255,o=Math.max(t,e,i),r=Math.min(t,e,i),u=(o+r)/2;if(o===r)return{Re:0,s:0,De:u};let s=0;const c=o-r,a=u>.5?c/(2-o-r):c/(o+r);switch(o){case t:s=(e-i)/c+(e<i?6:0);break;case e:s=(i-t)/c+2;break;case i:s=(t-e)/c+4}return s/=6,{Re:s,s:a,De:u}},t.xn=function(n){if(!n)return;4===(n=n.replace(/^#/,"")).length?n=n.substring(0,3):8===n.length&&(n=n.substring(0,6));3===n.length&&(n=n.split("").map((function(n){return n+n})).join(""));let t=parseInt(n.slice(0,2),16)/255,e=parseInt(n.slice(2,4),16)/255,i=parseInt(n.slice(4,6),16)/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;let o=.4124564*t+.3575761*e+.1804375*i,r=.2126729*t+.7151522*e+.072175*i,u=.0193339*t+.119192*e+.9503041*i,s=.8189330101*o+.3618667424*r-.1288597137*u,c=.0329845436*o+.9293118715*r+.0361456387*u,a=.0482003018*o+.2643662691*r+.633851707*u;s=Math.cbrt(s),c=Math.cbrt(c),a=Math.cbrt(a);let l=.2104542553*s+.793617785*c-.0040720468*a,d=1.9779984951*s-2.428592205*c+.4505937099*a,f=.0259040371*s+.7827717662*c-.808675766*a,m=Math.sqrt(d*d+f*f),h=Math.atan2(f,d)*(180/Math.PI);h<0&&(h+=360);return{$t:l,Cn:m,Ve:h}}},571(n,t,e){t.remote=void 0;const i=e(49);t.remote=i.K.rn||i.K.un?null:e(21)},796(n,t){t.it=void 0;t.it=class{constructor(n){this.Ee=n}start(n,t,e=!1){n.addEventListener(t,this.Ee,e)}remove(n,t,e=!1){n.removeEventListener(t,this.Ee,e)}}},937(n,t,e){var i=this&&this.__awaiter||function(n,t,e,i){return new(e||(e=Promise))((function(o,r){function u(n){try{c(i.next(n))}catch(n){r(n)}}function s(n){try{c(i.throw(n))}catch(n){r(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((i=i.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.G=t.Ge=t.pe=void 0,t._e=s,t.Dt=function(n){const t="B"===n?u.Lt.ze:"L"===n?u.Lt.Nt:u.Lt.Fe;return!(!t||t.classList.contains("layout--float"))},t.Vt=function(n){const t="B"===n?u.Lt.ze:"L"===n?u.Lt.Nt:u.Lt.Fe;let e;if(!t)return!1;e="B"===n?t.style.height:t.style.width;return!(!e||"0px"===e)},t.He=function(n="L"){const t="B"===n?u.Lt.zt:"L"===n?u.Lt.Bt:u.Lt.Rt;return!(!t||!t.classList.contains("fn__none"))},t.Gt=function(){return i(this,void 0,void 0,(function*(){return u.Lt.zt||(yield(0,r.N)(".layout__dockb")),!(!u.Lt.zt||u.Lt.zt.classList.contains("fn__none"))}))},t.isFullScreen=function(){return!(!o.remote||!o.remote.getCurrentWindow().isFullScreen())},t.qe=function(){return!(!u.Lt.status||!u.Lt.status.classList.contains("fn__none"))},t.fe=function(){return i(this,void 0,void 0,(function*(){return yield(0,r.We)('.layout__center [data-type="wnd"]').then((n=>{t.G=n})),t.G}))};const o=e(571),r=e(629),u=e(49);function s(){var n,e;u.Lt.toolbar&&(t.pe=(null===(n=u.Lt.toolbar)||void 0===n?void 0:n.scrollWidth)>u.Lt.toolbar.clientWidth,(null===(e=u.Lt.Ue)||void 0===e?void 0:e.classList.contains("fn__none"))||(t.pe=!0))}t.pe=!1,t.Ge=(0,r.et)(s),t.G=document.querySelectorAll('.layout__center [data-type="wnd"]')},629(n,t){var e=this&&this.__awaiter||function(n,t,e,i){return new(e||(e=Promise))((function(o,r){function u(n){try{c(i.next(n))}catch(n){r(n)}}function s(n){try{c(i.throw(n))}catch(n){r(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((i=i.apply(n,t||[])).next())}))};function i(n,t){let e=!1;return n&&t&&(e=n.right>t.left&&n.bottom>t.top&&n.left<t.left+t.width&&n.top<t.top+t.height),e}function o(n){return e(this,arguments,void 0,(function*(n,t=document,e=10,i=200){let o=0;for(;o<e;){const e=t.querySelector(n);if(e)return e;yield new Promise((n=>setTimeout(n,i))),o++}}))}Object.defineProperty(t,"__esModule",{value:!0}),t.Je=function(n,t){n.includes(t)||n.push(t)},t.et=function(n,t=200){let e=null;return(...i)=>{e&&clearTimeout(e),e=setTimeout((()=>{n(...i),e=null}),t)}},t.tt=function(n,t=200){let e=0,i=null,o=null;return(...r)=>{const u=Date.now();u-e>=t?(e=u,n(...r)):(o=r,i||(i=setTimeout((()=>{e=Date.now(),o&&n(...o),i=null,o=null}),t-(u-e))))}},t.Te=function(n,t){if(!n||!t)return!1;let e,o;e=n.getBoundingClientRect(),o=t.getBoundingClientRect();return i(e,o)},t.Ke=function(n,t){return e(this,void 0,void 0,(function*(){return!(!n||!t)&&new Promise((e=>{let o,r;o=n.getBoundingClientRect(),r=t.getBoundingClientRect();e(i(o,r))}))}))},t.Ye=function(n,t){if(!n.length||!t.length)return!1;const e=new Set(n),i=new Set(t);if(e.size!==i.size)return!1;for(const n of e)if(!i.has(n))return!1;return!0},t.N=o,t.We=function(n){return e(this,arguments,void 0,(function*(n,t=document,e=10,i=200){let o=0;for(;o<e;){const e=t.querySelectorAll(n);if(e.length>0)return e;yield new Promise((n=>setTimeout(n,i))),o++}}))},t.Pn=function(n){return e(this,arguments,void 0,(function*(n,t=!1){var i;const r={Qe:n||void 0,xe:!1,jn:void 0};if(!n){const t=yield o(".layout__center .layout-tab-bar .item--focus");n=null!==(i=null==t?void 0:t.getAttribute("data-id"))&&void 0!==i?i:void 0}if(!n)return r;const u=document.querySelector(`.layout__center .layout-tab-container>.protyle[data-id="${n}"]:not(.fn__none)`);return u?(t&&(yield function(n){return e(this,arguments,void 0,(function*(n,t=5e3){return new Promise((e=>{if("finished"===n.getAttribute("data-loading"))return void e(!0);let i;const o=new MutationObserver((n=>{for(const t of n)if("attributes"===t.type&&"data-loading"===t.attributeName&&"finished"===t.target.getAttribute("data-loading"))return clearTimeout(i),o.disconnect(),void e(!0)}));o.observe(n,{attributeFilter:["data-loading"]}),i=setTimeout((()=>{o.disconnect(),e(!1)}),t)}))}))}(u)),r.xe=!0,r.jn=u,r.Qe=n,r):r}))}},766(n,t){t.ue=t.me=t.he=void 0;t.he=class{constructor(n){this.Ee=(t,e)=>n(t,e),this.Xe=new ResizeObserver(this.Ee)}observe(n,t){this.Xe.observe(n,t)}disconnect(n){this.Xe.disconnect(),n&&n()}unobserve(n){this.Xe.unobserve(n)}};t.me=class{constructor(n){this.Ee=(t,e)=>n(t,e),this.Ze=new MutationObserver(this.Ee)}observe(n,t){this.Ze.observe(n,t)}disconnect(n){this.Ze.disconnect(),n&&n()}},t.ue={attributes:!0,subtree:!0,attributeFilter:["class"],attributeOldValue:!0}},49(n,t){t.K=t.Lt=void 0;const e=navigator.userAgent;let i=null,o=null,r=null,u=null,s=null,c=null,a=null,l=null,d=null,f=null,m=null,h=null,v=null,b=null,_=null,p=null,g=null,w=null;t.Lt={get ni(){return null!=i?i:i=document.getElementById("layouts")},get se(){return null!=o?o:o=document.querySelector(".layout__center")},get toolbar(){return null!=r?r:r=document.getElementById("toolbar")},get Bt(){return null!=u?u:u=document.getElementById("dockLeft")},get Rt(){return null!=s?s:s=document.getElementById("dockRight")},get zt(){return null!=c?c:c=document.getElementById("dockBottom")},get status(){return null!=a?a:a=document.getElementById("status")},get Nt(){return null!=l?l:l=document.querySelector(".layout__dockl")},get Fe(){return null!=d?d:d=document.querySelector(".layout__dockr")},get ze(){return null!=f?f:f=document.querySelector(".layout__dockb")},get je(){return null!=m?m:m=document.getElementById("barSync")},get Pe(){return null!=h?h:h=document.getElementById("barForward")},get ti(){return null!=v?v:v=document.getElementById("toolbarVIP")},get Be(){return null!=b?b:b=document.getElementById("drag")},get ei(){return null!=_?_:_=document.getElementById("barPlugins")},get $e(){return null!=p?p:p=document.getElementById("barSearch")},get ii(){return null!=g?g:g=document.getElementById("barMode")},get Ue(){return null!=w?w:w=document.getElementById("barMore")}},t.K={Kt:navigator.platform.indexOf("Mac")>-1,ke:"windows"===window.siyuan.config.system.os,sn:navigator.platform.indexOf("Linux")>-1,Yt:/Android/.test(e),un:!!document.getElementById("sidebar"),rn:!e.startsWith("SiYuan")||e.indexOf("iPad")>-1||/Android/.test(e)&&!/(?:Mobile)/.test(e),Oe:document.body.classList.contains("body--window"),Qt:(/iOS/i.test(e)||/iPad/i.test(e))&&/AppleWebKit/i.test(e)&&e.startsWith("SiYuan/"),lang:window.siyuan.config.lang,tn:CSS.supports("color","oklch(from red calc(l * 0.5) 0 h)"),Xt:window.siyuan.config.readonly,J:window.siyuan.config.appearance.mode>0?"dark":"light",oi:window.siyuan.config.appearance.modeOS,Zt:/^((?!chrome|android).)*safari/i.test(e)}},21(n){n.exports=require("@electron/remote")}},t={};function e(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return n[i].call(r.exports,r,r.exports,e),r.exports}e.d=(n,t)=>{for(var i in t)e.ri(t,i)&&!e.ri(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:t[i]})},e.ri=(n,t)=>Object.prototype.hasOwnProperty.call(n,t);(()=>{const n=e(2);(0,n.ie)(),window.destroyTheme=()=>{let t=!0;setTimeout((()=>{const e=window.siyuan.config.appearance.themeLight,i=window.siyuan.config.appearance.themeDark;"Asri"===e&&"Asri"===i&&(t=!1),(0,n.ce)(t)}),0)}})()})();