@wuxh/daily-avatar 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configManager.mjs +1 -1
- package/dist/configManager.umd.js +1 -1
- package/dist/configResolver.mjs +1 -1
- package/dist/configResolver.umd.js +1 -1
- package/dist/index.js +3 -3
- package/dist/mood-avatars/README.md +16 -0
- package/dist/mood-avatars/templates/cat-style/README.md +16 -0
- package/dist/mood-avatars/templates/line-dog/README.md +16 -0
- package/dist/mood-avatars/templates/line-dog/friday.jpg +0 -0
- package/dist/mood-avatars/templates/line-dog/monday.jpg +0 -0
- package/dist/mood-avatars/templates/line-dog/saturday.jpg +0 -0
- package/dist/mood-avatars/templates/line-dog/sunday.jpg +0 -0
- package/dist/mood-avatars/templates/line-dog/thursday.jpg +0 -0
- package/dist/mood-avatars/templates/line-dog/tuesday.jpg +0 -0
- package/dist/mood-avatars/templates/line-dog/wednesday.jpg +0 -0
- package/dist/mood-avatars/templates/wangzai-weekly/README.md +16 -0
- package/dist/mood-avatars/templates/wangzai-weekly/friday.jpg +0 -0
- package/dist/mood-avatars/templates/wangzai-weekly/monday.jpg +0 -0
- package/dist/mood-avatars/templates/wangzai-weekly/saturday.jpg +0 -0
- package/dist/mood-avatars/templates/wangzai-weekly/sunday.jpg +0 -0
- package/dist/mood-avatars/templates/wangzai-weekly/thursday.jpg +0 -0
- package/dist/mood-avatars/templates/wangzai-weekly/tuesday.jpg +0 -0
- package/dist/mood-avatars/templates/wangzai-weekly/wednesday.jpg +0 -0
- package/package.json +6 -3
- package/userscripts/v2ex-daily-avatar.user.js +15 -4
package/dist/configManager.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{openDB as e}from"idb";var t=`0.0
|
|
1
|
+
import{openDB as e}from"idb";var t=`0.1.0`;({}).DEV;const n={name:`Daily Avatar`,github:`https://github.com/Wxh16144/daily-avatar`,version:t},r={$TIMESTAMP:`当前时间戳`,$DATE:`YYYY-MM-DD`,$VERSION:`当前版本`,$RANDOM:`随机数,每次请求都会变化`};var i=class{config;constructor(e){this.config=e}get variables(){let e=new Date,t=(e,t=2)=>e.toString().padStart(t,`0`),i=e.getFullYear(),a=t(e.getMonth()+1),o=t(e.getDate()),s={$TIMESTAMP:e.getTime().toString(),$DATE:`${i}-${a}-${o}`,$VERSION:n.version,$RANDOM:Math.random().toString()},c={};return Object.entries(r).forEach(([e])=>{c[e]=s[e]||``}),c}replaceVariables(e){let t=e;return Object.entries(this.variables).forEach(([e,n])=>{t=t.split(e).join(n)}),t}getFinalApiUrl(){if(this.config.avatarSource!==`api`||!this.config.apiUrl)return``;try{let e=this.config.apiUrl.startsWith(`http`)?this.config.apiUrl:`https://${this.config.apiUrl}`,t=new URL(e);return(this.config.apiQueryParams||[]).forEach(({key:e,value:n})=>{e&&t.searchParams.append(e,this.replaceVariables(n))}),t.toString()}catch(e){return console.error(`Invalid API URL:`,this.config.apiUrl,e),this.config.apiUrl}}},a=class{getResolver(){return new i(this.config)}recordSuccess(){let e=Date.now(),t=[{timestamp:e,result:`success`},...this.state.history||[]].slice(0,20),n={lastUpdate:e,lastResult:`success`,lastErrorMessage:null,isUpdating:!1,nextScheduledUpdate:e+this.config.updateInterval,history:t},r=this.saveState(n);return r instanceof Promise?r.then(()=>this.state):this.state}recordError(e){let t=Date.now(),n=[{timestamp:t,result:`failure`,message:e.message||`Unknown error`},...this.state.history||[]].slice(0,20),r={lastUpdate:t,lastResult:`failure`,lastErrorMessage:e.message||`Unknown error`,isUpdating:!1,nextScheduledUpdate:t+this.config.updateInterval,history:n},i=this.saveState(r);return i instanceof Promise?i.then(()=>this.state):this.state}getState(){return this.state}hasUpdatedToday(){if(!this.state.lastUpdate||this.state.lastResult!==`success`)return!1;let e=new Date(this.state.lastUpdate),t=new Date;return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}};const o={enabled:!0,autoStart:!0,updateInterval:1440*60*1e3,checkOnLoad:!0,enableNotifications:!0,notifyOnSuccess:!0,notifyOnFailure:!0,notifyOnStart:!1,enableRetry:!1,retryCount:0,retryInterval:300*1e3,avatarSource:`random`,apiUrl:``,apiQueryParams:[]};function s(t){return e(t,2,{upgrade(e){e.objectStoreNames.contains(`config-store`)||e.createObjectStore(`config-store`),e.objectStoreNames.contains(`state-store`)||e.createObjectStore(`state-store`),e.objectStoreNames.contains(`mood-store`)||e.createObjectStore(`mood-store`)}})}var c=class extends a{config;state;dbName;dbPromise;constructor(e=`daily-avatar`){super(),this.dbName=e,this.dbPromise=s(this.dbName),this.config={...o},this.state=this.getDefaultState(),this.loadConfig(),this.loadState()}async loadConfig(){let e=await this.dbPromise,t=await e.get(`config-store`,`avatarConfig`);if(!t){await e.put(`config-store`,o,`avatarConfig`);let t={...o};return this.config=t,t}let n={...o,...t};return this.config=n,n}async saveConfig(e){return this.config={...this.config,...e},await(await this.dbPromise).put(`config-store`,this.config,`avatarConfig`),!0}async resetConfig(){return await(await this.dbPromise).put(`config-store`,o,`avatarConfig`),this.config={...o},!0}getConfig(){return{...this.config}}getDefaultState(){return{lastUpdate:0,lastResult:null,lastErrorMessage:null,isUpdating:!1,nextScheduledUpdate:0,history:[]}}async listStorage(){return[`avatarConfig`,`avatarState`]}async loadState(){let e=this.getDefaultState(),t=await(await this.dbPromise).get(`state-store`,`avatarState`),n=t?{...e,...t}:e;return this.state=n,n}async saveState(e){return this.state={...this.state,...e},await(await this.dbPromise).put(`state-store`,this.state,`avatarState`),!0}async clearAllData(){let e=await this.dbPromise;return await e.clear(`config-store`),await e.clear(`state-store`),await e.clear(`mood-store`),this.config={...o},this.state=this.getDefaultState(),!0}async getMoodAvatar(e){return await(await this.dbPromise).get(`mood-store`,`day-${e}`)||null}async saveMoodAvatar(e,t){return await(await this.dbPromise).put(`mood-store`,t,`day-${e}`),!0}};export{a as BaseConfigManager,c as BrowserConfigManager};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`idb`)):typeof define==`function`&&define.amd?define([`exports`,`idb`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.DailyAvatarBrowserConfigManager={},e.idb))})(this,function(e,t){var n=`0.0
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`idb`)):typeof define==`function`&&define.amd?define([`exports`,`idb`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.DailyAvatarBrowserConfigManager={},e.idb))})(this,function(e,t){var n=`0.1.0`;({}).DEV;let r={name:`Daily Avatar`,github:`https://github.com/Wxh16144/daily-avatar`,version:n},i={$TIMESTAMP:`当前时间戳`,$DATE:`YYYY-MM-DD`,$VERSION:`当前版本`,$RANDOM:`随机数,每次请求都会变化`};var a=class{config;constructor(e){this.config=e}get variables(){let e=new Date,t=(e,t=2)=>e.toString().padStart(t,`0`),n=e.getFullYear(),a=t(e.getMonth()+1),o=t(e.getDate()),s={$TIMESTAMP:e.getTime().toString(),$DATE:`${n}-${a}-${o}`,$VERSION:r.version,$RANDOM:Math.random().toString()},c={};return Object.entries(i).forEach(([e])=>{c[e]=s[e]||``}),c}replaceVariables(e){let t=e;return Object.entries(this.variables).forEach(([e,n])=>{t=t.split(e).join(n)}),t}getFinalApiUrl(){if(this.config.avatarSource!==`api`||!this.config.apiUrl)return``;try{let e=this.config.apiUrl.startsWith(`http`)?this.config.apiUrl:`https://${this.config.apiUrl}`,t=new URL(e);return(this.config.apiQueryParams||[]).forEach(({key:e,value:n})=>{e&&t.searchParams.append(e,this.replaceVariables(n))}),t.toString()}catch(e){return console.error(`Invalid API URL:`,this.config.apiUrl,e),this.config.apiUrl}}},o=class{getResolver(){return new a(this.config)}recordSuccess(){let e=Date.now(),t=[{timestamp:e,result:`success`},...this.state.history||[]].slice(0,20),n={lastUpdate:e,lastResult:`success`,lastErrorMessage:null,isUpdating:!1,nextScheduledUpdate:e+this.config.updateInterval,history:t},r=this.saveState(n);return r instanceof Promise?r.then(()=>this.state):this.state}recordError(e){let t=Date.now(),n=[{timestamp:t,result:`failure`,message:e.message||`Unknown error`},...this.state.history||[]].slice(0,20),r={lastUpdate:t,lastResult:`failure`,lastErrorMessage:e.message||`Unknown error`,isUpdating:!1,nextScheduledUpdate:t+this.config.updateInterval,history:n},i=this.saveState(r);return i instanceof Promise?i.then(()=>this.state):this.state}getState(){return this.state}hasUpdatedToday(){if(!this.state.lastUpdate||this.state.lastResult!==`success`)return!1;let e=new Date(this.state.lastUpdate),t=new Date;return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}};let s={enabled:!0,autoStart:!0,updateInterval:1440*60*1e3,checkOnLoad:!0,enableNotifications:!0,notifyOnSuccess:!0,notifyOnFailure:!0,notifyOnStart:!1,enableRetry:!1,retryCount:0,retryInterval:300*1e3,avatarSource:`random`,apiUrl:``,apiQueryParams:[]};function c(e){return(0,t.openDB)(e,2,{upgrade(e){e.objectStoreNames.contains(`config-store`)||e.createObjectStore(`config-store`),e.objectStoreNames.contains(`state-store`)||e.createObjectStore(`state-store`),e.objectStoreNames.contains(`mood-store`)||e.createObjectStore(`mood-store`)}})}var l=class extends o{config;state;dbName;dbPromise;constructor(e=`daily-avatar`){super(),this.dbName=e,this.dbPromise=c(this.dbName),this.config={...s},this.state=this.getDefaultState(),this.loadConfig(),this.loadState()}async loadConfig(){let e=await this.dbPromise,t=await e.get(`config-store`,`avatarConfig`);if(!t){await e.put(`config-store`,s,`avatarConfig`);let t={...s};return this.config=t,t}let n={...s,...t};return this.config=n,n}async saveConfig(e){return this.config={...this.config,...e},await(await this.dbPromise).put(`config-store`,this.config,`avatarConfig`),!0}async resetConfig(){return await(await this.dbPromise).put(`config-store`,s,`avatarConfig`),this.config={...s},!0}getConfig(){return{...this.config}}getDefaultState(){return{lastUpdate:0,lastResult:null,lastErrorMessage:null,isUpdating:!1,nextScheduledUpdate:0,history:[]}}async listStorage(){return[`avatarConfig`,`avatarState`]}async loadState(){let e=this.getDefaultState(),t=await(await this.dbPromise).get(`state-store`,`avatarState`),n=t?{...e,...t}:e;return this.state=n,n}async saveState(e){return this.state={...this.state,...e},await(await this.dbPromise).put(`state-store`,this.state,`avatarState`),!0}async clearAllData(){let e=await this.dbPromise;return await e.clear(`config-store`),await e.clear(`state-store`),await e.clear(`mood-store`),this.config={...s},this.state=this.getDefaultState(),!0}async getMoodAvatar(e){return await(await this.dbPromise).get(`mood-store`,`day-${e}`)||null}async saveMoodAvatar(e,t){return await(await this.dbPromise).put(`mood-store`,t,`day-${e}`),!0}};e.BaseConfigManager=o,e.BrowserConfigManager=l});
|
package/dist/configResolver.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`0.0
|
|
1
|
+
var e=`0.1.0`;({}).DEV;const t={name:`Daily Avatar`,github:`https://github.com/Wxh16144/daily-avatar`,version:e},n={$TIMESTAMP:`当前时间戳`,$DATE:`YYYY-MM-DD`,$VERSION:`当前版本`,$RANDOM:`随机数,每次请求都会变化`};var r=class{config;constructor(e){this.config=e}get variables(){let e=new Date,r=(e,t=2)=>e.toString().padStart(t,`0`),i=e.getFullYear(),a=r(e.getMonth()+1),o=r(e.getDate()),s={$TIMESTAMP:e.getTime().toString(),$DATE:`${i}-${a}-${o}`,$VERSION:t.version,$RANDOM:Math.random().toString()},c={};return Object.entries(n).forEach(([e])=>{c[e]=s[e]||``}),c}replaceVariables(e){let t=e;return Object.entries(this.variables).forEach(([e,n])=>{t=t.split(e).join(n)}),t}getFinalApiUrl(){if(this.config.avatarSource!==`api`||!this.config.apiUrl)return``;try{let e=this.config.apiUrl.startsWith(`http`)?this.config.apiUrl:`https://${this.config.apiUrl}`,t=new URL(e);return(this.config.apiQueryParams||[]).forEach(({key:e,value:n})=>{e&&t.searchParams.append(e,this.replaceVariables(n))}),t.toString()}catch(e){return console.error(`Invalid API URL:`,this.config.apiUrl,e),this.config.apiUrl}}};export{r as ConfigResolver};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.DailyAvatarConfigResolver={}))})(this,function(e){var t=`0.0
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.DailyAvatarConfigResolver={}))})(this,function(e){var t=`0.1.0`;({}).DEV;let n={name:`Daily Avatar`,github:`https://github.com/Wxh16144/daily-avatar`,version:t},r={$TIMESTAMP:`当前时间戳`,$DATE:`YYYY-MM-DD`,$VERSION:`当前版本`,$RANDOM:`随机数,每次请求都会变化`};e.ConfigResolver=class{config;constructor(e){this.config=e}get variables(){let e=new Date,t=(e,t=2)=>e.toString().padStart(t,`0`),i=e.getFullYear(),a=t(e.getMonth()+1),o=t(e.getDate()),s={$TIMESTAMP:e.getTime().toString(),$DATE:`${i}-${a}-${o}`,$VERSION:n.version,$RANDOM:Math.random().toString()},c={};return Object.entries(r).forEach(([e])=>{c[e]=s[e]||``}),c}replaceVariables(e){let t=e;return Object.entries(this.variables).forEach(([e,n])=>{t=t.split(e).join(n)}),t}getFinalApiUrl(){if(this.config.avatarSource!==`api`||!this.config.apiUrl)return``;try{let e=this.config.apiUrl.startsWith(`http`)?this.config.apiUrl:`https://${this.config.apiUrl}`,t=new URL(e);return(this.config.apiQueryParams||[]).forEach(({key:e,value:n})=>{e&&t.searchParams.append(e,this.replaceVariables(n))}),t.toString()}catch(e){return console.error(`Invalid API URL:`,this.config.apiUrl,e),this.config.apiUrl}}}});
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(M,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(M=typeof globalThis<"u"?globalThis:M||self,A(M.daily_avatar_UI=M.daily_avatar_UI||{}))})(this,(function(M){"use strict";var A,w,pe,j,ge,he,fe,be,Z,ee,te,P={},ve=[],qe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,L=Array.isArray;function $(e,t){for(var r in t)e[r]=t[r];return e}function re(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function _e(e,t,r){var o,a,i,s={};for(i in t)i=="key"?o=t[i]:i=="ref"?a=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?A.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return F(e,s,o,a,null)}function F(e,t,r,o,a){var i={type:e,props:t,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++pe,__i:-1,__u:0};return a==null&&w.vnode!=null&&w.vnode(i),i}function I(e){return e.children}function B(e,t){this.props=e,this.context=t}function N(e,t){if(t==null)return e.__?N(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?N(e):null}function ye(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return ye(e)}}function we(e){(!e.__d&&(e.__d=!0)&&j.push(e)&&!W.__r++||ge!=w.debounceRendering)&&((ge=w.debounceRendering)||he)(W)}function W(){for(var e,t,r,o,a,i,s,u=1;j.length;)j.length>u&&j.sort(fe),e=j.shift(),u=j.length,e.__d&&(r=void 0,o=void 0,a=(o=(t=e).__v).__e,i=[],s=[],t.__P&&((r=$({},o)).__v=o.__v+1,w.vnode&&w.vnode(r),oe(t.__P,r,o,t.__n,t.__P.namespaceURI,32&o.__u?[a]:null,i,a??N(o),!!(32&o.__u),s),r.__v=o.__v,r.__.__k[r.__i]=r,Ce(i,r,s),o.__e=o.__=null,r.__e!=a&&ye(r)));W.__r=0}function me(e,t,r,o,a,i,s,u,p,d,c){var l,h,g,v,_,y,f,b=o&&o.__k||ve,S=t.length;for(p=Je(r,t,b,p,S),l=0;l<S;l++)(g=r.__k[l])!=null&&(h=g.__i==-1?P:b[g.__i]||P,g.__i=l,y=oe(e,g,h,a,i,s,u,p,d,c),v=g.__e,g.ref&&h.ref!=g.ref&&(h.ref&&ae(h.ref,null,g),c.push(g.ref,g.__c||v,g)),_==null&&v!=null&&(_=v),(f=!!(4&g.__u))||h.__k===g.__k?p=xe(g,p,e,f):typeof g.type=="function"&&y!==void 0?p=y:v&&(p=v.nextSibling),g.__u&=-7);return r.__e=_,p}function Je(e,t,r,o,a){var i,s,u,p,d,c=r.length,l=c,h=0;for(e.__k=new Array(a),i=0;i<a;i++)(s=t[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[i]=F(null,s,null,null,null):L(s)?s=e.__k[i]=F(I,{children:s},null,null,null):s.constructor==null&&s.__b>0?s=e.__k[i]=F(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[i]=s,p=i+h,s.__=e,s.__b=e.__b+1,u=null,(d=s.__i=Qe(s,r,p,l))!=-1&&(l--,(u=r[d])&&(u.__u|=2)),u==null||u.__v==null?(d==-1&&(a>c?h--:a<c&&h++),typeof s.type!="function"&&(s.__u|=4)):d!=p&&(d==p-1?h--:d==p+1?h++:(d>p?h--:h++,s.__u|=4))):e.__k[i]=null;if(l)for(i=0;i<c;i++)(u=r[i])!=null&&(2&u.__u)==0&&(u.__e==o&&(o=N(u)),Ee(u,u));return o}function xe(e,t,r,o){var a,i;if(typeof e.type=="function"){for(a=e.__k,i=0;a&&i<a.length;i++)a[i]&&(a[i].__=e,t=xe(a[i],t,r,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=N(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Qe(e,t,r,o){var a,i,s,u=e.key,p=e.type,d=t[r],c=d!=null&&(2&d.__u)==0;if(d===null&&u==null||c&&u==d.key&&p==d.type)return r;if(o>(c?1:0)){for(a=r-1,i=r+1;a>=0||i<t.length;)if((d=t[s=a>=0?a--:i++])!=null&&(2&d.__u)==0&&u==d.key&&p==d.type)return s}return-1}function ke(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||qe.test(t)?r:r+"px"}function V(e,t,r,o,a){var i,s;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)r&&t in r||ke(e.style,t,"");if(r)for(t in r)o&&r[t]==o[t]||ke(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(be,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?o?r.u=o.u:(r.u=Z,e.addEventListener(t,i?te:ee,i)):e.removeEventListener(t,i?te:ee,i);else{if(a=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function Se(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Z++;else if(t.t<r.u)return;return r(w.event?w.event(t):t)}}}function oe(e,t,r,o,a,i,s,u,p,d){var c,l,h,g,v,_,y,f,b,S,E,K,O,Ve,X,H,ue,C=t.type;if(t.constructor!=null)return null;128&r.__u&&(p=!!(32&r.__u),i=[u=t.__e=r.__e]),(c=w.__b)&&c(t);e:if(typeof C=="function")try{if(f=t.props,b="prototype"in C&&C.prototype.render,S=(c=C.contextType)&&o[c.__c],E=c?S?S.props.value:c.__:o,r.__c?y=(l=t.__c=r.__c).__=l.__E:(b?t.__c=l=new C(f,E):(t.__c=l=new B(f,E),l.constructor=C,l.render=Ge),S&&S.sub(l),l.state||(l.state={}),l.__n=o,h=l.__d=!0,l.__h=[],l._sb=[]),b&&l.__s==null&&(l.__s=l.state),b&&C.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=$({},l.__s)),$(l.__s,C.getDerivedStateFromProps(f,l.__s))),g=l.props,v=l.state,l.__v=t,h)b&&C.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),b&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(b&&C.getDerivedStateFromProps==null&&f!==g&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(f,E),t.__v==r.__v||!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(f,l.__s,E)===!1){for(t.__v!=r.__v&&(l.props=f,l.state=l.__s,l.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(z){z&&(z.__=t)}),K=0;K<l._sb.length;K++)l.__h.push(l._sb[K]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(f,l.__s,E),b&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(g,v,_)})}if(l.context=E,l.props=f,l.__P=e,l.__e=!1,O=w.__r,Ve=0,b){for(l.state=l.__s,l.__d=!1,O&&O(t),c=l.render(l.props,l.state,l.context),X=0;X<l._sb.length;X++)l.__h.push(l._sb[X]);l._sb=[]}else do l.__d=!1,O&&O(t),c=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++Ve<25);l.state=l.__s,l.getChildContext!=null&&(o=$($({},o),l.getChildContext())),b&&!h&&l.getSnapshotBeforeUpdate!=null&&(_=l.getSnapshotBeforeUpdate(g,v)),H=c,c!=null&&c.type===I&&c.key==null&&(H=$e(c.props.children)),u=me(e,L(H)?H:[H],t,r,o,a,i,s,u,p,d),l.base=t.__e,t.__u&=-161,l.__h.length&&s.push(l),y&&(l.__E=l.__=null)}catch(z){if(t.__v=null,p||i!=null)if(z.then){for(t.__u|=p?160:128;u&&u.nodeType==8&&u.nextSibling;)u=u.nextSibling;i[i.indexOf(u)]=null,t.__e=u}else{for(ue=i.length;ue--;)re(i[ue]);ne(t)}else t.__e=r.__e,t.__k=r.__k,z.then||ne(t);w.__e(z,t,r)}else i==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):u=t.__e=Ye(r.__e,t,r,o,a,i,s,p,d);return(c=w.diffed)&&c(t),128&t.__u?void 0:u}function ne(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(ne)}function Ce(e,t,r){for(var o=0;o<r.length;o++)ae(r[o],r[++o],r[++o]);w.__c&&w.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){w.__e(i,a.__v)}})}function $e(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:L(e)?e.map($e):$({},e)}function Ye(e,t,r,o,a,i,s,u,p){var d,c,l,h,g,v,_,y=r.props||P,f=t.props,b=t.type;if(b=="svg"?a="http://www.w3.org/2000/svg":b=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((g=i[d])&&"setAttribute"in g==!!b&&(b?g.localName==b:g.nodeType==3)){e=g,i[d]=null;break}}if(e==null){if(b==null)return document.createTextNode(f);e=document.createElementNS(a,b,f.is&&f),u&&(w.__m&&w.__m(t,i),u=!1),i=null}if(b==null)y===f||u&&e.data==f||(e.data=f);else{if(i=i&&A.call(e.childNodes),!u&&i!=null)for(y={},d=0;d<e.attributes.length;d++)y[(g=e.attributes[d]).name]=g.value;for(d in y)if(g=y[d],d!="children"){if(d=="dangerouslySetInnerHTML")l=g;else if(!(d in f)){if(d=="value"&&"defaultValue"in f||d=="checked"&&"defaultChecked"in f)continue;V(e,d,null,g,a)}}for(d in f)g=f[d],d=="children"?h=g:d=="dangerouslySetInnerHTML"?c=g:d=="value"?v=g:d=="checked"?_=g:u&&typeof g!="function"||y[d]===g||V(e,d,g,y[d],a);if(c)u||l&&(c.__html==l.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(l&&(e.innerHTML=""),me(t.type=="template"?e.content:e,L(h)?h:[h],t,r,o,b=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,s,i?i[0]:r.__k&&N(r,0),u,p),i!=null)for(d=i.length;d--;)re(i[d]);u||(d="value",b=="progress"&&v==null?e.removeAttribute("value"):v!=null&&(v!==e[d]||b=="progress"&&!v||b=="option"&&v!=y[d])&&V(e,d,v,y[d],a),d="checked",_!=null&&_!=e[d]&&V(e,d,_,y[d],a))}return e}function ae(e,t,r){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(a){w.__e(a,r)}}function Ee(e,t,r){var o,a;if(w.unmount&&w.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||ae(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){w.__e(i,t)}o.base=o.__P=null}if(o=e.__k)for(a=0;a<o.length;a++)o[a]&&Ee(o[a],t,r||typeof e.type!="function");r||re(e.__e),e.__c=e.__=e.__e=void 0}function Ge(e,t,r){return this.constructor(e,r)}function Me(e,t,r){var o,a,i,s;t==document&&(t=document.documentElement),w.__&&w.__(e,t),a=(o=!1)?null:t.__k,i=[],s=[],oe(t,e=t.__k=_e(I,null,[e]),a||P,P,t.namespaceURI,a?null:t.firstChild?A.call(t.childNodes):null,i,a?a.__e:t.firstChild,o,s),Ce(i,e,s)}A=ve.slice,w={__e:function(e,t,r,o){for(var a,i,s;t=t.__;)if((a=t.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(e)),s=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,o||{}),s=a.__d),s)return a.__E=a}catch(u){e=u}throw e}},pe=0,B.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=$({},this.state),typeof e=="function"&&(e=e($({},r),this.props)),e&&$(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),we(this))},B.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),we(this))},B.prototype.render=I,j=[],he=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fe=function(e,t){return e.__v.__b-t.__v.__b},W.__r=0,be=/(PointerCapture)$|Capture$/i,Z=0,ee=Se(!1),te=Se(!0);const Ke='@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-indigo-50:oklch(96.2% .018 272.314);--color-indigo-500:oklch(58.5% .233 277.117);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-lg:.5rem;--radius-xl:.75rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.top-1{top:calc(var(--spacing)*1)}.top-4{top:calc(var(--spacing)*4)}.right-4{right:calc(var(--spacing)*4)}.bottom-4{bottom:calc(var(--spacing)*4)}.left-1{left:calc(var(--spacing)*1)}.left-\\[22px\\]{left:22px}.z-50{z-index:50}.z-\\[100\\]{z-index:100}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-3{margin-right:calc(var(--spacing)*3)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.-ml-1{margin-left:calc(var(--spacing)*-1)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-16{height:calc(var(--spacing)*16)}.h-full{height:100%}.max-h-40{max-height:calc(var(--spacing)*40)}.max-h-\\[90vh\\]{max-height:90vh}.w-1\\.5{width:calc(var(--spacing)*1.5)}.w-1\\/2{width:50%}.w-1\\/3{width:33.3333%}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-11{width:calc(var(--spacing)*11)}.w-16{width:calc(var(--spacing)*16)}.w-80{width:calc(var(--spacing)*80)}.w-full{width:100%}.max-w-\\[120px\\]{max-width:120px}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.rotate-180{rotate:180deg}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.appearance-none{appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*8)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*8)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-1>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*1)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*3)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-x-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-blue-100{border-color:var(--color-blue-100)}.border-blue-400{border-color:var(--color-blue-400)}.border-blue-500{border-color:var(--color-blue-500)}.border-blue-600{border-color:var(--color-blue-600)}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-green-100{border-color:var(--color-green-100)}.border-green-600{border-color:var(--color-green-600)}.border-red-100{border-color:var(--color-red-100)}.border-red-600{border-color:var(--color-red-600)}.border-transparent{border-color:#0000}.border-white{border-color:var(--color-white)}.border-yellow-600{border-color:var(--color-yellow-600)}.bg-black\\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\\/20{background-color:color-mix(in oklab,var(--color-black)20%,transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-400{background-color:var(--color-blue-400)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-50\\/30{background-color:#f9fafb4d}@supports (color:color-mix(in lab,red,red)){.bg-gray-50\\/30{background-color:color-mix(in oklab,var(--color-gray-50)30%,transparent)}}.bg-gray-50\\/50{background-color:#f9fafb80}@supports (color:color-mix(in lab,red,red)){.bg-gray-50\\/50{background-color:color-mix(in oklab,var(--color-gray-50)50%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-green-50\\/50{background-color:#f0fdf480}@supports (color:color-mix(in lab,red,red)){.bg-green-50\\/50{background-color:color-mix(in oklab,var(--color-green-50)50%,transparent)}}.bg-green-100{background-color:var(--color-green-100)}.bg-green-500{background-color:var(--color-green-500)}.bg-red-50\\/50{background-color:#fef2f280}@supports (color:color-mix(in lab,red,red)){.bg-red-50\\/50{background-color:color-mix(in oklab,var(--color-red-50)50%,transparent)}}.bg-red-500{background-color:var(--color-red-500)}.bg-white{background-color:var(--color-white)}.bg-white\\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\\/80{background-color:color-mix(in oklab,var(--color-white)80%,transparent)}}.bg-white\\/98{background-color:#fffffffa}@supports (color:color-mix(in lab,red,red)){.bg-white\\/98{background-color:color-mix(in oklab,var(--color-white)98%,transparent)}}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-blue-50{--tw-gradient-from:var(--color-blue-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-blue-500{--tw-gradient-from:var(--color-blue-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-indigo-50{--tw-gradient-to:var(--color-indigo-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-indigo-500{--tw-gradient-to:var(--color-indigo-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.object-cover{object-fit:cover}.p-1\\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-3\\.5{padding-block:calc(var(--spacing)*3.5)}.py-4{padding-block:calc(var(--spacing)*4)}.py-6{padding-block:calc(var(--spacing)*6)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.text-right{text-align:right}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[10px\\]{font-size:10px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.whitespace-nowrap{white-space:nowrap}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-700{color:var(--color-green-700)}.text-red-400{color:var(--color-red-400)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.accent-blue-600{accent-color:var(--color-blue-600)}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.outline-none{--tw-outline-style:none;outline-style:none}@media(hover:hover){.group-hover\\:scale-110:is(:where(.group):hover *){--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x)var(--tw-scale-y)}.group-hover\\:text-blue-500:is(:where(.group):hover *){color:var(--color-blue-500)}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.hover\\:border-blue-300:hover{border-color:var(--color-blue-300)}.hover\\:border-blue-400:hover{border-color:var(--color-blue-400)}.hover\\:border-gray-200:hover{border-color:var(--color-gray-200)}.hover\\:bg-blue-100:hover{background-color:var(--color-blue-100)}.hover\\:bg-blue-600:hover{background-color:var(--color-blue-600)}.hover\\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\\:bg-white:hover{background-color:var(--color-white)}.hover\\:bg-white\\/50:hover{background-color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/50:hover{background-color:color-mix(in oklab,var(--color-white)50%,transparent)}}.hover\\:text-blue-500:hover{color:var(--color-blue-500)}.hover\\:text-blue-600:hover{color:var(--color-blue-600)}.hover\\:text-gray-600:hover{color:var(--color-gray-600)}.hover\\:text-gray-700:hover{color:var(--color-gray-700)}.hover\\:text-gray-800:hover{color:var(--color-gray-800)}.hover\\:text-red-600:hover{color:var(--color-red-600)}.hover\\:text-red-700:hover{color:var(--color-red-700)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}}.focus\\:border-blue-500:focus{border-color:var(--color-blue-500)}.active\\:bg-blue-800:active{background-color:var(--color-blue-800)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}}:host{-webkit-text-size-adjust:100%;z-index:2147483647;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif;line-height:1.5;position:relative}*{box-sizing:border-box;border:0 solid #e5e7eb}:before,:after{--tw-content:"";box-sizing:border-box}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}.daily-avatar-panel{z-index:2147483647!important;-webkit-backdrop-filter:blur(12px)!important;background:#fffffffa!important;border:2px solid #d1d5db!important;border-radius:.75rem!important;width:16rem!important;position:fixed!important;bottom:1rem!important;right:1rem!important;overflow:hidden!important;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a!important}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}';var Xe=0;function n(e,t,r,o,a,i){t||(t={});var s,u,p=t;if("ref"in p)for(u in p={},t)u=="ref"?s=t[u]:p[u]=t[u];var d={type:e,props:p,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Xe,__i:-1,__u:0,__source:a,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(u in s)p[u]===void 0&&(p[u]=s[u]);return w.vnode&&w.vnode(d),d}const Ze=e=>{let t;const r=new Set,o=(d,c)=>{const l=typeof d=="function"?d(t):d;if(!Object.is(l,t)){const h=t;t=c??(typeof l!="object"||l===null)?l:Object.assign({},t,l),r.forEach(g=>g(t,h))}},a=()=>t,u={setState:o,getState:a,getInitialState:()=>p,subscribe:d=>(r.add(d),()=>r.delete(d))},p=t=e(o,a,u);return u},et=(e=>Ze),Ae={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},D=new Map,q=e=>{const t=D.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([r,o])=>[r,o.getState()])):{}},tt=(e,t,r)=>{if(e===void 0)return{type:"untracked",connection:t.connect(r)};const o=D.get(r.name);if(o)return{type:"tracked",store:e,...o};const a={connection:t.connect(r),stores:{}};return D.set(r.name,a),{type:"tracked",store:e,...a}},rt=(e,t)=>{if(t===void 0)return;const r=D.get(e);r&&(delete r.stores[t],Object.keys(r.stores).length===0&&D.delete(e))},ot=e=>{var t,r;if(!e)return;const o=e.split(`
|
|
2
|
-
`),a
|
|
1
|
+
(function(T,j){typeof exports=="object"&&typeof module<"u"?j(exports):typeof define=="function"&&define.amd?define(["exports"],j):(T=typeof globalThis<"u"?globalThis:T||self,j(T.daily_avatar_UI=T.daily_avatar_UI||{}))})(this,(function(T){"use strict";var j,_,pe,z,ge,he,fe,ve,ee,te,re,R={},be=[],Ve=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,W=Array.isArray;function M(e,t){for(var r in t)e[r]=t[r];return e}function oe(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function we(e,t,r){var a,n,i,s={};for(i in t)i=="key"?a=t[i]:i=="ref"?n=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?j.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return q(e,s,a,n,null)}function q(e,t,r,a,n){var i={type:e,props:t,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++pe,__i:-1,__u:0};return n==null&&_.vnode!=null&&_.vnode(i),i}function I(e){return e.children}function V(e,t){this.props=e,this.context=t}function U(e,t){if(t==null)return e.__?U(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?U(e):null}function ye(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return ye(e)}}function _e(e){(!e.__d&&(e.__d=!0)&&z.push(e)&&!J.__r++||ge!=_.debounceRendering)&&((ge=_.debounceRendering)||he)(J)}function J(){for(var e,t,r,a,n,i,s,d=1;z.length;)z.length>d&&z.sort(fe),e=z.shift(),d=z.length,e.__d&&(r=void 0,a=void 0,n=(a=(t=e).__v).__e,i=[],s=[],t.__P&&((r=M({},a)).__v=a.__v+1,_.vnode&&_.vnode(r),ae(t.__P,r,a,t.__n,t.__P.namespaceURI,32&a.__u?[n]:null,i,n??U(a),!!(32&a.__u),s),r.__v=a.__v,r.__.__k[r.__i]=r,Ce(i,r,s),a.__e=a.__=null,r.__e!=n&&ye(r)));J.__r=0}function me(e,t,r,a,n,i,s,d,h,c,g){var l,u,p,v,y,w,f,b=a&&a.__k||be,x=t.length;for(h=Je(r,t,b,h,x),l=0;l<x;l++)(p=r.__k[l])!=null&&(u=p.__i==-1?R:b[p.__i]||R,p.__i=l,w=ae(e,p,u,n,i,s,d,h,c,g),v=p.__e,p.ref&&u.ref!=p.ref&&(u.ref&&ie(u.ref,null,p),g.push(p.ref,p.__c||v,p)),y==null&&v!=null&&(y=v),(f=!!(4&p.__u))||u.__k===p.__k?h=xe(p,h,e,f):typeof p.type=="function"&&w!==void 0?h=w:v&&(h=v.nextSibling),p.__u&=-7);return r.__e=y,h}function Je(e,t,r,a,n){var i,s,d,h,c,g=r.length,l=g,u=0;for(e.__k=new Array(n),i=0;i<n;i++)(s=t[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[i]=q(null,s,null,null,null):W(s)?s=e.__k[i]=q(I,{children:s},null,null,null):s.constructor==null&&s.__b>0?s=e.__k[i]=q(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[i]=s,h=i+u,s.__=e,s.__b=e.__b+1,d=null,(c=s.__i=Qe(s,r,h,l))!=-1&&(l--,(d=r[c])&&(d.__u|=2)),d==null||d.__v==null?(c==-1&&(n>g?u--:n<g&&u++),typeof s.type!="function"&&(s.__u|=4)):c!=h&&(c==h-1?u--:c==h+1?u++:(c>h?u--:u++,s.__u|=4))):e.__k[i]=null;if(l)for(i=0;i<g;i++)(d=r[i])!=null&&(2&d.__u)==0&&(d.__e==a&&(a=U(d)),Ee(d,d));return a}function xe(e,t,r,a){var n,i;if(typeof e.type=="function"){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=xe(n[i],t,r,a));return t}e.__e!=t&&(a&&(t&&e.type&&!t.parentNode&&(t=U(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Qe(e,t,r,a){var n,i,s,d=e.key,h=e.type,c=t[r],g=c!=null&&(2&c.__u)==0;if(c===null&&d==null||g&&d==c.key&&h==c.type)return r;if(a>(g?1:0)){for(n=r-1,i=r+1;n>=0||i<t.length;)if((c=t[s=n>=0?n--:i++])!=null&&(2&c.__u)==0&&d==c.key&&h==c.type)return s}return-1}function ke(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Ve.test(t)?r:r+"px"}function Q(e,t,r,a,n){var i,s;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof a=="string"&&(e.style.cssText=a=""),a)for(t in a)r&&t in r||ke(e.style,t,"");if(r)for(t in r)a&&r[t]==a[t]||ke(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(ve,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?a?r.u=a.u:(r.u=ee,e.addEventListener(t,i?re:te,i)):e.removeEventListener(t,i?re:te,i);else{if(n=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function Se(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=ee++;else if(t.t<r.u)return;return r(_.event?_.event(t):t)}}}function ae(e,t,r,a,n,i,s,d,h,c){var g,l,u,p,v,y,w,f,b,x,C,$,N,qe,Z,B,ue,E=t.type;if(t.constructor!=null)return null;128&r.__u&&(h=!!(32&r.__u),i=[d=t.__e=r.__e]),(g=_.__b)&&g(t);e:if(typeof E=="function")try{if(f=t.props,b="prototype"in E&&E.prototype.render,x=(g=E.contextType)&&a[g.__c],C=g?x?x.props.value:g.__:a,r.__c?w=(l=t.__c=r.__c).__=l.__E:(b?t.__c=l=new E(f,C):(t.__c=l=new V(f,C),l.constructor=E,l.render=Ge),x&&x.sub(l),l.state||(l.state={}),l.__n=a,u=l.__d=!0,l.__h=[],l._sb=[]),b&&l.__s==null&&(l.__s=l.state),b&&E.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=M({},l.__s)),M(l.__s,E.getDerivedStateFromProps(f,l.__s))),p=l.props,v=l.state,l.__v=t,u)b&&E.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),b&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(b&&E.getDerivedStateFromProps==null&&f!==p&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(f,C),t.__v==r.__v||!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(f,l.__s,C)===!1){for(t.__v!=r.__v&&(l.props=f,l.state=l.__s,l.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(D){D&&(D.__=t)}),$=0;$<l._sb.length;$++)l.__h.push(l._sb[$]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(f,l.__s,C),b&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(p,v,y)})}if(l.context=C,l.props=f,l.__P=e,l.__e=!1,N=_.__r,qe=0,b){for(l.state=l.__s,l.__d=!1,N&&N(t),g=l.render(l.props,l.state,l.context),Z=0;Z<l._sb.length;Z++)l.__h.push(l._sb[Z]);l._sb=[]}else do l.__d=!1,N&&N(t),g=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++qe<25);l.state=l.__s,l.getChildContext!=null&&(a=M(M({},a),l.getChildContext())),b&&!u&&l.getSnapshotBeforeUpdate!=null&&(y=l.getSnapshotBeforeUpdate(p,v)),B=g,g!=null&&g.type===I&&g.key==null&&(B=$e(g.props.children)),d=me(e,W(B)?B:[B],t,r,a,n,i,s,d,h,c),l.base=t.__e,t.__u&=-161,l.__h.length&&s.push(l),w&&(l.__E=l.__=null)}catch(D){if(t.__v=null,h||i!=null)if(D.then){for(t.__u|=h?160:128;d&&d.nodeType==8&&d.nextSibling;)d=d.nextSibling;i[i.indexOf(d)]=null,t.__e=d}else{for(ue=i.length;ue--;)oe(i[ue]);ne(t)}else t.__e=r.__e,t.__k=r.__k,D.then||ne(t);_.__e(D,t,r)}else i==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):d=t.__e=Ye(r.__e,t,r,a,n,i,s,h,c);return(g=_.diffed)&&g(t),128&t.__u?void 0:d}function ne(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(ne)}function Ce(e,t,r){for(var a=0;a<r.length;a++)ie(r[a],r[++a],r[++a]);_.__c&&_.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(i){i.call(n)})}catch(i){_.__e(i,n.__v)}})}function $e(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:W(e)?e.map($e):M({},e)}function Ye(e,t,r,a,n,i,s,d,h){var c,g,l,u,p,v,y,w=r.props||R,f=t.props,b=t.type;if(b=="svg"?n="http://www.w3.org/2000/svg":b=="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((p=i[c])&&"setAttribute"in p==!!b&&(b?p.localName==b:p.nodeType==3)){e=p,i[c]=null;break}}if(e==null){if(b==null)return document.createTextNode(f);e=document.createElementNS(n,b,f.is&&f),d&&(_.__m&&_.__m(t,i),d=!1),i=null}if(b==null)w===f||d&&e.data==f||(e.data=f);else{if(i=i&&j.call(e.childNodes),!d&&i!=null)for(w={},c=0;c<e.attributes.length;c++)w[(p=e.attributes[c]).name]=p.value;for(c in w)if(p=w[c],c!="children"){if(c=="dangerouslySetInnerHTML")l=p;else if(!(c in f)){if(c=="value"&&"defaultValue"in f||c=="checked"&&"defaultChecked"in f)continue;Q(e,c,null,p,n)}}for(c in f)p=f[c],c=="children"?u=p:c=="dangerouslySetInnerHTML"?g=p:c=="value"?v=p:c=="checked"?y=p:d&&typeof p!="function"||w[c]===p||Q(e,c,p,w[c],n);if(g)d||l&&(g.__html==l.__html||g.__html==e.innerHTML)||(e.innerHTML=g.__html),t.__k=[];else if(l&&(e.innerHTML=""),me(t.type=="template"?e.content:e,W(u)?u:[u],t,r,a,b=="foreignObject"?"http://www.w3.org/1999/xhtml":n,i,s,i?i[0]:r.__k&&U(r,0),d,h),i!=null)for(c=i.length;c--;)oe(i[c]);d||(c="value",b=="progress"&&v==null?e.removeAttribute("value"):v!=null&&(v!==e[c]||b=="progress"&&!v||b=="option"&&v!=w[c])&&Q(e,c,v,w[c],n),c="checked",y!=null&&y!=e[c]&&Q(e,c,y,w[c],n))}return e}function ie(e,t,r){try{if(typeof e=="function"){var a=typeof e.__u=="function";a&&e.__u(),a&&t==null||(e.__u=e(t))}else e.current=t}catch(n){_.__e(n,r)}}function Ee(e,t,r){var a,n;if(_.unmount&&_.unmount(e),(a=e.ref)&&(a.current&&a.current!=e.__e||ie(a,null,t)),(a=e.__c)!=null){if(a.componentWillUnmount)try{a.componentWillUnmount()}catch(i){_.__e(i,t)}a.base=a.__P=null}if(a=e.__k)for(n=0;n<a.length;n++)a[n]&&Ee(a[n],t,r||typeof e.type!="function");r||oe(e.__e),e.__c=e.__=e.__e=void 0}function Ge(e,t,r){return this.constructor(e,r)}function Me(e,t,r){var a,n,i,s;t==document&&(t=document.documentElement),_.__&&_.__(e,t),n=(a=!1)?null:t.__k,i=[],s=[],ae(t,e=t.__k=we(I,null,[e]),n||R,R,t.namespaceURI,n?null:t.firstChild?j.call(t.childNodes):null,i,n?n.__e:t.firstChild,a,s),Ce(i,e,s)}j=be.slice,_={__e:function(e,t,r,a){for(var n,i,s;t=t.__;)if((n=t.__c)&&!n.__)try{if((i=n.constructor)&&i.getDerivedStateFromError!=null&&(n.setState(i.getDerivedStateFromError(e)),s=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,a||{}),s=n.__d),s)return n.__E=n}catch(d){e=d}throw e}},pe=0,V.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=M({},this.state),typeof e=="function"&&(e=e(M({},r),this.props)),e&&M(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),_e(this))},V.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_e(this))},V.prototype.render=I,z=[],he=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fe=function(e,t){return e.__v.__b-t.__v.__b},J.__r=0,ve=/(PointerCapture)$|Capture$/i,ee=0,te=Se(!1),re=Se(!0);const Ke='@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-indigo-50:oklch(96.2% .018 272.314);--color-indigo-500:oklch(58.5% .233 277.117);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.top-1{top:calc(var(--spacing)*1)}.top-4{top:calc(var(--spacing)*4)}.right-4{right:calc(var(--spacing)*4)}.bottom-4{bottom:calc(var(--spacing)*4)}.left-1{left:calc(var(--spacing)*1)}.left-\\[22px\\]{left:22px}.z-50{z-index:50}.z-\\[100\\]{z-index:100}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-3{margin-right:calc(var(--spacing)*3)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.-ml-1{margin-left:calc(var(--spacing)*-1)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.aspect-square{aspect-ratio:1}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-16{height:calc(var(--spacing)*16)}.h-full{height:100%}.max-h-40{max-height:calc(var(--spacing)*40)}.max-h-\\[90vh\\]{max-height:90vh}.w-1\\.5{width:calc(var(--spacing)*1.5)}.w-1\\/2{width:50%}.w-1\\/3{width:33.3333%}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-11{width:calc(var(--spacing)*11)}.w-16{width:calc(var(--spacing)*16)}.w-80{width:calc(var(--spacing)*80)}.w-full{width:100%}.max-w-\\[120px\\]{max-width:120px}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.-translate-x-1{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-0{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-90{--tw-scale-x:90%;--tw-scale-y:90%;--tw-scale-z:90%;scale:var(--tw-scale-x)var(--tw-scale-y)}.rotate-180{rotate:180deg}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.appearance-none{appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*8)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*8)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-1>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*1)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*3)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-x-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-blue-100{border-color:var(--color-blue-100)}.border-blue-400{border-color:var(--color-blue-400)}.border-blue-500{border-color:var(--color-blue-500)}.border-blue-600{border-color:var(--color-blue-600)}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-green-100{border-color:var(--color-green-100)}.border-green-600{border-color:var(--color-green-600)}.border-red-100{border-color:var(--color-red-100)}.border-red-600{border-color:var(--color-red-600)}.border-transparent{border-color:#0000}.border-white{border-color:var(--color-white)}.border-yellow-600{border-color:var(--color-yellow-600)}.bg-black\\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\\/20{background-color:color-mix(in oklab,var(--color-black)20%,transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-400{background-color:var(--color-blue-400)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-50\\/30{background-color:#f9fafb4d}@supports (color:color-mix(in lab,red,red)){.bg-gray-50\\/30{background-color:color-mix(in oklab,var(--color-gray-50)30%,transparent)}}.bg-gray-50\\/50{background-color:#f9fafb80}@supports (color:color-mix(in lab,red,red)){.bg-gray-50\\/50{background-color:color-mix(in oklab,var(--color-gray-50)50%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-green-50\\/50{background-color:#f0fdf480}@supports (color:color-mix(in lab,red,red)){.bg-green-50\\/50{background-color:color-mix(in oklab,var(--color-green-50)50%,transparent)}}.bg-green-100{background-color:var(--color-green-100)}.bg-green-500{background-color:var(--color-green-500)}.bg-red-50\\/50{background-color:#fef2f280}@supports (color:color-mix(in lab,red,red)){.bg-red-50\\/50{background-color:color-mix(in oklab,var(--color-red-50)50%,transparent)}}.bg-red-500{background-color:var(--color-red-500)}.bg-white{background-color:var(--color-white)}.bg-white\\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\\/80{background-color:color-mix(in oklab,var(--color-white)80%,transparent)}}.bg-white\\/98{background-color:#fffffffa}@supports (color:color-mix(in lab,red,red)){.bg-white\\/98{background-color:color-mix(in oklab,var(--color-white)98%,transparent)}}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-blue-50{--tw-gradient-from:var(--color-blue-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-blue-500{--tw-gradient-from:var(--color-blue-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-indigo-50{--tw-gradient-to:var(--color-indigo-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-indigo-500{--tw-gradient-to:var(--color-indigo-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.object-cover{object-fit:cover}.p-1\\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-3\\.5{padding-block:calc(var(--spacing)*3.5)}.py-4{padding-block:calc(var(--spacing)*4)}.py-6{padding-block:calc(var(--spacing)*6)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.text-right{text-align:right}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.whitespace-nowrap{white-space:nowrap}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-700{color:var(--color-green-700)}.text-red-400{color:var(--color-red-400)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.accent-blue-600{accent-color:var(--color-blue-600)}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-100{opacity:1}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-blue-100{--tw-ring-color:var(--color-blue-100)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.outline-none{--tw-outline-style:none;outline-style:none}@media(hover:hover){.group-hover\\:translate-x-0:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-hover\\:scale-110:is(:where(.group):hover *){--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x)var(--tw-scale-y)}.group-hover\\:text-blue-500:is(:where(.group):hover *){color:var(--color-blue-500)}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.hover\\:border-blue-400:hover{border-color:var(--color-blue-400)}.hover\\:border-blue-500:hover{border-color:var(--color-blue-500)}.hover\\:border-gray-200:hover{border-color:var(--color-gray-200)}.hover\\:bg-blue-100:hover{background-color:var(--color-blue-100)}.hover\\:bg-blue-600:hover{background-color:var(--color-blue-600)}.hover\\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\\:bg-white:hover{background-color:var(--color-white)}.hover\\:bg-white\\/50:hover{background-color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/50:hover{background-color:color-mix(in oklab,var(--color-white)50%,transparent)}}.hover\\:text-blue-500:hover{color:var(--color-blue-500)}.hover\\:text-blue-600:hover{color:var(--color-blue-600)}.hover\\:text-gray-600:hover{color:var(--color-gray-600)}.hover\\:text-gray-700:hover{color:var(--color-gray-700)}.hover\\:text-gray-800:hover{color:var(--color-gray-800)}.hover\\:text-red-600:hover{color:var(--color-red-600)}.hover\\:text-red-700:hover{color:var(--color-red-700)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\\:ring-1:hover{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\\:ring-blue-100:hover{--tw-ring-color:var(--color-blue-100)}}.focus\\:border-blue-500:focus{border-color:var(--color-blue-500)}.active\\:bg-blue-800:active{background-color:var(--color-blue-800)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}}:host{-webkit-text-size-adjust:100%;z-index:2147483647;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif;line-height:1.5;position:relative}*{box-sizing:border-box;border:0 solid #e5e7eb}:before,:after{--tw-content:"";box-sizing:border-box}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}.daily-avatar-panel{z-index:2147483647!important;-webkit-backdrop-filter:blur(12px)!important;background:#fffffffa!important;border:2px solid #d1d5db!important;border-radius:.75rem!important;width:16rem!important;position:fixed!important;bottom:1rem!important;right:1rem!important;overflow:hidden!important;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}';var Xe=0;function o(e,t,r,a,n,i){t||(t={});var s,d,h=t;if("ref"in h)for(d in h={},t)d=="ref"?s=t[d]:h[d]=t[d];var c={type:e,props:h,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Xe,__i:-1,__u:0,__source:n,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(d in s)h[d]===void 0&&(h[d]=s[d]);return _.vnode&&_.vnode(c),c}const Ze=e=>{let t;const r=new Set,a=(c,g)=>{const l=typeof c=="function"?c(t):c;if(!Object.is(l,t)){const u=t;t=g??(typeof l!="object"||l===null)?l:Object.assign({},t,l),r.forEach(p=>p(t,u))}},n=()=>t,d={setState:a,getState:n,getInitialState:()=>h,subscribe:c=>(r.add(c),()=>r.delete(c))},h=t=e(a,n,d);return d},et=(e=>Ze),Ae={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},O=new Map,Y=e=>{const t=O.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([r,a])=>[r,a.getState()])):{}},tt=(e,t,r)=>{if(e===void 0)return{type:"untracked",connection:t.connect(r)};const a=O.get(r.name);if(a)return{type:"tracked",store:e,...a};const n={connection:t.connect(r),stores:{}};return O.set(r.name,n),{type:"tracked",store:e,...n}},rt=(e,t)=>{if(t===void 0)return;const r=O.get(e);r&&(delete r.stores[t],Object.keys(r.stores).length===0&&O.delete(e))},ot=e=>{var t,r;if(!e)return;const a=e.split(`
|
|
2
|
+
`),n=a.findIndex(s=>s.includes("api.setState"));if(n<0)return;const i=((t=a[n+1])==null?void 0:t.trim())||"";return(r=/.+ (.+) .+/.exec(i))==null?void 0:r[1]},at=(e,t={})=>(r,a,n)=>{const{enabled:i,anonymousActionType:s,store:d,...h}=t;let c;try{c=(i??(Ae?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return e(r,a,n);const{connection:g,...l}=tt(d,c,h);let u=!0;n.setState=((y,w,f)=>{const b=r(y,w);if(!u)return b;const x=f===void 0?{type:s||ot(new Error().stack)||"anonymous"}:typeof f=="string"?{type:f}:f;return d===void 0?(g?.send(x,a()),b):(g?.send({...x,type:`${d}/${x.type}`},{...Y(h.name),[d]:n.getState()}),b)}),n.devtools={cleanup:()=>{g&&typeof g.unsubscribe=="function"&&g.unsubscribe(),rt(h.name,d)}};const p=(...y)=>{const w=u;u=!1,r(...y),u=w},v=e(n.setState,a,n);if(l.type==="untracked"?g?.init(v):(l.stores[l.store]=n,g?.init(Object.fromEntries(Object.entries(l.stores).map(([y,w])=>[y,y===l.store?v:w.getState()])))),n.dispatchFromDevtools&&typeof n.dispatch=="function"){let y=!1;const w=n.dispatch;n.dispatch=(...f)=>{(Ae?"production":void 0)!=="production"&&f[0].type==="__setState"&&!y&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),y=!0),w(...f)}}return g.subscribe(y=>{var w;switch(y.type){case"ACTION":if(typeof y.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return le(y.payload,f=>{if(f.type==="__setState"){if(d===void 0){p(f.state);return}Object.keys(f.state).length!==1&&console.error(`
|
|
3
3
|
[zustand devtools middleware] Unsupported __setState action format.
|
|
4
4
|
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
|
5
5
|
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|
|
6
|
-
`);const b=f.state[u];if(b==null)return;JSON.stringify(a.getState())!==JSON.stringify(b)&&g(b);return}a.dispatchFromDevtools&&typeof a.dispatch=="function"&&a.dispatch(f)});case"DISPATCH":switch(_.payload.type){case"RESET":return g(v),u===void 0?c?.init(a.getState()):c?.init(q(p.name));case"COMMIT":if(u===void 0){c?.init(a.getState());return}return c?.init(q(p.name));case"ROLLBACK":return ie(_.state,f=>{if(u===void 0){g(f),c?.init(a.getState());return}g(f[u]),c?.init(q(p.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return ie(_.state,f=>{if(u===void 0){g(f);return}JSON.stringify(a.getState())!==JSON.stringify(f[u])&&g(f[u])});case"IMPORT_STATE":{const{nextLiftedState:f}=_.payload,b=(y=f.computedStates.slice(-1)[0])==null?void 0:y.state;if(!b)return;g(u===void 0?b:b[u]),c?.send(null,f);return}case"PAUSE_RECORDING":return h=!h}return}}),v},ie=(e,t)=>{let r;try{r=JSON.parse(e)}catch(o){console.error("[zustand devtools middleware] Could not parse the received json",o)}r!==void 0&&t(r)},at=e=>(t,r,o)=>{const a=o.subscribe;return o.subscribe=((s,u,p)=>{let d=s;if(u){const c=p?.equalityFn||Object.is;let l=s(o.getState());d=h=>{const g=s(h);if(!c(l,g)){const v=l;u(l=g,v)}},p?.fireImmediately&&u(l,l)}return a(d)}),e(t,r,o)};var J,x,le,Te,se=0,je=[],k=w,Ie=k.__b,Ne=k.__r,Ue=k.diffed,ze=k.__c,Pe=k.unmount,De=k.__;function Re(e,t){k.__h&&k.__h(x,e,se||t),se=0;var r=x.__H||(x.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function T(e){return se=1,it(He,e)}function it(e,t,r){var o=Re(J++,2);if(o.t=e,!o.__c&&(o.__=[He(void 0,t),function(u){var p=o.__N?o.__N[0]:o.__[0],d=o.t(p,u);p!==d&&(o.__N=[d,o.__[1]],o.__c.setState({}))}],o.__c=x,!x.__f)){var a=function(u,p,d){if(!o.__c.__H)return!0;var c=o.__c.__H.__.filter(function(h){return!!h.__c});if(c.every(function(h){return!h.__N}))return!i||i.call(this,u,p,d);var l=o.__c.props!==u;return c.forEach(function(h){if(h.__N){var g=h.__[0];h.__=h.__N,h.__N=void 0,g!==h.__[0]&&(l=!0)}}),i&&i.call(this,u,p,d)||l};x.__f=!0;var i=x.shouldComponentUpdate,s=x.componentWillUpdate;x.componentWillUpdate=function(u,p,d){if(this.__e){var c=i;i=void 0,a(u,p,d),i=c}s&&s.call(this,u,p,d)},x.shouldComponentUpdate=a}return o.__N||o.__}function R(e,t){var r=Re(J++,3);!k.__s&&ct(r.__H,t)&&(r.__=e,r.u=t,x.__H.__h.push(r))}function lt(){for(var e;e=je.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Q),e.__H.__h.forEach(ce),e.__H.__h=[]}catch(t){e.__H.__h=[],k.__e(t,e.__v)}}k.__b=function(e){x=null,Ie&&Ie(e)},k.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),De&&De(e,t)},k.__r=function(e){Ne&&Ne(e),J=0;var t=(x=e.__c).__H;t&&(le===x?(t.__h=[],x.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Q),t.__h.forEach(ce),t.__h=[],J=0)),le=x},k.diffed=function(e){Ue&&Ue(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(je.push(t)!==1&&Te===k.requestAnimationFrame||((Te=k.requestAnimationFrame)||st)(lt)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),le=x=null},k.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Q),r.__h=r.__h.filter(function(o){return!o.__||ce(o)})}catch(o){t.some(function(a){a.__h&&(a.__h=[])}),t=[],k.__e(o,r.__v)}}),ze&&ze(e,t)},k.unmount=function(e){Pe&&Pe(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(o){try{Q(o)}catch(a){t=a}}),r.__H=void 0,t&&k.__e(t,r.__v))};var Oe=typeof requestAnimationFrame=="function";function st(e){var t,r=function(){clearTimeout(o),Oe&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(r,35);Oe&&(t=requestAnimationFrame(r))}function Q(e){var t=x,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),x=t}function ce(e){var t=x;e.__c=e.__(),x=t}function ct(e,t){return!e||e.length!==t.length||t.some(function(r,o){return r!==e[o]})}function He(e,t){return typeof t=="function"?t(e):t}const Y={name:"Daily Avatar",github:"https://github.com/Wxh16144/daily-avatar",version:{version:"0.0.1"}.version},de="https://unpkg.com/@wuxh/daily-avatar@0.0.1/dist",Le={title:Y.name},dt=(e,t)=>({init:async(r,o)=>{const a=await r.loadConfig();await r.loadState();const i=r.getState(),s={...Le,...o};e(u=>({configManager:r,config:a,stats:i,ui:{...u.ui,title:s.title}}))},updateConfig:(r,o)=>{e(a=>({config:{...a.config,[r]:o}}))},saveConfig:async()=>{const{configManager:r,config:o}=t();r&&await r.saveConfig(o)},resetConfig:async()=>{const{configManager:r}=t();if(r){await r.resetConfig();const o=r.getConfig();e({config:o})}},toggleSettings:r=>e(o=>({ui:{...o.ui,showSettings:r??!o.ui.showSettings}})),togglePanel:r=>e(o=>({ui:{...o.ui,showPanel:r??!o.ui.showPanel}})),showNotification:(r,o="info",a=3e3)=>{if(t().config.enableNotifications){const i=Date.now().toString()+Math.random().toString(36).slice(2,9);e(s=>({ui:{...s.ui,notifications:[...s.ui.notifications,{id:i,type:o,message:r,duration:a}]}})),a>0&&setTimeout(()=>{t().hideNotification(i)},a)}},hideNotification:r=>{e(o=>({ui:{...o.ui,notifications:o.ui.notifications.filter(a=>a.id!==r)}}))},refreshStats:()=>{const{configManager:r}=t();r&&e({stats:r.getState()})},updateAvatar:async()=>{const{configManager:r,updateHandler:o,config:a}=t();if(!(!r||!o)){e(i=>({ui:{...i.ui,isUpdating:!0}}));try{a.notifyOnStart&&t().showNotification("开始更新头像...","info"),console.log("[updateAvatar] Starting avatar update..."),await t().updateHandler?.(),console.log("[updateAvatar] Avatar update completed."),r.recordSuccess(),a.notifyOnSuccess&&t().showNotification("头像更新成功","success",3e3)}catch(i){console.error("Update failed:",i),r.recordError(i instanceof Error?i:new Error(String(i)));const s=i instanceof Error?i.message:String(i);a.notifyOnFailure&&t().showNotification(`失败: ${s}`,"error",5e3)}finally{e({stats:r.getState()}),e(i=>({ui:{...i.ui,isUpdating:!1}}))}}},registerUpdateHandler:r=>{e({updateHandler:r})}}),ut={configManager:null,config:{},stats:{},ui:{title:Le.title,showSettings:!1,showPanel:!1,isUpdating:!1,notifications:[]},updateHandler:null,history:[]},pt=(...e)=>({...ut,...dt(...e)}),U=et()(at(nt(pt,{name:"daily_avatar_UI"}))),m=function(e){const[t,r]=T(()=>e?e(U.getState()):U.getState());return R(()=>U.subscribe(a=>{const i=e?e(a):a;r(s=>s===i?s:i)}),[e]),t};m.getState=U.getState,m.setState=U.setState,m.subscribe=U.subscribe;function gt(){const{ui:{title:e},toggleSettings:t,togglePanel:r}=m();return n("div",{class:"flex items-center justify-between bg-gradient-to-r from-blue-50 to-indigo-50 px-4 py-3.5 border-b border-gray-200",style:{background:"linear-gradient(to right, #eff6ff, #eef2ff)",borderBottom:"1px solid #e5e7eb"},children:[n("div",{class:"flex items-center space-x-2",children:[n("div",{class:"w-2 h-2 rounded-full bg-blue-500 animate-pulse",style:{backgroundColor:"#3b82f6"}}),n("h3",{class:"font-semibold text-gray-800 text-sm",style:{color:"#1f2937",fontWeight:600},children:e})]}),n("div",{class:"flex space-x-1",children:[n("button",{onClick:()=>t(!0),class:"p-1.5 text-gray-500 hover:text-blue-600 hover:bg-white/50 rounded-lg transition-colors",title:"设置",children:n("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),n("button",{onClick:()=>r(!1),class:"p-1.5 text-gray-500 hover:text-red-600 hover:bg-white/50 rounded-lg transition-colors",title:"关闭",children:n("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})})})]})]})}function Fe(e,t=!1){if(typeof e!="number"||isNaN(e)||e<0)return t?"0s":"0秒";const r=Math.floor(e/1e3),o=Math.floor(r/60),a=Math.floor(o/60),i=Math.floor(a/24);if(t)return i>0?`${i}d ${a%24}h`:a>0?`${a}h ${o%60}m`:o>0?`${o}m ${r%60}s`:`${r}s`;if(i>0){const s=a%24;return s>0?`${i}天${s}小时`:`${i}天`}if(a>0){const s=o%60;return s>0?`${a}小时${s}分钟`:`${a}小时`}if(o>0){const s=r%60;return s>0?`${o}分钟${s}秒`:`${o}分钟`}return`${r}秒`}function Be(e,t=!1){if(!e||isNaN(e)||e<=0)return"从未";const r=new Date(e),o=new Date,a=r.toDateString()===o.toDateString(),i=r.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return t||!a?`${r.toLocaleDateString("zh-CN")} ${i}`:i}function ht(){const{stats:e}=m(),t=e.lastUpdate>0&&new Date(e.lastUpdate).toDateString()===new Date().toDateString();return n("div",{class:"space-y-3",children:[n("div",{class:"flex items-center justify-between p-3 bg-gray-50/50 rounded-lg border border-gray-100",style:{border:"1px solid #f3f4f6"},children:[n("span",{class:"text-sm text-gray-600",children:"今日状态"}),n("span",{class:`font-semibold px-3 py-1 rounded-full text-xs ${t?"bg-green-100 text-green-700":"bg-gray-100 text-gray-600"}`,style:{backgroundColor:t?"#dcfce7":"#f3f4f6",color:t?"#15803d":"#4b5563"},children:t?"✓ 已更新":"未更新"})]}),e.lastResult&&n("div",{class:`p-3 rounded-lg border ${e.lastResult==="success"?"bg-green-50/50 border-green-100":"bg-red-50/50 border-red-100"}`,style:{backgroundColor:e.lastResult==="success"?"rgba(240, 253, 244, 0.5)":"rgba(254, 242, 242, 0.5)",borderColor:e.lastResult==="success"?"#dcfce7":"#fee2e2",borderWidth:"1px",borderStyle:"solid"},children:[n("div",{class:"flex items-start justify-between",children:[n("span",{class:"text-sm text-gray-600",children:"上次结果"}),n("span",{class:`font-semibold text-xs ${e.lastResult==="success"?"text-green-700":"text-red-700"}`,style:{color:e.lastResult==="success"?"#15803d":"#b91c1c"},children:e.lastResult==="success"?"✓ 成功":"✗ 失败"})]}),n("div",{class:"flex justify-between items-center mt-1",children:n("span",{class:"text-xs text-gray-400",children:Be(e.lastUpdate,!0)})}),e.lastErrorMessage&&n("p",{class:"text-xs text-red-600 mt-2 leading-relaxed",style:{color:"#dc2626"},children:e.lastErrorMessage})]})]})}function ft(){const{config:e,stats:t}=m(),[r,o]=T(Date.now());R(()=>{const s=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(s)},[]);const a=t.nextScheduledUpdate-r;if(a<=0)return null;const i=Math.min(100,Math.round((1-a/e.updateInterval)*100));return n("div",{class:"bg-gradient-to-br from-blue-50 to-indigo-50 rounded-lg p-3 border border-blue-100",style:{border:"1px solid #dbeafe"},children:[n("div",{class:"flex justify-between items-center text-xs mb-2",children:[n("span",{class:"text-gray-600 font-medium",children:"下次更新倒计时"}),n("span",{class:"text-blue-600 font-semibold",children:Fe(a,!0)})]}),n("div",{class:"w-full bg-white/80 rounded-full h-2 overflow-hidden shadow-inner",style:{boxShadow:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)"},children:n("div",{class:"bg-gradient-to-r from-blue-500 to-indigo-500 h-full rounded-full",style:{width:`${i}%`,background:"linear-gradient(to right, #3b82f6, #6366f1)",transition:"width 1s cubic-bezier(0.4, 0, 0.2, 1)"}})})]})}function bt(){const{ui:{isUpdating:e},updateAvatar:t}=m();return n("div",{class:"pt-1",children:n("button",{onClick:t,disabled:e,class:`w-full py-2.5 rounded-lg flex items-center justify-center space-x-2 border ${e?"bg-blue-50 border-blue-100 text-blue-400 cursor-not-allowed":"bg-blue-600 border-blue-600 hover:bg-blue-700 text-white active:bg-blue-800"} font-medium text-sm`,children:e?n(I,{children:[n("svg",{class:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[n("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),n("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),n("span",{children:"更新中..."})]}):n(I,{children:[n("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),n("span",{children:"立即更新"})]})})})}function vt(){const{stats:e}=m(),[t,r]=T(!1);return!e.history||e.history.length===0?null:n("div",{class:"border-t border-gray-100 pt-2",children:[n("button",{onClick:()=>r(!t),class:"flex items-center justify-between w-full text-xs text-gray-500 hover:text-gray-700 py-1",children:[n("span",{class:"font-medium",children:"最近更新记录"}),n("svg",{class:`w-3 h-3 transition-transform ${t?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})})]}),t&&n("div",{class:"mt-2 space-y-2 max-h-40 overflow-y-auto custom-scrollbar",children:e.history.map((o,a)=>n("div",{class:"flex items-start space-x-2 text-xs p-2 rounded bg-gray-50/50 border border-gray-100",children:[n("div",{class:`w-1.5 h-1.5 rounded-full mt-1.5 flex-shrink-0 ${o.result==="success"?"bg-green-500":"bg-red-500"}`}),n("div",{class:"flex-1 min-w-0",children:[n("div",{class:"flex justify-between items-center",children:[n("span",{class:`font-medium ${o.result==="success"?"text-green-700":"text-red-700"}`,children:o.result==="success"?"更新成功":"更新失败"}),n("span",{class:"text-gray-400 text-[10px]",children:Be(o.timestamp,!0)})]}),o.message&&n("p",{class:"text-gray-500 mt-0.5 truncate",title:o.message,children:o.message})]})]},a))})]})}function _t(){return n("div",{class:"px-4 py-2 bg-gray-50/30 backdrop-blur-sm border-t border-gray-100 text-[10px] text-gray-400 flex justify-between items-center",children:[n("a",{href:Y.github,target:"_blank",rel:"noopener noreferrer",class:"font-medium hover:text-blue-600 transition-colors cursor-pointer",style:{textDecoration:"none"},children:Y.name}),n("span",{class:"opacity-70",children:["v",Y.version]})]})}function yt(){return n("div",{class:"fixed bottom-4 right-4 z-50 w-80",style:{position:"fixed",bottom:"1rem",right:"1rem",zIndex:2147483647,width:"20rem"},children:n("div",{class:"daily-avatar-panel bg-white/98 backdrop-blur-sm rounded-xl border-2 border-gray-300 overflow-hidden",style:{backgroundColor:"rgba(255, 255, 255, 0.98)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",borderRadius:"0.75rem",border:"2px solid #d1d5db",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",overflow:"hidden"},children:[n(gt,{}),n("div",{class:"p-4 space-y-3",children:[n(ht,{}),n(ft,{}),n(bt,{}),n(vt,{})]}),n(_t,{})]})})}function wt(){const{config:e,updateConfig:t}=m();return n("div",{class:"space-y-4",children:[n("h3",{class:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:"基本设置"}),n("div",{class:"space-y-4",children:[n("label",{class:"flex items-center justify-between group cursor-pointer p-3 rounded-xl hover:bg-gray-50 border border-transparent hover:border-gray-200",children:[n("span",{class:"text-gray-700 font-medium",children:"启用自动更新"}),n("div",{class:"relative inline-flex items-center cursor-pointer",children:[n("input",{type:"checkbox",checked:e.enabled,onChange:r=>t("enabled",r.currentTarget.checked),class:"sr-only"}),n("div",{class:`w-11 h-6 rounded-full border ${e.enabled?"bg-blue-600 border-blue-600":"bg-gray-200 border-gray-200"}`}),n("div",{class:`absolute top-1 bg-white border border-gray-300 rounded-full h-4 w-4 ${e.enabled?"left-[22px] border-white":"left-1"}`})]})]}),n("div",{class:"p-3 rounded-xl bg-gray-50/50 border border-gray-100 space-y-3",children:[n("label",{class:"block text-sm font-medium text-gray-700",children:"更新频率"}),n("div",{class:"space-y-2",children:[n("input",{type:"range",min:"1",max:"168",disabled:e.avatarSource==="weekly-mood",value:e.updateInterval/(3600*1e3),onChange:r=>t("updateInterval",parseInt(r.currentTarget.value)*60*60*1e3),class:`w-full h-2 rounded-lg appearance-none cursor-pointer accent-blue-600 ${e.avatarSource==="weekly-mood"?"bg-gray-100 cursor-not-allowed":"bg-gray-200"}`}),n("div",{class:"flex justify-between text-xs text-gray-500 font-medium",children:[n("span",{children:"1小时"}),n("span",{class:"text-blue-600",children:e.avatarSource==="weekly-mood"?"每天 (固定)":Fe(e.updateInterval)}),n("span",{children:"7天"})]}),e.avatarSource==="weekly-mood"&&n("p",{class:"text-xs text-gray-400",children:"一周心情表模式下,更新频率固定为每天一次"})]})]})]})]})}const mt=[{id:"default",path:"/mood-avatars",name:"默认风格",description:"默认的心情头像风格",copyright:"作者自制"},{id:"notion-style",path:"/mood-avatars/templates/cat-style",name:"打工猫风格",description:"抽象风格,适合表达多样心情",copyright:"小红书用户:呼噜噜^"}],G=[{key:"monday",label:"周一"},{key:"tuesday",label:"周二"},{key:"wednesday",label:"周三"},{key:"thursday",label:"周四"},{key:"friday",label:"周五"},{key:"saturday",label:"周六"},{key:"sunday",label:"周日"}];function xt(){const{configManager:e,showNotification:t}=m(),[r,o]=T({}),[a,i]=T(null),[s,u]=T(!1);R(()=>{e&&Promise.all(G.map(c=>e.getMoodAvatar(c.key))).then(c=>{const l={};G.forEach((h,g)=>{l[h.key]=c[g]||""}),o(l)})},[e]);const p=(c,l)=>{const h=new FileReader;h.onload=async g=>{const v=g.target?.result;v&&e&&(await e.saveMoodAvatar(c,v),o(_=>({..._,[c]:v})))},h.readAsDataURL(l)},d=async c=>{if(!e)return;i(c.id);let l=0;try{const h=G.map(async v=>{const _=c.id==="default"?"svg":"jpg",y=`${de}${c.path}/${v.key}.${_}`;try{const f=await fetch(y);if(!f.ok)throw new Error(`Failed to load ${v.key} from template`);return{key:v.key,blob:await f.blob()}}catch(f){console.warn(`Failed to load template image for ${v.key}, trying fallback...`,f),l++;const b=`${de}/mood-avatars/${v.key}.svg`,S=await fetch(b);if(!S.ok)throw new Error(`Failed to load fallback ${v.key}`);return{key:v.key,blob:await S.blob()}}}),g=await Promise.all(h);for(const{key:v,blob:_}of g){const y=new FileReader;await new Promise(f=>{y.onload=async b=>{const S=b.target?.result;S&&(await e.saveMoodAvatar(v,S),o(E=>({...E,[v]:S}))),f()},y.readAsDataURL(_)})}l>0?t(`已应用模版:${c.name} (部分使用默认图标兜底)`,"warning"):t(`已应用模版:${c.name}`,"success")}catch(h){console.error("Failed to apply template:",h),t("应用模版失败,请检查网络或文件","error")}finally{i(null)}};return n("div",{class:"space-y-4",children:[n("div",{class:"grid grid-cols-4 gap-2",children:[G.map(c=>n("div",{class:"flex flex-col items-center space-y-1",children:[n("div",{class:"relative w-16 h-16 rounded-lg overflow-hidden border border-gray-200 bg-white group",children:[n("img",{src:r[c.key]||`${de}/mood-avatars/${c.key}.svg`,alt:c.label,class:"w-full h-full object-cover",onError:l=>l.currentTarget.src=`https://api.dicebear.com/9.x/initials/svg?seed=${c.key}`}),n("label",{class:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",children:[n("span",{class:"text-white text-xs",children:"更换"}),n("input",{type:"file",accept:"image/*",class:"hidden",onChange:l=>{const h=l.currentTarget.files?.[0];h&&p(c.key,h)}})]})]}),n("span",{class:"text-xs text-gray-500",children:c.label})]},c.key)),n("button",{onClick:()=>u(!s),class:"flex flex-col items-center space-y-1 group outline-none",title:s?"收起模版库":"展开模版库",children:[n("div",{class:`w-16 h-16 flex items-center justify-center rounded-lg border-2 border-dashed transition-all duration-200 ${s?"border-blue-500 bg-blue-50 text-blue-600":"border-gray-300 hover:border-blue-400 hover:bg-gray-50 text-gray-400 hover:text-blue-500"}`,children:n("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-6 h-6 transition-transform group-hover:scale-110",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),n("span",{class:`text-xs font-medium transition-colors ${s?"text-blue-600":"text-gray-500 group-hover:text-blue-500"}`,children:s?"收起模版":"模版库"})]})]}),s&&n("div",{class:"space-y-2 pt-2 border-t border-gray-100 animate-in fade-in slide-in-from-top-2 duration-200",children:[n("h4",{class:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:"选择模版"}),n("div",{class:"grid grid-cols-1 gap-3",children:mt.map(c=>n("div",{class:"flex items-center justify-between p-3 rounded-xl bg-white border border-gray-200 hover:border-blue-300 transition-colors",children:[n("div",{class:"flex-1 min-w-0 mr-3",children:[n("div",{class:"flex items-center space-x-2",children:[n("span",{class:"text-sm font-medium text-gray-900",children:c.name}),n("span",{class:"text-[10px] px-1.5 py-0.5 rounded bg-gray-100 text-gray-500 border border-gray-200 truncate max-w-[120px]",children:c.copyright})]}),n("p",{class:"text-xs text-gray-500 mt-0.5 truncate",children:c.description})]}),n("button",{onClick:()=>d(c),disabled:a===c.id,class:"px-3 py-1.5 text-xs font-medium text-blue-600 bg-blue-50 hover:bg-blue-100 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed whitespace-nowrap",children:a===c.id?"应用中...":"使用模版"})]},c.id))})]})]})}const kt={$TIMESTAMP:"当前时间戳",$DATE:"YYYY-MM-DD",$VERSION:"当前版本",$RANDOM:"随机数,每次请求都会变化"};function St(){const{config:e,updateConfig:t}=m(),[r,o]=T(null),a=e.apiQueryParams||[],i=(p,d,c)=>{const l=a.map((h,g)=>g===p?{key:d,value:c}:h);t("apiQueryParams",l)},s=()=>{t("apiQueryParams",[...a,{key:"",value:""}]),o(a.length)},u=p=>{const d=a.filter((c,l)=>l!==p);t("apiQueryParams",d)};return n("div",{class:"space-y-2",children:[a.map((p,d)=>n("div",{class:"flex items-center space-x-2",children:[n("input",{type:"text",class:"w-1/3 px-2 py-1 border border-gray-200 rounded text-xs",placeholder:"KEY",value:p.key,onChange:c=>i(d,c.currentTarget.value,p.value)}),n("span",{class:"text-gray-400",children:"="}),n("input",{type:"text",class:"w-1/2 px-2 py-1 border border-gray-200 rounded text-xs",placeholder:"VALUE(可用 $DATE 等变量)",value:p.value,onChange:c=>i(d,p.key,c.currentTarget.value)}),n("button",{type:"button",class:"text-xs text-red-400 hover:text-red-600 px-1",onClick:()=>u(d),title:"删除",children:"×"})]},d)),n("button",{type:"button",class:"text-xs text-blue-500 hover:underline mt-1",onClick:s,children:"+ 添加参数"}),n("div",{class:"mt-2 p-2 rounded border border-gray-100 bg-gray-50",children:[n("div",{class:"text-xs font-medium text-gray-500 mb-2",children:["可用变量说明 ",n("span",{class:"text-[10px] font-normal text-gray-400 ml-1",children:"(须以 $ 开头)"})]}),n("div",{class:"text-xs space-y-1",children:Object.entries(kt).map(([p,d])=>n("div",{class:"flex justify-between items-center",children:[n("code",{class:"bg-gray-200 text-gray-600 px-1 rounded",children:p}),n("span",{class:"text-gray-400 text-right",children:d})]},p))})]})]})}function Ct(){const{config:e,updateConfig:t}=m();return n("div",{class:"space-y-4",children:[n("h3",{class:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:"头像来源"}),n("div",{class:"space-y-4",children:[n("div",{class:"p-3 rounded-xl bg-gray-50/50 border border-gray-100",children:[n("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"来源类型"}),n("select",{value:e.avatarSource,onChange:r=>{const o=r.currentTarget.value;t("avatarSource",o),o==="weekly-mood"&&t("updateInterval",1440*60*1e3)},class:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg focus:border-blue-500 outline-none text-sm appearance-none",children:[n("option",{value:"random",children:"随机头像"}),n("option",{value:"api",children:"自定义API"}),n("option",{value:"weekly-mood",children:"一周心情表"})]})]}),e.avatarSource==="api"&&n("div",{class:"p-3 rounded-xl bg-gray-50/50 border border-gray-100 space-y-4",children:[n("div",{children:[n("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"API 地址"}),n("input",{type:"text",value:e.apiUrl,onChange:r=>t("apiUrl",r.currentTarget.value),class:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg focus:border-blue-500 outline-none text-sm",placeholder:"https://api.dicebear.com/9.x/notionists/png"})]}),n("div",{children:[n("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"API Query"}),n(St,{})]})]}),e.avatarSource==="weekly-mood"&&n(xt,{})]})]})}function $t(){const{config:e,updateConfig:t}=m();return n("div",{class:"space-y-4",children:[n("h3",{class:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:"通知设置"}),n("div",{class:"space-y-2 bg-gray-50/50 rounded-xl p-2 border border-gray-100",children:[n("label",{class:"flex items-center justify-between p-2 rounded-lg hover:bg-white cursor-pointer",children:[n("span",{class:"text-sm text-gray-700",children:"启用通知"}),n("input",{type:"checkbox",checked:e.enableNotifications,onChange:r=>t("enableNotifications",r.currentTarget.checked),class:"w-4 h-4 text-blue-600 rounded border-gray-300"})]}),n("label",{class:"flex items-center justify-between p-2 rounded-lg hover:bg-white cursor-pointer",children:[n("span",{class:"text-sm text-gray-700",children:"成功时通知"}),n("input",{type:"checkbox",checked:e.notifyOnSuccess,onChange:r=>t("notifyOnSuccess",r.currentTarget.checked),class:"w-4 h-4 text-blue-600 rounded border-gray-300"})]}),n("label",{class:"flex items-center justify-between p-2 rounded-lg hover:bg-white cursor-pointer",children:[n("span",{class:"text-sm text-gray-700",children:"失败时通知"}),n("input",{type:"checkbox",checked:e.notifyOnFailure,onChange:r=>t("notifyOnFailure",r.currentTarget.checked),class:"w-4 h-4 text-blue-600 rounded border-gray-300"})]})]})]})}function Et(){const{saveConfig:e,resetConfig:t,toggleSettings:r,showNotification:o}=m(),[a,i]=T(!1);return n("div",{class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/20 backdrop-blur-sm",children:[n("div",{class:"absolute inset-0",onClick:()=>r(!1)}),n("div",{class:"relative bg-white rounded-xl w-full max-w-md max-h-[90vh] overflow-hidden panel-style",children:[n("div",{class:"flex items-center justify-between px-6 py-4 border-b border-gray-200 bg-gray-50/50",children:[n("h2",{class:"text-lg font-semibold text-gray-800 tracking-tight",children:"设置"}),n("button",{onClick:()=>r(!1),class:"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-200 rounded-lg",children:n("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})})})]}),n("div",{class:"overflow-y-auto custom-scrollbar",style:{maxHeight:"calc(90vh - 140px)"},children:n("div",{class:"px-6 py-6 space-y-8",children:[n(wt,{}),n(Ct,{}),n($t,{})]})}),n("div",{class:"px-6 py-4 border-t border-gray-200 bg-gray-50/50",children:n("div",{class:"flex justify-between items-center",children:[n("button",{onClick:async()=>{confirm("确定要重置为默认设置吗?")&&await t()},class:"text-sm text-red-600 hover:text-red-700 hover:bg-red-50 px-3 py-2 rounded-lg",children:"恢复默认"}),n("div",{class:"space-x-3 flex",children:[n("button",{onClick:()=>r(!1),class:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-200 rounded-lg border border-transparent",children:"取消"}),n("button",{onClick:async()=>{i(!0);try{await e(),o("设置已保存","success")}catch(p){console.error("保存失败:",p),o("保存失败","error")}finally{i(!1)}},disabled:a,class:`px-5 py-2 text-sm font-medium text-white rounded-lg border ${a?"bg-blue-400 border-blue-400 cursor-not-allowed":"bg-blue-600 border-blue-600 hover:bg-blue-700 active:bg-blue-800"}`,children:a?"保存中...":"保存设置"})]})]})})]})]})}function Mt(){const{refreshStats:e}=m();return R(()=>{e();const t=setInterval(()=>{e()},3e4);return()=>clearInterval(t)},[e]),null}function At(){const{ui:{isUpdating:e},togglePanel:t}=m();return n("button",{onClick:()=>t(!0),class:"bg-blue-500 hover:bg-blue-600 text-white rounded-full p-3 shadow-lg transition duration-200 fixed bottom-4 right-4 z-50","aria-busy":e,"aria-label":e?"正在更新":"立即更新",children:e?n("span",{class:"flex items-center",children:[n("svg",{class:"animate-spin -ml-1 mr-2 h-6 w-6 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[n("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),n("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),n("span",{children:"更新中..."})]}):n("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})})}const Tt={success:"bg-green-500 text-white border-green-600",error:"bg-red-500 text-white border-red-600",warning:"bg-yellow-500 text-white border-yellow-600",info:"bg-blue-500 text-white border-blue-600"},jt={success:n("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})}),error:n("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})}),warning:n("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),info:n("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})};function It(){const{ui:{notifications:e},hideNotification:t}=m();return e.length===0?null:n("div",{class:"fixed top-4 right-4 z-[100] flex flex-col gap-2 pointer-events-none",children:e.map(r=>n("div",{class:`pointer-events-auto flex items-center gap-2 px-4 py-3 rounded-lg shadow-lg border ${Tt[r.type]} animate-fadeIn transition-all duration-300`,style:{minWidth:"200px",maxWidth:"320px"},children:[n("div",{class:"flex-shrink-0",children:jt[r.type]}),n("div",{class:"flex-1 text-sm font-medium",children:r.message}),n("button",{onClick:()=>t(r.id),class:"flex-shrink-0 ml-2 opacity-70 hover:opacity-100 transition-opacity",children:n("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})})})]},r.id))})}function Nt(){const{config:e,stats:t,updateAvatar:r}=m();return R(()=>{if(!e?.autoStart||typeof r!="function")return;const o=Date.now(),a=t?.nextScheduledUpdate||0;o>=a&&(console.log("[AvatarAutoUpdater] Triggering automatic avatar update..."),r())},[e?.autoStart,t?.nextScheduledUpdate]),null}function Ut(){const{ui:{showSettings:e,showPanel:t}}=m();function r(){return e?n(Et,{}):t?n(yt,{}):n(At,{})}return n(I,{children:[n(Mt,{}),n(Nt,{}),n(It,{}),r()]})}function We(e,t,r="daily-avatar-ui"){m.getState().init(e,t);let o=document.getElementById(r);o||(o=document.createElement("div"),o.setAttribute("id",r),o.setAttribute("data-source","https://github.com/Wxh16144/daily-avatar"),o.style.position="absolute",o.style.top="0",o.style.left="0",o.style.width="0",o.style.height="0",o.style.overflow="visible",o.style.zIndex="2147483647",document.body.appendChild(o));const a=o.shadowRoot||o.attachShadow({mode:"open"});let i=a.querySelector("style");i||(i=document.createElement("style"),a.appendChild(i)),i.textContent=Ke;let s=a.getElementById("root");return s||(s=document.createElement("div"),s.id="root",a.appendChild(s)),Me(_e(Ut,{}),s),{unmount:()=>{s&&Me(null,s),o&&o.remove()}}}typeof window<"u"&&(window.daily_avatar_UI={init:We,store:m}),M.init=We,M.store=m,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})}));
|
|
6
|
+
`);const b=f.state[d];if(b==null)return;JSON.stringify(n.getState())!==JSON.stringify(b)&&p(b);return}n.dispatchFromDevtools&&typeof n.dispatch=="function"&&n.dispatch(f)});case"DISPATCH":switch(y.payload.type){case"RESET":return p(v),d===void 0?g?.init(n.getState()):g?.init(Y(h.name));case"COMMIT":if(d===void 0){g?.init(n.getState());return}return g?.init(Y(h.name));case"ROLLBACK":return le(y.state,f=>{if(d===void 0){p(f),g?.init(n.getState());return}p(f[d]),g?.init(Y(h.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return le(y.state,f=>{if(d===void 0){p(f);return}JSON.stringify(n.getState())!==JSON.stringify(f[d])&&p(f[d])});case"IMPORT_STATE":{const{nextLiftedState:f}=y.payload,b=(w=f.computedStates.slice(-1)[0])==null?void 0:w.state;if(!b)return;p(d===void 0?b:b[d]),g?.send(null,f);return}case"PAUSE_RECORDING":return u=!u}return}}),v},le=(e,t)=>{let r;try{r=JSON.parse(e)}catch(a){console.error("[zustand devtools middleware] Could not parse the received json",a)}r!==void 0&&t(r)},nt=e=>(t,r,a)=>{const n=a.subscribe;return a.subscribe=((s,d,h)=>{let c=s;if(d){const g=h?.equalityFn||Object.is;let l=s(a.getState());c=u=>{const p=s(u);if(!g(l,p)){const v=l;d(l=p,v)}},h?.fireImmediately&&d(l,l)}return n(c)}),e(t,r,a)};var G,k,se,Te,ce=0,je=[],S=_,ze=S.__b,Ie=S.__r,Ne=S.diffed,Ue=S.__c,Pe=S.unmount,De=S.__;function Re(e,t){S.__h&&S.__h(k,e,ce||t),ce=0;var r=k.__H||(k.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function A(e){return ce=1,it(He,e)}function it(e,t,r){var a=Re(G++,2);if(a.t=e,!a.__c&&(a.__=[He(void 0,t),function(d){var h=a.__N?a.__N[0]:a.__[0],c=a.t(h,d);h!==c&&(a.__N=[c,a.__[1]],a.__c.setState({}))}],a.__c=k,!k.__f)){var n=function(d,h,c){if(!a.__c.__H)return!0;var g=a.__c.__H.__.filter(function(u){return!!u.__c});if(g.every(function(u){return!u.__N}))return!i||i.call(this,d,h,c);var l=a.__c.props!==d;return g.forEach(function(u){if(u.__N){var p=u.__[0];u.__=u.__N,u.__N=void 0,p!==u.__[0]&&(l=!0)}}),i&&i.call(this,d,h,c)||l};k.__f=!0;var i=k.shouldComponentUpdate,s=k.componentWillUpdate;k.componentWillUpdate=function(d,h,c){if(this.__e){var g=i;i=void 0,n(d,h,c),i=g}s&&s.call(this,d,h,c)},k.shouldComponentUpdate=n}return a.__N||a.__}function H(e,t){var r=Re(G++,3);!S.__s&&ct(r.__H,t)&&(r.__=e,r.u=t,k.__H.__h.push(r))}function lt(){for(var e;e=je.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(K),e.__H.__h.forEach(de),e.__H.__h=[]}catch(t){e.__H.__h=[],S.__e(t,e.__v)}}S.__b=function(e){k=null,ze&&ze(e)},S.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),De&&De(e,t)},S.__r=function(e){Ie&&Ie(e),G=0;var t=(k=e.__c).__H;t&&(se===k?(t.__h=[],k.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(K),t.__h.forEach(de),t.__h=[],G=0)),se=k},S.diffed=function(e){Ne&&Ne(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(je.push(t)!==1&&Te===S.requestAnimationFrame||((Te=S.requestAnimationFrame)||st)(lt)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),se=k=null},S.__c=function(e,t){t.some(function(r){try{r.__h.forEach(K),r.__h=r.__h.filter(function(a){return!a.__||de(a)})}catch(a){t.some(function(n){n.__h&&(n.__h=[])}),t=[],S.__e(a,r.__v)}}),Ue&&Ue(e,t)},S.unmount=function(e){Pe&&Pe(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(a){try{K(a)}catch(n){t=n}}),r.__H=void 0,t&&S.__e(t,r.__v))};var Oe=typeof requestAnimationFrame=="function";function st(e){var t,r=function(){clearTimeout(a),Oe&&cancelAnimationFrame(t),setTimeout(e)},a=setTimeout(r,35);Oe&&(t=requestAnimationFrame(r))}function K(e){var t=k,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),k=t}function de(e){var t=k;e.__c=e.__(),k=t}function ct(e,t){return!e||e.length!==t.length||t.some(function(r,a){return r!==e[a]})}function He(e,t){return typeof t=="function"?t(e):t}const X={name:"Daily Avatar",github:"https://github.com/Wxh16144/daily-avatar",version:{version:"0.1.0"}.version},L="https://unpkg.com/@wuxh/daily-avatar@0.1.0/dist",Le={title:X.name},dt=(e,t)=>({init:async(r,a)=>{const n=await r.loadConfig();await r.loadState();const i=r.getState(),s={...Le,...a};e(d=>({configManager:r,config:n,stats:i,ui:{...d.ui,title:s.title}}))},updateConfig:(r,a)=>{e(n=>({config:{...n.config,[r]:a}}))},saveConfig:async()=>{const{configManager:r,config:a}=t();r&&await r.saveConfig(a)},resetConfig:async()=>{const{configManager:r}=t();if(r){await r.resetConfig();const a=r.getConfig();e({config:a})}},toggleSettings:r=>e(a=>({ui:{...a.ui,showSettings:r??!a.ui.showSettings}})),togglePanel:r=>e(a=>({ui:{...a.ui,showPanel:r??!a.ui.showPanel}})),showNotification:(r,a="info",n=3e3)=>{if(t().config.enableNotifications){const i=Date.now().toString()+Math.random().toString(36).slice(2,9);e(s=>({ui:{...s.ui,notifications:[...s.ui.notifications,{id:i,type:a,message:r,duration:n}]}})),n>0&&setTimeout(()=>{t().hideNotification(i)},n)}},hideNotification:r=>{e(a=>({ui:{...a.ui,notifications:a.ui.notifications.filter(n=>n.id!==r)}}))},refreshStats:()=>{const{configManager:r}=t();r&&e({stats:r.getState()})},updateAvatar:async()=>{const{configManager:r,updateHandler:a,config:n}=t();if(!(!r||!a)){e(i=>({ui:{...i.ui,isUpdating:!0}}));try{n.notifyOnStart&&t().showNotification("开始更新头像...","info"),console.log("[updateAvatar] Starting avatar update..."),await t().updateHandler?.(),console.log("[updateAvatar] Avatar update completed."),r.recordSuccess(),n.notifyOnSuccess&&t().showNotification("头像更新成功","success",3e3)}catch(i){console.error("Update failed:",i),r.recordError(i instanceof Error?i:new Error(String(i)));const s=i instanceof Error?i.message:String(i);n.notifyOnFailure&&t().showNotification(`失败: ${s}`,"error",5e3)}finally{e({stats:r.getState()}),e(i=>({ui:{...i.ui,isUpdating:!1}}))}}},registerUpdateHandler:r=>{e({updateHandler:r})}}),ut={configManager:null,config:{},stats:{},ui:{title:Le.title,showSettings:!1,showPanel:!1,isUpdating:!1,notifications:[]},updateHandler:null,history:[]},pt=(...e)=>({...ut,...dt(...e)}),P=et()(nt(at(pt,{name:"daily_avatar_UI"}))),m=function(e){const[t,r]=A(()=>e?e(P.getState()):P.getState());return H(()=>P.subscribe(n=>{const i=e?e(n):n;r(s=>s===i?s:i)}),[e]),t};m.getState=P.getState,m.setState=P.setState,m.subscribe=P.subscribe;function gt(){const{ui:{title:e},toggleSettings:t,togglePanel:r}=m();return o("div",{class:"flex items-center justify-between bg-gradient-to-r from-blue-50 to-indigo-50 px-4 py-3.5 border-b border-gray-200",style:{background:"linear-gradient(to right, #eff6ff, #eef2ff)",borderBottom:"1px solid #e5e7eb"},children:[o("div",{class:"flex items-center space-x-2",children:[o("div",{class:"w-2 h-2 rounded-full bg-blue-500 animate-pulse",style:{backgroundColor:"#3b82f6"}}),o("h3",{class:"font-semibold text-gray-800 text-sm",style:{color:"#1f2937",fontWeight:600},children:e})]}),o("div",{class:"flex space-x-1",children:[o("button",{onClick:()=>t(!0),class:"p-1.5 text-gray-500 hover:text-blue-600 hover:bg-white/50 rounded-lg transition-colors",title:"设置",children:o("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),o("button",{onClick:()=>r(!1),class:"p-1.5 text-gray-500 hover:text-red-600 hover:bg-white/50 rounded-lg transition-colors",title:"关闭",children:o("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})})})]})]})}function Fe(e,t=!1){if(typeof e!="number"||isNaN(e)||e<0)return t?"0s":"0秒";const r=Math.floor(e/1e3),a=Math.floor(r/60),n=Math.floor(a/60),i=Math.floor(n/24);if(t)return i>0?`${i}d ${n%24}h`:n>0?`${n}h ${a%60}m`:a>0?`${a}m ${r%60}s`:`${r}s`;if(i>0){const s=n%24;return s>0?`${i}天${s}小时`:`${i}天`}if(n>0){const s=a%60;return s>0?`${n}小时${s}分钟`:`${n}小时`}if(a>0){const s=r%60;return s>0?`${a}分钟${s}秒`:`${a}分钟`}return`${r}秒`}function Be(e,t=!1){if(!e||isNaN(e)||e<=0)return"从未";const r=new Date(e),a=new Date,n=r.toDateString()===a.toDateString(),i=r.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return t||!n?`${r.toLocaleDateString("zh-CN")} ${i}`:i}function ht(){const{stats:e}=m(),t=e.lastUpdate>0&&new Date(e.lastUpdate).toDateString()===new Date().toDateString();return o("div",{class:"space-y-3",children:[o("div",{class:"flex items-center justify-between p-3 bg-gray-50/50 rounded-lg border border-gray-100",style:{border:"1px solid #f3f4f6"},children:[o("span",{class:"text-sm text-gray-600",children:"今日状态"}),o("span",{class:`font-semibold px-3 py-1 rounded-full text-xs ${t?"bg-green-100 text-green-700":"bg-gray-100 text-gray-600"}`,style:{backgroundColor:t?"#dcfce7":"#f3f4f6",color:t?"#15803d":"#4b5563"},children:t?"✓ 已更新":"未更新"})]}),e.lastResult&&o("div",{class:`p-3 rounded-lg border ${e.lastResult==="success"?"bg-green-50/50 border-green-100":"bg-red-50/50 border-red-100"}`,style:{backgroundColor:e.lastResult==="success"?"rgba(240, 253, 244, 0.5)":"rgba(254, 242, 242, 0.5)",borderColor:e.lastResult==="success"?"#dcfce7":"#fee2e2",borderWidth:"1px",borderStyle:"solid"},children:[o("div",{class:"flex items-start justify-between",children:[o("span",{class:"text-sm text-gray-600",children:"上次结果"}),o("span",{class:`font-semibold text-xs ${e.lastResult==="success"?"text-green-700":"text-red-700"}`,style:{color:e.lastResult==="success"?"#15803d":"#b91c1c"},children:e.lastResult==="success"?"✓ 成功":"✗ 失败"})]}),o("div",{class:"flex justify-between items-center mt-1",children:o("span",{class:"text-xs text-gray-400",children:Be(e.lastUpdate,!0)})}),e.lastErrorMessage&&o("p",{class:"text-xs text-red-600 mt-2 leading-relaxed",style:{color:"#dc2626"},children:e.lastErrorMessage})]})]})}function ft(){const{config:e,stats:t}=m(),[r,a]=A(Date.now());H(()=>{const s=setInterval(()=>a(Date.now()),1e3);return()=>clearInterval(s)},[]);const n=t.nextScheduledUpdate-r;if(n<=0)return null;const i=Math.min(100,Math.round((1-n/e.updateInterval)*100));return o("div",{class:"bg-gradient-to-br from-blue-50 to-indigo-50 rounded-lg p-3 border border-blue-100",style:{border:"1px solid #dbeafe"},children:[o("div",{class:"flex justify-between items-center text-xs mb-2",children:[o("span",{class:"text-gray-600 font-medium",children:"下次更新倒计时"}),o("span",{class:"text-blue-600 font-semibold",children:Fe(n,!0)})]}),o("div",{class:"w-full bg-white/80 rounded-full h-2 overflow-hidden shadow-inner",style:{boxShadow:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)"},children:o("div",{class:"bg-gradient-to-r from-blue-500 to-indigo-500 h-full rounded-full",style:{width:`${i}%`,background:"linear-gradient(to right, #3b82f6, #6366f1)",transition:"width 1s cubic-bezier(0.4, 0, 0.2, 1)"}})})]})}function vt(){const{ui:{isUpdating:e},updateAvatar:t}=m();return o("div",{class:"pt-1",children:o("button",{onClick:t,disabled:e,class:`w-full py-2.5 rounded-lg flex items-center justify-center space-x-2 border ${e?"bg-blue-50 border-blue-100 text-blue-400 cursor-not-allowed":"bg-blue-600 border-blue-600 hover:bg-blue-700 text-white active:bg-blue-800"} font-medium text-sm`,children:e?o(I,{children:[o("svg",{class:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[o("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),o("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),o("span",{children:"更新中..."})]}):o(I,{children:[o("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),o("span",{children:"立即更新"})]})})})}function bt(){const{stats:e}=m(),[t,r]=A(!1);return!e.history||e.history.length===0?null:o("div",{class:"border-t border-gray-100 pt-2",children:[o("button",{onClick:()=>r(!t),class:"flex items-center justify-between w-full text-xs text-gray-500 hover:text-gray-700 py-1",children:[o("span",{class:"font-medium",children:"最近更新记录"}),o("svg",{class:`w-3 h-3 transition-transform ${t?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})})]}),t&&o("div",{class:"mt-2 space-y-2 max-h-40 overflow-y-auto custom-scrollbar",children:e.history.map((a,n)=>o("div",{class:"flex items-start space-x-2 text-xs p-2 rounded bg-gray-50/50 border border-gray-100",children:[o("div",{class:`w-1.5 h-1.5 rounded-full mt-1.5 flex-shrink-0 ${a.result==="success"?"bg-green-500":"bg-red-500"}`}),o("div",{class:"flex-1 min-w-0",children:[o("div",{class:"flex justify-between items-center",children:[o("span",{class:`font-medium ${a.result==="success"?"text-green-700":"text-red-700"}`,children:a.result==="success"?"更新成功":"更新失败"}),o("span",{class:"text-gray-400 text-[10px]",children:Be(a.timestamp,!0)})]}),a.message&&o("p",{class:"text-gray-500 mt-0.5 truncate",title:a.message,children:a.message})]})]},n))})]})}function wt(){return o("div",{class:"px-4 py-2 bg-gray-50/30 backdrop-blur-sm border-t border-gray-100 text-[10px] text-gray-400 flex justify-between items-center",children:[o("a",{href:X.github,target:"_blank",rel:"noopener noreferrer",class:"font-medium hover:text-blue-600 transition-colors cursor-pointer",style:{textDecoration:"none"},children:X.name}),o("span",{class:"opacity-70",children:["v",X.version]})]})}function yt(){return o("div",{class:"fixed bottom-4 right-4 z-50 w-80",style:{position:"fixed",bottom:"1rem",right:"1rem",zIndex:2147483647,width:"20rem"},children:o("div",{class:"daily-avatar-panel bg-white/98 backdrop-blur-sm rounded-xl border-2 border-gray-300 overflow-hidden",style:{backgroundColor:"rgba(255, 255, 255, 0.98)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",borderRadius:"0.75rem",border:"2px solid #d1d5db",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",overflow:"hidden"},children:[o(gt,{}),o("div",{class:"p-4 space-y-3",children:[o(ht,{}),o(ft,{}),o(vt,{}),o(bt,{})]}),o(wt,{})]})})}function _t(){const{config:e,updateConfig:t}=m();return o("div",{class:"space-y-4",children:[o("h3",{class:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:"基本设置"}),o("div",{class:"space-y-4",children:[o("label",{class:"flex items-center justify-between group cursor-pointer p-3 rounded-xl hover:bg-gray-50 border border-transparent hover:border-gray-200",children:[o("span",{class:"text-gray-700 font-medium",children:"启用自动更新"}),o("div",{class:"relative inline-flex items-center cursor-pointer",children:[o("input",{type:"checkbox",checked:e.enabled,onChange:r=>t("enabled",r.currentTarget.checked),class:"sr-only"}),o("div",{class:`w-11 h-6 rounded-full border ${e.enabled?"bg-blue-600 border-blue-600":"bg-gray-200 border-gray-200"}`}),o("div",{class:`absolute top-1 bg-white border border-gray-300 rounded-full h-4 w-4 ${e.enabled?"left-[22px] border-white":"left-1"}`})]})]}),o("div",{class:"p-3 rounded-xl bg-gray-50/50 border border-gray-100 space-y-3",children:[o("label",{class:"block text-sm font-medium text-gray-700",children:"更新频率"}),o("div",{class:"space-y-2",children:[o("input",{type:"range",min:"1",max:"168",disabled:e.avatarSource==="weekly-mood",value:e.updateInterval/(3600*1e3),onChange:r=>t("updateInterval",parseInt(r.currentTarget.value)*60*60*1e3),class:`w-full h-2 rounded-lg appearance-none cursor-pointer accent-blue-600 ${e.avatarSource==="weekly-mood"?"bg-gray-100 cursor-not-allowed":"bg-gray-200"}`}),o("div",{class:"flex justify-between text-xs text-gray-500 font-medium",children:[o("span",{children:"1小时"}),o("span",{class:"text-blue-600",children:e.avatarSource==="weekly-mood"?"每天 (固定)":Fe(e.updateInterval)}),o("span",{children:"7天"})]}),e.avatarSource==="weekly-mood"&&o("p",{class:"text-xs text-gray-400",children:"一周心情表模式下,更新频率固定为每天一次"})]})]})]})]})}const mt=[{id:"default",path:"/mood-avatars",name:"默认风格",description:"默认的心情头像风格",copyright:"默认",url:"https://github.com/Wxh16144/daily-avatar"},{id:"notion-style",path:"/mood-avatars/templates/cat-style",name:"打工猫风格",description:"抽象风格,适合表达多样心情",copyright:"小红书用户:呼噜噜^",url:"http://xhslink.com/o/3IpDqAMBT3o"},{id:"line-dog",path:"/mood-avatars/templates/line-dog",name:"线条小狗",description:"线条小狗的一周精神状态",copyright:"小红书用户:RH",url:"http://xhslink.com/o/7WdVDuLOhNC"},{id:"wangzai-weekly",path:"/mood-avatars/templates/wangzai-weekly",name:"旺仔一周头像",description:"超可爱的旺仔一周头像快快换起来吧!",copyright:"小红书用户:旺仔俱乐部",url:"http://xhslink.com/o/1MR3rhW37dA"}],F=[{key:"monday",label:"周一"},{key:"tuesday",label:"周二"},{key:"wednesday",label:"周三"},{key:"thursday",label:"周四"},{key:"friday",label:"周五"},{key:"saturday",label:"周六"},{key:"sunday",label:"周日"}];function xt(){const{configManager:e,showNotification:t}=m(),[r,a]=A({}),[n,i]=A(null),[s,d]=A(!1),[h,c]=A(null);H(()=>{e&&Promise.all(F.map(u=>e.getMoodAvatar(u.key))).then(u=>{const p={};F.forEach((v,y)=>{p[v.key]=u[y]||""}),a(p)})},[e]);const g=(u,p)=>{const v=new FileReader;v.onload=async y=>{const w=y.target?.result;w&&e&&(await e.saveMoodAvatar(u,w),a(f=>({...f,[u]:w})))},v.readAsDataURL(p)},l=async u=>{if(!e)return;i(u.id);let p=0;try{const v=F.map(async w=>{const f=u.id==="default"?"svg":"jpg",b=`${L}${u.path}/${w.key}.${f}`;try{const x=await fetch(b);if(!x.ok)throw new Error(`Failed to load ${w.key} from template`);return{key:w.key,blob:await x.blob()}}catch(x){console.warn(`Failed to load template image for ${w.key}, trying fallback...`,x),p++;const C=`${L}/mood-avatars/${w.key}.svg`,$=await fetch(C);if(!$.ok)throw new Error(`Failed to load fallback ${w.key}`);return{key:w.key,blob:await $.blob()}}}),y=await Promise.all(v);for(const{key:w,blob:f}of y){const b=new FileReader;await new Promise(x=>{b.onload=async C=>{const $=C.target?.result;$&&(await e.saveMoodAvatar(w,$),a(N=>({...N,[w]:$}))),x()},b.readAsDataURL(f)})}p>0?t(`已应用模版:${u.name} (部分使用默认图标兜底)`,"warning"):t(`已应用模版:${u.name}`,"success")}catch(v){console.error("Failed to apply template:",v),t("应用模版失败,请检查网络或文件","error")}finally{i(null)}};return o("div",{class:"space-y-4",children:[o("div",{class:"grid grid-cols-4 gap-2",children:[F.map(u=>o("div",{class:"flex flex-col items-center space-y-1",children:[o("div",{class:"relative w-16 h-16 rounded-lg overflow-hidden border border-gray-200 bg-white group",children:[o("img",{src:r[u.key]||`${L}/mood-avatars/${u.key}.svg`,alt:u.label,class:"w-full h-full object-cover",onError:p=>p.currentTarget.src=`https://api.dicebear.com/9.x/initials/svg?seed=${u.key}`}),o("label",{class:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",children:[o("span",{class:"text-white text-xs",children:"更换"}),o("input",{type:"file",accept:"image/*",class:"hidden",onChange:p=>{const v=p.currentTarget.files?.[0];v&&g(u.key,v)}})]})]}),o("span",{class:"text-xs text-gray-500",children:u.label})]},u.key)),o("button",{onClick:()=>d(!s),class:"flex flex-col items-center space-y-1 group outline-none",title:s?"收起模版库":"展开模版库",children:[o("div",{class:`w-16 h-16 flex items-center justify-center rounded-lg border-2 border-dashed transition-all duration-200 ${s?"border-blue-500 bg-blue-50 text-blue-600":"border-gray-300 hover:border-blue-400 hover:bg-gray-50 text-gray-400 hover:text-blue-500"}`,children:o("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-6 h-6 transition-transform group-hover:scale-110",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),o("span",{class:`text-xs font-medium transition-colors ${s?"text-blue-600":"text-gray-500 group-hover:text-blue-500"}`,children:s?"收起模版":"模版库"})]})]}),s&&o("div",{class:"space-y-2 pt-2 border-t border-gray-100 animate-in fade-in slide-in-from-top-2 duration-200",children:[o("h4",{class:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:"选择模版"}),o("div",{class:"grid grid-cols-1 gap-3",children:mt.map(u=>{const p=h===u.id;return o("div",{class:`group flex flex-col p-3 rounded-xl bg-white border transition-all duration-200 cursor-pointer ${p?"border-blue-500 ring-2 ring-blue-100 shadow-sm":"border-gray-200 hover:border-blue-500 hover:ring-1 hover:ring-blue-100 hover:shadow-md"}`,onClick:()=>c(p?null:u.id),children:[o("div",{class:"flex items-center justify-between",children:[o("div",{class:"flex-1 min-w-0 mr-3",children:[o("div",{class:"flex items-center space-x-2",children:[o("span",{class:"text-sm font-medium text-gray-900",children:u.name}),o("span",{class:"text-[10px] px-1.5 py-0.5 rounded bg-gray-100 text-gray-500 border border-gray-200 truncate max-w-[120px]",children:u.copyright})]}),o("p",{class:"text-xs text-gray-500 mt-0.5 truncate",children:u.description})]}),o("div",{class:"flex items-center gap-3",children:[o("button",{onClick:v=>{v.stopPropagation(),l(u)},disabled:n===u.id,class:"px-3 py-1.5 text-xs font-medium text-blue-600 bg-blue-50 hover:bg-blue-100 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed whitespace-nowrap",children:n===u.id?"应用中...":"使用模版"}),o("div",{class:"flex items-center text-gray-400 transition-colors group-hover:text-blue-500",children:[o("span",{class:`text-[10px] mr-1 transition-all duration-200 ${p?"opacity-100 translate-x-0":"opacity-0 -translate-x-1 group-hover:opacity-100 group-hover:translate-x-0"}`,children:p?"收起":"预览"}),o("div",{class:`transition-transform duration-200 ${p?"rotate-180":""}`,children:o("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})})})]})]})]}),p&&o("div",{class:"mt-3 pt-3 border-t border-gray-100 animate-in fade-in slide-in-from-top-1 duration-200 cursor-default",onClick:v=>v.stopPropagation(),children:[o("div",{class:"flex items-center justify-between mb-2 px-1",children:[o("span",{class:"text-[10px] font-medium text-gray-400",children:"预览效果"}),o("span",{class:"text-[10px] text-gray-300",children:"共 7 款"})]}),o("div",{class:"grid grid-cols-7 gap-1.5",children:F.map(v=>{const y=u.id==="default"?"svg":"jpg",w=`${L}${u.path}/${v.key}.${y}`;return o("div",{class:"flex flex-col items-center",children:[o("div",{class:"w-full aspect-square rounded-md overflow-hidden bg-gray-50 border border-gray-100",children:o("img",{src:w,alt:v.label,class:"w-full h-full object-cover",loading:"lazy",onError:f=>{const b=f.currentTarget,x=`${L}/mood-avatars/${v.key}.svg`;b.src!==x&&(b.src=x)}})}),o("span",{class:"text-[9px] text-gray-400 mt-1 scale-90",children:v.label})]},v.key)})})]})]},u.id)})})]})]})}const kt={$TIMESTAMP:"当前时间戳",$DATE:"YYYY-MM-DD",$VERSION:"当前版本",$RANDOM:"随机数,每次请求都会变化"};function St(){const{config:e,updateConfig:t}=m(),[r,a]=A(null),n=e.apiQueryParams||[],i=(h,c,g)=>{const l=n.map((u,p)=>p===h?{key:c,value:g}:u);t("apiQueryParams",l)},s=()=>{t("apiQueryParams",[...n,{key:"",value:""}]),a(n.length)},d=h=>{const c=n.filter((g,l)=>l!==h);t("apiQueryParams",c)};return o("div",{class:"space-y-2",children:[n.map((h,c)=>o("div",{class:"flex items-center space-x-2",children:[o("input",{type:"text",class:"w-1/3 px-2 py-1 border border-gray-200 rounded text-xs",placeholder:"KEY",value:h.key,onChange:g=>i(c,g.currentTarget.value,h.value)}),o("span",{class:"text-gray-400",children:"="}),o("input",{type:"text",class:"w-1/2 px-2 py-1 border border-gray-200 rounded text-xs",placeholder:"VALUE(可用 $DATE 等变量)",value:h.value,onChange:g=>i(c,h.key,g.currentTarget.value)}),o("button",{type:"button",class:"text-xs text-red-400 hover:text-red-600 px-1",onClick:()=>d(c),title:"删除",children:"×"})]},c)),o("button",{type:"button",class:"text-xs text-blue-500 hover:underline mt-1",onClick:s,children:"+ 添加参数"}),o("div",{class:"mt-2 p-2 rounded border border-gray-100 bg-gray-50",children:[o("div",{class:"text-xs font-medium text-gray-500 mb-2",children:["可用变量说明 ",o("span",{class:"text-[10px] font-normal text-gray-400 ml-1",children:"(须以 $ 开头)"})]}),o("div",{class:"text-xs space-y-1",children:Object.entries(kt).map(([h,c])=>o("div",{class:"flex justify-between items-center",children:[o("code",{class:"bg-gray-200 text-gray-600 px-1 rounded",children:h}),o("span",{class:"text-gray-400 text-right",children:c})]},h))})]})]})}function Ct(){const{config:e,updateConfig:t}=m();return o("div",{class:"space-y-4",children:[o("h3",{class:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:"头像来源"}),o("div",{class:"space-y-4",children:[o("div",{class:"p-3 rounded-xl bg-gray-50/50 border border-gray-100",children:[o("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"来源类型"}),o("select",{value:e.avatarSource,onChange:r=>{const a=r.currentTarget.value;t("avatarSource",a),a==="weekly-mood"&&t("updateInterval",1440*60*1e3)},class:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg focus:border-blue-500 outline-none text-sm appearance-none",children:[o("option",{value:"random",children:"随机头像"}),o("option",{value:"api",children:"自定义API"}),o("option",{value:"weekly-mood",children:"一周心情表"})]})]}),e.avatarSource==="api"&&o("div",{class:"p-3 rounded-xl bg-gray-50/50 border border-gray-100 space-y-4",children:[o("div",{children:[o("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"API 地址"}),o("input",{type:"text",value:e.apiUrl,onChange:r=>t("apiUrl",r.currentTarget.value),class:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg focus:border-blue-500 outline-none text-sm",placeholder:"https://api.dicebear.com/9.x/notionists/png"})]}),o("div",{children:[o("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"API Query"}),o(St,{})]})]}),e.avatarSource==="weekly-mood"&&o(xt,{})]})]})}function $t(){const{config:e,updateConfig:t}=m();return o("div",{class:"space-y-4",children:[o("h3",{class:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:"通知设置"}),o("div",{class:"space-y-2 bg-gray-50/50 rounded-xl p-2 border border-gray-100",children:[o("label",{class:"flex items-center justify-between p-2 rounded-lg hover:bg-white cursor-pointer",children:[o("span",{class:"text-sm text-gray-700",children:"启用通知"}),o("input",{type:"checkbox",checked:e.enableNotifications,onChange:r=>t("enableNotifications",r.currentTarget.checked),class:"w-4 h-4 text-blue-600 rounded border-gray-300"})]}),o("label",{class:"flex items-center justify-between p-2 rounded-lg hover:bg-white cursor-pointer",children:[o("span",{class:"text-sm text-gray-700",children:"成功时通知"}),o("input",{type:"checkbox",checked:e.notifyOnSuccess,onChange:r=>t("notifyOnSuccess",r.currentTarget.checked),class:"w-4 h-4 text-blue-600 rounded border-gray-300"})]}),o("label",{class:"flex items-center justify-between p-2 rounded-lg hover:bg-white cursor-pointer",children:[o("span",{class:"text-sm text-gray-700",children:"失败时通知"}),o("input",{type:"checkbox",checked:e.notifyOnFailure,onChange:r=>t("notifyOnFailure",r.currentTarget.checked),class:"w-4 h-4 text-blue-600 rounded border-gray-300"})]})]})]})}function Et(){const{saveConfig:e,resetConfig:t,toggleSettings:r,showNotification:a}=m(),[n,i]=A(!1);return o("div",{class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/20 backdrop-blur-sm",children:[o("div",{class:"absolute inset-0",onClick:()=>r(!1)}),o("div",{class:"relative bg-white rounded-xl w-full max-w-md max-h-[90vh] overflow-hidden panel-style",children:[o("div",{class:"flex items-center justify-between px-6 py-4 border-b border-gray-200 bg-gray-50/50",children:[o("h2",{class:"text-lg font-semibold text-gray-800 tracking-tight",children:"设置"}),o("button",{onClick:()=>r(!1),class:"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-200 rounded-lg",children:o("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})})})]}),o("div",{class:"overflow-y-auto custom-scrollbar",style:{maxHeight:"calc(90vh - 140px)"},children:o("div",{class:"px-6 py-6 space-y-8",children:[o(_t,{}),o(Ct,{}),o($t,{})]})}),o("div",{class:"px-6 py-4 border-t border-gray-200 bg-gray-50/50",children:o("div",{class:"flex justify-between items-center",children:[o("button",{onClick:async()=>{confirm("确定要重置为默认设置吗?")&&await t()},class:"text-sm text-red-600 hover:text-red-700 hover:bg-red-50 px-3 py-2 rounded-lg",children:"恢复默认"}),o("div",{class:"space-x-3 flex",children:[o("button",{onClick:()=>r(!1),class:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-200 rounded-lg border border-transparent",children:"取消"}),o("button",{onClick:async()=>{i(!0);try{await e(),a("设置已保存","success")}catch(h){console.error("保存失败:",h),a("保存失败","error")}finally{i(!1)}},disabled:n,class:`px-5 py-2 text-sm font-medium text-white rounded-lg border ${n?"bg-blue-400 border-blue-400 cursor-not-allowed":"bg-blue-600 border-blue-600 hover:bg-blue-700 active:bg-blue-800"}`,children:n?"保存中...":"保存设置"})]})]})})]})]})}function Mt(){const{refreshStats:e}=m();return H(()=>{e();const t=setInterval(()=>{e()},3e4);return()=>clearInterval(t)},[e]),null}function At(){const{ui:{isUpdating:e},togglePanel:t}=m();return o("button",{onClick:()=>t(!0),class:"bg-blue-500 hover:bg-blue-600 text-white rounded-full p-3 shadow-lg transition duration-200 fixed bottom-4 right-4 z-50","aria-busy":e,"aria-label":e?"正在更新":"立即更新",children:e?o("span",{class:"flex items-center",children:[o("svg",{class:"animate-spin -ml-1 mr-2 h-6 w-6 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[o("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),o("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),o("span",{children:"更新中..."})]}):o("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})})}const Tt={success:"bg-green-500 text-white border-green-600",error:"bg-red-500 text-white border-red-600",warning:"bg-yellow-500 text-white border-yellow-600",info:"bg-blue-500 text-white border-blue-600"},jt={success:o("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})}),error:o("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})}),warning:o("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),info:o("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})};function zt(){const{ui:{notifications:e},hideNotification:t}=m();return e.length===0?null:o("div",{class:"fixed top-4 right-4 z-[100] flex flex-col gap-2 pointer-events-none",children:e.map(r=>o("div",{class:`pointer-events-auto flex items-center gap-2 px-4 py-3 rounded-lg shadow-lg border ${Tt[r.type]} animate-fadeIn transition-all duration-300`,style:{minWidth:"200px",maxWidth:"320px"},children:[o("div",{class:"flex-shrink-0",children:jt[r.type]}),o("div",{class:"flex-1 text-sm font-medium",children:r.message}),o("button",{onClick:()=>t(r.id),class:"flex-shrink-0 ml-2 opacity-70 hover:opacity-100 transition-opacity",children:o("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})})})]},r.id))})}function It(){const{config:e,stats:t,updateAvatar:r}=m();return H(()=>{if(!e?.autoStart||typeof r!="function")return;const a=Date.now(),n=t?.nextScheduledUpdate||0;a>=n&&(console.log("[AvatarAutoUpdater] Triggering automatic avatar update..."),r())},[e?.autoStart,t?.nextScheduledUpdate]),null}function Nt(){const{ui:{showSettings:e,showPanel:t}}=m();function r(){return e?o(Et,{}):t?o(yt,{}):o(At,{})}return o(I,{children:[o(Mt,{}),o(It,{}),o(zt,{}),r()]})}function We(e,t,r="daily-avatar-ui"){m.getState().init(e,t);let a=document.getElementById(r);a||(a=document.createElement("div"),a.setAttribute("id",r),a.setAttribute("data-source","https://github.com/Wxh16144/daily-avatar"),a.style.position="absolute",a.style.top="0",a.style.left="0",a.style.width="0",a.style.height="0",a.style.overflow="visible",a.style.zIndex="2147483647",document.body.appendChild(a));const n=a.shadowRoot||a.attachShadow({mode:"open"});let i=n.querySelector("style");i||(i=document.createElement("style"),n.appendChild(i)),i.textContent=Ke;let s=n.getElementById("root");return s||(s=document.createElement("div"),s.id="root",n.appendChild(s)),Me(we(Nt,{}),s),{unmount:()=>{s&&Me(null,s),a&&a.remove()}}}typeof window<"u"&&(window.daily_avatar_UI={init:We,store:m}),T.init=We,T.store=m,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 默认风格
|
|
3
|
+
description: 默认的心情头像风格
|
|
4
|
+
copyright: 默认
|
|
5
|
+
url: https://github.com/Wxh16144/daily-avatar
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# 默认风格
|
|
9
|
+
|
|
10
|
+
默认的心情头像风格
|
|
11
|
+
|
|
12
|
+
### 预览
|
|
13
|
+
|
|
14
|
+
| 周一 | 周二 | 周三 | 周四 | 周五 | 周六 | 周日 |
|
|
15
|
+
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
|
16
|
+
| <img src="./monday.svg" width="256" /> | <img src="./tuesday.svg" width="256" /> | <img src="./wednesday.svg" width="256" /> | <img src="./thursday.svg" width="256" /> | <img src="./friday.svg" width="256" /> | <img src="./saturday.svg" width="256" /> | <img src="./sunday.svg" width="256" /> |
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 打工猫风格
|
|
3
|
+
description: 抽象风格,适合表达多样心情
|
|
4
|
+
copyright: 小红书用户:呼噜噜^
|
|
5
|
+
url: http://xhslink.com/o/3IpDqAMBT3o
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# 打工猫风格
|
|
9
|
+
|
|
10
|
+
抽象风格,适合表达多样心情
|
|
11
|
+
|
|
12
|
+
### 预览
|
|
13
|
+
|
|
14
|
+
| 周一 | 周二 | 周三 | 周四 | 周五 | 周六 | 周日 |
|
|
15
|
+
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
|
16
|
+
| <img src="./monday.jpg" width="256" /> | <img src="./tuesday.jpg" width="256" /> | <img src="./wednesday.jpg" width="256" /> | <img src="./thursday.jpg" width="256" /> | <img src="./friday.jpg" width="256" /> | <img src="./saturday.jpg" width="256" /> | <img src="./sunday.jpg" width="256" /> |
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 线条小狗
|
|
3
|
+
description: 线条小狗的一周精神状态
|
|
4
|
+
copyright: 小红书用户:RH
|
|
5
|
+
url: http://xhslink.com/o/7WdVDuLOhNC
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# 线条小狗
|
|
9
|
+
|
|
10
|
+
线条小狗的一周精神状态
|
|
11
|
+
|
|
12
|
+
### 预览
|
|
13
|
+
|
|
14
|
+
| 周一 | 周二 | 周三 | 周四 | 周五 | 周六 | 周日 |
|
|
15
|
+
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
|
16
|
+
| <img src="./monday.jpg" width="256" /> | <img src="./tuesday.jpg" width="256" /> | <img src="./wednesday.jpg" width="256" /> | <img src="./thursday.jpg" width="256" /> | <img src="./friday.jpg" width="256" /> | <img src="./saturday.jpg" width="256" /> | <img src="./sunday.jpg" width="256" /> |
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 旺仔一周头像
|
|
3
|
+
description: 超可爱的旺仔一周头像快快换起来吧!
|
|
4
|
+
copyright: 小红书用户:旺仔俱乐部
|
|
5
|
+
url: http://xhslink.com/o/1MR3rhW37dA
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# 旺仔一周头像
|
|
9
|
+
|
|
10
|
+
超可爱的旺仔一周头像快快换起来吧!
|
|
11
|
+
|
|
12
|
+
### 预览
|
|
13
|
+
|
|
14
|
+
| 周一 | 周二 | 周三 | 周四 | 周五 | 周六 | 周日 |
|
|
15
|
+
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
|
16
|
+
| <img src="./monday.jpg" width="256" /> | <img src="./tuesday.jpg" width="256" /> | <img src="./wednesday.jpg" width="256" /> | <img src="./thursday.jpg" width="256" /> | <img src="./friday.jpg" width="256" /> | <img src="./saturday.jpg" width="256" /> | <img src="./sunday.jpg" width="256" /> |
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wuxh/daily-avatar",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -34,7 +34,9 @@
|
|
|
34
34
|
"build:userscripts": "tsdown -c ./tsdown.user-scripts.ts",
|
|
35
35
|
"dev:lib": "tsdown --watch -c ./tsdown.lib.ts",
|
|
36
36
|
"dev:userscripts": "tsdown -c ./tsdown.user-scripts.ts --watch",
|
|
37
|
-
"prepublishOnly": "npm run build"
|
|
37
|
+
"prepublishOnly": "npm run build",
|
|
38
|
+
"prepare": "npm run generate:readmes",
|
|
39
|
+
"generate:readmes": "tsx scripts/generate-readmes.ts"
|
|
38
40
|
},
|
|
39
41
|
"repository": {
|
|
40
42
|
"type": "git",
|
|
@@ -55,7 +57,8 @@
|
|
|
55
57
|
"@types/node": "^24.10.1",
|
|
56
58
|
"tailwindcss": "^4.1.18",
|
|
57
59
|
"tsdown": "^0.18.3",
|
|
60
|
+
"tsx": "^4.21.0",
|
|
58
61
|
"typescript": "~5.9.3",
|
|
59
62
|
"vite": "^7.2.4"
|
|
60
63
|
}
|
|
61
|
-
}
|
|
64
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// ==UserScript==
|
|
2
2
|
// @name V2EX Daily Avatar
|
|
3
3
|
// @namespace https://github.com/wxh16144/daily-avatar
|
|
4
|
-
// @version 0.0
|
|
4
|
+
// @version 0.1.0
|
|
5
5
|
// @description Automatically update V2EX avatar daily.
|
|
6
6
|
// @icon https://www.v2ex.com/static/img/icon_rayps_64.png
|
|
7
7
|
// @match *://v2ex.com/*
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
// @connect *
|
|
20
20
|
// @require https://unpkg.com/jquery@3.3.1/dist/jquery.slim.min.js
|
|
21
21
|
// @require https://unpkg.com/idb@8.0.3/build/umd.js
|
|
22
|
-
// @require https://unpkg.com/@wuxh/daily-avatar@0.0
|
|
22
|
+
// @require https://unpkg.com/@wuxh/daily-avatar@0.1.0
|
|
23
23
|
// @author Wuxh <wuxh16144@qq.com>
|
|
24
24
|
// @homepage https://github.com/wxh16144/daily-avatar
|
|
25
25
|
// @supportURL https://github.com/wxh16144/daily-avatar/issues
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
// @downloadURL https://unpkg.com/@wuxh/daily-avatar/userscripts/v2ex-daily-avatar.user.js
|
|
30
30
|
// ==/UserScript==
|
|
31
31
|
(function(idb) {
|
|
32
|
-
var version = "0.0
|
|
32
|
+
var version = "0.1.0";
|
|
33
33
|
({}).DEV;
|
|
34
34
|
const APP_META = {
|
|
35
35
|
name: "Daily Avatar",
|
|
@@ -59,6 +59,16 @@
|
|
|
59
59
|
while (n--) u8arr[n] = bstr.charCodeAt(n);
|
|
60
60
|
return new Blob([u8arr], { type: mime });
|
|
61
61
|
}
|
|
62
|
+
async checkIsLogin() {
|
|
63
|
+
try {
|
|
64
|
+
const html = await (await fetch("/")).text();
|
|
65
|
+
const tools = $("<div>").html(html).find("#Top .tools");
|
|
66
|
+
return !["登录", "注册"].some((text) => tools.text().includes(text));
|
|
67
|
+
} catch (error) {
|
|
68
|
+
console.error("Check login status failed:", error);
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
62
72
|
async fetchAvatarImage() {
|
|
63
73
|
const config = this.configManager.getConfig();
|
|
64
74
|
let url = "";
|
|
@@ -107,7 +117,7 @@
|
|
|
107
117
|
onload: (response) => {
|
|
108
118
|
if (response.status === 200 && response.responseText) {
|
|
109
119
|
const html = response.responseText;
|
|
110
|
-
const once = $(html).find("input[name=\"once\"]").val();
|
|
120
|
+
const once = $("<div>").html(html).find("input[name=\"once\"]").val();
|
|
111
121
|
resolve(once ? String(once) : null);
|
|
112
122
|
} else resolve(null);
|
|
113
123
|
},
|
|
@@ -143,6 +153,7 @@
|
|
|
143
153
|
}
|
|
144
154
|
async execute() {
|
|
145
155
|
try {
|
|
156
|
+
if (!await this.checkIsLogin()) throw new Error("未登录 V2EX,无法更新头像");
|
|
146
157
|
const blob = await this.fetchAvatarImage();
|
|
147
158
|
await this.uploadAvatar(blob);
|
|
148
159
|
this.configManager.recordSuccess();
|