From 3e01da0ceab10cd2dd5835dbdcc33982ac8dc284 Mon Sep 17 00:00:00 2001 From: canisminor1990 Date: Wed, 15 May 2024 22:25:16 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20Fit=20SD=20WebUI=201.9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .i18nrc.js | 2 +- javascript/giscus-BNK3dBIH.js | 77 +++++ javascript/main.js | 327 ++++++++++-------- locales/de_DE.json | 1 + locales/en_US.json | 159 ++++----- locales/es_ES.json | 1 + locales/fr_FR.json | 1 + locales/ja_JP.json | 1 + locales/ko_KR.json | 1 + locales/pt_BR.json | 1 + locales/ru_RU.json | 1 + locales/tr_TR.json | 1 + locales/zh_CN.json | 3 +- locales/zh_HK.json | 1 + package.json | 117 +++---- src/app/index.tsx | 2 + src/app/layout.tsx | 23 ++ src/components/StructuredData/index.tsx | 26 ++ src/components/StructuredData/ld.ts | 216 ++++++++++++ src/const/url.ts | 6 +- src/features/ExtraNetworkSidebar/style.ts | 47 +++ src/features/Setting/Form/Appearance.tsx | 4 +- src/features/Setting/Form/Experimental.tsx | 4 +- src/features/Setting/Form/Layout.tsx | 6 +- src/features/Setting/Form/Sidebar.tsx | 6 +- .../Setting/Sidebar/BrandWatermark.tsx | 41 +++ src/features/Setting/Sidebar/Item.tsx | 47 --- src/features/Setting/Sidebar/Menu.tsx | 97 ++++++ src/features/Setting/Sidebar/Mobile.tsx | 2 +- .../Setting/Sidebar/SidebarLayout.tsx | 56 +++ src/features/Setting/Sidebar/index.tsx | 37 +- src/features/Setting/Sidebar/useTabItems.ts | 15 - src/features/Setting/Sidebar/useTabItems.tsx | 28 ++ src/features/Setting/index.tsx | 77 +++-- src/modules/ImageInfo/features/formatInfo.ts | 11 +- 35 files changed, 1041 insertions(+), 404 deletions(-) create mode 100644 javascript/giscus-BNK3dBIH.js create mode 100644 src/components/StructuredData/index.tsx create mode 100644 src/components/StructuredData/ld.ts create mode 100644 src/features/Setting/Sidebar/BrandWatermark.tsx delete mode 100644 src/features/Setting/Sidebar/Item.tsx create mode 100644 src/features/Setting/Sidebar/Menu.tsx create mode 100644 src/features/Setting/Sidebar/SidebarLayout.tsx delete mode 100644 src/features/Setting/Sidebar/useTabItems.ts create mode 100644 src/features/Setting/Sidebar/useTabItems.tsx diff --git a/.i18nrc.js b/.i18nrc.js index ff52873..ff9dfc0 100644 --- a/.i18nrc.js +++ b/.i18nrc.js @@ -10,7 +10,7 @@ module.exports = { entryLocale: 'en_US', output: 'locales', outputLocales: outputLocales, - modelName: 'gpt-3.5-turbo-1106', + modelName: 'gpt-3.5-turbo-0125', experimental: { jsonMode: true, }, diff --git a/javascript/giscus-BNK3dBIH.js b/javascript/giscus-BNK3dBIH.js new file mode 100644 index 0000000..8f4dce7 --- /dev/null +++ b/javascript/giscus-BNK3dBIH.js @@ -0,0 +1,77 @@ +/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),i=new WeakMap;let r=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=i.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&i.set(s,t))}return t}toString(){return this.cssText}};const n=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,s))(e)})(t):t +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */,{is:o,defineProperty:h,getOwnPropertyDescriptor:a,getOwnPropertyNames:l,getOwnPropertySymbols:c,getPrototypeOf:d}=Object,u=globalThis,p=u.trustedTypes,_=p?p.emptyScript:"",$=u.reactiveElementPolyfillSupport,g=(t,e)=>t,f={toAttribute(t,e){switch(e){case Boolean:t=t?_:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch{s=null}}return s}},m=(t,e)=>!o(t,e),v={attribute:!0,type:String,converter:f,reflect:!1,hasChanged:m};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),u.litPropertyMetadata??(u.litPropertyMetadata=new WeakMap);class A extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=v){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&h(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:r}=a(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return null==i?void 0:i.call(this)},set(e){const n=null==i?void 0:i.call(this);r.call(this,e),this.requestUpdate(t,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??v}static _$Ei(){if(this.hasOwnProperty(g("elementProperties")))return;const t=d(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(g("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(g("properties"))){const t=this.properties,e=[...l(t),...c(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const t=this._$Eu(e,s);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(n(t))}else void 0!==t&&e.push(n(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),null==(t=this.constructor.l)||t.forEach((t=>t(this)))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&(null==(e=t.hostConnected)||e.call(t))}removeController(t){var e;null==(e=this._$EO)||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const s=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((s,i)=>{if(e)s.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of i){const i=document.createElement("style"),r=t.litNonce;void 0!==r&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}})(s,this.constructor.elementStyles),s}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this._$EO)||t.forEach((t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this._$EO)||t.forEach((t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){var s;const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(void 0!==r&&!0===i.reflect){const n=(void 0!==(null==(s=i.converter)?void 0:s.toAttribute)?i.converter:f).toAttribute(e,i.type);this._$Em=t,null==n?this.removeAttribute(r):this.setAttribute(r,n),this._$Em=null}}_$AK(t,e){var s;const i=this.constructor,r=i._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=i.getPropertyOptions(r),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(s=t.converter)?void 0:s.fromAttribute)?t.converter:f;this._$Em=r,this[r]=n.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??m)(this[t],e))return;this.P(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t)!0!==s.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],s)}let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null==(t=this._$EO)||t.forEach((t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)})),this.update(s)):this._$EU()}catch(i){throw e=!1,this._$EU(),i}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;null==(e=this._$EO)||e.forEach((t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach((t=>this._$EC(t,this[t])))),this._$EU()}updated(t){}firstUpdated(t){}}A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[g("elementProperties")]=new Map,A[g("finalized")]=new Map,null==$||$({ReactiveElement:A}),(u.reactiveElementVersions??(u.reactiveElementVersions=[])).push("2.0.4"); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const y=globalThis,S=y.trustedTypes,E=S?S.createPolicy("lit-html",{createHTML:t=>t}):void 0,b="$lit$",w=`lit$${(Math.random()+"").slice(9)}$`,C="?"+w,U=`<${C}>`,P=document,O=()=>P.createComment(""),M=t=>null===t||"object"!=typeof t&&"function"!=typeof t,T=Array.isArray,R="[ \t\n\f\r]",N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,I=/-->/g,x=/>/g,H=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),k=/'/g,L=/"/g,D=/^(?:script|style|textarea|title)$/i,j=(W=1,(t,...e)=>({_$litType$:W,strings:t,values:e})),z=Symbol.for("lit-noChange"),Y=Symbol.for("lit-nothing"),G=new WeakMap,B=P.createTreeWalker(P,129);var W;function V(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==E?E.createHTML(e):e}class q{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,n=0;const o=t.length-1,h=this.parts,[a,l]=((t,e)=>{const s=t.length-1,i=[];let r,n=2===e?"":"",o=N;for(let h=0;h"===a[0]?(o=r??N,l=-1):void 0===a[1]?l=-2:(l=o.lastIndex-a[2].length,s=a[1],o=void 0===a[3]?H:'"'===a[3]?L:k):o===L||o===k?o=H:o===I||o===x?o=N:(o=H,r=void 0);const d=o===H&&t[h+1].startsWith("/>")?" ":"";n+=o===N?e+U:l>=0?(i.push(s),e.slice(0,l)+b+e.slice(l)+w+d):e+w+(-2===l?h:d)}return[V(t,n+(t[s]||"")+(2===e?"":"")),i]})(t,e);if(this.el=q.createElement(a,s),B.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=B.nextNode())&&h.length0){i.textContent=S?S.emptyScript:"";for(let s=0;sT(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==Y&&M(this._$AH)?this._$AA.nextSibling.data=t:this.T(P.createTextNode(t)),this._$AH=t}$(t){var e;const{values:s,_$litType$:i}=t,r="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=q.createElement(V(i.h,i.h[0]),this.options)),i);if((null==(e=this._$AH)?void 0:e._$AD)===r)this._$AH.p(s);else{const t=new J(r,this),e=t.u(this.options);t.p(s),this.T(e),this._$AH=t}}_$AC(t){let e=G.get(t.strings);return void 0===e&&G.set(t.strings,e=new q(t)),e}k(t){T(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const r of t)i===e.length?e.push(s=new F(this.S(O()),this.S(O()),this,this.options)):s=e[i],s._$AI(r),i++;i2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=Y}_$AI(t,e=this,s,i){const r=this.strings;let n=!1;if(void 0===r)t=K(this,t,e,0),n=!M(t)||t!==this._$AH&&t!==z,n&&(this._$AH=t);else{const i=t;let o,h;for(t=r[0],o=0;o{const i=(null==s?void 0:s.renderBefore)??e;let r=i._$litPart$;if(void 0===r){const t=(null==s?void 0:s.renderBefore)??null;i._$litPart$=r=new F(e.insertBefore(O(),t),t,void 0,s??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null==(t=this._$Do)||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this._$Do)||t.setConnected(!1)}render(){return z}};var rt;it._$litElement$=!0,it.finalized=!0,null==(rt=globalThis.litElementHydrateSupport)||rt.call(globalThis,{LitElement:it});const nt=globalThis.litElementPolyfillSupport;null==nt||nt({LitElement:it}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.4"); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const ot={attribute:!0,type:String,converter:f,reflect:!1,hasChanged:m},ht=(t=ot,e,s)=>{const{kind:i,metadata:r}=s;let n=globalThis.litPropertyMetadata.get(r);if(void 0===n&&globalThis.litPropertyMetadata.set(r,n=new Map),n.set(s.name,t),"accessor"===i){const{name:i}=s;return{set(s){const r=e.get.call(this);e.set.call(this,s),this.requestUpdate(i,r,t)},init(e){return void 0!==e&&this.P(i,void 0,t),e}}}if("setter"===i){const{name:i}=s;return function(s){const r=this[i];e.call(this,s),this.requestUpdate(i,r,t)}}throw Error("Unsupported decorator location: "+i)}; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function at(t){return(e,s)=>"object"==typeof s?ht(t,e,s):((t,e,s)=>{const i=e.hasOwnProperty(s);return e.constructor.createProperty(s,i?{...t,wrapped:!0}:t),i?Object.getOwnPropertyDescriptor(e,s):void 0})(t,e,s)} +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const lt=2; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */let ct=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const dt=(t,e)=>{var s;const i=t._$AN;if(void 0===i)return!1;for(const r of i)null==(s=r._$AO)||s.call(r,e,!1),dt(r,e);return!0},ut=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===(null==s?void 0:s.size))},pt=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),gt(e)}};function _t(t){void 0!==this._$AN?(ut(this),this._$AM=t,pt(this)):this._$AM=t}function $t(t,e=!1,s=0){const i=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(e)if(Array.isArray(i))for(let n=s;n{t.type==lt&&(t._$AP??(t._$AP=$t),t._$AQ??(t._$AQ=_t))};class ft extends ct{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),pt(this),this.isConnected=t._$AU}_$AO(t,e=!0){var s,i;t!==this.isConnected&&(this.isConnected=t,t?null==(s=this.reconnected)||s.call(this):null==(i=this.disconnected)||i.call(this)),e&&(dt(this,t),ut(this))}setValue(t){if((t=>void 0===t.strings)(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}} +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */class mt{}const vt=new WeakMap,At=(t=>(...e)=>({_$litDirective$:t,values:e}))(class extends ft{render(t){return Y}update(t,[e]){var s;const i=e!==this.Y;return i&&void 0!==this.Y&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.Y=e,this.ht=null==(s=t.options)?void 0:s.host,this.rt(this.ct=t.element)),Y}rt(t){if("function"==typeof this.Y){const e=this.ht??globalThis;let s=vt.get(e);void 0===s&&(s=new WeakMap,vt.set(e,s)),void 0!==s.get(this.Y)&&this.Y.call(this.ht,void 0),s.set(this.Y,t),void 0!==t&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){var t,e;return"function"==typeof this.Y?null==(t=vt.get(this.ht??globalThis))?void 0:t.get(this.Y):null==(e=this.Y)?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var yt=Object.defineProperty,St=Object.getOwnPropertyDescriptor,Et=(t,e,s,i)=>{for(var r,n=i>1?void 0:i?St(e,s):e,o=t.length-1;o>=0;o--)(r=t[o])&&(n=(i?r(e,s,n):r(n))||n);return i&&n&&yt(e,s,n),n};let bt=class extends it{constructor(){super(),this.GISCUS_SESSION_KEY="giscus-session",this.GISCUS_DEFAULT_HOST="https://giscus.app",this.ERROR_SUGGESTION="Please consider reporting this error at https://github.com/giscus/giscus/issues/new.",this.__session="",this._iframeRef=new mt,this.messageEventHandler=this.handleMessageEvent.bind(this),this.hasLoaded=!1,this.host=this.GISCUS_DEFAULT_HOST,this.strict="0",this.reactionsEnabled="1",this.emitMetadata="0",this.inputPosition="bottom",this.theme="light",this.lang="en",this.loading="eager",this.setupSession(),window.addEventListener("message",this.messageEventHandler)}get iframeRef(){var t;return null==(t=this._iframeRef)?void 0:t.value}get _host(){try{return new URL(this.host),this.host}catch{return this.GISCUS_DEFAULT_HOST}}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("message",this.messageEventHandler)}_formatError(t){return`[giscus] An error occurred. Error message: "${t}".`}setupSession(){const t=location.href,e=new URL(t),s=localStorage.getItem(this.GISCUS_SESSION_KEY),i=e.searchParams.get("giscus")??"";if(this.__session="",i)return localStorage.setItem(this.GISCUS_SESSION_KEY,JSON.stringify(i)),this.__session=i,e.searchParams.delete("giscus"),e.hash="",void history.replaceState(void 0,document.title,e.toString());if(s)try{this.__session=JSON.parse(s)}catch(r){localStorage.removeItem(this.GISCUS_SESSION_KEY),console.warn(`${this._formatError(null==r?void 0:r.message)} Session has been cleared.`)}}signOut(){localStorage.removeItem(this.GISCUS_SESSION_KEY),this.__session="",this.update(new Map)}handleMessageEvent(t){if(t.origin!==this._host)return;const{data:e}=t;if("object"!=typeof e||!e.giscus)return;if(this.iframeRef&&e.giscus.resizeHeight&&(this.iframeRef.style.height=`${e.giscus.resizeHeight}px`),e.giscus.signOut)return console.info("[giscus] User has logged out. Session has been cleared."),void this.signOut();if(!e.giscus.error)return;const s=e.giscus.error;if(s.includes("Bad credentials")||s.includes("Invalid state value")||s.includes("State has expired")){if(null!==localStorage.getItem(this.GISCUS_SESSION_KEY))return console.warn(`${this._formatError(s)} Session has been cleared.`),void this.signOut();console.error(`${this._formatError(s)} No session is stored initially. ${this.ERROR_SUGGESTION}`)}s.includes("Discussion not found")?console.warn(`[giscus] ${s}. A new discussion will be created if a comment/reaction is submitted.`):console.error(`${this._formatError(s)} ${this.ERROR_SUGGESTION}`)}sendMessage(t){var e;null==(e=this.iframeRef)||!e.contentWindow||!this.hasLoaded||this.iframeRef.contentWindow.postMessage({giscus:t},this._host)}updateConfig(){const t={setConfig:{repo:this.repo,repoId:this.repoId,category:this.category,categoryId:this.categoryId,term:this.getTerm(),number:+this.getNumber(),strict:"1"===this.strict,reactionsEnabled:"1"===this.reactionsEnabled,emitMetadata:"1"===this.emitMetadata,inputPosition:this.inputPosition,theme:this.theme,lang:this.lang}};this.sendMessage(t)}firstUpdated(){var t;null==(t=this.iframeRef)||t.addEventListener("load",(()=>{var t;null==(t=this.iframeRef)||t.classList.remove("loading"),this.hasLoaded=!0,this.updateConfig()}))}requestUpdate(t,e,s){this.hasUpdated&&"host"!==t?this.updateConfig():super.requestUpdate(t,e,s)}getMetaContent(t,e=!1){const s=e?`meta[property='og:${t}'],`:"",i=document.querySelector(s+`meta[name='${t}']`);return i?i.content:""}_getCleanedUrl(){const t=new URL(location.href);return t.searchParams.delete("giscus"),t.hash="",t}getTerm(){switch(this.mapping){case"url":return this._getCleanedUrl().toString();case"title":return document.title;case"og:title":return this.getMetaContent("title",!0);case"specific":return this.term??"";case"number":return"";default:return location.pathname.length<2?"index":location.pathname.substring(1).replace(/\.\w+$/,"")}}getNumber(){return"number"===this.mapping?this.term??"":""}getIframeSrc(){const t=this._getCleanedUrl().toString(),e=`${t}${this.id?"#"+this.id:""}`,s=this.getMetaContent("description",!0),i=this.getMetaContent("giscus:backlink")||t,r={origin:e,session:this.__session,repo:this.repo,repoId:this.repoId??"",category:this.category??"",categoryId:this.categoryId??"",term:this.getTerm(),number:this.getNumber(),strict:this.strict,reactionsEnabled:this.reactionsEnabled,emitMetadata:this.emitMetadata,inputPosition:this.inputPosition,theme:this.theme,description:s,backLink:i};return`${this._host}${this.lang?`/${this.lang}`:""}/widget?${new URLSearchParams(r).toString()}`}render(){return j` + + `}};bt.styles=((t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,s,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[i+1]),t[0]);return new r(i,t,s)})` + :host, + iframe { + width: 100%; + border: none; + min-height: 150px; + color-scheme: light dark; + } + + iframe.loading { + opacity: 0; + } + `,Et([at({reflect:!0})],bt.prototype,"host",2),Et([at({reflect:!0})],bt.prototype,"repo",2),Et([at({reflect:!0})],bt.prototype,"repoId",2),Et([at({reflect:!0})],bt.prototype,"category",2),Et([at({reflect:!0})],bt.prototype,"categoryId",2),Et([at({reflect:!0})],bt.prototype,"mapping",2),Et([at({reflect:!0})],bt.prototype,"term",2),Et([at({reflect:!0})],bt.prototype,"strict",2),Et([at({reflect:!0})],bt.prototype,"reactionsEnabled",2),Et([at({reflect:!0})],bt.prototype,"emitMetadata",2),Et([at({reflect:!0})],bt.prototype,"inputPosition",2),Et([at({reflect:!0})],bt.prototype,"theme",2),Et([at({reflect:!0})],bt.prototype,"lang",2),Et([at({reflect:!0})],bt.prototype,"loading",2),bt=Et([function(t){return customElements.get(t)?t=>t:(t=>(e,s)=>{void 0!==s?s.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)})(t)}("giscus-widget")],bt);export{bt as GiscusWidget}; diff --git a/javascript/main.js b/javascript/main.js index d1f614b..088f8da 100644 --- a/javascript/main.js +++ b/javascript/main.js @@ -1,4 +1,4 @@ -var e=Object.defineProperty,t=(t,n,r)=>(((t,n,r)=>{n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r})(t,"symbol"!=typeof n?n+"":n,r),r);function n(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function i(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var a={exports:{}},l={},s={exports:{}},c={},u=Symbol.for("react.element"),d=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),m=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),x=Symbol.iterator;var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,k={};function E(e,t,n){this.props=e,this.context=t,this.refs=k,this.updater=n||S}function O(){}function D(e,t,n){this.props=e,this.context=t,this.refs=k,this.updater=n||S}E.prototype.isReactComponent={},E.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},E.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},O.prototype=E.prototype;var $=D.prototype=new O;$.constructor=D,C($,E.prototype),$.isPureReactComponent=!0;var j=Array.isArray,P=Object.prototype.hasOwnProperty,_={current:null},N={key:!0,ref:!0,__self:!0,__source:!0};function I(e,t,n){var r,o={},i=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(i=""+t.key),t)P.call(t,r)&&!N.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(1===l)o.children=n;else if(1(((t,n,r)=>{n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r})(t,"symbol"!=typeof n?n+"":n,r),r);function n(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function i(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var a={exports:{}},l={},s={exports:{}},c={},u=Symbol.for("react.element"),d=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),m=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),x=Symbol.iterator;var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function E(e,t,n){this.props=e,this.context=t,this.refs=C,this.updater=n||k}function D(){}function $(e,t,n){this.props=e,this.context=t,this.refs=C,this.updater=n||k}E.prototype.isReactComponent={},E.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},E.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},D.prototype=E.prototype;var O=$.prototype=new D;O.constructor=$,S(O,E.prototype),O.isPureReactComponent=!0;var _=Array.isArray,I=Object.prototype.hasOwnProperty,N={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function P(e,t,n){var r,o={},i=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(i=""+t.key),t)I.call(t,r)&&!j.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(1===l)o.children=n;else if(1(((t,n,r)=>{n in t?e(t,n,{enumerable:!0,c * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -var G=W,V=Symbol.for("react.element"),X=Symbol.for("react.fragment"),K=Object.prototype.hasOwnProperty,Y=G.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Q={key:!0,ref:!0,__self:!0,__source:!0};function J(e,t,n){var r,o={},i=null,a=null;for(r in void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(a=t.ref),t)K.call(t,r)&&!Q.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:V,type:e,key:i,ref:a,props:o,_owner:Y.current}}l.Fragment=X,l.jsx=J,l.jsxs=J,a.exports=l;var Z=a.exports;const ee={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},te={silent:{level:-1},fatal:{level:ee.fatal},error:{level:ee.error},warn:{level:ee.warn},log:{level:ee.log},info:{level:ee.info},success:{level:ee.success},fail:{level:ee.fail},ready:{level:ee.info},start:{level:ee.info},box:{level:ee.info},debug:{level:ee.debug},trace:{level:ee.trace},verbose:{level:ee.verbose}};function ne(e){return null!==e&&"object"==typeof e}function re(e,t,n=".",r){if(!ne(t))return re(e,{},n,r);const o=Object.assign({},t);for(const i in e){if("__proto__"===i||"constructor"===i)continue;const t=e[i];null!=t&&(r&&r(o,i,t,n)||(Array.isArray(t)&&Array.isArray(o[i])?o[i]=[...t,...o[i]]:ne(t)&&ne(o[i])?o[i]=re(t,o[i],(n?`${n}.`:"")+i.toString(),r):o[i]=t))}return o}const oe=(...e)=>e.reduce(((e,t)=>re(e,t,"",ie)),{});var ie;function ae(e){return t=e,"[object Object]"===Object.prototype.toString.call(t)&&(!(!e.message&&!e.args)&&!e.stack);var t}let le=!1;const se=[];class ce{constructor(e={}){const t=e.types||te;this.options=oe({...e,defaults:{...e.defaults},level:ue(e.level,t),reporters:[...e.reporters||[]]},{types:te,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(const n in t){const e={type:n,...this.options.defaults,...t[n]};this[n]=this._wrapLogFn(e),this[n].raw=this._wrapLogFn(e,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=ue(e,this.options.types,this.options.level)}prompt(e,t){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(e,t)}create(e){const t=new ce({...this.options,...e});return this._mockFn&&t.mockTypes(this._mockFn),t}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){const t=this.options.reporters.indexOf(e);if(t>=0)return this.options.reporters.splice(t,1)}else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(const e in this.options.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(const e in this.options.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(e,t){e&&(e.__write||(e.__write=e.write),e.write=e=>{this[t].raw(String(e).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){le=!0}resumeLogs(){le=!1;const e=se.splice(0);for(const t of e)t[0]._logFn(t[1],t[2])}mockTypes(e){const t=e||this.options.mockFn;if(this._mockFn=t,"function"==typeof t)for(const n in this.options.types)this[n]=t(n,this.options.types[n])||this[n],this[n].raw=this[n]}_wrapLogFn(e,t){return(...n)=>{if(!le)return this._logFn(e,n,t);se.push([this,e,n,t])}}_logFn(e,t,n){if((e.level||0)>this.level)return!1;const r={date:new Date,args:[],...e,level:ue(e.level,this.options.types)};!n&&1===t.length&&ae(t[0])?Object.assign(r,t[0]):r.args=[...t],r.message&&(r.args.unshift(r.message),delete r.message),r.additional&&(Array.isArray(r.additional)||(r.additional=r.additional.split("\n")),r.args.push("\n"+r.additional.join("\n")),delete r.additional),r.type="string"==typeof r.type?r.type.toLowerCase():"log",r.tag="string"==typeof r.tag?r.tag:"";const o=(e=!1)=>{const t=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&t>0){const e=[...this._lastLog.object.args];t>1&&e.push(`(repeated ${t} times)`),this._log({...this._lastLog.object,args:e}),this._lastLog.count=1}e&&(this._lastLog.object=r,this._log(r))};clearTimeout(this._lastLog.timeout);const i=this._lastLog.time&&r.date?r.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=r.date,ithis.options.throttleMin))return void(this._lastLog.timeout=setTimeout(o,this.options.throttle))}catch{}o(!0)}_log(e){for(const t of this.options.reporters)t.log(e,{options:this.options})}}function ue(e,t={},n=3){return void 0===e?n:"number"==typeof e?e:t[e]&&void 0!==t[e].level?t[e].level:n}ce.prototype.add=ce.prototype.addReporter,ce.prototype.remove=ce.prototype.removeReporter,ce.prototype.clear=ce.prototype.removeReporter,ce.prototype.withScope=ce.prototype.withTag,ce.prototype.mock=ce.prototype.mockTypes,ce.prototype.pause=ce.prototype.pauseLogs,ce.prototype.resume=ce.prototype.resumeLogs;class de{constructor(e){this.options={...e},this.defaultColor="#7f8c8d",this.levelColorMap={0:"#c0392b",1:"#f39c12",3:"#00BCD4"},this.typeColorMap={success:"#2ecc71"}}_getLogFn(e){return e<1?console.__error||console.error:1===e?console.__warn||console.warn:console.__log||console.log}log(e){const t=this._getLogFn(e.level),n="log"===e.type?"":e.type,r=e.tag||"",o=`\n background: ${this.typeColorMap[e.type]||this.levelColorMap[e.level]||this.defaultColor};\n border-radius: 0.5em;\n color: white;\n font-weight: bold;\n padding: 2px 0.5em;\n `,i=`%c${[r,n].filter(Boolean).join(":")}`;"string"==typeof e.args[0]?t(`${i}%c ${e.args[0]}`,o,"",...e.args.slice(1)):t(i,o,...e.args)}}const fe=function(e={}){return function(e={}){return new ce(e)}({reporters:e.reporters||[new de({})],prompt:(e,t={})=>"confirm"===t.type?Promise.resolve(confirm(e)):Promise.resolve(prompt(e)),...e})}();var pe={exports:{}},he={},ge={exports:{}},me={}; +var G=U,X=Symbol.for("react.element"),K=Symbol.for("react.fragment"),Y=Object.prototype.hasOwnProperty,Q=G.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,J={key:!0,ref:!0,__self:!0,__source:!0};function Z(e,t,n){var r,o={},i=null,a=null;for(r in void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(a=t.ref),t)Y.call(t,r)&&!J.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:X,type:e,key:i,ref:a,props:o,_owner:Q.current}}l.Fragment=K,l.jsx=Z,l.jsxs=Z,a.exports=l;var ee=a.exports;const te={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},ne={silent:{level:-1},fatal:{level:te.fatal},error:{level:te.error},warn:{level:te.warn},log:{level:te.log},info:{level:te.info},success:{level:te.success},fail:{level:te.fail},ready:{level:te.info},start:{level:te.info},box:{level:te.info},debug:{level:te.debug},trace:{level:te.trace},verbose:{level:te.verbose}};function re(e){return null!==e&&"object"==typeof e}function oe(e,t,n=".",r){if(!re(t))return oe(e,{},n);const o=Object.assign({},t);for(const i in e){if("__proto__"===i||"constructor"===i)continue;const t=e[i];null!=t&&(Array.isArray(t)&&Array.isArray(o[i])?o[i]=[...t,...o[i]]:re(t)&&re(o[i])?o[i]=oe(t,o[i],(n?`${n}.`:"")+i.toString()):o[i]=t)}return o}const ie=(...e)=>e.reduce(((e,t)=>oe(e,t,"")),{});function ae(e){return t=e,"[object Object]"===Object.prototype.toString.call(t)&&(!(!e.message&&!e.args)&&!e.stack);var t}let le=!1;const se=[];class ce{constructor(e={}){const t=e.types||ne;this.options=ie({...e,defaults:{...e.defaults},level:ue(e.level,t),reporters:[...e.reporters||[]]},{types:ne,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(const n in t){const e={type:n,...this.options.defaults,...t[n]};this[n]=this._wrapLogFn(e),this[n].raw=this._wrapLogFn(e,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=ue(e,this.options.types,this.options.level)}prompt(e,t){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(e,t)}create(e){const t=new ce({...this.options,...e});return this._mockFn&&t.mockTypes(this._mockFn),t}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){const t=this.options.reporters.indexOf(e);if(t>=0)return this.options.reporters.splice(t,1)}else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(const e in this.options.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(const e in this.options.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(e,t){e&&(e.__write||(e.__write=e.write),e.write=e=>{this[t].raw(String(e).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){le=!0}resumeLogs(){le=!1;const e=se.splice(0);for(const t of e)t[0]._logFn(t[1],t[2])}mockTypes(e){const t=e||this.options.mockFn;if(this._mockFn=t,"function"==typeof t)for(const n in this.options.types)this[n]=t(n,this.options.types[n])||this[n],this[n].raw=this[n]}_wrapLogFn(e,t){return(...n)=>{if(!le)return this._logFn(e,n,t);se.push([this,e,n,t])}}_logFn(e,t,n){if((e.level||0)>this.level)return!1;const r={date:new Date,args:[],...e,level:ue(e.level,this.options.types)};!n&&1===t.length&&ae(t[0])?Object.assign(r,t[0]):r.args=[...t],r.message&&(r.args.unshift(r.message),delete r.message),r.additional&&(Array.isArray(r.additional)||(r.additional=r.additional.split("\n")),r.args.push("\n"+r.additional.join("\n")),delete r.additional),r.type="string"==typeof r.type?r.type.toLowerCase():"log",r.tag="string"==typeof r.tag?r.tag:"";const o=(e=!1)=>{const t=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&t>0){const e=[...this._lastLog.object.args];t>1&&e.push(`(repeated ${t} times)`),this._log({...this._lastLog.object,args:e}),this._lastLog.count=1}e&&(this._lastLog.object=r,this._log(r))};clearTimeout(this._lastLog.timeout);const i=this._lastLog.time&&r.date?r.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=r.date,ithis.options.throttleMin))return void(this._lastLog.timeout=setTimeout(o,this.options.throttle))}catch{}o(!0)}_log(e){for(const t of this.options.reporters)t.log(e,{options:this.options})}}function ue(e,t={},n=3){return void 0===e?n:"number"==typeof e?e:t[e]&&void 0!==t[e].level?t[e].level:n}ce.prototype.add=ce.prototype.addReporter,ce.prototype.remove=ce.prototype.removeReporter,ce.prototype.clear=ce.prototype.removeReporter,ce.prototype.withScope=ce.prototype.withTag,ce.prototype.mock=ce.prototype.mockTypes,ce.prototype.pause=ce.prototype.pauseLogs,ce.prototype.resume=ce.prototype.resumeLogs;class de{constructor(e){this.options={...e},this.defaultColor="#7f8c8d",this.levelColorMap={0:"#c0392b",1:"#f39c12",3:"#00BCD4"},this.typeColorMap={success:"#2ecc71"}}_getLogFn(e){return e<1?console.__error||console.error:1===e?console.__warn||console.warn:console.__log||console.log}log(e){const t=this._getLogFn(e.level),n="log"===e.type?"":e.type,r=e.tag||"",o=`\n background: ${this.typeColorMap[e.type]||this.levelColorMap[e.level]||this.defaultColor};\n border-radius: 0.5em;\n color: white;\n font-weight: bold;\n padding: 2px 0.5em;\n `,i=`%c${[r,n].filter(Boolean).join(":")}`;"string"==typeof e.args[0]?t(`${i}%c ${e.args[0]}`,o,"",...e.args.slice(1)):t(i,o,...e.args)}}const fe=function(e={}){return function(e={}){return new ce(e)}({reporters:e.reporters||[new de({})],prompt:(e,t={})=>"confirm"===t.type?Promise.resolve(confirm(e)):Promise.resolve(prompt(e)),...e})}();var pe={exports:{}},he={},ge={exports:{}},me={}; /** * @license React * scheduler.production.min.js @@ -18,7 +18,7 @@ var G=W,V=Symbol.for("react.element"),X=Symbol.for("react.fragment"),K=Object.pr * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -!function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0>>1,i=e[r];if(!(0>>1;ro(s,n))co(u,s)?(e[r]=u,e[c]=n,r=c):(e[r]=s,e[l]=n,r=l);else{if(!(co(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var s=[],c=[],u=1,d=null,f=3,p=!1,h=!1,g=!1,m="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function y(e){for(var o=n(c);null!==o;){if(null===o.callback)r(c);else{if(!(o.startTime<=e))break;r(c),o.sortIndex=o.expirationTime,t(s,o)}o=n(c)}}function w(e){if(g=!1,y(e),!h)if(null!==n(s))h=!0,N(x);else{var t=n(c);null!==t&&I(w,t.startTime-e)}}function x(t,o){h=!1,g&&(g=!1,b(E),E=-1),p=!0;var i=f;try{for(y(o),d=n(s);null!==d&&(!(d.expirationTime>o)||t&&!$());){var a=d.callback;if("function"==typeof a){d.callback=null,f=d.priorityLevel;var l=a(d.expirationTime<=o);o=e.unstable_now(),"function"==typeof l?d.callback=l:d===n(s)&&r(s),y(o)}else r(s);d=n(s)}if(null!==d)var u=!0;else{var m=n(c);null!==m&&I(w,m.startTime-o),u=!1}return u}finally{d=null,f=i,p=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,C=!1,k=null,E=-1,O=5,D=-1;function $(){return!(e.unstable_now()-De||125a?(r.sortIndex=i,t(c,r),null===n(s)&&r===n(c)&&(g?(b(E),E=-1):g=!0,I(w,i-a))):(r.sortIndex=l,t(s,r),h||p||(h=!0,N(x))),r},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(me),ge.exports=me;var be=ge.exports,ve=W,ye=be; +!function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0>>1,i=e[r];if(!(0>>1;ro(s,n))co(u,s)?(e[r]=u,e[c]=n,r=c):(e[r]=s,e[l]=n,r=l);else{if(!(co(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var s=[],c=[],u=1,d=null,f=3,p=!1,h=!1,g=!1,m="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function y(e){for(var o=n(c);null!==o;){if(null===o.callback)r(c);else{if(!(o.startTime<=e))break;r(c),o.sortIndex=o.expirationTime,t(s,o)}o=n(c)}}function w(e){if(g=!1,y(e),!h)if(null!==n(s))h=!0,j(x);else{var t=n(c);null!==t&&P(w,t.startTime-e)}}function x(t,o){h=!1,g&&(g=!1,b(E),E=-1),p=!0;var i=f;try{for(y(o),d=n(s);null!==d&&(!(d.expirationTime>o)||t&&!O());){var a=d.callback;if("function"==typeof a){d.callback=null,f=d.priorityLevel;var l=a(d.expirationTime<=o);o=e.unstable_now(),"function"==typeof l?d.callback=l:d===n(s)&&r(s),y(o)}else r(s);d=n(s)}if(null!==d)var u=!0;else{var m=n(c);null!==m&&P(w,m.startTime-o),u=!1}return u}finally{d=null,f=i,p=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var k,S=!1,C=null,E=-1,D=5,$=-1;function O(){return!(e.unstable_now()-$e||125a?(r.sortIndex=i,t(c,r),null===n(s)&&r===n(c)&&(g?(b(E),E=-1):g=!0,P(w,i-a))):(r.sortIndex=l,t(s,r),h||p||(h=!0,j(x))),r},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(me),ge.exports=me;var be=ge.exports,ve=U,ye=be; /** * @license React * react-dom.production.min.js @@ -27,102 +27,46 @@ var G=W,V=Symbol.for("react.element"),X=Symbol.for("react.fragment"),K=Object.pr * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */function we(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n