Fuwari/_astro/LightDarkSwitch.CrseSjSX.js

1 line
26 KiB
JavaScript
Raw Permalink Normal View History

2024-07-30 14:54:12 +08:00
import{S as lt,i as at,s as ft,G as ue,n as re,J as He,j as S,D as ut,K as Ct,L as de,M as Qe,e as M,d as L,f as j,N as Ge,O as Ot,H as jt,P as Pt,E as Mt,Q as Ke,R as Lt,a as ve,I as xe,T as z,b as A,t as _e,U as H,h as N,g as ke,k as I,l as O,o as x,V as Q,q as G,x as K,y as W,W as J,z as Dt}from"./translation.DIdkVo7S.js";import{L as Y,D as Z,A as B,b as $t,c as Ft,d as At}from"./setting-utils.CmAt4it9.js";function dt(t,e){const n={},o={},r={$$scope:1};let i=t.length;for(;i--;){const s=t[i],c=e[i];if(c){for(const t in s)t in c||(o[t]=1);for(const t in c)r[t]||(n[t]=c[t],r[t]=1);t[i]=c}else for(const t in s)r[t]=1}for(const t in o)t in n||(n[t]=void 0);return n}const te=/^[a-z0-9]+(-[a-z0-9]+)*$/,pe=(t,e,n,o="")=>{const r=t.split(":");if("@"===t.slice(0,1)){if(r.length<2||r.length>3)return null;o=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const t=r.pop(),n=r.pop(),i={provider:r.length>0?r[0]:o,prefix:n,name:t};return e&&!ae(i)?null:i}const i=r[0],s=i.split("-");if(s.length>1){const t={provider:o,prefix:s.shift(),name:s.join("-")};return e&&!ae(t)?null:t}if(n&&""===o){const t={provider:o,prefix:"",name:i};return e&&!ae(t,n)?null:t}return null},ae=(t,e)=>!!t&&!(""!==t.provider&&!t.provider.match(te)||!(e&&""===t.prefix||t.prefix.match(te))||!t.name.match(te)),ht=Object.freeze({left:0,top:0,width:16,height:16}),he=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ge=Object.freeze({...ht,...he}),Te=Object.freeze({...ge,body:"",hidden:!1});function Nt(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const o=((t.rotate||0)+(e.rotate||0))%4;return o&&(n.rotate=o),n}function We(t,e){const n=Nt(t,e);for(const o in Te)o in he?o in t&&!(o in n)&&(n[o]=he[o]):o in e?n[o]=e[o]:o in t&&(n[o]=t[o]);return n}function Vt(t,e){const n=t.icons,o=t.aliases||Object.create(null),r=Object.create(null);return Object.keys(n).concat(Object.keys(o)).forEach((function t(e){if(n[e])return r[e]=[];if(!(e in r)){r[e]=null;const n=o[e]&&o[e].parent,i=n&&t(n);i&&(r[e]=[n].concat(i))}return r[e]})),r}function Bt(t,e,n){const o=t.icons,r=t.aliases||Object.create(null);let i={};function s(t){i=We(o[t]||r[t],i)}return s(e),n.forEach(s),We(t,i)}function pt(t,e){const n=[];if("object"!=typeof t||"object"!=typeof t.icons)return n;t.not_found instanceof Array&&t.not_found.forEach((t=>{e(t,null),n.push(t)}));const o=Vt(t);for(const r in o){const i=o[r];i&&(e(r,Bt(t,r,i)),n.push(r))}return n}const Rt={provider:"",aliases:{},not_found:{},...ht};function Se(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function gt(t){if("object"!=typeof t||null===t)return null;const e=t;if("string"!=typeof e.prefix||!t.icons||"object"!=typeof t.icons||!Se(t,Rt))return null;const n=e.icons;for(const t in n){const e=n[t];if(!t.match(te)||"string"!=typeof e.body||!Se(e,Te))return null}const o=e.aliases||Object.create(null);for(const t in o){const e=o[t],r=e.parent;if(!t.match(te)||"string"!=typeof r||!n[r]&&!o[r]||!Se(e,Te))return null}return e}const Je=Object.create(null);function Ut(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function R(t,e){const n=Je[t]||(Je[t]=Object.create(null));return n[e]||(n[e]=Ut(t,e))}function Le(t,e){return gt(e)?pt(e,((e,n)=>{n?t.icons[e]=n:t.missing.add(e)})):[]}function qt(t,e,n){try{if("string"==typeof n.body)return t.icons[e]={...n},!0}catch{}return!1}let ne=!1;function mt(t){return"boolean"==typeof t&&(ne=t),ne}function zt(t){const e="string"==typeof t?pe(t,!0,ne):t;if(e){const t=R(e.provider,e.prefix),n=e.name;return t.icons[n]||(t.missing.has(n)?null:void 0)}}function Ht(t,e){const n=pe(t,!0,ne);if(!n)return!1;return qt(R(n.provider,n.prefix),n.name,e)}function Qt(t,e){if("object"!=typeof t)return!1;if("string"!=typeof e&&(e=t.provider||""),ne&&!e&&!t.prefix){let e=!1;return gt(t)&&(t.prefix="",pt(t,((t,n)=>{n&&Ht(t,n)&&(e=!0)}))),e}const n=t.prefix;if(!ae({provider:e,prefix:n,name:"a"}))return!1;return!!Le(R(e,n),t)}const bt=Object.freeze({width:null,height:null}),yt=Object.freeze({...bt,...he}),Gt=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Kt=