PageSourceSearch

https://top4ai.com/_next/static/chunks/common-34a8b36bd40ffcfa.js

js top4ai.com collected 2026-10-08 18:54:07 UTC 176,030 bytes, 11 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8592],{72431:function(){},58984:function(e,t,r){Promise.resolve().then(r.bind(r,79621)),Promise.resolve().then(r.bind(r,95063)),Promise.resolve().then(r.bind(r,81670)),Promise.resolve().then(r.bind(r,79090)),Promise.resolve().then(r.bind(r,34081)),Promise.resolve().then(r.bind(r,68730)),Promise.resolve().then(r.bind(r,1006)),Promise.resolve().then(r.bind(r,60696)),Promise.resolve().then(r.bind(r,68649)),Promise.resolve().then(r.bind(r,94732)),Promise.resolve().then(r.bind(r,93388)),Promise.resolve().then(r.bind(r,87201)),Promise.resolve().then(r.bind(r,8985)),Promise.resolve().then(r.bind(r,72024)),Promise.resolve().then(r.bind(r,70034)),Promise.resolve().then(r.bind(r,56924)),Promise.resolve().then(r.bind(r,60990)),Promise.resolve().then(r.bind(r,95151)),Promise.resolve().then(r.bind(r,80548)),Promise.resolve().then(r.bind(r,4259)),Promise.resolve().then(r.bind(r,53545)),Promise.resolve().then(r.bind(r,48779)),Promise.resolve().then(r.bind(r,20775)),Promise.resolve().then(r.bind(r,31013)),Promise.resolve().then(r.bind(r,48546)),Promise.resolve().then(r.bind(r,70481)),Promise.resolve().then(r.bind(r,85205)),Promise.resolve().then(r.bind(r,90677)),Promise.resolve().then(r.bind(r,91966)),Promise.resolve().then(r.bind(r,6576)),Promise.resolve().then(r.bind(r,48190)),Promise.resolve().then(r.bind(r,16057)),Promise.resolve().then(r.bind(r,20234)),Promise.resolve().then(r.bind(r,81768)),Promise.resolve().then(r.bind(r,1475)),Promise.resolve().then(r.bind(r,64893)),Promise.resolve().then(r.bind(r,90837)),Promise.resolve().then(r.bind(r,16864)),Promise.resolve().then(r.bind(r,57976)),Promise.resolve().then(r.bind(r,32510)),Promise.resolve().then(r.bind(r,73165)),Promise.resolve().then(r.bind(r,97867)),Promise.resolve().then(r.bind(r,31085)),Promise.resolve().then(r.bind(r,10575)),Promise.resolve().then(r.t.bind(r,15599,23)),Promise.resolve().then(r.bind(r,86414)),Promise.resolve().then(r.bind(r,22870))},23423:function(e,t,r){Promise.resolve().then(r.bind(r,97867)),Promise.resolve().then(r.bind(r,31085)),Promise.resolve().then(r.bind(r,27191))},12:function(e,t,r){var n,s,a;s=[],void 0!==(a="function"==typeof(n=function(){"use strict";function t(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){o(n.response,t,r)},n.onerror=function(){console.error("could not download file")},n.send()}function n(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function s(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var t=document.createEvent("MouseEvents");
1t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof r.g&&r.g.global===r.g?r.g:void 0,i=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),o=a.saveAs||("object"!=typeof window||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!i?function(e,r,i){var o=a.URL||a.webkitURL,l=document.createElement("a");r=r||e.name||"download",l.download=r,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?s(l):n(l.href)?t(e,r,i):s(l,l.target="_blank")):(l.href=o.createObjectURL(e),setTimeout(function(){o.revokeObjectURL(l.href)},4e4),setTimeout(function(){s(l)},0))}:"msSaveOrOpenBlob"in navigator?function(e,r,a){if(r=r||e.name||"download","string"!=typeof e){var i;navigator.msSaveOrOpenBlob((void 0===(i=a)?i={autoBom:!1}:"object"!=typeof i&&(console.warn("Deprecated: Expected third argument to be a object"),i={autoBom:!i}),i.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e),r)}else if(n(e))t(e,r,a);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){s(o)})}}:function(e,r,n,s){if((s=s||open("","_blank"))&&(s.document.title=s.document.body.innerText="downloading..."),"string"==typeof e)return t(e,r,n);var o="application/octet-stream"===e.type,l=/constructor/i.test(a.HTMLElement)||a.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||o&&l||i)&&"undefined"!=typeof FileReader){var d=new FileReader;d.onloadend=function(){var e=d.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),s?s.location.href=e:location=e,s=null},d.readAsDataURL(e)}else{var u=a.URL||a.webkitURL,h=u.createObjectURL(e);s?s.location=h:location.href=h,s=null,setTimeout(function(){u.revokeObjectURL(h)},4e4)}});a.saveAs=o.saveAs=o,e.exports=o})?n.apply(t,s):n)&&(e.exports=a)},40875:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},92451:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},10407:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},53417:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},81288:function(e){!function(){let t=e=>new TextEncoder().encode(e);function r(e,r){let n,s,a,i,o,l;for("string"==typeof e&&(e=t(e)),n=3&e.length,s=e.length-n,a=r,l=0;l<s;)o=255&e[l]|(255&e[++l])<<8|(255&e[++l])<<16|(255&e[++l])<<24,++l,a^=o=(65535&(o=(o=(65535&o)*3432918353+(((o>>>16)*3432918353&65535)<<16)&4294967295)<<15|o>>>17))*461845907+(((o>>>16)*461845907&65535)<<16)&4294967295,a=(65535&(i=(65535&(a=a<<13|a>>>19))*5+(((a>>>16)*5&65535)<<16)&4294967295))+27492+(((i>>>16)+58964&65535)<<16);switch(o=0,n){case 3:o^=(255&e[l+2])<<16;case 2:o^=(255&e[l+1])<<8;case 1:o^=255&e[l],a^=o=(65535&(o=(o=(65535&o)*3432918353+(((o>>>16)*3432918353&65535)<<16)&4294967295)<<15|o>>>17))*461845907+(((o>>>16)*461845907&65535)<<16)&4294967295}return a^=e.length,a^=a>>>16,a=(65535&a)*2246822507+(((a>>>16)*2246822507&65535)<<16)&4294967295,a^=a>>>13,a=(65535&a)*3266489909+(((a>>>16)*3266489909&65535)<<16)&4294967295,(a^=a>>>16)>>>0}r.v2=function(e,r){"string"==typeof e&&(e=t(e));let n=e.length,s=r^n,a=0,i;for(;n>=4;)i=(65535&(i=255&e[a]|(255&e[++a])<<8|(255&e[++a])<<16|(255&e[++a])<<24))*1540483477+(((i>>>16)*1540483477&65535)<<16),i^=i>>>24,s=(65535&s)*1540483477+(((s>>>16)*1540483477&65535)<<16)^(i=(65535&i)*1540483477+(((i>>>16)*1540483477&65535)<<16)),n-=4,++a;switch(n){case 3:s^=(255&e[a+2])<<16;case 2:s^=(255&e[a+1])<<8;case 1:s^=255&e[a],s=(65535&s)*1540483477+(((s>>>16)*1540483477&65535)<<16)}return s^=s>>>13,s=(65535&s)*1540483477+(((s>>>16)*1540483477&65535)<<16),(s^=s>>>15)>>>0},r.v3=r,e.exports=r}()},73874:function(e,t,r){"use strict";var n=r(8946);r.o(n,"debounce")&&r.d(t,{debounce:function(){return n.debounce}})},11235:function(e,t){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"detectDomainLocale",{enumerable:!0,get:function(){return r}});let r=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r]};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},71154:function(e,t,r){"use strict";function n(e,t){return e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeLocale",{enumerable:!0,get:function(){return n}}),r(63381),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6680:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{createRouteLoader:function(){return m},getClientBuildManifest:function(){return p},isAssetError:function(){return c},markAssetError:function(){return l}}),r(43230),r(96899);let n=r(36390),s=r(63515),a=r(65157);function i(e,t,r){let n,s=t.get(e);if(s)return"future"in s?s.future:Promise.resolve(s);let a=new Promise(e=>{n=e});return t.set(e,s={resolve:n,future:a}),r?r().then(e=>(n(e),e)).catch(r=>{throw t.delete(e),r}):a}let o=Symbol("ASSET_LOAD_ERROR");function l(e){return Object.defineProperty(e,o,{})}function c(e){return e&&o in e}let d=function(e){try{return e=document.createElement("link"),!!window.MSInputMethodContext&&!!document.documentMode||e.relList.supports("prefetch")}catch(e){return!1}}(),u=()=>(0,a.getDeploymentIdQueryOrEmptyString)();function h(e,t,r){return new Promise((n,a)=>{let i=!1;e.then(e=>{i=!0,n(e)}).catch(a),(0,s.requestIdleCallback)(()=>setTimeout(()=>{i||a(r)},t))})}function p(){return self.__BUILD_MANIFEST?Promise.resolve(self.__BUILD_MANIFEST):h(new Promise(e=>{let t=self.__BUILD_MANIFEST_CB;self.__BUILD_MANIFEST_CB=()=>{e(self.__BUILD_MANIFEST),t&&t()}}),3800,l(Error("Failed to load client build manifest")))}function f(e,t){return p().then(r=>{if(!(t in r))throw l(Error("Failed to lookup route: "+t));let s=r[t].map(t=>e+"/_next/"+encodeURI(t));return{scripts:s.filter(e=>e.endsWith(".js")).map(e=>(0,n.__unsafeCreateTrustedScriptURL)(e)+u()),css:s.filter(e=>e.endsWith(".css")).map(e=>e+u())}})}function m(e){let t=new Map,r=new Map,n=new Map,a=new Map;function o(e){{var t;let n=r.get(e.toString());return n||(document.querySelector('script[src^="'+e+'"]')?Promise.resolve():(r.set(e.toString(),n=new Promise((r,n)=>{(t=document.createElement("script")).onload=r,t.onerror=()=>n(l(Error("Failed to load script: "+e))),t.crossOrigin=void 0,t.src=e,document.body.appendChild(t)})),n))}}function c(e){let t=n.get(e);return t||n.set(e,t=fetch(e,{credentials:"same-origin"}).then(t=>{if(!t.ok)throw Error("Failed to load stylesheet: "+e);return t.text().then(t=>({href:e,content:t}))}).catch(e=>{throw l(e)})),t}return{whenEntrypoint:e=>i(e,t),onEntrypoint(e,r){(r?Promise.resolve().then(()=>r()).then(e=>({component:e&&e.default||e,exports:e}),e=>({error:e})):Promise.resolve(void 0)).then(r=>{let n=t.get(e);n&&"resolve"in n?r&&(t.set(e,r),n.resolve(r)):(r?t.set(e,r):t.delete(e),a.delete(e))})}
1,loadRoute(r,n){return i(r,a,()=>{let s;return h(f(e,r).then(e=>{let{scripts:n,css:s}=e;return Promise.all([t.has(r)?[]:Promise.all(n.map(o)),Promise.all(s.map(c))])}).then(e=>this.whenEntrypoint(r).then(t=>({entrypoint:t,styles:e[1]}))),3800,l(Error("Route did not complete loading: "+r))).then(e=>{let{entrypoint:t,styles:r}=e,n=Object.assign({styles:r},t);return"error"in t?t:n}).catch(e=>{if(n)throw e;return{error:e}}).finally(()=>null==s?void 0:s())})},prefetch(t){let r;return(r=navigator.connection)&&(r.saveData||/2g/.test(r.effectiveType))?Promise.resolve():f(e,t).then(e=>Promise.all(d?e.scripts.map(e=>{var t,r,n;return t=e.toString(),r="script",new Promise((e,s)=>{if(document.querySelector('\n      link[rel="prefetch"][href^="'+t+'"],\n      link[rel="preload"][href^="'+t+'"],\n      script[src^="'+t+'"]'))return e();n=document.createElement("link"),r&&(n.as=r),n.rel="prefetch",n.crossOrigin=void 0,n.onload=e,n.onerror=()=>s(l(Error("Failed to prefetch: "+t))),n.href=t,document.head.appendChild(n)})}):[])).then(()=>{(0,s.requestIdleCallback)(()=>this.loadRoute(t,!0).catch(()=>{}))}).catch(()=>{})}}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},27325:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{Router:function(){return a.default},createRouter:function(){return m},default:function(){return p},makePublicRouterInstance:function(){return g},useRouter:function(){return f},withRouter:function(){return l.default}});let n=r(43230),s=n._(r(2265)),a=n._(r(28384)),i=r(25523),o=n._(r(2467)),l=n._(r(36146)),c={router:null,readyCallbacks:[],ready(e){if(this.router)return e();"undefined"!=typeof window&&this.readyCallbacks.push(e)}},d=["pathname","route","query","asPath","components","isFallback","basePath","locale","locales","defaultLocale","isReady","isPreview","isLocaleDomain","domainLocales"],u=["push","replace","reload","back","prefetch","beforePopState"];function h(){if(!c.router)throw Error('No router instance found.\nYou should only use "next/router" on the client side of your app.\n');return c.router}Object.defineProperty(c,"events",{get:()=>a.default.events}),d.forEach(e=>{Object.defineProperty(c,e,{get:()=>h()[e]})}),u.forEach(e=>{c[e]=function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return h()[e](...r)}}),["routeChangeStart","beforeHistoryChange","routeChangeComplete","routeChangeError","hashChangeStart","hashChangeComplete"].forEach(e=>{c.ready(()=>{a.default.events.on(e,function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];let s="on"+e.charAt(0).toUpperCase()+e.substring(1);if(c[s])try{c[s](...r)}catch(e){console.error("Error when running the Router event: "+s),console.error((0,o.default)(e)?e.message+"\n"+e.stack:e+"")}})})});let p=c;function f(){let e=s.default.useContext(i.RouterContext);if(!e)throw Error("NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted");return e}function m(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return c.router=new a.default(...t),c.readyCallbacks.forEach(e=>e()),c.readyCallbacks=[],c.router}function g(e){let t={};for(let r of d){if("object"==typeof e[r]){t[r]=Object.assign(Array.isArray(e[r])?[]:{},e[r]);continue}t[r]=e[r]}return t.events=a.default.events,u.forEach(r=>{t[r]=function(){for(var t=arguments.length,n=Array(t),s=0;s<t;s++)n[s]=arguments[s];return e[r](...n)}}),t}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},36390:function(e,t){"use strict";let r;function n(e){var t;return(null==(t=function(){if(void 0===r&&"undefined"!=typeof window){var e;r=(null==(e=window.trustedTypes)?void 0:e.createPolicy("nextjs",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e}))||null}return r}())?void 0:t.createScriptURL(e))||e}
1Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"__unsafeCreateTrustedScriptURL",{enumerable:!0,get:function(){return n}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},36146:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}}),r(43230);let n=r(57437);r(2265);let s=r(27325);function a(e){function t(t){return(0,n.jsx)(e,{router:(0,s.useRouter)(),...t})}return t.getInitialProps=e.getInitialProps,t.origGetInitialProps=e.origGetInitialProps,t}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},61875:function(e,t){"use strict";function r(e){return"/api"===e||!!(null==e?void 0:e.startsWith("/api/"))}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isAPIRoute",{enumerable:!0,get:function(){return r}})},2467:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return s},getProperError:function(){return a}});let n=r(99832);function s(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}function a(e){return s(e)?e:Error((0,n.isPlainObject)(e)?JSON.stringify(e):e+"")}},74574:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BloomFilter",{enumerable:!0,get:function(){return r}});class r{static from(e,t){void 0===t&&(t=1e-4);let n=new r(e.length,t);for(let t of e)n.add(t);return n}export(){return{numItems:this.numItems,errorRate:this.errorRate,numBits:this.numBits,numHashes:this.numHashes,bitArray:this.bitArray}}import(e){this.numItems=e.numItems,this.errorRate=e.errorRate,this.numBits=e.numBits,this.numHashes=e.numHashes,this.bitArray=e.bitArray}add(e){this.getHashValues(e).forEach(e=>{this.bitArray[e]=1})}contains(e){return this.getHashValues(e).every(e=>this.bitArray[e])}getHashValues(e){let t=[];for(let r=1;r<=this.numHashes;r++){let n=function(e){let t=0;for(let r=0;r<e.length;r++)t=Math.imul(t^e.charCodeAt(r),1540483477),t^=t>>>13,t=Math.imul(t,1540483477);return t>>>0}(""+e+r)%this.numBits;t.push(n)}return t}constructor(e,t=1e-4){this.numItems=e,this.errorRate=t,this.numBits=Math.ceil(-(e*Math.log(t))/(Math.log(2)*Math.log(2))),this.numHashes=Math.ceil(this.numBits/e*Math.log(2)),this.bitArray=Array(this.numBits).fill(0)}}},43579:function(e,t){"use strict";function r(e,t){let r;let n=e.split("/");return(t||[]).some(t=>!!n[1]&&n[1].toLowerCase()===t.toLowerCase()&&(r=t,n.splice(1,1),e=n.join("/")||"/",!0)),{pathname:e,detectedLocale:r}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizeLocalePath",{enumerable:!0,get:function(){return r}})},99832:function(e,t){"use strict";function r(e){return Object.prototype.toString.call(e)}function n(e){if("[object Object]"!==r(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t.hasOwnProperty("isPrototypeOf")}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getObjectClassLabel:function(){return r},isPlainObject:function(){return n}})},29081:function(e,t){"use strict";function r(){let e=Object.create(null);return{on(t,r){(e[t]||(e[t]=[])).push(r)},off(t,r){e[t]&&e[t].splice(e[t].indexOf(r)>>>0,1)},emit(t){for(var r=arguments.length,n=Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];(e[t]||[]).slice().map(e=>{e(...n)})}}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}})},8645:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"denormalizePagePath",{enumerable:!0,get:function(){return a}});let n=r(86279),s=r(27524);function a(e){let t=(0,s.normalizePathSep)(e);return t.startsWith("/index/")&&!(0,n.isDynamicRoute)(t)?t.slice(6):"/index"!==t?t:"/"}},27524:function(e,t){"use strict";function r(e){return e.replace(/\\/g,"/")}
1Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathSep",{enumerable:!0,get:function(){return r}})},28384:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{createKey:function(){return B},default:function(){return V},matchesMiddleware:function(){return I}});let n=r(43230),s=r(47788),a=r(26674),i=r(6680),o=r(88003),l=s._(r(2467)),c=r(8645),d=r(43579),u=n._(r(29081)),h=r(3987),p=r(38104),f=r(85907);r(72431);let m=r(4199),g=r(9964),x=r(57497);r(11235);let b=r(63381),k=r(55449),w=r(71154),v=r(35076),y=r(1634),j=r(11283),C=r(25246),_=r(61875),P=r(93331),N=r(79114),L=r(75902),D=r(53552),S=r(86146),A=r(17053),M=r(37205),E=r(7092);function R(){return Object.assign(Error("Route Cancelled"),{cancelled:!0})}async function I(e){let t=await Promise.resolve(e.router.pageLoader.getMiddleware());if(!t)return!1;let{pathname:r}=(0,b.parsePath)(e.asPath),n=(0,j.hasBasePath)(r)?(0,v.removeBasePath)(r):r,s=(0,y.addBasePath)((0,k.addLocale)(n,e.locale));return t.some(e=>new RegExp(e.regexp).test(s))}function T(e){let t=(0,h.getLocationOrigin)();return e.startsWith(t)?e.substring(t.length):e}function O(e,t,r){let[n,s]=(0,C.resolveHref)(e,t,!0),a=(0,h.getLocationOrigin)(),i=n.startsWith(a),o=s&&s.startsWith(a);n=T(n),s=s?T(s):s;let l=i?n:(0,y.addBasePath)(n),c=r?T((0,C.resolveHref)(e,r)):s||n;return{url:l,as:o?c:(0,y.addBasePath)(c)}}function z(e,t){let r=(0,a.removeTrailingSlash)((0,c.denormalizePagePath)(e));return"/404"===r||"/_error"===r?e:(t.includes(r)||t.some(t=>{if((0,p.isDynamicRoute)(t)&&(0,g.getRouteRegex)(t).re.test(r))return e=t,!0}),(0,a.removeTrailingSlash)(e))}async function Z(e){if(!await I(e)||!e.fetchData)return null;let t=await e.fetchData(),r=await function(e,t,r){let n={basePath:r.router.basePath,i18n:{locales:r.router.locales},trailingSlash:!1},s=t.headers.get("x-nextjs-rewrite"),o=s||t.headers.get("x-nextjs-matched-path"),l=t.headers.get("x-matched-path");if(!l||o||l.includes("__next_data_catchall")||l.includes("/_error")||l.includes("/404")||(o=l),o){if(o.startsWith("/")){let t=(0,f.parseRelativeUrl)(o),l=(0,P.getNextPathnameInfo)(t.pathname,{nextConfig:n,parseData:!0}),c=(0,a.removeTrailingSlash)(l.pathname);return Promise.all([r.router.pageLoader.getPageList(),(0,i.getClientBuildManifest)()]).then(a=>{let[i,{__rewrites:o}]=a,u=(0,k.addLocale)(l.pathname,l.locale);if((0,p.isDynamicRoute)(u)||!s&&i.includes((0,d.normalizeLocalePath)((0,v.removeBasePath)(u),r.router.locales).pathname)){let r=(0,P.getNextPathnameInfo)((0,f.parseRelativeUrl)(e).pathname,{nextConfig:n,parseData:!0});u=(0,y.addBasePath)(r.pathname),t.pathname=u}if(!i.includes(c)){let e=z(c,i);e!==c&&(c=e)}let h=i.includes(c)?c:z((0,d.normalizeLocalePath)((0,v.removeBasePath)(t.pathname),r.router.locales).pathname,i);if((0,p.isDynamicRoute)(h)){let e=(0,m.getRouteMatcher)((0,g.getRouteRegex)(h))(u);Object.assign(t.query,e||{})}return{type:"rewrite",parsedAs:t,resolvedHref:h}})}let t=(0,b.parsePath)(e);return Promise.resolve({type:"redirect-external",destination:""+(0,N.formatNextPathnameInfo)({...(0,P.getNextPathnameInfo)(t.pathname,{nextConfig:n,parseData:!0}),defaultLocale:r.router.defaultLocale,buildId:""})+t.query+t.hash})}let c=t.headers.get("x-nextjs-redirect");if(c){if(c.startsWith("/")){let e=(0,b.parsePath)(c),t=(0,N.formatNextPathnameInfo)({...(0,P.getNextPathnameInfo)(e.pathname,{nextConfig:n,parseData:!0}),defaultLocale:r.router.defaultLocale,buildId:""});return Promise.resolve({type:"redirect-internal",newAs:""+t+e.query+e.hash,newUrl:""+t+e.query+e.hash})}return Promise.resolve({type:"redirect-external",destination:c})}return Promise.resolve({type:"next"})}(t.dataHref,t.response,e);return{dataHref:t.dataHref,json:t.json,response:t.response,text:t.text,cacheKey:t.cacheKey,effect:r}}let F=Symbol("SSG_DATA_NOT_FOUND");function $(e){try{return JSON.parse(e)}catch(e){return null}}function H(e){let{dataHref:t,inflightCache:r,isPrefetch:n,hasMiddleware:s,isServerRender:a,parseJSON:o,persistCache:l,isBackgroun
1d:c,unstable_skipClientCache:d}=e,{href:u}=new URL(t,window.location.href),h=e=>{var c;return(function e(t,r,n){return fetch(t,{credentials:"same-origin",method:n.method||"GET",headers:Object.assign({},n.headers,{"x-nextjs-data":"1"})}).then(s=>!s.ok&&r>1&&s.status>=500?e(t,r-1,n):s)})(t,a?3:1,{headers:Object.assign({},n?{purpose:"prefetch"}:{},n&&s?{"x-middleware-prefetch":"1"}:{}),method:null!=(c=null==e?void 0:e.method)?c:"GET"}).then(r=>r.ok&&(null==e?void 0:e.method)==="HEAD"?{dataHref:t,response:r,text:"",json:{},cacheKey:u}:r.text().then(e=>{if(!r.ok){if(s&&[301,302,307,308].includes(r.status))return{dataHref:t,response:r,text:e,json:{},cacheKey:u};if(404===r.status){var n;if(null==(n=$(e))?void 0:n.notFound)return{dataHref:t,json:{notFound:F},response:r,text:e,cacheKey:u}}let o=Error("Failed to load static props");throw a||(0,i.markAssetError)(o),o}return{dataHref:t,json:o?$(e):null,response:r,text:e,cacheKey:u}})).then(e=>(l&&"no-cache"!==e.response.headers.get("x-middleware-cache")||delete r[u],e)).catch(e=>{throw d||delete r[u],("Failed to fetch"===e.message||"NetworkError when attempting to fetch resource."===e.message||"Load failed"===e.message)&&(0,i.markAssetError)(e),e})};return d&&l?h({}).then(e=>("no-cache"!==e.response.headers.get("x-middleware-cache")&&(r[u]=Promise.resolve(e)),e)):void 0!==r[u]?r[u]:r[u]=h(c?{method:"HEAD"}:{})}function B(){return Math.random().toString(36).slice(2,10)}function U(e){let{url:t,router:r}=e;if(t===(0,y.addBasePath)((0,k.addLocale)(r.asPath,r.locale)))throw Error("Invariant: attempted to hard navigate to the same URL "+t+" "+location.href);window.location.href=t}let W=e=>{let{route:t,router:r}=e,n=!1,s=r.clc=()=>{n=!0};return()=>{if(n){let e=Error('Abort fetching component for route: "'+t+'"');throw e.cancelled=!0,e}s===r.clc&&(r.clc=null)}};class V{reload(){window.location.reload()}back(){window.history.back()}forward(){window.history.forward()}push(e,t,r){return void 0===r&&(r={}),{url:e,as:t}=O(this,e,t),this.change("pushState",e,t,r)}replace(e,t,r){return void 0===r&&(r={}),{url:e,as:t}=O(this,e,t),this.change("replaceState",e,t,r)}async _bfl(e,t,r,n){{let l=!1,c=!1;for(let d of[e,t])if(d){let t=(0,a.removeTrailingSlash)(new URL(d,"http://n").pathname),u=(0,y.addBasePath)((0,k.addLocale)(t,r||this.locale));if(t!==(0,a.removeTrailingSlash)(new URL(this.asPath,"http://n").pathname)){var s,i,o;for(let e of(l=l||!!(null==(s=this._bfl_s)?void 0:s.contains(t))||!!(null==(i=this._bfl_s)?void 0:i.contains(u)),[t,u])){let t=e.split("/");for(let e=0;!c&&e<t.length+1;e++){let r=t.slice(0,e).join("/");if(r&&(null==(o=this._bfl_d)?void 0:o.contains(r))){c=!0;break}}}if(l||c){if(n)return!0;return U({url:(0,y.addBasePath)((0,k.addLocale)(e,r||this.locale,this.defaultLocale)),router:this}),new Promise(()=>{})}}}}return!1}async change(e,t,r,n,s){var c,d,u,C,_,P,N,S,E;let T,Z;if(!(0,D.isLocalURL)(t))return U({url:t,router:this}),!1;let $=1===n._h;$||n.shallow||await this._bfl(r,void 0,n.locale);let H=$||n._shouldResolveHref||(0,b.parsePath)(t).pathname===(0,b.parsePath)(r).pathname,B={...this.state},W=!0!==this.isReady;this.isReady=!0;let q=this.isSsr;if($||(this.isSsr=!1),$&&this.clc)return!1;let G=B.locale;h.ST&&performance.mark("routeChange");let{shallow:J=!1,scroll:K=!0}=n,X={shallow:J};this._inFlightRoute&&this.clc&&(q||V.events.emit("routeChangeError",R(),this._inFlightRoute,X),this.clc(),this.clc=null),r=(0,y.addBasePath)((0,k.addLocale)((0,j.hasBasePath)(r)?(0,v.removeBasePath)(r):r,n.locale,this.defaultLocale));let Q=(0,w.removeLocale)((0,j.hasBasePath)(r)?(0,v.removeBasePath)(r):r,B.locale);this._inFlightRoute=r;let Y=G!==B.locale;if(!$&&this.onlyAHashChange(Q)&&!Y){B.asPath=Q,V.events.emit("hashChangeStart",r,X),this.changeState(e,t,r,{...n,scroll:!1}),K&&this.scrollToHash(Q);try{await this.set(B,this.components[B.route],null)}catch(e){throw(0,l.default)(e)&&e.cancelled&&V.events.emit("routeChangeError",e,Q,X),e}return V.events.emit("hashChangeComplete",r,X),!0}let ee=(0,f.parseRelativeUrl)(t),{pathname:et,query:er}=ee;try{[T,{__rewrites:Z}
1]=await Promise.all([this.pageLoader.getPageList(),(0,i.getClientBuildManifest)(),this.pageLoader.getMiddleware()])}catch(e){return U({url:r,router:this}),!1}this.urlIsNew(Q)||Y||(e="replaceState");let en=r;et=et?(0,a.removeTrailingSlash)((0,v.removeBasePath)(et)):et;let es=(0,a.removeTrailingSlash)(et),ea=r.startsWith("/")&&(0,f.parseRelativeUrl)(r).pathname;if(null==(c=this.components[et])?void 0:c.__appRouter)return U({url:r,router:this}),new Promise(()=>{});let ei=!!(ea&&es!==ea&&(!(0,p.isDynamicRoute)(es)||!(0,m.getRouteMatcher)((0,g.getRouteRegex)(es))(ea))),eo=!n.shallow&&await I({asPath:r,locale:B.locale,router:this});if($&&eo&&(H=!1),H&&"/_error"!==et&&(n._shouldResolveHref=!0,ee.pathname=z(et,T),ee.pathname===et||(et=ee.pathname,ee.pathname=(0,y.addBasePath)(et),eo||(t=(0,x.formatWithValidation)(ee)))),!(0,D.isLocalURL)(r))return U({url:r,router:this}),!1;en=(0,w.removeLocale)((0,v.removeBasePath)(en),B.locale),es=(0,a.removeTrailingSlash)(et);let el=!1;if((0,p.isDynamicRoute)(es)){let e=(0,f.parseRelativeUrl)(en),n=e.pathname,s=(0,g.getRouteRegex)(es);el=(0,m.getRouteMatcher)(s)(n);let a=es===n,i=a?(0,M.interpolateAs)(es,n,er):{};if(el&&(!a||i.result))a?r=(0,x.formatWithValidation)(Object.assign({},e,{pathname:i.result,query:(0,A.omit)(er,i.params)})):Object.assign(er,el);else{let e=Object.keys(s.groups).filter(e=>!er[e]&&!s.groups[e].optional);if(e.length>0&&!eo)throw Error((a?"The provided `href` ("+t+") value is missing query values ("+e.join(", ")+") to be interpolated properly. ":"The provided `as` value ("+n+") is incompatible with the `href` value ("+es+"). ")+"Read more: https://nextjs.org/docs/messages/"+(a?"href-interpolation-failed":"incompatible-href-as"))}}$||V.events.emit("routeChangeStart",r,X);let ec="/404"===this.pathname||"/_error"===this.pathname;try{let a=await this.getRouteInfo({route:es,pathname:et,query:er,as:r,resolvedAs:en,routeProps:X,locale:B.locale,isPreview:B.isPreview,hasMiddleware:eo,unstable_skipClientCache:n.unstable_skipClientCache,isQueryUpdating:$&&!this.isFallback,isMiddlewareRewrite:ei});if($||n.shallow||await this._bfl(r,"resolvedAs"in a?a.resolvedAs:void 0,B.locale),"route"in a&&eo){es=et=a.route||es,X.shallow||(er=Object.assign({},a.query||{},er));let e=(0,j.hasBasePath)(ee.pathname)?(0,v.removeBasePath)(ee.pathname):ee.pathname;if(el&&et!==e&&Object.keys(el).forEach(e=>{el&&er[e]===el[e]&&delete er[e]}),(0,p.isDynamicRoute)(et)){let e=!X.shallow&&a.resolvedAs?a.resolvedAs:(0,y.addBasePath)((0,k.addLocale)(new URL(r,location.href).pathname,B.locale),!0);(0,j.hasBasePath)(e)&&(e=(0,v.removeBasePath)(e));let t=(0,g.getRouteRegex)(et),n=(0,m.getRouteMatcher)(t)(new URL(e,location.href).pathname);n&&Object.assign(er,n)}}if("type"in a){if("redirect-internal"===a.type)return this.change(e,a.newUrl,a.newAs,n);return U({url:a.destination,router:this}),new Promise(()=>{})}let i=a.Component;if(i&&i.unstable_scriptLoader&&[].concat(i.unstable_scriptLoader()).forEach(e=>{(0,o.handleClientScriptLoad)(e.props)}),(a.__N_SSG||a.__N_SSP)&&a.props){if(a.props.pageProps&&a.props.pageProps.__N_REDIRECT){n.locale=!1;let t=a.props.pageProps.__N_REDIRECT;if(t.startsWith("/")&&!1!==a.props.pageProps.__N_REDIRECT_BASE_PATH){let r=(0,f.parseRelativeUrl)(t);r.pathname=z(r.pathname,T);let{url:s,as:a}=O(this,t,t);return this.change(e,s,a,n)}return U({url:t,router:this}),new Promise(()=>{})}if(B.isPreview=!!a.props.__N_PREVIEW,a.props.notFound===F){let e;try{await this.fetchComponent("/404"),e="/404"}catch(t){e="/_error"}if(a=await this.getRouteInfo({route:e,pathname:e,query:er,as:r,resolvedAs:en,routeProps:{shallow:!1},locale:B.locale,isPreview:B.isPreview,isNotFound:!0}),"type"in a)throw Error("Unexpected middleware effect on /404")}}$&&"/_error"===this.pathname&&(null==(u=self.__NEXT_DATA__.props)?void 0:null==(d=u.pageProps)?void 0:d.statusCode)===500&&(null==(C=a.props)?void 0:C.pageProps)&&(a.props.pageProps.statusCode=500);let c=n.shallow&&B.route===(null!=(_=a.route)?_:es),h=null!=(P=n.scroll)?P:!$&&!c,x=null!=s?s:h?{x:0,y:0}:null,b={...B,route:es,pathname:et,query:er,asPath:Q,isFallback:!1};if($&&ec){if(a=await this.getRouteInfo({route:this.pathname,pathname:this.pathname,query:er,as:r,resolvedAs:en,routeProps:{shallow:!1},locale:B.locale,isPreview:B.isPreview,isQueryUpdating:$&&!this.isFallback}),"type"in a)throw Error("Unexpected middleware effect on "+this.pathname);"/_error"===this.pathname&&(null==(S=self.__NEXT_DATA__.props)?void 0:null==(N=S.pageProps)?void 0:N.statusCode)===500&&(null==(E=a.props)?void 0:E.pageProps)&&(a.props.pageProps.statusCode=500);try{await this.set(b,a,x)}catch(e){throw(0,l.default)(e)&&e.cancelled&&V.events.emit("routeChangeError",e,Q,X),e}return!0}if(V.events.emit("beforeHistoryChange",r,X),this.changeState(e,t,r,n),!($&&!x&&!W&&!Y&&(0,L.compareRouterStates)(b,this.state))){try{await this.set(b,a,x)}catch(e){if(e.cancelled)a.error=a.error||e;else throw e}if(a.error)throw $||V.events.emit("routeChangeError",a.error,Q,X),a.error;$||V.events.emit("routeChangeComplete",r,X),h&&/#.+$/.test(r)&&this.scrollToHash(r)}return!0}catch(e){if((0,l.default)(e)&&e.cancelled)return!1;throw e}}changeState(e,t,r,n){void 0===n&&(n={}),("pushState"!==e||(0,h.getURL)()!==r)&&(this._shallow=n.shallow,window.history[e]({url:t,as:r,options:n,__N:!0,key:this._key="pushState"!==e?this._key:B()},"",r))}async handleRouteInfoError(e,t,r,n,s,a){if(console.error(e),e.cancelled)throw e;if((0,i.isAssetError)(e)||a)throw V.events.emit("routeChangeError",e,n,s),U({url:n,router:this}),R();try{let n;let{page:s,styleSheets:a}=await this.fetchComponent("/_error"),i={props:n,Component:s,styleSheets:a,err:e,error:e};if(!i.props)try{i.props=await this.getInitialProps(s,{err:e,pathname:t,query:r})}catch(e){console.error("Error in error page `getInitialProps`: ",e),i.props={}}return i}catch(e){return this.handleRouteInfoError((0,l.default)(e)?e:Error(e+""),t,r,n,s,!0)}}async getRouteInfo(e){let{route:t,pathname:r,query:n,as:s,resolvedAs:i,routeProps:o,locale:c,hasMiddleware:u,isPreview:h,unstable_skipClientCache:p,isQueryUpdating:f,isMiddlewareRewrite:m,isNotFound:g}=e,b=t;try{var k,w,y,j;let e=this.components[b];if(o.shallow&&e&&this.route===b)return e;let t=W({route:b,router:this});u&&(e=void 0);let l=!e||"initial"in e?void 0:e,C={dataHref:this.pageLoader.getDataHref({href:(0,x.formatWithValidation)({pathname:r,query:n}),skipInterpolation:!0,asPath:g?"/404":i,locale:c}),hasMiddleware:!0,isServerRender:this.isSsr,parseJSON:!0,inflightCache:f?this.sbc:this.sdc,persist
1Cache:!h,isPrefetch:!1,unstable_skipClientCache:p,isBackground:f},P=f&&!m?null:await Z({fetchData:()=>H(C),asPath:g?"/404":i,locale:c,router:this}).catch(e=>{if(f)return null;throw e});if(P&&("/_error"===r||"/404"===r)&&(P.effect=void 0),f&&(P?P.json=self.__NEXT_DATA__.props:P={json:self.__NEXT_DATA__.props}),t(),(null==P?void 0:null==(k=P.effect)?void 0:k.type)==="redirect-internal"||(null==P?void 0:null==(w=P.effect)?void 0:w.type)==="redirect-external")return P.effect;if((null==P?void 0:null==(y=P.effect)?void 0:y.type)==="rewrite"){let t=(0,a.removeTrailingSlash)(P.effect.resolvedHref),s=await this.pageLoader.getPageList();if((!f||s.includes(t))&&(b=t,r=P.effect.resolvedHref,n={...n,...P.effect.parsedAs.query},i=(0,v.removeBasePath)((0,d.normalizeLocalePath)(P.effect.parsedAs.pathname,this.locales).pathname),e=this.components[b],o.shallow&&e&&this.route===b&&!u))return{...e,route:b}}if((0,_.isAPIRoute)(b))return U({url:s,router:this}),new Promise(()=>{});let N=l||await this.fetchComponent(b).then(e=>({Component:e.page,styleSheets:e.styleSheets,__N_SSG:e.mod.__N_SSG,__N_SSP:e.mod.__N_SSP})),L=null==P?void 0:null==(j=P.response)?void 0:j.headers.get("x-middleware-skip"),D=N.__N_SSG||N.__N_SSP;L&&(null==P?void 0:P.dataHref)&&delete this.sdc[P.dataHref];let{props:S,cacheKey:A}=await this._getData(async()=>{if(D){if((null==P?void 0:P.json)&&!L)return{cacheKey:P.cacheKey,props:P.json};let e=(null==P?void 0:P.dataHref)?P.dataHref:this.pageLoader.getDataHref({href:(0,x.formatWithValidation)({pathname:r,query:n}),asPath:i,locale:c}),t=await H({dataHref:e,isServerRender:this.isSsr,parseJSON:!0,inflightCache:L?{}:this.sdc,persistCache:!h,isPrefetch:!1,unstable_skipClientCache:p});return{cacheKey:t.cacheKey,props:t.json||{}}}return{headers:{},props:await this.getInitialProps(N.Component,{pathname:r,query:n,asPath:s,locale:c,locales:this.locales,defaultLocale:this.defaultLocale})}});return N.__N_SSP&&C.dataHref&&A&&delete this.sdc[A],this.isPreview||!N.__N_SSG||f||H(Object.assign({},C,{isBackground:!0,persistCache:!1,inflightCache:this.sbc})).catch(()=>{}),S.pageProps=Object.assign({},S.pageProps),N.props=S,N.route=b,N.query=n,N.resolvedAs=i,this.components[b]=N,N}catch(e){return this.handleRouteInfoError((0,l.getProperError)(e),r,n,s,o)}}set(e,t,r){return this.state=e,this.sub(t,this.components["/_app"].Component,r)}beforePopState(e){this._bps=e}onlyAHashChange(e){if(!this.asPath)return!1;let[t,r]=this.asPath.split("#",2),[n,s]=e.split("#",2);return!!s&&t===n&&r===s||t===n&&r!==s}scrollToHash(e){let[,t=""]=e.split("#",2);(0,E.handleSmoothScroll)(()=>{if(""===t||"top"===t){window.scrollTo(0,0);return}let e=decodeURIComponent(t),r=document.getElementById(e);if(r){r.scrollIntoView();return}let n=document.getElementsByName(e)[0];n&&n.scrollIntoView()},{onlyHashChange:this.onlyAHashChange(e)})}urlIsNew(e){return this.asPath!==e}async prefetch(e,t,r){if(void 0===t&&(t=e),void 0===r&&(r={}),"undefined"!=typeof window&&(0,S.isBot)(window.navigator.userAgent))return;let n=(0,f.parseRelativeUrl)(e),s=n.pathname,{pathname:i,query:o}=n,l=i,c=await this.pageLoader.getPageList(),d=t,u=void 0!==r.locale?r.locale||void 0:this.locale,h=await I({asPath:t,locale:u,router:this});n.pathname=z(n.pathname,c),(0,p.isDynamicRoute)(n.pathname)&&(i=n.pathname,n.pathname=i,Object.assign(o,(0,m.getRouteMatcher)((0,g.getRouteRegex)(n.pathname))((0,b.parsePath)(t).pathname)||{}),h||(e=(0,x.formatWithValidation)(n)));let k=await Z({fetchData:()=>H({dataHref:this.pageLoader.getDataHref({href:(0,x.formatWithValidation)({pathname:l,query:o}),skipInterpolation:!0,asPath:d,locale:u}),hasMiddleware:!0,isServerRender:!1,parseJSON:!0,inflightCache:this.sdc,persistCache:!this.isPreview,isPrefetch:!0}),asPath:t,locale:u,router:this});if((null==k?void 0:k.effect.type)==="rewrite"&&(n.pathname=k.effect.resolvedHref,i=k.effect.resolvedHref,o={...o,...k.effect.parsedAs.query},d=k.effect.parsedAs.pathname,e=(0,x.formatWithValidation)(n)),(null==k?void 0:k.effect.type)==="redirect-external")return;let w=(0,a.removeTrailingSlash)(i);await this._bfl(t,d,r.locale,!0)&&(this.components[s]={__appRouter:!0}),await Promise.all([this.pageLoader._isSsg(w).then(t=>!!t&&H({dataHref:(null==k?void 0:k.json)?null==k?void 0:k.dataHref:this.pageLoader.getDataHref({href:e,asPath:d,locale:u}
1),isServerRender:!1,parseJSON:!0,inflightCache:this.sdc,persistCache:!this.isPreview,isPrefetch:!0,unstable_skipClientCache:r.unstable_skipClientCache||r.priority&&!0}).then(()=>!1).catch(()=>!1)),this.pageLoader[r.priority?"loadPage":"prefetch"](w)])}async fetchComponent(e){let t=W({route:e,router:this});try{let r=await this.pageLoader.loadPage(e);return t(),r}catch(e){throw t(),e}}_getData(e){let t=!1,r=()=>{t=!0};return this.clc=r,e().then(e=>{if(r===this.clc&&(this.clc=null),t){let e=Error("Loading initial props cancelled");throw e.cancelled=!0,e}return e})}_getFlightData(e){return H({dataHref:e,isServerRender:!0,parseJSON:!1,inflightCache:this.sdc,persistCache:!1,isPrefetch:!1}).then(e=>{let{text:t}=e;return{data:t}})}getInitialProps(e,t){let{Component:r}=this.components["/_app"],n=this._wrapApp(r);return t.AppTree=n,(0,h.loadGetInitialProps)(r,{AppTree:n,Component:e,router:this,ctx:t})}get route(){return this.state.route}get pathname(){return this.state.pathname}get query(){return this.state.query}get asPath(){return this.state.asPath}get locale(){return this.state.locale}get isFallback(){return this.state.isFallback}get isPreview(){return this.state.isPreview}constructor(e,t,n,{initialProps:s,pageLoader:i,App:o,wrapApp:l,Component:c,err:d,subscription:u,isFallback:m,locale:g,locales:b,defaultLocale:k,domainLocales:w,isPreview:v}){this.sdc={},this.sbc={},this.isFirstPopStateEvent=!0,this._key=B(),this.onPopState=e=>{let t;let{isFirstPopStateEvent:r}=this;this.isFirstPopStateEvent=!1;let n=e.state;if(!n){let{pathname:e,query:t}=this;this.changeState("replaceState",(0,x.formatWithValidation)({pathname:(0,y.addBasePath)(e),query:t}),(0,h.getURL)());return}if(n.__NA){window.location.reload();return}if(!n.__N||r&&this.locale===n.options.locale&&n.as===this.asPath)return;let{url:s,as:a,options:i,key:o}=n;this._key=o;let{pathname:l}=(0,f.parseRelativeUrl)(s);(!this.isSsr||a!==(0,y.addBasePath)(this.asPath)||l!==(0,y.addBasePath)(this.pathname))&&(!this._bps||this._bps(n))&&this.change("replaceState",s,a,Object.assign({},i,{shallow:i.shallow&&this._shallow,locale:i.locale||this.defaultLocale,_h:0}),t)};let j=(0,a.removeTrailingSlash)(e);this.components={},"/_error"!==e&&(this.components[j]={Component:c,initial:!0,props:s,err:d,__N_SSG:s&&s.__N_SSG,__N_SSP:s&&s.__N_SSP}),this.components["/_app"]={Component:o,styleSheets:[]};{let{BloomFilter:e}=r(74574),t={numItems:5,errorRate:1e-4,numBits:96,numHashes:14,bitArray:[1,1,0,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,1,1,0,1,1,0,0,0,0,0,0,0,0,1,1,0,0,1,1,0,1,0,1,0,1,1,0,1,0,1,1,0,0,1,1,0,0,0,1,1,1,0,0,1,0,1,0,0,1,1,0,1,1,1,0,0,1,1,0,1]},n={numItems:2,errorRate:1e-4,numBits:39,numHashes:14,bitArray:[1,1,1,0,1,1,0,1,0,1,1,0,1,0,0,1,0,0,1,1,0,1,0,1,0,0,0,0,1,0,0,1,1,1,1,0,1,1,1]};(null==t?void 0:t.numHashes)&&(this._bfl_s=new e(t.numItems,t.errorRate),this._bfl_s.import(t)),(null==n?void 0:n.numHashes)&&(this._bfl_d=new e(n.numItems,n.errorRate),this._bfl_d.import(n))}this.events=V.events,this.pageLoader=i;let C=(0,p.isDynamicRoute)(e)&&self.__NEXT_DATA__.autoExport;if(this.basePath="",this.sub=u,this.clc=null,this._wrapApp=l,this.isSsr=!0,this.isLocaleDomain=!1,this.isReady=!!(self.__NEXT_DATA__.gssp||self.__NEXT_DATA__.gip||self.__NEXT_DATA__.isExperimentalCompile||self.__NEXT_DATA__.appGip&&!self.__NEXT_DATA__.gsp||!C&&!self.location.search),this.state={route:j,pathname:e,query:t,asPath:C?e:n,isPreview:!!v,locale:void 0,isFallback:m},this._initialMatchesMiddlewarePromise=Promise.resolve(!1),"undefined"!=typeof window){if(!n.startsWith("//")){let r={locale:g},s=(0,h.getURL)();this._initialMatchesMiddlewarePromise=I({router:this,locale:g,asPath:s}).then(a=>(r._shouldResolveHref=n!==e,this.changeState("replaceState",a?s:(0,x.formatWithValidation)({pathname:(0,y.addBasePath)(e),query:t}),s,r),a))}window.addEventListener("popstate",this.onPopState)}}}V.events=(0,u.default)()},87571:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addLocale",{enumerable:!0,get:function(){return a}});let n=r(68498),s=r(10580);function a(e,t,r,a){if(!t||t===r)return e;let i=e.toLowerCase();return!a&&((0,s.pathHasPrefix)(i,"/api")||(0,s.pathHasPrefix)(i,"/"+t.toLowerCase()))?e:(0,n.addPathPrefix)(e,"/"+t)}},99235:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathSuffix",{enumerable:!0,get:function(){return s}});let n=r(63381);function s(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:s,hash:a}=(0,n.parsePath)(e);return""+r+t+s+a}},75902:function(e,t){"use strict";function r(e,t){let r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=r.length;n--;){let s=r[n];if("query"===s){let r=Object.keys(e.query);if(r.length!==Object.keys(t.query).length)return!1;for(let n=r.length;n--;){let s=r[n];if(!t.query.hasOwnProperty(s)||e.query[s]!==t.query[s])return!1}}else if(!t.hasOwnProperty(s)||e[s]!==t[s])return!1}return!0}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"compareRouterStates",{enumerable:!0,get:function(){return r}})},79114:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"formatNextPathnameInfo",{enumerable:!0,get:function(){return o}});let n=r(26674),s=r(68498),a=r(99235),i=r(87571);function o(e){let t=(0,i.addLocale)(e.pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix);return(e.buildId||!e.trailingSlash)&&(t=(0,n.removeTrailingSlash)(t)),e.buildId&&(t=(0,a.addPathSuffix)((0,s.addPathPrefix)(t,"/_next/data/"+e.buildId),"/"===e.pathname?"index.json":".json")),t=(0,s.addPathPrefix)(t,e.basePath),!e.buildId&&e.trailingSlash?t.endsWith("/")?t:(0,a.addPathSuffix)(t,"/"):(0,n.removeTrailingSlash)(t)}},96899:function(e,t){"use strict";function r(e,t){return void 0===t&&(t=""),("/"===e?"/index":/^\/index(\/|$)/.test(e)?"/index"+e:e)+t}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}})},93331:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getNextPathnameInfo",{enumerable:!0,get:function(){return i}});let n=r(43579),s=r(2133),a=r(10580);function i(e,t){var r,i;let{basePath:o,i18n:l,trailingSlash:c}=null!=(r=t.nextConfig)?r:{},d={pathname:e,trailingSlash:"/"!==e?e.endsWith("/"):c};o&&(0,a.pathHasPrefix)(d.pathname,o)&&(d.pathname=(0,s.removePathPrefix)(d.pathname,o),d.basePath=o);let u=d.pathname;if(d.pathname.startsWith("/_next/data/")&&d.pathname.endsWith(".json")){let e=d.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),r=e[0];d.buildId=r,u="index"!==e[1]?"/"+e.slice(1).join("/"):"/",!0===t.parseData&&(d.pathname=u)}if(l){let e=t.i18nProvider?t.i18nProvider.analyze(d.pathname):(0,n.normalizeLocalePath)(d.pathname,l.locales);d.locale=e.detectedLocale,d.pathname=null!=(i=e.pathname)?i:d.pathname,!e.detectedLocale&&d.buildId&&(e=t.i18nProvider?t.i18nProvider.analyze(u):(0,n.normalizeLocalePath)(u,l.locales)).detectedLocale&&(d.locale=e.detectedLocale)}return d}},85907:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parseRelativeUrl",{enumerable:!0,get:function(){return a}});let n=r(3987),s=r(48637);function a(e,t){let r=new URL("undefined"==typeof window?"http://n":(0,n.getLocationOrigin)()),a=t?new URL(t,r):e.startsWith(".")?new URL("undefined"==typeof window?"http://n":window.location.href):r,{pathname:i,searchParams:o,search:l,hash:c,href:d,origin:u}=new URL(e,a);if(u!==r.origin)throw Error("invariant: invalid relative URL, router received "+e);return{pathname:i,query:(0,s.searchParamsToUrlQuery)(o),search:l,hash:c,href:d.slice(r.origin.length)}}},2133:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removePathPrefix",{enumerable:!0,get:function(){return s}});let n=r(10580);function s(e,t){if(!(0,n.pathHasPrefix)(e,t))return e;let r=e.slice(t.length);return r.startsWith("/")?r:"/"+r}},29498:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(57437),s=r(40334);function a(e){let{id:t,children:r,className:a}=e;return(0,n.jsx)("div",{className:(0,s.Z)("w-full max-w-[1280px] box-border mx-auto px-4 sm:px-6",a),id:t,children:r})}r(2265)},77960:function(e,t,r){"use strict";r.d(t,{V:function(){return d}});var n=r(57437),s=r(12946),a=r(94654),i=r(55156),o=r(66975),l=r(96539),c=r(49072);function d(e){let{title:t,content:r,isOpen:d,onClose:u,onConfirm:h,confirmText:p,cancelText:f,confirmColor:m="primary",isLoading:g=!1,children:x,...b}=e;return(0,n.jsx)(s.R,{isOpen:d,onClose:u,onClick:e=>e.stopPropagation(),...b,children:(0,n.jsx)(a.A,{children:e=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.k,{children:t}),(0,n.jsx)(o.I,{className:"pb-4",children:r||x}),(p||f)&&(0,n.jsxs)(l.R,{children:[f&&(0,n.jsx)(c.A,{variant:"light",onPress:e,children:f}),p&&(0,n.jsx)(c.A,{color:m,onPress:h,isLoading:g,children:p})]})]})})})}},86414:function(e,t,r){"use strict";r.d(t,{default:function(){return I}});var n=r(57437),s=r(42586),a=r(40334),i=r(49072),o=r(55049);r(52674);var l=r(2265);r(23332);var c=r(25167);r(27325),r(51393),r(71131),r(16441),r(31982),r(62434),(0,c.JM)({packageName:"@clerk/nextjs"}),(0,c.Aw)("@clerk/nextjs");let d=o.CH,u=o.tj;o.Cv;var h=r(10765),p=r(86595),f=r(79205);let m=(0,f.Z)("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);var g=r(82023);let x=(0,f.Z)("Laugh",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M18 13a6 6 0 0 1-6 5 6 6 0 0 1-6-5h12Z",key:"b2q4dd"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);var b=r(31810),k=r(53417),w=r(61178);let v=(0,f.Z)("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]),y=(0,f.Z)("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),j=(0,f.Z)("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);var C=r(64269),_=r(8878);let P=()=>{let e=window.navigator.userAgent.toLowerCase(),t=/micromessenger/.test(e),r=/qq/.test(e),n=/mqqbrowser|qzone|weibo|instagram/.test(e);return t||r||n};var N=r(63885),L=r(49084),D=r(99355),S=r(93448);function A(e){let{href:t,icon:r,label:s,className:a=""}=e;return(0,n.jsxs)(_.rU,{href:t,className:(0,S.cn)("group flex w-full items-center justify-center rounded-md px-3 py-2 text-sm font-medium hover:bg-gray-100 dark:hover:bg-gray-800",a),children:[r&&(0,n.jsx)(r,{size:18,className:"mr-2"}),(0,n.jsx)("span",{className:"whitespace-nowrap",children:s})]})}var M=r(40875);function E(e){let t=(0,l.useRef)(null);return(0,l.useEffect)(()=>
1{function r(r){t.current&&!t.current.contains(r.target)&&e()}return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[e]),t}function R(e){let{label:t,dropdownList:r,className:s}=e,[a,i]=(0,l.useState)(!1),o=E(()=>{i(!1)});return(0,n.jsxs)("div",{className:"relative shrink-0",ref:o,children:[(0,n.jsxs)("button",{type:"button",className:(0,S.cn)("flex items-center justify-center gap-1 px-3 py-2","rounded-md text-sm font-medium","hover:bg-gray-100 dark:hover:bg-gray-800",s),onClick:()=>i(!a),children:[t,(0,n.jsx)(M.Z,{className:"hidden sm:block h-4 w-4"})]}),a&&(0,n.jsx)("div",{className:(0,S.cn)("absolute right-0 mt-2 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none","z-10","w-max"),role:"menu","aria-orientation":"vertical","aria-labelledby":"menu-button",tabIndex:-1,children:(0,n.jsx)("div",{className:"py-1",role:"none",children:r.map(e=>(0,n.jsxs)(_.rU,{href:e.href,className:(0,S.cn)("text-gray-700 block px-4 py-2 text-sm hover:bg-gray-100","flex items-center justify-start gap-2"),role:"menuitem",tabIndex:-1,onClick:()=>{i(!1)},children:[e.icon,(0,n.jsx)("span",{className:"whitespace-nowrap",children:e.label})]},e.href))})})]})}function I(e){var t;let{className:r}=e,c=(0,s.useTranslations)("header"),f=(0,s.useTranslations)("index"),[S,M]=(0,l.useState)(!1),[I,T]=(0,l.useState)(!1),O=(0,s.useTranslations)("Blog");(0,l.useEffect)(()=>{let e=()=>{let e=window.scrollY>20;e!==S&&M(e)};return window.addEventListener("scroll",e,{passive:!0}),()=>{window.removeEventListener("scroll",e)}},[S]);let z=(0,s.useLocale)(),Z=(0,o.aF)(),{signOut:F}=(0,o.aC)(),$=(null===(t=Z.user)||void 0===t?void 0:t.id)&&C.X.manageUsers.includes(Z.user.id);"".concat(window.location.origin,"/").concat(z,"/submit");let H=E(()=>{T(!1)});return(0,n.jsx)("header",{className:(0,a.Z)("fixed top-0 left-0 right-0 z-50 transition-all duration-300 ease-in-out ".concat(S?"h-16 backdrop-blur-md shadow-md":"h-24"),r),children:(0,n.jsxs)("div",{className:"flex container mx-auto px-4 h-full flex items-center justify-between",children:[(0,n.jsx)(N.Z,{}),(0,n.jsxs)("nav",{className:"hidden md:flex items-center space-x-1",children:[(0,n.jsx)(A,{href:"/featured",icon:p.Z,label:f("featured")}),(0,n.jsx)(R,{className:"shrink-0",label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(m,{}),f("rank.label")]}),dropdownList:[{label:f("latest"),href:"/new",icon:(0,n.jsx)(g.Z,{})},{label:f("fun"),href:"/fun",icon:(0,n.jsx)(x,{})},{label:f("rank.vote.label"),href:"/rank/vote",icon:(0,n.jsx)(b.Z,{})}]}),(0,n.jsx)(A,{className:"hidden xl:flex",href:"/prompts",icon:k.Z,label:"Prompt"}),(0,n.jsx)(A,{className:"hidden xl:flex",href:"/favorites",icon:w.Z,label:f("favorites")}),(0,n.jsx)(A,{className:"hidden xl:flex",href:"/blog",icon:v,label:O("navLabel")}),(0,n.jsx)(R,{className:"xl:hidden w-full",label:(0,n.jsx)(y,{}),dropdownList:[{label:"Prompt",href:"/prompts",icon:(0,n.jsx)(k.Z,{})},{label:f("favorites"),href:"/favorites",icon:(0,n.jsx)(w.Z,{})},{label:O("navLabel"),href:"/blog",icon:(0,n.jsx)(v,{})}]})]}),(0,n.jsxs)("nav",{className:"hidden md:flex items-center space-x-4",children:[(0,n.jsx)(L.O,{asButton:!0}),(0,n.jsx)(D.Z,{}),(0,n.jsx)(_.rU,{href:"/submit",children:(0,n.jsx)(i.A,{className:"font-semibold",color:"primary",size:"sm",children:c("submit")})}),(0,n.jsxs)(u,{children:[(0,n.jsx)(o.$d,{mode:"modal",children:(0,n.jsx)(i.A,{className:"font-semibold",size:"sm",variant:"bordered",children:c("login")})}),(0,n.jsx)(o.gX,{mode:"modal",children:(0,n.jsx)(i.A,{className:"font-semibold",size:"sm",variant:"bordered",children:c("signUp")})})]}),(0,n.jsxs)(d,{children:[$&&(0,n.jsx)(_.rU,{href:"/dashboard",target:"_blank",children:(0,n.jsx)(i.A,{className:"font-semibold",color:"primary",size:"sm",variant:"bordered",children:c("dashboard")})}),(0,n.jsx)(o.l8,{appearance:{elements:{avatarBox:"w-[2.2rem] h-[2.2rem]",userButtonPopoverFooter:"hidden"}}})]})]}),(0,n.jsxs)("div",{ref:H,className:"md:hidden",children:[(0,n.jsx)("button",{"aria-label":"Open Menu",title:"Open Menu",className:"p-2 -mr-1 transition duration-200 rounded focus:outline-none focus:shadow-outline hover:bg-deep-purple-50 focus:bg-deep-purple-50",onClick:()=>T(!I),children:(0,n.jsx)(j,{className:"h-6 w-6"})}),I&&(0,n.jsx)("div",{className:"absolute top-18 right-[5%] w-[90%] z-50",children:(0,n.jsxs)("div",{className:"p-5 bg-background border rounded shadow-sm",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-y-2",children:[(0,n.jsx)(_.rU,{href:"/submit",children:(0,n.jsx)(i.A,{className:"font-semibold w-full",color:"primary",size:"sm",disableRipple:!0,onClick:e=>e.stopPropagation(),children:c("submit")})}),(0,n.jsxs)(u,{children:[(0,n.jsx)(o.$d,{mode:"modal",children:(0,n.jsx)(i.A,{className:"font-semibold w-full",size:"sm",variant:"bordered",onPress:()=>{P()&&h.Am.warning((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-sm text-yellow-700",children:c("tips.unsupportedBrowserTip_1")}),(0,n.jsx)("p",{className:"text-sm text-yellow-700",children:c("tips.unsupportedBrowserTip_2")})]}),{autoClose:5e3})},children:c("login")})}),(0,n.jsx)(o.gX,{mode:"modal",children:(0,n.jsx)(i.A,{className:"font-semibold w-full",size:"sm",variant:"bordered",children:c("signUp")})})]}),(0,n.jsxs)(d,{children:[$&&(0,n.jsx)(_.rU,{href:"/dashboard",target:"_blank",children:(0,n.jsx)(i.A,{className:"font-semibold  w-full",color:"primary",size:"sm",variant:"bordered",disableRipple:!0,onClick:e=>e.stopPropagation(),children:c("dashboard")})}),(0,n.jsx)("div",{className:"flex justify-center",children:(0,n.jsx)(o.l8,{appearance:{elements:{userButtonPopoverFooter:"hidden"}}})})]})]}),(0,n.jsxs)("div",{className:"pt-2",children:[(0,n.jsxs)("div",{className:"flex items-center flex-wrap  gap-y-2",children:[(0,n.jsx)(A,{className:"w-1/3",href:"/featured",icon:p.Z,label:f("featured")}),(0,n.jsx)(A,{className:"w-1/3",href:"/new",icon:g.Z,label:f("latest")}),(0,n.jsx)(A,{className:"w-1/3",href:"/fun",icon:x,label:f("fun")}),(0,n.jsx)(A,{className:"w-1/3",href:"/favorites",icon:w.Z,label:f("favorites")}),(0,n.jsx)(A,{className:"w-1/3",href:"/rank/vote",icon:b.Z,label:f("rank.vote.label")}),(0,n.jsx)(A,{className:"w-1/3",href:"/prompts",icon:k.Z,label:"Prompt"}),(0,n.jsx)(A,{className:"w-1/3",href:"/blog",icon:v,label:O("navL
1abel")})]}),(0,n.jsxs)("div",{className:"flex items-center gap-x-5 mt-2 justify-between",children:[(0,n.jsx)(L.O,{asButton:!0}),(0,n.jsx)(D.Z,{})]})]})]})})]})]})})}},99355:function(e,t,r){"use strict";r.d(t,{Z:function(){return u}});var n=r(57437),s=r(42586),a=r(2265);let i=(0,r(79205).Z)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);var o=r(40875),l=r(26214),c=r(13307),d=r(8878);function u(e){var t;let{xDirection:r="left",yDirection:u="down",mini:h=!1}=e,p=(0,s.useLocale)(),f=(0,d.tv)(),m=(0,d.jD)(),[g,x]=(0,a.useState)(p),[b,k]=(0,a.useState)(!1),w=(0,a.useRef)(null),v=(0,a.useRef)(null),y=e=>{x(e),k(!1),f.replace(m,{locale:e})};return(0,a.useEffect)(()=>{let e=e=>{w.current&&!w.current.contains(e.target)&&v.current&&!v.current.contains(e.target)&&(k(!1),document.body.style.overflow="")};return document.addEventListener("mousedown",e),document.documentElement.lang=p,()=>{document.removeEventListener("mousedown",e)}},[]),(0,a.useEffect)(()=>{b?document.body.style.overflow="hidden":document.body.style.overflow=""},[b]),(0,n.jsxs)("div",{className:"relative inline-block text-left",children:[(0,n.jsxs)("button",{ref:v,className:"flex items-center justify-center space-x-2 px-3 py-2 text-sm font-medium text-white bg-gradient-to-r from-pink-500 to-yellow-500 rounded-md hover:from-pink-600 hover:to-yellow-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-pink-500 transition duration-300 ease-in-out transform hover:scale-105",onClick:()=>k(!b),children:[(0,n.jsx)(i,{className:"h-5 w-5"}),!h&&(0,n.jsx)("span",{className:"hidden md:inline-flex",children:null===(t=c.ul.find(e=>e.code===g))||void 0===t?void 0:t.name}),(0,n.jsx)(o.Z,{className:"h-4 w-4"})]}),b&&(0,n.jsx)("div",{ref:w,className:"origin-top-right absolute mt-2 w-48 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 z-10 overflow-hidden ".concat("top"===u?"-translate-y-full -top-5 left-0":""," ").concat("left"===r?"right-0":"left-0"),children:(0,n.jsx)(l.o,{className:"max-h-64 overflow-y-auto py-1",role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu",onWheel:e=>{e.stopPropagation()},children:c.ul.map(e=>(0,n.jsxs)("button",{className:"flex items-center justify-between w-full px-4 py-2 text-sm text-gray-700 hover:bg-gradient-to-r hover:from-pink-100 hover:to-yellow-100 hover:text-gray-900 transition duration-150 ease-in-out",role:"menuitem",onClick:()=>{y(e.code)},children:[(0,n.jsx)("span",{className:"flex items-center",children:e.name}),e.code===g&&(0,n.jsx)("span",{className:"flex items-center justify-center w-5 h-5 bg-gradient-to-r from-pink-500 to-yellow-500 rounded-full",children:(0,n.jsx)("svg",{className:"w-3 h-3 text-white",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,n.jsx)("path",{d:"M5 13l4 4L19 7"})})})]},e.code))})})]})}},17655:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(57437),s=r(72708);function a(e){let{isLoading:t,size:r}=e;return t?(0,n.jsx)("div",{className:"absolute top-0 right-0 bottom-0 left-0 bg-primary-100/70 z-[10] pointer-events-none",children:(0,n.jsx)(s.c,{className:"absolute top-[50%] left-[50%] -translate-x-[50%] -translate-y-[50%]",color:"default",size:r})}):null}},63885:function(e,t,r){"use strict";r.d(t,{Z:function(){return d}});var n=r(57437),s=r(15599),a=r.n(s),i=r(40334);r(2265),(0,r(79205).Z)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var o={logo:e=>{let{...t}=e;return(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"128",height:"128",viewBox:"0 0 128 128",fill:"none",className:"h-full w-full",id:"iconWithBackground",...t,children:[(0,n.jsx)("rect",{id:"r4",width:"128",height:"128",x:"0",y:"0",rx:"20",fill:"url(#linearGradient-iconWithBackground)",stroke:"#f2f2f2",strokeWidth:"0",strokeOpacity:"100%",paintOrder:"stroke"}),(0,n.jsxs)("defs",{children:[(0,n.jsxs)("linearGradient",{id:"linearGradient-iconWithBackgroun
1d",gradientUnits:"userSpaceOnUse",gradientTransform:"rotate(90)",style:{transformOrigin:"center center"},children:[(0,n.jsx)("stop",{stopColor:"#f1e9e9"}),(0,n.jsx)("stop",{offset:"1",stopColor:"#ca8a04"})]}),(0,n.jsxs)("radialGradient",{id:"glare",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(256) rotate(90) scale(128)",children:[(0,n.jsx)("stop",{stopColor:"white"}),(0,n.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,n.jsx)("clipPath",{id:"clip",children:(0,n.jsx)("use",{xlinkHref:"#r4"})})]}),(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"128",height:"128",viewBox:"0 0 128 128",x:"0",y:"0",children:[(0,n.jsx)("path",{fill:"",d:"m125.47 86.16l-8.27-1.49c.1-1.84.09-3.7 0-5.56l8.4-1.25a2.132 2.132 0 0 0 1.8-2.42c-.17-1.16-1.26-1.96-2.42-1.8l-8.18 1.22c-.9-5.98-3.2-11.94-6.68-17.31c1.05-10.02 3.06-37.18-5.09-42.65c-6.5-4.36-21.96 11.82-26.94 17.63c-1.15 1.34-2.2 2.55-3.16 3.65c-3.48-.53-7.02-.82-10.55-.82c-3.53-.01-7.06.29-10.54.82c-.96-1.1-2.01-2.31-3.16-3.65c-4.98-5.81-20.44-21.99-26.93-17.63c-8.15 5.47-6.13 32.63-5.09 42.65c-3.47 5.36-5.79 11.33-6.68 17.31L3.8 73.64c-1.16-.16-2.25.63-2.43 1.8c-.18 1.16.63 2.25 1.79 2.42l8.4 1.25c-.09 1.86-.1 3.72 0 5.56L3.3 86.16a2.131 2.131 0 0 0 .38 4.23c.12 0 .25-.01.38-.03L12 88.93c.33 2.1.81 4.17 1.5 6.18l-6.48 2.05a2.146 2.146 0 0 0-1.39 2.68a2.136 2.136 0 0 0 2.68 1.39l6.85-2.17c1.98 3.89 4.88 7.47 8.98 10.53c6.05 4.51 13.57 7.57 21.33 9.23c2.94.63 10.56 2.1 18.55 2.1s16.35-1.47 19.3-2.1c7.75-1.66 15.28-4.72 21.33-9.23c4.1-3.06 7-6.64 8.98-10.53l6.84 2.17a2.136 2.136 0 0 0 2.68-1.39c.36-1.12-.26-2.32-1.38-2.68l-6.48-2.06c.69-2 1.18-4.07 1.5-6.18l7.95 1.43a2.149 2.149 0 0 0 2.48-1.72a2.18 2.18 0 0 0-1.75-2.47z"}),(0,n.jsx)("path",{fill:"",d:"M70.95 103.19c.21.46-.17 1.2-.28 1.62c-.14.53-.27 1.05-.43 1.56c-.76 2.52-2.06 4.88-4.85 5.43c-2.58.51-5.06-1.25-6.03-3.58c-.36-.85-.64-1.73-.94-2.6c-.16-.48-.32-.96-.47-1.43c-.11-.34-.4-.88-.36-1.23c1.42-.09 3.07-.73 4.29-1.45c.4-.24.85-.37 1.22-.66c.33-.26.54-.63.96-.76c.42.45 1.13.7 1.65 1.05c.63.42 1.27.79 1.95 1.11c.63.3 1.38.3 2.03.47c.34.09.91.04 1.16.33c.05.04.08.08.1.14z"}),(0,n.jsxs)("g",{fill:"#2f2f2f",children:[(0,n.jsx)("path",{d:"M46.92 81.07c0 4.59-3.31 8.3-7.38 8.3s-7.38-3.72-7.38-8.3c0-4.6 3.31-8.31 7.38-8.31c4.07-.01 7.38 3.71 7.38 8.31zm34.34 0c0 4.59 3.3 8.3 7.38 8.3c4.07 0 7.38-3.72 7.38-8.3c0-4.6-3.31-8.31-7.38-8.31c-4.07-.01-7.38 3.71-7.38 8.31zm-16.78 20.26c-.77 0-1.39-.62-1.39-1.39v-8.15c0-.77.62-1.39 1.39-1.39c.77 0 1.39.62 1.39 1.39v8.15c0 .77-.62 1.39-1.39 1.39z"}),(0,n.jsx)("path",{d:"M57.49 104.6c-.43 0-.89-.02-1.36-.06c-5.66-.5-8.15-4.89-8.68-7.15a1.71 1.71 0 0 1 1.28-2.05a1.7 1.7 0 0 1 2.05 1.27c.05.21 1.11 4.12 5.65 4.53c4.75.43 6.59-2.06 6.67-2.17c.55-.76 1.6-.95 2.37-.42s.97 1.57.45 2.35c-.11.16-2.57 3.7-8.43 3.7z"}),(0,n.jsx)("path",{d:"M71.52 104.6c-5.86 0-8.32-3.54-8.43-3.7c-.53-.78-.32-1.85.46-2.38c.79-.53 1.85-.32 2.38.46c.06.08 1.93 2.57 6.65 2.15c4.63-.41 5.64-4.48 5.65-4.52c.22-.92 1.14-1.49 2.05-1.28c.92.22 1.49 1.13 1.28 2.05c-.53 2.25-3.03 6.65-8.68 7.15c-.48.05-.93.07-1.36.07zm-12.3-12.87c.08 1.05.79 2.15 1.89 2.82c.88.55 2.13.82 3.36.82c1.22 0 2.47-.27 3.35-.82c1.1-.68 1.81-1.77 1.89-2.82c.08-1-.15-2.02-1.24-2.72c-.6-.39-1.35-.65-2.12-.79c-.29-.05-1.05-.18-1.85-.18c-.79 0-1.62.12-1.92.18c-.77.14-1.52.4-2.12.79c-1.08.71-1.32 1.72-1.24 2.72z"}),(0,n.jsx)("path",{d:"M64.43 96.86c-1.54 0-3.04-.38-4.11-1.04c-1.47-.91-2.47-2.43-2.59-3.97c-.17-2.24.96-3.45 1.92-4.08c.74-.47 1.66-.82 2.66-1c.4-.08 1.31-.2 2.18-.2c.94 0 1.8.14 2.12.2c1 .18 1.92.53 2.65 1c.97.63 2.1 1.85 1.92 4.09c-.12 1.53-1.11 3.05-2.59 3.97c-1.07.66-2.57 1.04-4.11 1.04h-.05zm.07-7.33c-.68 0-1.41.11-1.64.15c-.62.12-1.19.32-1.59.58c-.39.25-.62.57-.56 1.35c.05.6.51 1.25 1.19 1.67c.61.38 1.56.6 2.55.6v1.49l.02-1.49c1.03 0 1.98-.23 2.58-.6c.67-.41 1.15-1.08 1.19-1.67c.07-.78-.17-1.1-.56-1.35c-.4-.26-.97-.46-1.58-.58c-.17-.02-.88-.15-1.6-.15z"})]}),(0,n.jsx)("path",{fill:"",d:"M64.48 113.66c-2.83 0-5.55-1.85-6.76-4.76c-.56-1.35-1.69-4.89-1.74-5.04c-.3-.93.22-1.93 1.15-2.23c.93-.3 1.93.22 2.23 1.15c.39 1.22 1.23 3.79 1.63 4.75c.62 1.49 2.26 2.88 4.05 2.53c1.64-.32 2.72-1.62 3.5-4.2c.1-.35.31-1.14.51-1.88c.15-.58.3-1.14.38-1.43c.27-.94 1.23-1.49 2.19-1.22c.94.27 1.49 1.25 1.22 2.19c-.08.28-.22.81-.37 1.37c-.2.77-.42 1.6-.54 1.99c-.44 1.44-1.76 5.78-6.21 6.66c-.4.08-.82.12-1.24.12z"})]})]})},idea:e=>{let{...t}=e;return(0,n.jsxs)("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",...t,children:[(0,n.jsx)("path",{d:"M512 469.333333m-426.666667 0a426.666667 426.666667 0 1 0 853.333334 0 426.666667 426.666667 0 1 0-853.333334 0Z",fill:"#FFF59D"}),(0,n.jsx)("path",{d:"M789.333333 469.333333c0-164.266667-140.8-294.4-309.333333-275.2-128 14.933333-230.4 117.333333-243.2 245.333334-10.666667 98.133333 29.866667 185.6 98.133333 241.066666 29.866667 25.6 49.066667 61.866667 49.066667 102.4v6.4h256v-2.133333c0-38.4 17.066667-76.8 46.933333-102.4 61.866667-51.2 102.4-128 102.4-215.466667z",fill:"#FBC02D"}),(0,n.jsx)("path",{d:"M652.8 430.933333l-64-42.666666c-6.4-4.266667-17.066667-4.266667-23.466667 0L512 422.4l-51.2-34.133333c-6.4-4.266667-17.066667-4.266667-23.466667 0l-64 42.666666c-4.266667 4.266667-8.533333 8.533333-8.533333 14.933334s0 12.8 4.266667 17.066666l81.066666 100.266667V789.333333h42.666667V554.666667c0-4.266667-2.133333-8.533333-4.266667-12.8l-70.4-87.466667 32-21.333333 51.2 34.133333c6.4 4.266667 17.066667 4.266667 23.466667 0l51.2-34.133333 32 21.333333-70.4 87.466667c-2.133333 4.266667-4.266667 8.533333-4.266667 12.8v234.666666h42.666667V563.2l81.066667-100.266667c4.266667-4.266667 6.4-10.666667 4.266666-17.066666s-4.266667-12.8-8.533333-14.933334z",fill:"#FFF59D"}),(0,n.jsx)("path",{d:"M512 938.666667m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z",fill:"#5C6BC0"}),(0,n.jsx)("path",{d:"M554.666667 960h-85.333334c-46.933333 0-85.333333-38.4-85.333333-85.333333v-106.666667h256v106.666667c0 46.933333-38.4 85.333333-85.333333 85.333333z",fill:"#9FA8DA"}),(0,n.jsx)("path",{d:"M640 874.666667l-247.466667 34.133333c6.4 14.933333 19.2 29.866667 34.133334 38.4l200.533333-27.733333c8.533333-12.8 12.8-27.733333 12.8-44.8zM384 825.6v42.666667L640 832v-42.666667z",fill:"#5C6BC0"})]})}},l=r(64269),c=r(8878);function d(e){let{isInFooter:t,className:r}=e;return(0,n.jsx)(c.rU,{className:"shrink-0",href:"/",children:t?(0,n.jsx)("h2",{className:(0,i.Z)("text-primary-800 text-2xl sm:text-4xl font-bold bg-gradient-to-r from-pink-500 via-red-500 to-yellow-500 text-transparent bg-clip-text drop-shadow-lg",r,a().className),children:l.X.siteNameFooter}):(0,n.jsxs)("h1",{className:(0,i.Z)("flex items-center","text-primary-800 text-2xl sm:text-4xl font-bold bg-gradient-to-r from-pink-500 via-red-500 to-yellow-500 text-transparent bg-clip-text drop-shadow-lg",r,a().className),children:[(0,n.jsxs)("div",{className:"relative mr-2",children:[(0,n.jsx)(o.idea,{className:"absolute h-6 w-6 to
1p-1 left-0 -translate-x-1/3 -translate-y-[90%]"}),(0,n.jsx)(o.idea,{className:"absolute h-6 w-6 top-1 right-0 translate-x-1/3 -translate-y-[90%]"}),(0,n.jsx)(o.logo,{className:"h-12 w-12"})]}),(0,n.jsx)("span",{className:"flex-nowrap hidden 2xl:flex",children:l.X.siteName}),(0,n.jsx)("span",{className:"flex-nowrap hidden xl:flex 2xl:hidden",children:l.X.siteNameMD}),(0,n.jsx)("span",{className:"flex-nowrap xl:hidden",children:l.X.siteNameSM})]})})}},8106:function(e,t,r){"use strict";r.d(t,{default:function(){return l}});var n=r(57437),s=r(5646),a=r(61613),i=r(99637),o=r(42586);function l(e){let{name:t}=e,r=(0,o.useLocale)();return(0,n.jsxs)(s.$,{itemClasses:{item:"text-primary-400 text-base"},children:[(0,n.jsxs)(a.d,{href:"/".concat(r),children:[(0,n.jsx)(i.Z,{size:16})," ",(0,n.jsx)("span",{children:"Home"})]}),(Array.isArray(t)?t:[t]).map((e,t)=>(0,n.jsx)(a.d,{className:"overflow-hidden text-ellipsis line-clamp-1",children:e},"NavBarItem_".concat(t)))]})}},87278:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(57437);function s(e){let{className:t}=e;return(0,n.jsxs)("svg",{className:t,fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"1"}),(0,n.jsx)("circle",{cx:"12",cy:"5",r:"1"}),(0,n.jsx)("circle",{cx:"12",cy:"19",r:"1"})]})}},27191:function(e,t,r){"use strict";r.d(t,{default:function(){return c}});var n=r(57437),s=r(2265),a=r(49072),i=r(42586),o=r(34834),l=r(93448);function c(e){let{initialData:t,getSitesHandler:r,siteParams:c,loadMoreSize:d,title:u,id:h,badgeType:p,badgeLimit:f,className:m,SiteGroupClassName:g}=e,x=(0,i.useTranslations)("search"),[b,k]=(0,s.useState)(t),[w,v]=(0,s.useState)(!1),[y,j]=(0,s.useState)(null);(0,s.useEffect)(()=>{k(t)},[t]);let C=async()=>{if(b.hasMore&&b.nextCursor&&!w)try{var e;v(!0),j(null);let t=null!==(e=null!=d?d:c.size)&&void 0!==e?e:4,n=await r({...c,size:t,cursor:b.nextCursor});k(e=>({sites:[...e.sites,...n.sites],nextCursor:n.nextCursor,hasMore:n.hasMore}))}catch(e){j(e instanceof Error?e.message:"Failed to fetch data"),console.error("Error fetching more data:",e)}finally{v(!1)}};return(0,n.jsxs)("div",{className:(0,l.cn)("relative",m),children:[(0,n.jsx)(o.default,{id:h,className:(0,l.cn)(g),sites:b.sites,title:u,badgeType:p,badgeLimit:f}),y&&(0,n.jsx)("div",{className:"text-danger text-center mt-4 text-sm",children:y}),b.hasMore&&(0,n.jsx)("div",{className:"flex justify-center mt-8 mb-4",children:(0,n.jsx)(a.A,{className:"font-semibold px-8",color:"primary",radius:"full",variant:"flat",onPress:C,isLoading:w,disabled:w,children:x("loadMore")})})]})}},34834:function(e,t,r){"use strict";r.d(t,{default:function(){return D}});
1var n=r(57437),s=r(47857),a=r.n(s),i=r(2265),o=r(40334),l=r(29498),c=r(34364),d=r(27457),u=r(42586),h=r(96362),p=r(31810),f=r(8878),m=r(86595);function g(e){let{className:t,text:r="Featured"}=e;return(0,n.jsxs)("div",{className:(0,o.Z)("group relative inline-flex items-center px-3 py-1 rounded-md bg-gradient-to-r from-purple-600 to-pink-500 text-white text-sm font-semibold shadow-md transition-all duration-300 hover:shadow-lg hover:scale-105 overflow-hidden",t),children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-white opacity-0 group-hover:opacity-20 transition-opacity duration-300"}),(0,n.jsx)(m.Z,{className:"w-4 h-4 mr-1.5 text-yellow-300 animate-spin-slow"}),(0,n.jsxs)("span",{className:"relative z-10",children:[(0,n.jsx)("span",{className:"sr-only",children:"Featured:"})," ",r]}),(0,n.jsx)("span",{className:"absolute top-1 right-1 w-1.5 h-1.5 bg-yellow-300 rounded-full animate-ping",style:{animation:"ping 2s cubic-bezier(0, 0, 0.2, 1) infinite"}})]})}var x=r(82023);function b(e){let{className:t,text:r="New"}=e;return(0,n.jsxs)("div",{className:(0,o.Z)("relative inline-flex items-center px-3 py-1 rounded-md bg-gradient-to-r from-green-400 to-blue-500 text-white text-sm font-semibold shadow-md transition-all duration-300 hover:shadow-lg hover:-translate-y-0.5",t),children:[(0,n.jsx)(x.Z,{className:"w-4 h-4 mr-1.5"}),(0,n.jsxs)("span",{className:"relative z-10",children:[(0,n.jsx)("span",{className:"sr-only",children:"New:"})," ",r]}),(0,n.jsx)("span",{className:"absolute top-1 right-1 w-1.5 h-1.5 rounded-full bg-white opacity-75 animate-pulse"})]})}var k=r(93448);function w(e){let{likes:t,text:r,className:s}=e;return(0,n.jsxs)("div",{className:(0,k.cn)("relative inline-flex items-center px-3 py-1 rounded-md text-white text-sm font-semibold shadow-md transition-all duration-300 hover:shadow-lg hover:-translate-y-0.5",t>=1e3?"bg-gradient-to-r from-red-500 to-pink-500":t>=500?"bg-gradient-to-r from-orange-500 to-yellow-500":t>=100?"bg-gradient-to-r from-green-400 to-blue-500":"bg-gray-300 dark:bg-gray-700",s),children:[r&&(0,n.jsx)("span",{className:"relative z-10 mr-1.5",children:r}),(0,n.jsx)(p.Z,{className:"w-4 h-4 mr-1.5"}),(0,n.jsx)("span",{className:"relative z-10",children:t})]})}var v=r(92183),y=r(64269),j=(0,i.memo)(function(e){var t,r;let{site:s,badgeType:a,badgeSuffix:i=""}=e,l=(0,f.tv)(),m=(0,u.useTranslations)("index"),x=(0,u.useTranslations)("site.PricingType"),{ref:k,inView:j}=(0,c.YD)({triggerOnce:!0,threshold:.1}),C={siteId:s._id,name:s.name,url:s.url,siteKey:s.siteKey,tagline:s.tagline,description:s.description};return(0,n.jsxs)("div",{className:"relative sm:flex sm:flex-col",children:[(0,n.jsxs)("div",{className:"absolute z-[11] right-0",children:["featured"===a&&(0,n.jsx)(g,{text:m("featured")+i}),"latest"===a&&(0,n.jsx)(b,{text:m("latest")+i}),"vote"===a&&(0,n.jsx)(w,{likes:s.voteCount,text:i})]}),(0,n.jsxs)("div",{ref:k,className:"relative sm:flex sm:flex-col sm:flex-1 sm:justify-between group w-full shadow-medium hover:shadow-large transition-all bg-primary-100 rounded-md overflow-hidden cursor-pointer touch-manipulation",onClick:()=>{l.push("/s/".concat(s.siteKey))},children:[(0,n.jsxs)("div",{className:"relative",children:[j?(0,n.jsx)(d.J,{isZoomed:!0,alt:s.name+(s.tagline?" - ".concat(s.tagline):""),classNames:{wrapper:"w-full !max-w-full",img:"w-full aspect-video object-fill"},radius:"none",src:s.snapshot.replace("img.maomaoyu.coffee","img.mastermao.com")}):(0,n.jsx)(d.J,{isZoomed:!0,alt:"".concat(s.name+(s.tagline?" - ".concat(s.tagline):"")," | Top 4 AI Tool loading"),classNames:{wrapper:"w-full !max-w-full",img:"w-full aspect-video object-fill"},radius:"none",src:"/images/maomao-loading.webp"}),(0,n.jsx)(v.default,{className:"absolute bottom-0 right-0 opacity-80 sm:opacity-0 sm:group-hover:opacity-100 z-10 transition-opacity",favoriteItem:C,simpleMode:!0})]}),(0,n.jsxs)("div",{className:"sm:flex sm:flex-col sm:flex-1 sm:justify-between p-4",children:[(0,n.jsx)("div",{className:"flex justify-between items-center",children:(0,n.jsx)("div",{className:(0,o.Z)("flex items-center text-primary-800 font-semibold gap-2 relative","after:content-[' '] after:overflow-hidden after:absolute after:-bottom-[1px] after:left-0 after:h-[2px] after:bg-primary-900 after:w-0 group-hover:after:w-full after:transition-width"),children:(0,n.jsxs)(f.rU,{className:"flex items-center gap-2",href:"featured"===a?s.url+y.X.utmSource:"/s/".concat(s.siteKey),target:"_blank",onClick:e=>{e.stopPropagation()},children:[(0,n.jsxs)("h3",{className:"text-lg overflow-hidden text-ellipsis line-clamp-3",children:[s.name,s.tagline?" - ".concat(s.tagline):""]}),(0,n.jsx)(h.Z,{className:"shrink-0",size:16}),s.voteCount>0&&(0,n.jsxs)("div",{className:"flex items-center text-primary-500 gap-1",children:[(0,n.jsx)(p.Z,{size:13}),(0,n.jsx)("span",{className:"text-sm",children:s.voteCount})]})]})})}),(0,n.jsx)("div",{className:"mt-2 text-primary-400 text-sm overflow-hidden text-ellipsis line-clamp-2",children:s.description.toString()}),(0,n.jsxs)("div",{className:"mt-4 flex items-center justify-between gap-4",children:[(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:null===(r=s.categories)||void 0===r?void 0:null===(t=r.slice(0,1))||void 0===t?void 0:t.map((e,t)=>(0,n.jsx)("span",{className:"text-tiny font-medium py-[1px] px-2 rounded-[4px] bg-primary-700 text-primary-200 inline-block",children:e},t))}),(0,n.jsx)("span",{className:"text-primary-600 text-nowrap text-tiny font-medium",children:x(s.pricingType.replace(/\s/g,"-"))})]})]})]})]},s._id)}),C=r(49072),_=r(7449),P=r(89291),N=r(68591),L=r(55736),D=(0,i.memo)(function(e){let{sites:t,title:r,id:s,badgeType:c,badgeLimit:d,subTitle:u,className:h,groupClassName:p}=e,[f,m]=(0,i.useState)(4),g=e=>d?e<d?c:void 0:c,x=e=>void 0!==e&&d&&e<d?" Top ".concat(e+1):"",b=(0,i.useCallback)(()=>{m(e=>{switch(e){case 4:return 3;case 3:return 2;case 2:return 1;default:return 4}})},[]);return(0,n.jsxs)(l.Z,{className:(0,k.cn)("mt-10 sm:mt-16",h),id:s,children:[(0,n.jsxs)("h2",{className:(0,o.Z)(a().className,"flex items-center","text-2xl font-bold"),children:[r,u&&u]}),(0,n.jsxs)("div",{className:"relative group/button",children:[(0,n.jsx)(C.A,{className:"absolute top-0 -right-10 hidden sm:flex opacity-0 group-hover/button:opacity-100",isIconOnly:!0,size:"sm",onPress:b,children:(()=>{switch(f){case 1:return(0,n.jsx)(_.Z,{size:20});case 2:return(0,n.jsx)(P.Z,{size:20});case 3:return(0,n.jsx)(N.Z,{size:20});default:return(0,n.jsx)(L.Z,{size:20})}})()}),(0,n.jsx)("div",{className:(0,k.cn)("grid  gap-4 mt-4",p||(()=>{switch(f){case 1:return"grid-cols-1";case 2:return"grid-cols-1 sm:grid-cols-2";case 3:return"grid-cols-1 sm:grid-cols-2 md:grid-cols-3";default:return"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"}})()),children:t.map((e,t)=>(0,n.jsx)(j,{site:e,badgeType:g(t),badgeSuffix:x(t)},e._id))})]})]})})},49084:function(e,t,r){"use strict";r.d(t,{O:function(){return c}});var n=r(57437),s=r(79205);let a=(0,s.Z)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),i=(0,s.Z)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);var o=r(5076),l=r(2265);function c(e){let{asButton:t}=e,[r,s]=(0,l.useState)(!1),{theme:c,setTheme:d}=(0,o.F)();(0,l.useEffect)(()=>{s(!0)},[]);let u=(0,l.useCallback)(()=>{"light"===c?d("dark"):d("light")},[d,c]);if(!r)return null;
1let h="dark"===c?(0,n.jsx)(a,{className:"text-primary cursor-pointer",size:16,onClick:t?void 0:u}):(0,n.jsx)(i,{className:"text-primary cursor-pointer",size:16,onClick:t?void 0:u});return t?(0,n.jsx)("button",{type:"button",className:"p-1 rounded-md cursor-pointer",onClick:u,children:h}):h}},92183:function(e,t,r){"use strict";var n=r(57437),s=r(2265),a=r(10765),i=r(45275),o=r(61178),l=r(42586),c=r(35592),d=r(77960),u=r(93448);t.default=e=>{let{favoriteItem:t,onFavoriteChange:r,onCategoriesChange:h,simpleMode:p,className:f}=e,m=(0,l.useTranslations)("FavoritesPage"),g=t.siteId,[x,b]=(0,s.useState)(!1),[k,w]=(0,s.useState)(""),[v,y]=s.useState([]),[j,C]=(0,s.useState)(!1),[_,P]=(0,s.useState)(!1),N=async e=>{C(!0);try{await (0,c.a3)({...t,categoryId:e}),P(!0),a.Am.success(m("addedToFavorites")),r&&r()}catch(e){a.Am.error(e.message)}finally{C(!1),setTimeout(()=>{b(!1)},30)}},L=async()=>{C(!0);try{await (0,c.Ni)(g),P(!1),a.Am.success(m("removedFromFavorites"))}catch(e){a.Am.error(e.message)}finally{C(!1)}},D=async()=>{C(!0);try{let e=await (0,c.CP)();y(e)}finally{C(!1)}},S=async()=>{if(!k){a.Am.error("类别名称不能为空");return}try{C(!0);let e=await (0,c.k4)(k);e.id&&(h&&h(),N(e.id)),w("")}catch(e){a.Am.error(e.message)}finally{C(!1)}};return s.useEffect(()=>{(async()=>{C(!0);try{let e=(await (0,c._l)()).some(e=>e.siteId===g);P(e)}finally{C(!1)}})(),D()},[g]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{onClick:async e=>{e.stopPropagation(),_?await L():(await D(),b(!0))},className:(0,u.cn)("font-bold py-1.5 px-2 rounded-lg transition-all duration-200 text-sm","relative overflow-hidden group",f,_?"bg-gradient-to-br from-gray-600 to-gray-800 hover:from-gray-700 hover:to-gray-900 text-white shadow-lg":"bg-gradient-to-br from-red-500 to-red-600 hover:from-red-600 hover:to-red-700 text-white shadow-lg hover:shadow-xl"),disabled:j,children:[(0,n.jsxs)("span",{className:"relative z-10 flex items-center gap-2",children:[j?(0,n.jsxs)("svg",{className:"animate-spin h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"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"})]}):(0,n.jsx)("div",{className:"relative flex items-center justify-center h-4 w-4",children:_?(0,n.jsx)(i.Z,{}):(0,n.jsx)(o.Z,{})}),!p&&(_?m("removeFromFavorites"):m("addToFavorites"))]}),(0,n.jsx)("span",{className:"absolute inset-0 bg-white opacity-0 group-hover:opacity-10 transition-opacity duration-200"})]}),(0,n.jsxs)(d.V,{isOpen:x,onClose:()=>b(!1),title:m("selectCategory"),cancelText:m("close"),children:[(0,n.jsxs)("div",{className:"max-h-[35vh] overflow-y-auto px-1",children:[(0,n.jsx)("ul",{className:"space-y-2",children:v.map(e=>(0,n.jsx)("li",{children:(0,n.jsxs)("button",{onClick:()=>N(e.id),className:"w-full bg-white/90 backdrop-blur-sm hover:bg-white text-gray-800 font-medium p-4 rounded-lg shadow-sm transition-all duration-200 hover:shadow-md border border-gray-200/50 hover:border-gray-300 text-sm relative overflow-hidden group text-left",children:[(0,n.jsx)("span",{className:"relative z-10 flex items-center",children:e.name}),(0,n.jsx)("span",{className:"absolute inset-0 bg-gradient-to-br from-white/30 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),(0,n.jsx)("span",{className:"absolute inset-0 ring-1 ring-inset ring-gray-200/50 group-hover:ring-gray-300 rounded-lg transition-all duration-300"})]})},e.id))}),0===v.length&&(0,n.jsx)("div",{className:"text-center py-6 text-gray-500",children:m("noCategories")})]}),(0,n.jsxs)("div",{className:"mt-6",children:[(0,n.jsx)("div",{className:"text-sm font-medium text-gray-600 mb-2",children:m("createNewCategory")}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("input",{type:"text",value:k,onChange:e=>w(e.target.value),placeholder:m("categoryNamePlaceholder"),className:"flex-1 bg-white/90 backdrop-blur-sm border border-gray-200/50 rounded-xl px-4 py-2.5 focus:ring-2 focus:ring-blue-500/50 focus:outline-none shadow-sm transition-all duration-200 focus:border-blue-500 placeholder:text-gray-400",onKeyDown:e=>"Enter"===e.key&&S()}),(0,n.jsxs)("button",{onClick:S,disabled:!k,className:"bg-gradient-to-br from-blue-500 to-blue-600 hover:from-blue-600 hover:to-blue-700 text-white font-medium py-2.5 px-6 rounded-xl shadow-sm hover:shadow-md transition-all duration-200 relative overflow-hidden group disabled:opacity-50 disabled:pointer-events-none",children:[(0,n.jsx)("span",{className:"relative z-10",children:m("create")}),(0,n.jsx)("span",{className:"absolute inset-0 bg-white/10 opacity-0 group-hover:opacity-100 transition-opacity duration-300"})]})]})]})]})]})}},22870:function(e,t,r){"use strict";var n=r(57437),s=r(49072),a=r(1590),i=r(99376),o=r(8878),l=r(70082);t.default=()=>{let e=(0,o.jD)(),t=(0,i.useParams)(),r=(0,o.tv)(),c=new RegExp("^/".concat((0,l.jJ)().join("|"))),d=n=>{r.replace({pathname:e,params:t},{locale:n})};return(0,n.jsx)("div",{className:"flex space-x-2 flex-wrap justify-center",children:l.XP.map(t=>{let r=t.nativeName,i="/".concat(t.code).concat(e.replace(c,""));return(0,n.jsx)("span",{children:(0,n.jsx)(s.A,{variant:"light",onPress:()=>{d(t.code)},children:(0,n.jsx)(a.O,{href:"".concat(i),children:r})})},t.code)})})}},58072:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(57437),s=r(40334);function a(e){let{children:t,onClick:r,active:a,className:i}=e;return(0,n.jsx)("span",{className:(0,s.Z)("inline-block px-2 py-1 rounded bg-blue-500 text-white hover:px-4 hover:rounded-none hover:bg-blue-700 text-sm font-medium cursor-pointer transition-all",i,{"!bg-blue-700":a}),onClick:r,children:t})}},34927:function(e,t,r){"use strict";r.d(t,{default:function(){return j}});var n=r(57437),s=r(82272),a=r(10999),i=r(53206),o=r(93433),l=r(49072),c=r(27987),d=r(2265),u=r(65621),h=r(18930),p=r(73247),f=r(2499),m=r(40334),g=r(42586),x=r(96281),b=r(99376);r(83079);var k=(0,r(12119).$)("4ed77a5cb23a537a6cfc2dcc525d27ab1a5c2f8d"),w=r(8878),v=r(29498),y=r(58072);function j(e){let{isDisabledCategory:t,category:r,className:j,isLoading:C}=e,_=(0,b.useSearchParams)(),P=decodeURIComponent((null==_?void 0:_.get("s"))||""),[N,L]=(0,d.useState)(P||""),D=(0,w.tv)(),S=(0,g.useLocale)(),A=(0,g.useTranslations)("index"),[M,E]=(0,d.useState)([]),R=(0,d.useCallback)(()=>{try{E(JSON.parse(window.localStorage.getItem("histories")||""))}catch(e){}},[]),I=(0,d.useCallback)(e=>{window.localStorage.setItem("histories",JSON.stringify([e,...M].slice(10))),R()},[M,R]),T=(0,d.useCallback)(()=>{window.localStorage.setItem("histories",JSON.stringify([])),R()},[R]);(0,d.useEffect)(()=>{R()},[R]),(0,d.useEffect)(()=>{L(P)},[P]);let{data:O=[]}=(0,x.a)({queryKey:["all-featured-categories"],queryFn:async()=>t?[]:await k(S)}),z=M.length?(0,n.jsxs)(s.F,{placement:"bottom-end",children:[(0,n.jsx)(a.S,{children:(0,n.jsx)(u.Z,{className:"text-primary-400 hover:text-default-foreground transition-all cursor-pointer",size:16,strokeWidth:3})}),(0,n.jsxs)(i.a,{children:[M.map((e,t)=>(0,n.jsx)(o.W,{onClick:()=>{L(e),D.push("/search?s=".concat(encodeURIComponent(e)))},children:e},t)),(0,n.jsx)(o.W,{onClick:()=>T(),children:(0,n.jsx)(l.A,{className:"w-full",color:"danger",size:"sm",startContent:(0,n.jsx)(h.Z,{size:14,strokeWidth:3}),children:A("clearAll")})},"clearAll")]})]}):null,Z=(0,d.useCallback)(async e=>{if(C)return;I(e);let t="/search?s=".concat(encodeURIComponent(e));r&&(t+="&c=".concat(encodeURIComponent(r))),D.push(t)},[r,D,I,C]);return(0,n.jsxs)(v.Z,{className:(0,m.Z)("mt-10 sm:mt-16",j),children:[(0,n.jsx)("div",{className:"max-w-[600px] mx-auto text-center relative",children:(0,n.jsx)("form",{onSubmit:e=>{e.preventDefault(),Z(N)},children:(0,n.jsx)(c.Y,{classNames:{input:"text-center font-semibold placeholder:transition-all placeholder:text-primary-300 placeholder:font-semibold group-hover:placeholder:text-primary-400 group-data-[focus=true]:placeholder:text-primary-400",mainWrapper:"group",inputWrapper:"!border-primary-900"},endContent:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[z,(0,n.jsx)(l.A,{isIconOnly:!0,className:"bg-primary-900 text-white",disabled:C,radius:"full",size:"sm",type:"submit",children:(0,n.jsx)(p.Z,{className:"text-white dark:invert",size:16,strokeWidth:3})})]}),maxLength:100,placeholder:A("searchPlaceholder"),radius:"full",size:"lg",startContent:(0,n.jsx)(f.Z,{className:"text-primary-900 group-hover:text-primary-400 group-data-[focus=true]:text-default-foreground transition-all",size:20,strokeWidth:2}),value:N,variant:"bordered",onValueChange:L})})}),O.length>0&&!t&&(0,n.jsxs)("div",{className:"mt-6 flex flex-wrap justify-center gap-2",children:[O.map(e=>(0,n.jsxs)(y.Z,{active:e.name===r,onClick:()=>{let t="";t=e.name!==r?"/search?s=".concat(encodeURIComponent(N),"&c=").concat(encodeURIComponent(e.name)):"/search?s=".concat(encodeURIComponent(N)),D.push(t)}
1,children:[[e.icon,e.localeName||e.name].filter(Boolean).join(" ")," ",e.siteCount]},"featured_".concat(e._id))),(0,n.jsx)(w.rU,{href:"/categories",children:(0,n.jsx)(y.Z,{children:A("more")})})]})]})}},8122:function(e,t,r){"use strict";var n=r(57437),s=r(98555),a=r(8150),i=r(21120),o=r(82906),l=r(59008),c=r(9423),d=r(94734),u=r(66613),h=r(96999),p=r(60782),f=r(27012),m=r(1815),g=r(42636),x=r(43272),b=r(64728),k=r(28564),w=r(61133),v=r(29674),y=r(23024),j=r(41887),C=r(2265);let _=[a.Z,b.Z,k.Z.extend({elementProps:{divider:e=>({...e,color:"#007aff"})}}),p.Z,g.lB,g.ZD,g.W_,i.Z,d.Z,f.aS,f.hU,f.B4,x.Z,c.Z,o.Z,l.Z.extend({options:{async onUpload(e){let t=await (0,j.cT)("promptId",e);return{src:URL.createObjectURL(t.data),alt:"uploaded image",sizes:{width:800,height:600}}}}}),u.Z.extend({options:{onUpload:async e=>{let t=await (0,j.cT)("promptId",e);return{src:URL.createObjectURL(t.data),alt:"uploaded video",sizes:{width:800,height:600}}},onUploadPoster:async e=>{let t=await (0,j.cT)("promptId",e);return URL.createObjectURL(t.data)}}}),h.Z.extend({options:{onUpload:async e=>{let t=await (0,j.cT)("promptId",e);return{src:URL.createObjectURL(t.data),format:e.type,name:e.name,size:e.size}}}})],P={ActionMenu:{render:w.Ts,tool:w.ZP},Toolbar:{render:v.u,tool:v.Z},LinkTool:{render:y.I,tool:y.Z}},N=[m.d8,m.Tx,m.vD,m.v6,m.Re,m.y$];t.Z=function(e){let{editor:t,editorId:r,value:a,readOnly:i,onChange:o}=e,l=(0,C.useRef)(null);return(0,n.jsx)("div",{className:"flex justify-center",ref:l,children:(0,n.jsx)(s.ZP,{style:{width:"100%",minHeight:"60vh"},editor:t,value:a,plugins:_,tools:P,marks:N,selectionBoxRoot:l,onChange:e=>{o&&o(e)},readOnly:i,autoFocus:!0},r)})}},88654:function(e,t,r){"use strict";r.d(t,{default:function(){return eT}});var n=r(57437),s=r(2265),a=r(49072),i=r(82272),o=r(10999),l=r(53206),c=r(93433),d=r(10765),u=r(99376),h=r(42586),p=r(98555);let f={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null},m=/[&<>"']/,g=RegExp(m.source,"g"),x=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,b=RegExp(x.source,"g"),k={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},w=e=>k[e];function v(e,t){if(t){if(m.test(e))return e.replace(g,w)}else if(x.test(e))return e.replace(b,w);return e}let y=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,j=/(^|[^\[])\^/g;function C(e,t){let r="string"==typeof e?e:e.source;t=t||"";let n={replace:(e,t)=>{let s="string"==typeof t?t:t.source;return s=s.replace(j,"$1"),r=r.replace(e,s),n},getRegex:()=>new RegExp(r,t)};return n}function _(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}let P={exec:()=>null};function N(e,t){let r=e.replace(/\|/g,(e,t,r)=>{let n=!1,s=t;for(;--s>=0&&"\\"===r[s];)n=!n;return n?"|":" |"}).split(/ \|/),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t){if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("")}for(;n<r.length;n++)r[n]=r[n].trim().replace(/\\\|/g,"|");return r}function L(e,t,r){let n=e.length;if(0===n)return"";let s=0;for(;s<n;){let a=e.charAt(n-s-1);if(a!==t||r){if(a===t||!r)break;s++}else s++}return e.slice(0,n-s)}function D(e,t,r,n){let s=t.href,a=t.title?v(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;let e={type:"link",raw:r,href:s,title:a,text:i,tokens:n.inlineTokens(i)};return n.state.inLink=!1,e}return{type:"image",raw:r,href:s,title:a,text:v(i)}}class S{options;rules;lexer;constructor(e){this.options=e||f}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:L(e,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],r=function(e,t){let r=e.match(/^(\s+)(?:```)/);if(null===r)return t;let n=r[1];return t.split("\n").map(e=>{let t=e.match(/^\s+/);if(null===t)return e;let[r]=t;return r.length>=n.length?e.slice(n.length):e}).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){let t=L(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:L(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=L(t[0],"\n").split("\n"),r="",n="",s=[];for(;e.length>0;){let t,a=!1,i=[];for(t=0;t<e.length;t++)if(/^ {0,3}>/.test(e[t]))i.push(e[t]),a=!0;else{if(a)break;i.push(e[t])}e=e.slice(t);let o=i.join("\n"),l=o.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n    $1").replace(/^ {0,3}>[ \t]?/gm,"");r=r?`${r}
2${o}`:o,n=n?`${n}
3${l}`:l;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,s,!0),this.lexer.state.top=c,
30===e.length)break;let d=s[s.length-1];if("code"===d?.type)break;if("blockquote"===d?.type){let t=d.raw+"\n"+e.join("\n"),a=this.blockquote(t);s[s.length-1]=a,r=r.substring(0,r.length-d.raw.length)+a.raw,n=n.substring(0,n.length-d.text.length)+a.text;break}if("list"!==d?.type);else{let t=d.raw+"\n"+e.join("\n"),a=this.list(t);s[s.length-1]=a,r=r.substring(0,r.length-d.raw.length)+a.raw,n=n.substring(0,n.length-d.raw.length)+a.raw,e=t.substring(s[s.length-1].raw.length).split("\n")}}return{type:"blockquote",raw:r,tokens:s,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim(),n=r.length>1,s={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");let a=RegExp(`^( {0,3}${r})((?:[	 ][^\\n]*)?(?:\\n|$))`),i="",o="",l=!1;for(;e;){let r=!1;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;i=t[0],e=e.substring(i.length);let n=t[2].split("\n",1)[0].replace(/^\t+/,e=>" ".repeat(3*e.length)),c=e.split("\n",1)[0],d=0;this.options.pedantic?(d=2,o=n.trimStart()):(d=(d=t[2].search(/[^ ]/))>4?1:d,o=n.slice(d),d+=t[1].length);let u=!1;if(!n&&/^ *$/.test(c)&&(i+=c+"\n",e=e.substring(c.length+1),r=!0),!r){let t=RegExp(`^ {0,${Math.min(3,d-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`),r=RegExp(`^ {0,${Math.min(3,d-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),s=RegExp(`^ {0,${Math.min(3,d-1)}}(?:\`\`\`|~~~)`),a=RegExp(`^ {0,${Math.min(3,d-1)}}#`);for(;e;){let l=e.split("\n",1)[0];if(c=l,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g,"  ")),s.test(c)||a.test(c)||t.test(c)||r.test(e))break;if(c.search(/[^ ]/)>=d||!c.trim())o+="\n"+c.slice(d);else{if(u||n.search(/[^ ]/)>=4||s.test(n)||a.test(n)||r.test(n))break;o+="\n"+c}u||c.trim()||(u=!0),i+=l+"\n",e=e.substring(l.length+1),n=c.slice(d)}}s.loose||(l?s.loose=!0:/\n *\n *$/.test(i)&&(l=!0));let h,p=null;this.options.gfm&&(p=/^\[[ xX]\] /.exec(o))&&(h="[ ] "!==p[0],o=o.replace(/^\[[ xX]\] +/,"")),s.items.push({type:"list_item",raw:i,task:!!p,checked:h,loose:!1,text:o,tokens:[]}),s.raw+=i}s.items[s.items.length-1].raw=i.trimEnd(),s.items[s.items.length-1].text=o.trimEnd(),s.raw=s.raw.trimEnd();for(let e=0;e<s.items.length;e++)if(this.lexer.state.top=!1,s.items[e].tokens=this.lexer.blockTokens(s.items[e].text,[]),!s.loose){let t=s.items[e].tokens.filter(e=>"space"===e.type),r=t.length>0&&t.some(e=>/\n.*\n/.test(e.raw));s.loose=r}if(s.loose)for(let e=0;e<s.items.length;e++)s.items[e].loose=!0;return s}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(/\s+/g," "),r=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:n}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;let r=N(t[1]),n=t[2].replace(/^\||\| *$/g,"").split("|"),s=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(let e of n)/^ *-+: *$/.test(e)?a.align.push("right"):/^ *:-+: *$/.test(e)?a.align.push("center"):/^ *:-+ *$/.test(e)?a.align.push("left"):a.align.push(null);for(let e=0;e<r.length;e++)a.header.push({text:r[e],tokens:this.lexer.inline(r[e]),header:!0,align:a.align[e]});for(let e of s)a.rows.push(N(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:v(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;let t=L(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(")"))return -1;let r=0;for(let t=0;t<e.length;t++)if("\\"===e[t])t++;else if("("===e[t])r++;else if(")"===e[t]&&--r<0)return t;return -1}(t[2],"()");if(e>-1){let r=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let r=t[2],n="";if(this.options.pedantic){let e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);e&&(r=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(r=this.options.pedantic&&!/>$/.test(e)?r.slice(1):r.slice(1,-1)),D(t,{href:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r,title:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n},t[0],this.lexer)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let e=t[(r[2]||r[1]).replace(/\s+/g," ").toLowerCase()];if(!e){let e=r[0].charAt(0);return{type:"text",raw:e,text:e}}return D(r,e,r[0],this.lexer)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(n&&!(n[3]&&r.match(/[\p{L}\p{N}]/u))&&(!(n[1]||n[2])||!r||this.rules.inline.punctuation.exec(r))){let r=[...n[0]].length-1,s,a,i=r,o=0,l="*"===n[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+r);null!=(n=l.exec(t));){if(!(s=n[1]||n[2]||n[3]||n[4]||n[5]||n[6]))continue;if(a=[...s].length,n[3]||n[4]){i+=a;continue}if((n[5]||n[6])&&r%3&&!((r+a)%3)){o+=a;continue}if((i-=a)>0)continue;a=Math.min(a,a+i+o);let t=[...n[0]][0].length,l=e.slice(0,r+n.index+t+a);if(Math.min(r,a)%2){let e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}let c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," "),r=/[^ ]/.test(e),n=/^ /.test(e)&&/ $/.test(e);return r&&n&&(e=e.substring(1,e.length-1)),e=v(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,r;
vendor: 8,983 bytes, line 3
3return r="@"===t[2]?"mailto:"+(e=v(t[1])):e=v(t[1]),{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,r;if("@"===t[2])r="mailto:"+(e=v(t[0]));else{let n;do n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(n!==t[0]);e=v(t[0]),r="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:v(t[0]),{type:"text",raw:t[0],text:e}}}}let A=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,M=/(?:[*+-]|\d{1,9}[.)])/,E=C(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,M).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),R=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,I=/(?!\s*\])(?:\\.|[^\[\]\\])+/,T=C(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",I).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),O=C(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,M).getRegex(),z="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Z=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,F=C("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",Z).replace("tag",z).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$=C(R).replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",z).getRegex(),H={blockquote:C(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",$).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:T,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:A,html:F,lheading:E,list:O,newline:/^(?: *(?:\n|$))+/,paragraph:$,table:P,text:/^[^\n]+/},B=C("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",z).getRegex(),U={...H,table:B,paragraph:C(R).replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",B).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",z).getRegex()},W={...H,html:C("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Z).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:P,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:C(R).replace("hr",A).replace("heading"," *#{1,6} *[^\n]").replace("lheading",E).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},V=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,q=/^( {2,}|\\)\n(?!\s*$)/,G="\\p{P}\\p{S}",J=C(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,G).getRegex(),K=C(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,G).getRegex(),X=C("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,G).getRegex(),Q=C("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,G).getRegex(),Y=C(/\\([punct])/,"gu").replace(/punct/g,G).getRegex(),ee=C(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),et=C(Z).replace("(?:-->|$)","-->").getRegex(),er=C("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",et).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),en=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,es=C(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",en).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ea=C(/^!?\[(label)\]\[(ref)\]/).replace("label",en).replace("ref",I).getRegex(),ei=C(/^!?\[(ref)\](?:\[\])?/).replace("ref",I).getRegex(),eo={_backpedal:P,anyPunctuation:Y,autolink:ee,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:q,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:P,emStrongLDelim:K,emStrongRDelimAst:X,emStrongRDelimUnd:Q,escape:V,link:es,nolink:ei,punctuation:J,reflink:ea,reflinkSearch:C("reflink|nolink(?!\\()","g").replace("reflink",ea).replace("nolink",ei).getRegex(),tag:er,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:P},el={...eo,link:C(/^!?\[(label)\]\((.*?)\)/).replace("label",en).getRegex(),reflink:C(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",en).getRegex()},ec={...eo,escape:C(V).replace("])","~|])").getRegex(),url:C(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},ed={...ec,br:C(q).replace("{2,}","*").getRegex(),text:C(ec.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},eu={normal:H,gfm:U,pedantic:W},eh={normal:eo,gfm:ec,breaks:ed,pedantic:el};class ep{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||f,this.options.tokenizer=this.options.tokenizer||new S,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={block:eu.normal,inline:eh.normal};this.options.pedantic?(t.block=eu.pedantic,t.inline=eh.pedantic):this.options.gfm&&(t.block=eu.gfm,this.options.breaks?t.inline=eh.breaks:t.inline=eh.gfm),this.tokenizer.rules=t}static get rules(){return{block:eu,inline:eh}}static lex(e,t){return new ep(t).lex(e)}static lexInline(e,t){return new ep(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let e=0;
3e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){let n,s,a;for(e=this.options.pedantic?e.replace(/\t/g,"    ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,(e,t,r)=>t+"    ".repeat(r.length));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))){if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),(s=t[t.length-1])&&("paragraph"===s.type||"text"===s.type)?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),(s=t[t.length-1])&&("paragraph"===s.type||"text"===s.type)?(s.raw+="\n"+n.raw,s.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(a=e,this.options.extensions&&this.options.extensions.startBlock){let t,r=1/0,n=e.slice(1);this.options.extensions.startBlock.forEach(e=>{"number"==typeof(t=e.call({lexer:this},n))&&t>=0&&(r=Math.min(r,t))}),r<1/0&&r>=0&&(a=e.substring(0,r+1))}if(this.state.top&&(n=this.tokenizer.paragraph(a)))s=t[t.length-1],r&&"paragraph"===s?.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n),r=a.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),(s=t[t.length-1])&&"text"===s.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r,n,s,a,i,o,l=e;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(a=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,a.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(i||(o=""),i=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))){if(r=this.tokenizer.escape(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.tag(e))e=e.substring(r.raw.length),(n=t[t.length-1])&&"text"===r.type&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(r=this.tokenizer.link(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(r.raw.length),(n=t[t.length-1])&&"text"===r.type&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(r=this.tokenizer.emStrong(e,l,o))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.codespan(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.br(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.del(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.autolink(e))e=e.substring(r.raw.length),t.push(r);else if(!this.state.inLink&&(r=this.tokenizer.url(e)))e=e.substring(r.raw.length),t.push(r);else{if(s=e,this.options.extensions&&this.options.extensions.startInline){let t,r=1/0,n=e.slice(1);
3this.options.extensions.startInline.forEach(e=>{"number"==typeof(t=e.call({lexer:this},n))&&t>=0&&(r=Math.min(r,t))}),r<1/0&&r>=0&&(s=e.substring(0,r+1))}if(r=this.tokenizer.inlineText(s))e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(o=r.raw.slice(-1)),i=!0,(n=t[t.length-1])&&"text"===n.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}}return t}}class ef{options;parser;constructor(e){this.options=e||f}space(e){return""}code({text:e,lang:t,escaped:r}){let n=(t||"").match(/^\S*/)?.[0],s=e.replace(/\n$/,"")+"\n";return n?'<pre><code class="language-'+v(n)+'">'+(r?s:v(s,!0))+"</code></pre>\n":"<pre><code>"+(r?s:v(s,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>
4${this.parser.parse(e)}</blockquote>
5`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
6`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,r=e.start,n="";for(let t=0;t<e.items.length;t++){let r=e.items[t];n+=this.listitem(r)}let s=t?"ol":"ul";return"<"+s+(t&&1!==r?' start="'+r+'"':"")+">\n"+n+"</"+s+">\n"}listitem(e){let t="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=r+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" "}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
7`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
8`}table(e){let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.tablecell(e.header[t]);t+=this.tablerow({text:r});let n="";for(let t=0;t<e.rows.length;t++){let s=e.rows[t];r="";for(let e=0;e<s.length;e++)r+=this.tablecell(s[e]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+n+"</table>\n"}tablerow({text:e}){return`<tr>
9${e}</tr>
10`}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
11`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),s=_(e);if(null===s)return n;let a='<a href="'+(e=s)+'"';return t&&(a+=' title="'+t+'"'),a+=">"+n+"</a>"}image({href:e,title:t,text:r}){let n=_(e);if(null===n)return r;let s=`<img src="${e=n}" alt="${r}"`;return t&&(s+=` title="${t}"`),s+=">"}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}}class em{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class eg{options;renderer;textRenderer;constructor(e){this.options=e||f,this.options.renderer=this.options.renderer||new ef,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new em}static parse(e,t){return new eg(t).parse(e)}static parseInline(e,t){return new eg(t).parseInline(e)}parse(e,t=!0){let r="";for(let n=0;n<e.length;n++){let s=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){let e=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==e||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(s.type)){r+=e||"";continue}}switch(s.type){case"space":r+=this.renderer.space(s);continue;case"hr":r+=this.renderer.hr(s);continue;case"heading":r+=this.renderer.heading(s);continue;case"code":r+=this.renderer.code(s);continue;case"table":r+=this.renderer.table(s);continue;case"blockquote":r+=this.renderer.blockquote(s);continue;case"list":r+=this.renderer.list(s);continue;case"html":r+=this.renderer.html(s);continue;
11case"paragraph":r+=this.renderer.paragraph(s);continue;case"text":{let a=s,i=this.renderer.text(a);for(;n+1<e.length&&"text"===e[n+1].type;)a=e[++n],i+="\n"+this.renderer.text(a);r+=t?this.renderer.paragraph({type:"paragraph",raw:i,text:i,tokens:[{type:"text",raw:i,text:i}]}):i;continue}default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw Error(e)}}}return r}parseInline(e,t){t=t||this.renderer;let r="";for(let n=0;n<e.length;n++){let s=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){let e=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=e||"";continue}}switch(s.type){case"escape":case"text":r+=t.text(s);break;case"html":r+=t.html(s);break;case"link":r+=t.link(s);break;case"image":r+=t.image(s);break;case"strong":r+=t.strong(s);break;case"em":r+=t.em(s);break;case"codespan":r+=t.codespan(s);break;case"br":r+=t.br(s);break;case"del":r+=t.del(s);break;default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw Error(e)}}}return r}}class ex{options;constructor(e){this.options=e||f}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}let eb=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#e(ep.lex,eg.parse);parseInline=this.#e(ep.lexInline,eg.parseInline);Parser=eg;Renderer=ef;TextRenderer=em;Lexer=ep;Tokenizer=S;Hooks=ex;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let n of e)switch(r=r.concat(t.call(this,n)),n.type){case"table":for(let e of n.header)r=r.concat(this.walkTokens(e.tokens,t));for(let e of n.rows)for(let n of e)r=r.concat(this.walkTokens(n.tokens,t));break;case"list":r=r.concat(this.walkTokens(n.items,t));break;default:{let e=n;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(n=>{let s=e[n].flat(1/0);r=r.concat(this.walkTokens(s,t))}):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error("extension name required");if("renderer"in e){let r=t.renderers[e.name];t.renderers[e.name]=r?function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=r.apply(this,t)),n}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw Error("extension level must be 'block' or 'inline'");let r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),r.extensions=t),e.renderer){let t=this.defaults.renderer||new ef(this.defaults);for(let r in e.renderer){if(!(r in t))throw Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let n=r,s=e.renderer[n],a=t[n];t[n]=(...r)=>{e.useNewRenderer||(s=this.#t(s,n,t));let i=s.apply(t,r);return!1===i&&(i=a.apply(t,r)),i||""}}r.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new S(this.defaults);for(let r in e.tokenizer){if(!(r in t))throw Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let n=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=s.apply(t,e)),r}}r.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new ex;for(let r in e.hooks){if(!(r in t))throw Error(`hook '${r}' does not exist`);if("options"===r)continue;let n=e.hooks[r],s=t[r];ex.passThroughHooks.has(r)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(n.call(t,e)).then(e=>s.call(t,e));let r=n.call(t,e);return s.call(t,r)}:t[r]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=s.apply(t,e)),r}}r.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,n=e.walkTokens;r.walkTokens=function(e){let r=[];return r.push(n.call(this,e)),t&&(r=r.concat(t.call(this,e))),r}}this.defaults={...this.defaults,...r}}),this}#t(e,t,r){switch(t){case"heading":return function(n){return n.type&&n.type===t?e(r.parser.parseInline(n.tokens),n.depth,r.parser.parseInline(n.tokens,r.parser.textRenderer).replace(y,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")):e.apply(this,arguments)};case"code":return function(r){return r.type&&r.type===t?e(r.text,r.lang,!!r.escaped):e.apply(this,arguments)};case"table":return function(r){if(!r.type||r.type!==t)return e.apply(this,arguments);let n="",s="";for(let e=0;e<r.header.length;e++)s+=this.tablecell({text:r.header[e].text,tokens:r.header[e].tokens,header:!0,align:r.align[e]});n+=this.tablerow({text:s});let a="";for(let e=0;e<r.rows.length;e++){let t=r.rows[e];s="";for(let e=0;e<t.length;e++)s+=this.tablecell({text:t[e].text,tokens:t[e].tokens,header:!1,align:r.align[e]});a+=this.tablerow({text:s})}return e(n,a)};case"blockquote":return function(r){return r.type&&r.type===t?e(this.parser.parse(r.tokens)):e.apply(this,arguments)};case"list":return function(r){if(!r.type||r.type!==t)return e.apply(this,arguments);let n=r.ordered,s=r.start,a=r.loose,i="";for(let e=0;e<r.items.length;e++){let t=r.items[e],n=t.checked,s=t.task,o="";if(t.task){let e=this.checkbox({checked:!!n});a?t.tokens.length>0&&"paragraph"===t.tokens[0].type?(t.tokens[0].text=e+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=e+" "+t.tokens[0].tokens[0].text)):t.tokens.unshift({type:"text",text:e+" "}):o+=e+" "}o+=this.parser.parse(t.tokens,a),i+=this.listitem({type:"list_item",raw:o,text:o,task:s,checked:!!n,loose:a,tokens:t.tokens})}return e(i,n,s)};case"html":return function(r){return r.type&&r.type===t?e(r.text,r.block):e.apply(this,arguments)};case"paragraph":case"strong":case"em":case"del":return function(r){return r.type&&r.type===t?e(this.parser.parseInline(r.tokens)):e.apply(this,arguments)};case"escape":case"codespan":case"text":return function(r){return r.type&&r.type===t?e(r.text):e.apply(this,arguments)};case"link":return function(r){return r.type&&r.type===t?e(r.href,r.title,this.parser.parseInline(r.tokens)):e.apply(this,arguments)};case"image":return function(r){return r.type&&r.type===t?e(r.href,r.title,r.text):e.apply(this,arguments)}}return e}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ep.lex(e,t??this.defaults)}parser(e,t){return eg.parse(e,t??this.defaults)}#e(e,t){return(r,n)=>{let s={...n},a={...this.defaults,...s};!0===this.defaults.async&&!1===s.async&&(a.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),a.async=!0);let i=this.#r(!!a.silent,!!a.async);if(null==r)return i(Error("marked(): input parameter is undefined or null"));if("string"!=typeof r)return i(Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(r):r).then(t=>e(t,a)).then(e=>a.hooks?a.hooks.processAllTokens(e):e).then(e=>a.walkTokens?Promise.all(this.walkTokens(e,a.walkTokens)).then(()=>e):e).then(e=>t(e,a)).then(e=>a.hooks?a.hooks.postprocess(e):e).catch(i);try{a.hooks&&(r=a.hooks.preprocess(r));let n=e(r,a);a.hooks&&(n=a.hooks.processAllTokens(n)),a.walkTokens&&this.walkTokens(n,a.walkTokens);let s=t(n,a);return a.hooks&&(s=a.hooks.postprocess(s)),s}catch(e){return i(e)}}}#r(e,t){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+v(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}};function ek(e,t){return eb.parse(e,t)}ek.options=ek.setOptions=function(e){return eb.setOptions(e),ek.defaults=eb.defaults,f=ek.defaults,ek},ek.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},ek.defaults=f,ek.use=function(...e){return eb.use(...e),ek.defaults=eb.defaults,f=ek.defaults,ek},ek.walkTokens=function(e,t){return eb.walkTokens(e,t)},ek.parseInline=eb.parseInline,ek.Parser=eg,ek.parser=eg.parse,ek.Renderer=ef,ek.TextRenderer=em,ek.Lexer=ep,ek.lexer=ep.lex,ek.Tokenizer=S,ek.Hooks=ex,ek.parse=ek,ek.options,ek.setOptions,ek.use,ek.walkTokens,ek.parseInline,eg.parse,ep.lex;let ew={deserialize:function(e,t){return ek.use({extensions:[{name:"image",level:"block",start(e){var t;return null===(t=e.match(/!\[/))||void 0===t?void 0:t.index},tokenizer(e){let t=/^!\[(.*?)\]\((.*?)\)/.exec(e);if(t)return{type:"image",raw:t[0],alt:t[1],href:t[2]}},renderer:e=>`<img alt="${e.alt}" src="${e.href}">`}]}),function(e,t){let r=(new DOMParser).parseFromString(t,"text/html"),n={};
11return(0,p.Yw)(e,r.body).forEach((e,t)=>{e.meta.order=t,n[e.id]=e}),n}(e,ek.parse(t,{gfm:!0,breaks:!0,pedantic:!1}))},serialize:function(e,t){return e.getMarkdown(t)}},ev={deserialize:function(e,t){let r=(0,p.Ox)();return{[r]:p.no.buildBlockData({id:r,value:[{id:(0,p.Ox)(),type:"paragraph",children:[{text:t}]}]})}}};var ey=r(12),ej=r(49211),eC=r.n(ej),e_=r(41887),eP=r(8122),eN=r(77960),eL=r(93448),eD=r(18930),eS=r(92451);function eA(e){let{versionHistoryList:t,currentVersionId:r,onVersionSelect:a,onVersionDel:i}=e,[o,l]=(0,s.useState)(null);return 0===t.length?(0,n.jsx)("div",{className:"flex items-center justify-center h-full text-default-500",children:(0,n.jsx)("p",{className:"text-sm",children:"暂无版本历史"})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"px-2 py-2",children:(0,n.jsx)("div",{className:"space-y-4 relative before:absolute before:left-[19px] before:top-[28px] before:bottom-2 before:w-[2px] before:bg-default-100",children:t.map((e,t)=>(0,n.jsxs)("div",{className:(0,eL.cn)("relative pl-12 pr-2 py-3 transition-all duration-200","hover:bg-default-100/50 hover:shadow-sm","hover:ring-1 hover:ring-primary/20","rounded-lg cursor-pointer group",e.id===r&&"bg-primary/5"),onClick:()=>e.id!==r&&a(e.id),children:[(0,n.jsx)("div",{className:(0,eL.cn)("absolute left-[14px] w-3 h-3 rounded-full border-2 z-10","top-1/2 -translate-y-1/2 transition-all duration-200","group-hover:scale-110",e.id===r?"bg-primary/20 border-primary":"bg-background border-default-300")}),(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("span",{className:(0,eL.cn)("font-medium transition-colors duration-200",e.id===r?"text-primary":"group-hover:text-primary"),children:["版本 ",e.version]}),e.id===r&&(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-success animate-pulse"}),(0,n.jsx)("span",{className:"text-[10px] text-success font-medium tracking-widest",children:"当前版本"})]})]}),(0,n.jsx)("div",{className:"flex items-center gap-2 text-xs text-default-400",children:(0,n.jsx)("span",{children:(0,eL.p)(e.createdAt)})}),e.description&&(0,n.jsx)("p",{className:"text-sm text-default-600 line-clamp-2 mt-1 transition-colors duration-200 group-hover:text-default-800",children:e.description})]}),(0,n.jsx)("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity",onClick:t=>{t.stopPropagation(),l(e.id)},children:(0,n.jsx)(eD.Z,{className:"h-4 w-4 text-danger hover:text-danger-600"})})]},e.id))})}),(0,n.jsx)(eN.V,{title:"删除版本",isOpen:!!o,confirmText:"确认",cancelText:"取消",onClose:()=>l(null),onConfirm:()=>{o&&(i(o),l(null))},children:(0,n.jsx)("p",{children:"确定要删除该版本吗?"})})]})}function eM(e){let{title:t,className:r,versionHistoryList:i,currentVersionId:o,defaultExpanded:l=!0,onVersionChange:c,onVersionDel:d}=e,[u,h]=(0,s.useState)(l);return(0,n.jsxs)("div",{className:(0,eL.cn)("relative flex h-full","transition-all duration-300 ease-in-out",u?"w-72":"w-0",r),children:[(0,n.jsx)("div",{className:(0,eL.cn)("bg-background border-r overflow-hidden transition-[width] duration-300","shadow-lg rounded-r-xl","border-r border-default-200/50"),children:(0,n.jsxs)("div",{className:"w-64 h-full flex flex-col",children:[(0,n.jsx)("div",{className:"p-4 border-b min-h-[60px] flex items-center",children:(0,n.jsx)("h2",{className:"text-lg font-semibold",children:t})}),(0,n.jsx)("div",{className:"overflow-y-auto max-h-[60vh]",children:(0,n.jsx)(eA,{versionHistoryList:i,currentVersionId:o,onVersionSelect:c,onVersionDel:d})})]})}),(0,n.jsx)(a.A,{isIconOnly:!0,size:"sm",variant:"bordered",onPress:()=>h(!u),"aria-label":u?"收起侧边栏":"展开侧边栏",className:(0,eL.cn)("h-8 -ml-4 z-10 bg-background shadow-sm hover:scale-105 transition-transform",u?"rotate-0":"rotate-180"),children:(0,n.jsx)(eS.Z,{className:"h-4 w-4"})})]})}var eE=r(81288),eR=r.n(eE);function eI(e,t,r){let n="string"==typeof e?e:JSON.stringify(e),s="".concat(n,"::").concat(t,"::").concat(r);return eR().v3(s,0).toString(36)}var eT=function(e){let{promptId:t,readOnly:r}=e,f=(0,h.useTranslations)("PromptsPage.PromptEditor"),[m,g]=(0,s.use
11State)(),[x,b]=(0,s.useState)((0,p.Ox)()),[k,w]=(0,s.useState)(!1),[v,y]=(0,s.useState)(""),[j,C]=(0,s.useState)(""),[_,P]=(0,s.useState)(""),[N,L]=(0,s.useState)("default"),[D,S]=(0,s.useState)([]),[A,M]=(0,s.useState)(!1),[E,R]=(0,s.useState)("current"),[I,T]=(0,s.useState)(""),O=(0,s.useRef)(null),z=(0,s.useMemo)(()=>(0,p.Dw)(),[]),Z=(0,u.useRouter)(),F=(0,u.usePathname)(),[$,H]=(0,s.useState)(!1),[B,U]=(0,s.useState)(null),W=async()=>{if(t)try{let e=await (0,e_.r1)(t);if(e){let t=JSON.parse(e.content);b((0,p.Ox)()),g(t),P(e.currentVersionId),y(e.title),C(e.description),L(e.categoryId);let r=eI(e.content,e.title,e.description);T(r),z.focus()}}catch(e){console.error("Failed to fetch prompt:",e),d.Am.error(f("loadingPromptFailed"))}else z.withoutSavingHistory(()=>{let e=f("startBuildingPrompt"),t=ev.deserialize(z,e);b((0,p.Ox)()),g(t),z.focus()})},V=async()=>{if(t)try{let e=await (0,e_.sA)(t);console.log("versionIdHistory",e),S(e)}catch(e){console.error("Failed to fetch versions:",e),d.Am.error("获取版本历史失败")}};(0,s.useEffect)(()=>{W(),V()},[]);let q=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"current";try{R(e),w(!0);let r=z.getEditorValue(),n=JSON.stringify(r);if(console.log("editorContent",r,t),t){if("current"===e){let e=await (0,e_.XA)(t,_,{title:v,description:j,content:n,categoryId:N});await V(),P(e.id),d.Am.success(f("saveSuccess"))}else{let e=await (0,e_.r2)(t,{title:v,content:n,description:j},!0);await V(),P(e.id),d.Am.success(f("newVersionCreated"))}}else await (0,e_.Fh)({title:v,description:j,content:n,categoryId:N,tags:[],versionIdHistory:[],branches:[],usageCount:0}),d.Am.success(f("createSuccess")),Z.push("/prompts");let s=eI(n,v,j);T(s)}catch(e){d.Am.error("保存失败"),console.error("保存失败:",e)}finally{w(!1)}},G=()=>{let e=ew.serialize(z,m);eC()(e),d.Am.success(f("markdownCopied"))},J=async()=>{var e;let t=null===(e=O.current)||void 0===e?void 0:e.value;if(t)try{let e=ew.deserialize(z,t);b((0,p.Ox)()),g(e),d.Am.success(f("markdownImported")),M(!1)}catch(e){console.error("导入Markdown失败:",e),d.Am.error(f("markdownImportFailed"))}},[K,X]=(0,s.useState)(!1),[Q,Y]=(0,s.useState)(""),ee=async e=>{if(eI(m,v,j)!==I){Y(e),X(!0);return}await et(e)},et=async e=>{try{let r=await (0,e_.a0)(t,e);if(r){let t=JSON.parse(r.content);b((0,p.Ox)()),P(e),g(t),y(r.title),C(r.description);let n=eI(r.content,r.title,r.description);T(n),z.focus()}}catch(e){console.error("Failed to switch version:",e),d.Am.error(f("versionSwitchFailed"))}},er=async e=>{try{if(await (0,e_.pD)(t,e),d.Am.success(f("versionDeleted")),e===_){await V();let e=await (0,e_.sA)(t);if(e.length>0){let t=e[0];await et(t.id)}else g(void 0),y(""),C(""),T("")}else await V()}catch(e){console.error("Failed to delete version:",e),d.Am.error(f("versionDeleteFailed"))}};return(0,s.useEffect)(()=>{let e=e=>{eI(m,v,j)!==I&&(e.preventDefault(),e.returnValue="")};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}},[m,v,j,I]),(0,s.useEffect)(()=>{let e=e=>{if(eI(m,v,j)!==I)throw U(e),H(!0),window.history.pushState(null,"",F),"Route change aborted"};return window.addEventListener("popstate",()=>e(window.location.pathname)),()=>{window.removeEventListener("popstate",()=>e(window.location.pathname))}},[m,v,j,I,F]),(0,n.jsxs)("div",{className:"flex",children:[t&&(0,n.jsx)(eM,{className:"sticky top-16 z-10",title:v||"",versionHistoryList:D,currentVersionId:_,defaultExpanded:!r,onVersionChange:ee,onVersionDel:er}),(0,n.jsxs)("div",{className:"flex-1 flex flex-col pl-8 py-4 w-72",children:[r?(0,n.jsx)("div",{className:"flex justify-end gap-2 mb-4 sticky top-16 z-10",children:(0,n.jsx)(a.A,{onPress:G,color:"secondary",size:"sm",className:"w-full md:w-auto",children:f("copyMarkdown")})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex justify-end flex-wrap gap-2 mb-4 sticky top-16 z-10",children:[(0,n.jsx)(a.A,{className:"w-full md:w-auto",color:"current"===E?"primary":"default",size:"sm",isLoading:k,onPress:()=>q("current"),children:k?f("saving"):f("saveButton")}),t&&(0,n.jsx)(a.A,{className:"w-full md:w-auto",color:"new"===E?"primary":"default",size:"sm",onPress:()=>q("new"),children:f("saveAsNewVersion")}),(0,n.jsx)(a.A,{onPress:G,color:"secondary",size:"sm",className:"w-full md:w-auto",children:f("copyMarkdown")}),(0,n.jsx)(a.A,{onPress:()=>{let e=new Blob([ew.serialize(z,m)],{type:"text/markdown;charset=utf-8"});(0,ey.saveAs)(e,"prompt.md")},color:"success",size:"sm",className:"w-full md:w-auto",children:f("exportMarkdown")}),(0,n.jsxs)(i.F,{children:[(0,n.jsx)(o.S,{children:(0,n.jsx)(a.A,{color:"warning",size:"sm",className:"w-full md:w-auto",children:f("markdownImport")})}),(0,n.jsxs)(l.a,{"aria-label":"Markdown导入选项",children:[(0,n.jsx)(c.W,{onPress:async()=>{let e=document.createElement("input");e.type="file",e.accept=".md,.mdx",e.onchange=async e=>{var t;let r=null===(t=e.target.files)||void 0===t?void 0:t[0];if(r)try{let e=await r.text(),t=ew.deserialize(z,e);b((0,p.Ox)()),g(t),d.Am.success(f("markdownImported"))}
11catch(e){console.error("导入Markdown失败:",e),d.Am.error(f("markdownImportFailed"))}},e.click()},children:f("importMarkdownFile")},"import-file"),(0,n.jsx)(c.W,{onPress:()=>M(!0),children:f("inputMarkdownContent")},"input-content")]})]}),(0,n.jsx)(eN.V,{title:"输入Markdown内容",isOpen:A,confirmText:"导入",cancelText:"取消",confirmColor:"primary",size:"2xl",onClose:()=>M(!1),onConfirm:J,children:(0,n.jsx)("textarea",{className:"w-full h-64 p-2 border rounded",placeholder:"在此粘贴或输入Markdown内容...",ref:O})})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsx)("input",{type:"text",placeholder:f("promptTitle"),value:v,onChange:e=>{y(e.target.value)},className:"p-2 border rounded",required:!0,readOnly:r}),(0,n.jsx)("textarea",{placeholder:f("promptDescription"),value:j,onChange:e=>{C(e.target.value)},className:"p-2 border rounded",rows:3,required:!0,readOnly:r}),(0,n.jsx)("select",{value:N,onChange:e=>L(e.target.value),className:"p-2 border rounded",disabled:r,required:!0,children:(0,n.jsx)("option",{value:"default",children:f("defaultCategory")})})]})]}),(0,n.jsx)(eP.Z,{editor:z,value:m,editorId:x,readOnly:r,onChange:e=>{g(e)}})]}),(0,n.jsx)(eN.V,{title:f("switchVersionConfirmTitle"),isOpen:K,onClose:()=>X(!1),onConfirm:async()=>{await et(Q),X(!1)},confirmText:"确认切换",cancelText:"取消",confirmColor:"primary",children:(0,n.jsx)("p",{children:f("switchVersionConfirmMessage")})}),(0,n.jsx)(eN.V,{title:f("leaveConfirmTitle"),isOpen:$,onClose:()=>H(!1),onConfirm:()=>{H(!1),B&&(window.location.href=B)},confirmText:"确认离开",cancelText:"取消",confirmColor:"primary",children:(0,n.jsx)("p",{children:f("leaveConfirmMessage")})})]})}},46243:function(e,t,r){"use strict";r.d(t,{default:function(){return o}});var n=r(57437),s=r(8878),a=r(93448),i=r(42586);function o(e){let{title:t,className:r}=e,o=(0,i.useTranslations)("PromptsPage.PromptEditorHeader");return(0,n.jsxs)("div",{className:(0,a.cn)("flex items-center justify-between mb-8",r),children:[(0,n.jsx)("h1",{className:"text-3xl font-bold text-gray-800",children:t}),(0,n.jsxs)(s.rU,{href:"/prompts",className:"flex items-center text-sm text-gray-600 hover:text-gray-900 transition-colors duration-200",children:[(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-1",viewBox:"0 0 20 20",fill:"currentColor",children:(0,n.jsx)("path",{fillRule:"evenodd",d:"M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z",clipRule:"evenodd"})}),o("backToPromptList")]})]})}},74369:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(57437);function s(e){let{className:t}=e;return(0,n.jsxs)("svg",{className:t,fill:"none",height:"127",viewBox:"0 0 270 127",width:"270",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("path",{d:"M59.2422 114.628C59.2422 114.628 57.7956 110.673 55.943 105.533H55.8615V105.305C54.1464 100.548 52.1004 94.8297 50.5371 90.3061V105.484H44.3031V83.9428H48.4111C48.2513 83.4306 48.149 83.0413 48.0994 82.7988C47.8357 81.5223 48.1474 80.7245 48.6046 80.0527H30.4941V126.326H65.083V125.445C61.2099 123.602 60.1054 116.953 59.2422 114.628ZM39.1018 105.533H32.8678V83.9923H39.1018V105.533Z",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M50.5356 109.208V107.191H44.3081V109.208H50.5356Z",fill:"#6D6D6D"}),(0,n.jsx)("path",{d:"M55.8613 109.254V107.237H56.4528L57.0074 109.254H55.8613Z",fill:"#6D6D6D"}),(0,n.jsx)("path",{d:"M39.1001 109.254V107.237H32.8725V109.254H39.1001Z",fill:"#6D6D6D"}),(0,n.jsx)("path",{d:"M47.3034 120.51C48.511 120.51 49.4901 119.532 49.4901 118.327C49.4901 117.121 48.511 116.144 47.3034 116.144C46.0957 116.144 45.1167 117.121 45.1167 118.327C45.1167 119.532 46.0957 120.51 47.3034 120.51Z",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M60.6441 119.632C60.4067 119.969 60.0786 120.232 59.6978 120.391C59.3169 120.549 58.8989 120.597 58.4919 120.529C58.085 120.46 57.7058 120.278 57.3981 120.004C57.0905 119.729 56.867 119.373 56.7534 118.977C56.6398 118.581 56.6408 118.161 56.7563 117.765C56.8718 117.37 57.097 117.015 57.406 116.742C57.715 116.469 58.095 116.289 58.5023 116.222C58.9095 116.156 59.3274 116.205 59.7074 116.366",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M35.8664 120.558C37.074 120.558 38.053 119.58 38.053 118.375C38.053 117.169 37.074 116.192 35.8664 116.192C34.6587 116.192 33.6797 117.169 33.6797 118.375C33.6797 119.58 34.6587 120.558 35.8664 120.558Z",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M50.5371 90.5375V105.492H44.3096V83.946H48.2545",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M50.1118 89.0712H44.9072",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M50.1118 91.4438H44.9072",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M50.1118 93.8165H44.9072",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M39.1001 105.538V83.994H32.8726V105.538H39.1001Z",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M38.6798 98.9895H33.3218",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M38.6798 86.7463H33.3218",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M38.6798 101.362H33.3218",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M38.6798 103.735H33.3218",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M54.5377 62.2951C54.2487 61.4829 53.8203 60.727 53.2717 60.0613C51.2865 57.6471 51.2625 56.1137 50.1436 54.9569C49.0247 53.8001 47.2488 54.3282 48.8472 58.2518C49.0998 58.8709 49.3294 59.4331 49.5362 59.9384",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M46.3071 59.6576C47.9343 59.6815 53.3403 60.0884 56.3102 64.513",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M46.397 63.1265C49.8336 62.4021 58.4173 61.6457 60.1021 71.5832",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M51.6974 74.5607C51.2291 72.9347 50.676 71.3934 50.0734 70.4536C48.3055 67.6963 44.3574 67.9006 44.3574 67.9006C44.3574 67.9006 34.3191 59.0146 32.8661 57.4094C31.4131 55.8042 31.9694 54.274 34.5669 56.0579C35.908 56.9786 38.6397 58.93 40.9607 60.607",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M44.186 67.5048C44.186 67.5048 39.031 56.0722 38.259 53.9182C37.4869 51.7641 38.5307 50.628 40.2842 53.4857C41.0451 54.7271 42.2295 56.677 43.3213 58.4912",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M43.6983 66.5905C43.6983 66.5905 43.2875 56.7839 43.2891 54.8835C43.2891 51.7513 45.1736 50.861 45.6596 55.083C45.9793 57.9024 46.3421 63.0993 46.3421 63.0993",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M192.14 62.4755C192.43 61.5968 192.88 60.7794 193.468 60.0645C195.455 57.6487 195.476 56.1137 196.6 54.9585C197.724 53.8033 199.493 54.3298 197.895 58.2535C197.
11625 58.9204 197.38 59.5214 197.159 60.0565",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M200.569 59.656C199.148 59.656 193.638 59.9496 190.553 64.3359",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M200.307 63.1185C196.846 62.3972 188.318 61.6824 186.638 71.5752",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M195.161 74.1521C195.604 72.6793 196.12 71.3119 196.667 70.4502C198.435 67.693 202.383 67.8973 202.383 67.8973C202.383 67.8973 212.418 59.0129 213.874 57.4077C215.33 55.8025 214.771 54.2723 212.173 56.0562C210.797 57.0008 207.958 59.0336 205.594 60.7346",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M202.554 67.5048C202.554 67.5048 207.709 56.0722 208.481 53.9182C209.253 51.7641 208.209 50.628 206.457 53.4857C205.68 54.7495 204.465 56.752 203.353 58.5917",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M203.351 58.614C203.409 56.9434 203.452 55.4994 203.45 54.8835C203.45 51.7513 201.566 50.861 201.08 55.083C200.76 57.9024 200.399 63.0993 200.399 63.0993",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M203.042 66.5905C203.042 66.5905 203.23 62.1068 203.352 58.6124",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M101.658 50.1238C93.7267 54.0793 91.2235 60.2815 92.0563 66.7421H91.9796C91.9796 66.7421 81.5481 66.6033 75.7042 83.9332C73.9923 79.9123 72.2548 75.9775 71.5083 74.7457C69.8091 71.9502 64.0084 73.2059 62.493 71.2641C60.9777 69.3222 60.4406 68.7111 60.4406 68.7111C60.4406 68.7111 55.933 74.0819 50.3033 73.4804C50.3033 73.4804 49.9836 74.4473 50.1978 76.8886C50.412 79.3299 47.4372 79.6091 48.1006 82.802C48.764 85.9948 59.237 114.628 59.237 114.628C60.2248 117.29 61.5292 125.617 66.9415 125.914C66.9562 125.953 66.9818 125.986 67.0153 126.011C67.0488 126.036 67.0886 126.05 67.1301 126.053C75.7122 126.029 180.654 126.116 180.654 126.116C180.654 126.116 180.663 126.003 180.674 125.789C185.35 124.688 186.561 117.138 187.493 114.628C187.493 114.628 197.968 85.9948 198.63 82.802C199.291 79.6091 196.321 79.3299 196.534 76.8886C196.747 74.4473 196.427 73.4804 196.427 73.4804C190.804 74.0739 186.294 68.7127 186.294 68.7127C186.294 68.7127 185.757 69.319 184.244 71.2657C182.73 73.2123 179.856 71.0136 178.158 73.8091C176.787 76.0685 171.924 87.9095 170.107 92.3693C164.592 75.9967 157.497 67.6771 145.921 65.5837C145.162 60.9915 143.136 55.7786 138.01 51.9906",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M196.299 76.5312C196.701 73.9782 196.493 72.9953 196.493 72.9953C191.355 74.1043 186.608 68.2739 186.608 68.2739C186.608 68.2739 186.069 68.9505 184.53 71.1014C184.092 71.7572 183.417 72.2199 182.647 72.3938C184.779 79.322 194.065 80.2123 197.546 80.2953C197.287 78.7842 195.996 78.4699 196.299 76.5312Z",fill:"#111111"}),(0,n.jsx)("path",{d:"M50.1339 76.5185C49.7327 73.9655 50.2474 72.9953 50.2474 72.9953C55.3864 74.1043 60.1338 68.2739 60.1338 68.2739C60.1338 68.2739 60.9075 68.3601 62.4436 70.5078C63.0622 71.3742 64.1252 72.1034 64.7661 72.2805C62.6338 79.2071 51.9546 80.1469 48.4731 80.2315C48.7353 78.7252 50.4376 78.4587 50.1339 76.5185Z",fill:"#111111"}),(0,n.jsx)("path",{d:"M92.4349 66.423C89.3116 67.0612 85.6367 68.4813 82.7739 71.6518C85.4385 75.5004 95.1811 88.8078 112.345 91.597C112.332 91.4782 112.306 91.3611 112.268 91.2475C102.753 87.3399 93.4404 76.5057 92.4349 66.423Z",fill:"#111111"}),(0,n.jsx)("path",{d:"M145.288 64.6534C145.883 68.1989 145.72 71.3821 145.64 73.2618C145.376 79.4751 143.092 83.7657 141.337 86.858L141.001 89.0807C148.25 87.375 154.276 75.8371 155.246 69.2344C152.673 67.8351 151.592 65.9267 145.288 64.6534Z",fill:"#111111"}),(0,n.jsx)("path",{d:"M112.147 87.1293C112.147 87.1293 119.037 98.9942 119.751 106.489",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.28078"}),(0,n.jsx)("path",{d:"M140.065 86.8341C140.065 86.8341 137.155 98.5092 137.943 105.997",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.28078"}),(0,n.jsx)("path",{d:"M75.519 83.3046L82.9902 100.761",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M170.363 91.8857L165.272 101.815",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M97.8721 113.494C97.8721 113.494 97.2327 126.485 90.4297 126.182",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M135.926 92.1124C139.584 81.3037 138.163 67.7394 135.692 65.7736C135.195 65.3795 133.701 65.0795 131.629 64.8513C130.763 64.7572 130.085 65.3858 130.085 65.3858L133.157 65.8645C131.787 78.9677 125.929 83.0972 125.929 83.0972C116.381 72.089 105.705 64.7093 105.705 64.7093L106.473 64.1812L105.929 64.1891L101.023 65.8757C101.023 65.8757 119.701 83.1977 125.232 114.805C126.1 119.761 126.687 123.656 127.077 126.712L136.535 126.158C135.117 115.191 133.608 98.9735 135.926 92.1124Z",fill:"#111111"}),(0,n.jsx)("path",{d:"M110.021 57.6935L109.782 61.9043L105.706 64.7094C105.706 64.7094 116.382 72.0891 125.929 83.1116C125.929 83.1116 131.787 78.9774 133.157 65.879L130.085 65.4003",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M104.719 42.5591C103.068 43.0282 99.6715 44.5392 101.043 48.8394C102.231 52.562 105.544 51.9812 107.633 51.1738",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M135.865 27.088C137.449 33.4896 137.91 40.4912 137.889 45.8987Z",fill:"white"}),(0,n.jsx)("path",{d:"M135.865 27.088C137.449 33.4896 137.91 40.4912 137.889 45.8987",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M108.124 41.0033C109.288 41.9431 112.785 47.7448 113.795 50.5227C113.795 50.5227 120.44 47.3044 130.336 45.988C130.336 45.988 135.755 45.463 137.985 45.8683C137.985 45.8683 138.677 56.0467 134.896 61.8053C131.116 67.5639 121.68 67.1905 116.973 64.5498C112.266 61.909 111.378 60.4937 109.985 57.2403C108.591 53.9868 104.491 41.7277 104.491 41.7277L108.124 41.0033Z",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M105.554 43.4957C105.554 43.4957 102.061 39.1795 100.372 34.4693C98.7733 30.0414 100.33 25.0264 104.254 22.5022C107.538 20.3912 110.268 21.4315 110.268 21.4315C110.268 21.4315 105.859 15.4863 110.762 9.21389C111.612 8.12127 112.679 7.21514 113.896 6.55192C115.112 5.8887 116.453 5.48259 117.833 5.35889C124.615 4.77649 127.358 10.3324 127.358 10.3324C127.358 10.3324 133.076 -3.9946 148.813 2.26819C150.4 2.90643 152.337 4.94882 153.316 6.36572C159.249 14.9597 144.321 27.6863 136.011 29.5213C126.884 31.5349 121.305 30.6095 118.073 28.6628C120.437 29.7542 119.529 44.0589 105.554 43.4957Z",fill:"#111111"}),(0,n.jsx)("path",{d:"M129.51 39.6072L131.518 48.3097L128.936 48.8952",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.28078"}),(0,n.jsx)("path",{d:"M132.935 43.1001C133.427 43.0452 133.756 42.3745 133.669 41.602C133.583 40.8296 133.114 40.2479 132.622 40.3029C132.129 40.3578 131.801 41.0285 131.887 41.801C131.974 42.5734 132.443 43.155 132.935 43.1001Z",fill:"#111111"}),(0,n.jsx)("path",{d:"M124.413 43.6668C124.905 43.6118 125.234 42.9411 125.148 42.1687C125.061 41.3962 124.592 40.8146 124.1 40.8695C123.607 40.9245 123.279 41.5952 123.365 42.3676C123.452 43.14 123.921 43.7217 124.413 43.6668Z",fill:"#111111"}),(0,n.jsx)("path",{d:"M121.096 40.0013C121.096 40.0013 124.742 39.7843 124.695 37.3525",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.28078"}),(0,n.jsx)("path",{d:"M131.589 33.8726C131.589 33.8726 133.987 32.9295 134.837 34.9049",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.28078"}),(0,n.jsx)("path",{d:"M128.719 52.7758C127.439 53.0096 126.136 53.0958 124.836 53.0327C124.037 52.9992 123.431 53.4922 123.668 53.9901C124.082 54.8645 125.071 55.9048 127.421 55.632C129.735 55.3575 130.197 54.29 130.192 53.4683C130.189 52.9737 129.443 52.6338 128.719 52.7758Z",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M150.058 106.388C149.721 106.388 149.391 106.488 149.11 106.676C148.829 106.863 148.61 107.129 148.481 107.44C148.352 107.752 148.318 108.094 148.384 108.425C148.45 108.755 148.612 109.059 148.851 109.297C149.09 109.536 149.394 109.698 149.725 109.764C150.056 109.83 150.4 109.796 150.712 109.667C151.023 109.538 151.29 109.319 151.478 109.039C151.665 108.759 151.765 108.429 151.765 108.092C151.765 107.641 151.585 107.207 151.265 106.888C150.945 106.568 150.511 106.389 150.058 106.388Z",fill:"#111111"}),(0,n.jsx)("path",{d:"M144.561 118.376C144.108 118.376 143.674 118.556 143.354 118.875C143.034 119.195 142.854 119.628 142.854 120.08C142.854 120.532 143.034 120.966 143.354 12
111.285C143.674 121.605 144.108 121.784 144.561 121.784H144.569C145.022 121.783 145.456 121.603 145.775 121.283C146.095 120.962 146.273 120.528 146.272 120.076C146.271 119.624 146.09 119.191 145.769 118.873C145.449 118.554 145.014 118.375 144.561 118.376Z",fill:"#111111"}),(0,n.jsx)("path",{d:"M188.445 102.73H142.09V114.309L133.583 114.451L133.639 126.03L182.767 125.797L182.711 114.309H188.45L188.445 102.73ZM146.455 121.95C146.21 122.201 145.918 122.401 145.595 122.538C145.272 122.675 144.925 122.746 144.574 122.748H144.561C143.854 122.75 143.175 122.471 142.674 121.973C142.173 121.475 141.89 120.799 141.889 120.093C141.887 119.387 142.166 118.71 142.665 118.209C143.164 117.709 143.841 117.427 144.548 117.425H144.561C145.085 117.427 145.598 117.583 146.034 117.874C146.47 118.165 146.81 118.578 147.012 119.061C147.214 119.544 147.269 120.075 147.17 120.589C147.071 121.103 146.822 121.577 146.455 121.95ZM150.058 110.751C149.531 110.751 149.015 110.595 148.577 110.302C148.138 110.01 147.797 109.594 147.595 109.108C147.393 108.621 147.34 108.086 147.443 107.57C147.546 107.054 147.8 106.58 148.173 106.207C148.546 105.835 149.021 105.582 149.538 105.479C150.055 105.376 150.591 105.429 151.079 105.63C151.566 105.832 151.982 106.173 152.275 106.611C152.568 107.048 152.724 107.563 152.724 108.089C152.724 108.795 152.444 109.473 151.944 109.972C151.444 110.472 150.766 110.753 150.058 110.754V110.751ZM157.493 122.959L157.462 116.736L159.483 116.726L159.511 122.949L157.493 122.959ZM159.994 105.099H162.015V111.322H159.994V105.099ZM160.416 122.944L160.386 116.722L181.965 116.619L181.995 122.842L160.416 122.944ZM184.5 111.316H162.921V105.093H184.5V111.316Z",fill:"#111111"}),(0,n.jsx)("path",{d:"M176.861 122.158L176.839 117.538",stroke:"#6D6D6D",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M174.484 122.169L174.462 117.55",stroke:"#6D6D6D",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M172.107 122.18L172.085 117.561",stroke:"#6D6D6D",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M169.478 110.537V105.918",stroke:"#6D6D6D",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M181.743 110.537V105.918",stroke:"#6D6D6D",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M167.101 110.537V105.918",stroke:"#6D6D6D",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M164.724 110.537V105.918",stroke:"#6D6D6D",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M237.091 85.8417H179.683V126.262H237.091V85.8417Z",fill:"#6D6D6D"}),(0,n.jsx)("path",{d:"M211.893 85.9342V126.493Z",fill:"#6D6D6D"}),(0,n.jsx)("path",{d:"M211.893 85.9342V126.493",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M204.164 90.319H230.14",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M219.88 104.841H236.569",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M201.567 118.389H234.103",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M206.113 101.211H189.294",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M179.747 94.8569H189.943",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M179.683 113.527H199.618",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M179.596 94.9207C175.309 96.6056 179.725 99.4251 179.725 99.4251C179.725 99.4251 180.83 96.2338 186.479 94.9334L179.596 94.9207Z",fill:"#6D6D6D",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M237.259 104.774C241.544 106.459 237.127 109.28 237.127 109.28C237.127 109.28 236.025 106.088 230.374 104.786L237.259 104.774Z",fill:"#6D6D6D",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M194.749 113.556C194.749 113.556 184.802 115.429 185.048 121.271C185.048 121.271 177.075 118.351 179.773 
11113.556H194.749Z",fill:"#6D6D6D",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.960582"}),(0,n.jsx)("path",{d:"M-0.0473633 126.212H269.291",stroke:"#111111",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.28078"})]})}},8878:function(e,t,r){"use strict";r.d(t,{jD:function(){return h},rU:function(){return c},tv:function(){return p}});var n=r(53795),s=r(87366),a=r(13307),i=r(2265);let o=(0,s.R)({locales:a.k1,localePrefix:"as-needed",defaultLocale:a.al,localeDetection:!1,localeCookie:!1}),l=(0,n.os)(o).Link,c=(0,i.forwardRef)(function(e,t){let{prefetch:r=!1,target:n="_blank",...s}=e;return(0,i.createElement)(l,{...s,prefetch:r,target:n,ref:t})}),{getPathname:d,redirect:u,usePathname:h,useRouter:p}=(0,n.os)(o)},33671:function(e,t,r){"use strict";r.d(t,{$k:function(){return s},J3:function(){return f},KF:function(){return c},_K:function(){return p},_z:function(){return x},ed:function(){return m},ey:function(){return h},i0:function(){return w},kP:function(){return g},mz:function(){return d},nB:function(){return o},qP:function(){return l},uu:function(){return b},x1:function(){return k},xb:function(){return u},xi:function(){return a},zh:function(){return i}}),r(83079);var n=r(12119);(0,n.$)("8fbd7644bffbd6fd3c52e2410f6ea84f39762fb9"),(0,n.$)("6daf9fb041f84b35ea3cead83cd54cd866e50fe9");var s=(0,n.$)("57dd107b4a645827f7a3e86cff6cbcd320982e3d"),a=(0,n.$)("51a5ed61cead7cc3ab74a14a0b5281d009067445");(0,n.$)("6225c5fea90e545f9830f5c8537e20646abd9be5"),(0,n.$)("39587292107d874a385f846f9b097327d7b12dd4");var i=(0,n.$)("be3ea3a79b0f600cf1f0e38a2b2a3d46b467b485"),o=(0,n.$)("fb319cf9c690454f4c553eaddc0300e05ff1d063"),l=(0,n.$)("8083fc03ab6588968dbfd19cefcd55b62ed09ed1"),c=(0,n.$)("1509ea89d7140ed7e30be1c772a68c0fcbb105c3"),d=(0,n.$)("9eba3e53e08bce74eb43981a526cdc62b80d9653"),u=(0,n.$)("7ea2386de1d0ffe502b59d0f2e2d9b46d7f8c962"),h=(0,n.$)("7a6a6186ca7342fef5bf6e4b137eaa6d39de87e8"),p=(0,n.$)("73f3cf645e4f6a9bb7e640718c3bda6e3504ed88"),f=(0,n.$)("56d8e57a298995800682acbd801da5f30a7c2e52"),m=(0,n.$)("e7372337eb1f72c8875aa66ac8e5f8030c34cb6e"),g=(0,n.$)("0ab771b5395c6a335537e938c80369501f4f3c3d"),x=(0,n.$)("77855e6297e2d4048dc8030801017c82589c6cfd"),b=(0,n.$)("a72f1af267ade82a8e5b2d85310dbd407ef84276"),k=(0,n.$)("c3bda410351a218d868bdff96f2b099c8512424e");(0,n.$)("9523a3afa281b6e232e4f6e88a1edd297d2a806c"),(0,n.$)("fcb267e2b45d65169c7f5d334fc0be2205b59c8f");var w=(0,n.$)("092099eafaeabd624fed1c5f50241b3c116a941b")},64269:function(e,t,r){"use strict";r.d(t,{X:function(){return a}});var n=r(40257),s=r(96434).Buffer;let a={isDev:!1,appGenerator:"MasterMao",appGeneratorUrl:"https://twitter.com/maomaoyu_coffee",siteUrl:"https://top4ai.com",siteBackLinkName:"Top AI Tools",siteName:"Top4 AI Tools",siteNameMD:"Top4 AI Tools",siteNameSM:"Top4 AI",siteNameFooter:"猫猫鱼 Top4 AI工具窝",openGraph:{type:"website",locale:"en_US",url:"https://top4ai.com",images:[{url:"/og.png",width:1200,height:630,alt:"Top 4 AI Tools: Save Time & Find the Best AI"}],title:"Top 4 AI Tools List",description:"MaoMaoYu Top 4 AI Tools is a leading AI directory and search engine. We provide a comprehensive and curated list of the top AI tools available across various categories, making it easy for users to discover, compare, and select the right AI solutions for their specific needs. From image generation to text processing, our directory helps you navigate the complex world of AI.",siteName:"Top 4 AI Tools List"},suggestionSiteId:"search-feedback",nextThemeColor:"light",utmSource:"?utm_source=top4ai.com",friendLink:[{label:"Master Tools",url:"https://tool.mastermao.com"},{label:"Free Invoice Generator",url:"https://www.getinvoify.com"}],debugClerk:"true"===n.env.CLERK_DEBUG,manageUsers:("user_2pC6b7H0Y5FTeJtW8UTTMQVYF6i".split(",")||[]).filter(Boolean),mongoUri:n.env.MONGODB_URI||"",mongoServerSelectionTimeout:12e3,mongoPoolWaitTimeout:12e3,mongoMaxConnecting:2,mongoSocketTimeout:2e4,mongoReadMaxTime:8e3,imageStorage:"s3",minioBase:n.env.MINIO_BASE||"",minioBucket:n.env.MINIO_BUCKET||"",minioEndPoint:n.env.MINIO_ENDPOINT||"",minioPort:parseInt(n.env.MINIO_PORT,10),minioUseSSL:"true"===n.env.MINIO_SSL,minioAccessKey:n.env.MINIO_ACCESS_KEY||"",minioSecretKey:n.env.MINIO_SECERT_KEY||"",s3FolderName:n.env.S3_FOLDER_NAME||"",s3Base:n.env.S3_BASE||"",s3Region:n.env.S3_REGION||"",s3Bucket:n.env.S3_BUCKET||"",s3AccessKey:n.env.S3_ACCESS_KEY_ID||"",s3Secert:n.env.S3_ACCESS_SECERT||"",s3CustomDomain:n.env.S3_CUSTOM_DOMAIN||"",cosBase:n.env.COS_BASE||"",cosRegion:n.env.COS_REGION||"",cosBucket:n.env.COS_BUCKET||"",cosSecertId:n.env.COS_SECERT_ID||"",cosSecertKey:n.env.COS_SECERT_KEY||"",crawlerGateway:n.env.CRAWLER_GATEWAY||"",crawlerAuthUser:n.env.CRAWLER_AUTH_USER||"",crawlerAuthPassword:n.env.CRAWLER_AUTH_PASSWORD||"",requestTimeout:12e3,googleAnalyticsID:"G-YE588NNHWT",get crawlerAuthToken(){return s.from("".concat(this.crawlerAuthUser,":").concat(this.crawlerAuthPassword),"utf8").toString("base64")}}},35592:function(e,t,r){"use strict";r.d(t,{CP:function(){return u},K8:function(){return m},Ni:function(){return d},VA:function(){return g},_l:function(){return l},a3:function(){return c},k4:function(){return h},uu:function(){return p},yr:function(){return f}});var n=r(49360),s=r(26202);class a extends s.ZP{constructor(){super("FavoritesDB"),this.version(4).stores({favorites:"siteId, categoryId,order",categories:"id, name, order, favoritesCount"}).upgrade(async e=>{let t=await e.table("categories").toArray(),r=(await e.table("favorites").toArray()).reduce((e,t)=>
11(e[t.categoryId]=(e[t.categoryId]||0)+1,e),{});await Promise.all(t.map(t=>e.table("categories").update(t.id,{favoritesCount:r[t.id]||0})))}),this.favorites=this.table("favorites"),this.categories=this.table("categories")}}class i{init(){window.indexedDB?this.db=new a:this.useLocalStorage=!0}async getFavorites(){try{if(this.useLocalStorage){let e=localStorage.getItem("maomaoyu_favorites");if(e&&e.length>5242880)return console.warn("Favorites storage exceeds 5MB"),[];return e?JSON.parse(e):[]}if(!this.db)throw Error("Database not initialized");return await this.db.favorites.toArray()}catch(e){return console.error("Failed to get favorites:",e),[]}}async addFavorite(e){try{if(this.useLocalStorage){let t=await this.getFavorites(),r=t.reduce((e,t)=>Math.max(e,t.order||0),0);t.push({...e,order:r+1,createdAt:Date.now()});let n=JSON.stringify(t);if(n.length>5242880)throw Error("Favorites storage limit exceeded");localStorage.setItem("maomaoyu_favorites",n)}else{if(!this.db)throw Error("Database not initialized");let t=(await this.db.favorites.toArray()).reduce((e,t)=>Math.max(e,t.order||0),0);await this.db.transaction("rw",this.db.favorites,this.db.categories,async()=>{await this.db.favorites.put({...e,order:t+1,createdAt:Date.now()}),await this.db.categories.where("id").equals(e.categoryId).modify(e=>{e.favoritesCount=(e.favoritesCount||0)+1})})}}catch(e){throw console.error("Failed to add favorite:",e),e}}async removeFavorite(e){try{if(this.useLocalStorage){let t=(await this.getFavorites()).filter(t=>t.siteId!==e);localStorage.setItem("maomaoyu_favorites",JSON.stringify(t))}else{if(!this.db)throw Error("Database not initialized");await this.db.transaction("rw",this.db.favorites,this.db.categories,async()=>{let t=await this.db.favorites.get(e);t&&(await this.db.favorites.delete(e),await this.db.categories.where("id").equals(t.categoryId).modify(e=>{e.favoritesCount=Math.max(0,(e.favoritesCount||0)-1)}))})}}catch(e){throw console.error("Failed to remove favorite:",e),e}}async getCategories(){try{let e;if(this.useLocalStorage){let t=localStorage.getItem("maomaoyu_categories");try{e=t?JSON.parse(t):[]}catch(e){return console.error("Failed to parse categories from localStorage",e),[]}}else{if(!this.db)throw Error("Database not initialized");e=await this.db.categories.toArray()}return e.sort((e,t)=>(e.order||0)-(t.order||0))}catch(e){return console.error("Failed to get categories:",e),[]}}async createCategory(e){if(!e||"string"!=typeof e||0===e.trim().length)throw Error("Category name is required");let t={id:(0,n.Z)(),name:e.trim(),order:0,favoritesCount:0};try{if(this.useLocalStorage){let e=await this.getCategories(),r=e.reduce((e,t)=>Math.max(e,t.order||0),0);t.order=r+1,e.push(t),localStorage.setItem("maomaoyu_categories",JSON.stringify(e))}else{if(!this.db)throw Error("Database not initialized");await this.db.transaction("rw",this.db.categories,async()=>{let e=(await this.db.categories.toArray()).reduce((e,t)=>Math.max(e,t.order||0),0);t.order=e+1,await this.db.categories.put(t)})}return t}catch(e){throw console.error("Failed to create category:",e),Error("Failed to create category")}}async deleteCategory(e){if(this.useLocalStorage){let t=(await this.getCategories()).filter(t=>t.id!==e);localStorage.setItem("maomaoyu_categories",JSON.stringify(t));let r=(await this.getFavorites()).filter(t=>t.categoryId!==e);localStorage.setItem("maomaoyu_favorites",JSON.stringify(r))}else await Promise.all([this.db.categories.delete(e),this.db.favorites.where({categoryId:e}).delete()])}async updateCategory(e,t){if(this.useLocalStorage){let r=(await this.getCategories()).map(r=>r.id===e?{...r,name:t,favoritesCount:r.favoritesCount}:r);localStorage.setItem("maomaoyu_categories",JSON.stringify(r))}else{let r=await this.db.categories.get(e);r&&await this.db.categories.update(e,{name:t,favoritesCount:r.favoritesCount})}}async updateCategoryOrder(e){if(this.useLocalStorage){let t=await this.getCategories(),r=e.map((e,r)=>{let n=t.find(t=>t.id===e);return n?{...n,order:r}:null}).filter(Boolean);localStorage.setItem("maomaoyu_categories",JSON.stringify(r))}else{if(!this.db)throw Error("Database not initialized");let t=e.map((e,t)=>({key:e,changes:{order:t}}));await this.db.categories.bulkUpdate(t)}}async updateFavoriteOrder(e){if(this.useLocalStorage){let t=await this.getFavorites(),r=e.map((e,r)=>{let n=t.find(t=>t.siteId===e);return n?{...n,order:r}:null}
11).filter(Boolean);localStorage.setItem("maomaoyu_favorites",JSON.stringify(r))}else{if(!this.db)throw Error("Database not initialized");let t=e.map((e,t)=>({key:e,changes:{order:t}}));await this.db.favorites.bulkUpdate(t)}}constructor(){this.db=null,this.useLocalStorage=!1,this.init()}}let o=new i,l=async()=>await o.getFavorites(),c=async e=>await o.addFavorite(e),d=async e=>await o.removeFavorite(e),u=async()=>await o.getCategories(),h=async e=>await o.createCategory(e),p=async e=>await o.deleteCategory(e),f=async(e,t)=>await o.updateCategory(e,t),m=async e=>await o.updateCategoryOrder(e),g=async e=>await o.updateFavoriteOrder(e)},70082:function(e,t,r){"use strict";r.d(t,{XP:function(){return n},jJ:function(){return s}});let n=[{code:"en",name:"English",nativeName:"\uD83C\uDDFA\uD83C\uDDF8 English",enabled:!0},{code:"zh-TW",name:"Chinese Traditional",nativeName:"\uD83C\uDDE8\uD83C\uDDF3 中文繁體",enabled:!0},{code:"zh",name:"Chinese Simplified",nativeName:"\uD83C\uDDE8\uD83C\uDDF3 中文简体",enabled:!0},{code:"ar",name:"Arabic",nativeName:"\uD83C\uDDE6\uD83C\uDDEA العربية",enabled:!0},{code:"de",name:"German",nativeName:"\uD83C\uDDE9\uD83C\uDDEA Deutsch",enabled:!0},{code:"es",name:"Spanish",nativeName:"\uD83C\uDDEA\uD83C\uDDF8 Espa\xf1ol",enabled:!0},{code:"fr",name:"French",nativeName:"\uD83C\uDDEB\uD83C\uDDF7 Fran\xe7ais",enabled:!0},{code:"id",name:"Indonesian",nativeName:"\uD83C\uDDEE\uD83C\uDDE9 Bahasa Indonesia",enabled:!0},{code:"it",name:"Italian",nativeName:"\uD83C\uDDEE\uD83C\uDDF9 Italiano",enabled:!0},{code:"ja",name:"Japanese",nativeName:"\uD83C\uDDEF\uD83C\uDDF5 日本語",enabled:!0},{code:"ko",name:"Korean",nativeName:"한국어",enabled:!0},{code:"ms",name:"Malay",nativeName:"\uD83C\uDDF2\uD83C\uDDFE Bahasa Melayu",enabled:!0},{code:"pt",name:"Portuguese",nativeName:"\uD83C\uDDF5\uD83C\uDDF9 Portugu\xeas",enabled:!0},{code:"ru",name:"Russian",nativeName:"\uD83C\uDDF7\uD83C\uDDFA Русский",enabled:!0},{code:"vi",name:"Vietnamese",nativeName:"\uD83C\uDDFB\uD83C\uDDF3 Tiếng Việt",enabled:!0},{code:"th",name:"Thai",nativeName:"\uD83C\uDDF9\uD83C\uDDED ไทย",enabled:!0},{code:"hi",name:"Hindi",nativeName:"\uD83C\uDDEE\uD83C\uDDF3 हिन्दी",enabled:!0},{code:"nl",name:"Dutch",region:"荷兰",nativeName:"\uD83C\uDDF3\uD83C\uDDF1 Nederlands",enabled:!1}
11,{code:"pl",name:"Polish",region:"波兰",nativeName:"\uD83C\uDDF5\uD83C\uDDF1 Polski",enabled:!1},{code:"se",name:"Swedish",region:"瑞典",nativeName:"\uD83C\uDDF8\uD83C\uDDEA Svenska",enabled:!1},{code:"cz",name:"Czech",region:"捷克",nativeName:"\uD83C\uDDE8\uD83C\uDDFF Čeština",enabled:!1},{code:"el",name:"Greek",region:"希腊",nativeName:"\uD83C\uDDEC\uD83C\uDDF7 Ελληνικά",enabled:!1},{code:"dk",name:"Danish",region:"丹麦",nativeName:"\uD83C\uDDE9\uD83C\uDDF0 Dansk",enabled:!1},{code:"fi",name:"Finnish",region:"芬兰",nativeName:"\uD83C\uDDEB\uD83C\uDDEE Suomi",enabled:!1},{code:"no",name:"Norwegian",region:"挪威",nativeName:"\uD83C\uDDF3\uD83C\uDDF4 Norsk",enabled:!1},{code:"ro",name:"Romanian",region:"罗马尼亚",nativeName:"\uD83C\uDDF7\uD83C\uDDF4 Rom\xe2nă",enabled:!1},{code:"ph",name:"Filipino",region:"菲律宾",nativeName:"\uD83C\uDDF5\uD83C\uDDED Filipino",enabled:!1},{code:"tr",name:"Turkish",region:"土耳其",nativeName:"\uD83C\uDDF9\uD83C\uDDF7 T\xfcrk\xe7e",enabled:!1}].filter(e=>e.enabled);function s(){return n.map(e=>e.code)}},13307:function(e,t,r){"use strict";r.d(t,{al:function(){return a},k1:function(){return s},ul:function(){return n}});let n=r(70082).XP.map(e=>({code:e.code,name:e.nativeName})),s=n.map(e=>e.code);n.map(e=>e.name);let a="en"},41887:function(e,t,r){"use strict";r.d(t,{Fh:function(){return o},P8:function(){return d},XA:function(){return h},a0:function(){return g},cT:function(){return i},pD:function(){return p},r1:function(){return l},r2:function(){return u},sA:function(){return f}});var n=r(26202);class s extends n.ZP{constructor(){super("PromptDatabase"),this.version(1).stores({prompts:"\n        id,\n        title,\n        content,\n        description,\n        categoryId,\n        tags,\n        rating,\n        createdAt,\n        updatedAt,\n        usageCount,\n        currentVersionId,\n        currentVersionNumber,\n        branches,\n        templateId,\n        [categoryId+rating],\n        [categoryId+updatedAt]\n      ",categories:"\n        id,\n        name,\n        order,\n        promptCount,\n        parentId,\n        [parentId+order]\n      ",images:"\n        id,\n        promptId,\n        createdAt,\n        updatedAt\n      ",promptVersions:"\n        id,\n        promptId,\n        version,\n        createdAt,\n        updatedAt,\n        [promptId+version],\n        [promptId+createdAt]\n      "})}}let a=new s,i=async(e,t)=>{let r=crypto.randomUUID(),n=Date.now(),s=new Blob([await t.arrayBuffer()],{type:t.type}),i=await a.images.add({id:r,promptId:e,data:s,createdAt:n,updatedAt:n});return a.images.get(i)},o=async e=>{let t=crypto.randomUUID(),r=crypto.randomUUID(),n=Date.now(),s="1.0.0";return a.transaction("rw",a.prompts,a.promptVersions,async()=>{let{title:i,tags:o,categoryId:l,usageCount:c}=e;return await a.promptVersions.add({id:r,promptId:t,version:s,content:e.content,description:e.description||"",author:"",title:i,categoryId:l,tags:o,usageCount:c,metadata:{},createdAt:n,updatedAt:n}),await a.prompts.add({...e,id:t,createdAt:n,updatedAt:n,currentVersionId:r,currentVersionNumber:s,branches:[],usageCount:0,author:"",versionIdHistory:[r]}),t})},l=async e=>a.prompts.get(e),c=async(e,t)=>{let{id:r,version:n,...s}=t,i={currentVersionId:t.id,currentVersionNumber:t.version,updatedAt:Date.now(),...s};return a.prompts.update(e,i)},d=async(e,t)=>{let[r,n]=await Promise.all([a.prompts.offset((e-1)*t).limit(t).toArray().then(e=>e.map(e=>{let{content:t,...r}=e;return r})),a.prompts.count()]);return{prompts:r,total:n}},u=async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=Date.now(),s=crypto.randomUUID();return a.transaction("rw",a.prompts,a.promptVersions,async()=>{var i;let o=await a.prompts.get(e);if(!o)throw Error("Prompt not found");let l="0.0.0";if(null===(i=o.versionIdHistory)||void 0===i?void 0:i.length){let e=o.versionIdHistory[o.versionIdHistory.length-1],t=await a.promptVersions.get(e);t&&(l=t.version)}let[d,u,h]=l.split(".").map(Number),p=r?"".concat(d+1,".0.0"):"".concat(d,".").concat(u+1,".").concat(h),{tags:f,categoryId:m}=o,g={id:s,promptId:e,version:p,title:t.title,content:t.content,description:t.description,author:t.author||"",categoryId:m,tags:f,usageCount:0,metadata:t.metadata,createdAt:n,updatedAt:n},x={id:s,version:p,versionIdHistory:[...o.versionIdHistory||[],s],title:t.title,content:t.content,description:t.description,author:t.author||"",categoryId:m,tags:f};return await Promise.all([a.promptVersions.add(g),c(e,x)]),{id:s,version:p}})},h=async(e,t,r)=>{let n=Date.now();return a.transaction("rw",a.prompts,a.promptVersions,async()=>{let[s,i]=await Promise.all([a.prompts.get(e),a.promptVersions.get(t)]);if(!i)throw Error("Version not found");if(!s)throw Error("Prompt not found");let[o,l,d]=i.version.split(".").map(Number),u="".concat(o,".").concat(l+1,".").concat(d),h={...r,version:u,updatedAt:n},p=[a.promptVersions.update(t,h)];return s.currentVersionId===t&&p.push(c(e,h)),await Promise.all(p),{...i,...h}})},p=async(e,t)=>a.transaction("rw",a.prompts,a.promptVersions,async()=>{let[r,n]=await Promise.all([a.prompts.get(e),a.promptVersions.get(t)]);if(!r)throw Error("Prompt not found");if(!n)throw Error("Version not found");let s=r.versionIdHistory.filter(e=>e!==t);if(r.currentVersionId===t){if(s.length>0){let t=s[0],r=await a.promptVersions.get(t);if(!r)throw Error("Latest version not found while deleting current version.");await a.prompts.update(e,{currentVersionId:r.id,currentVersionNumber:r.version,versionIdHistory:s,updatedAt:Date.now()})}else await a.prompts.update(e,{currentVersionId:"",currentVersionNumber:"",versionIdHistory:[],updatedAt:Date.now()})}else await a.prompts.update(e,{versionIdHistory:s,updatedAt:Date.now()});await a.promptVersions.delete(t)}),f=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"createdAt",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=await a.promptVersions.where("promptId").equals(e).toArray();switch(t){case"createdAt":return n.sort((e,t)=>
11r?e.createdAt-t.createdAt:t.createdAt-e.createdAt);case"updatedAt":return n.sort((e,t)=>r?e.updatedAt-t.updatedAt:t.updatedAt-e.updatedAt);case"version":return n.sort((e,t)=>{let n=m(e.version,t.version);return r?n:-n});default:return n}},m=(e,t)=>{let r=e.split(".").map(Number),n=t.split(".").map(Number);for(let e=0;e<Math.max(r.length,n.length);e++){let t=r[e]||0,s=n[e]||0;if(t>s)return 1;if(t<s)return -1}return 0},g=async(e,t)=>a.transaction("rw",a.prompts,a.promptVersions,async()=>{if(!await a.prompts.get(e))throw Error("Prompt not found");let r=await a.promptVersions.get(t);if(!r)throw Error("Version not found");return await c(e,r),r})},93448:function(e,t,r){"use strict";r.d(t,{cn:function(){return a},p:function(){return i}});var n=r(40334),s=r(2997);function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,s.m6)((0,n.W)(t))}function i(e){let t=new Date(e);return"".concat(t.getFullYear(),"-").concat(String(t.getMonth()+1).padStart(2,"0"),"-").concat(String(t.getDate()).padStart(2,"0")," ").concat(String(t.getHours()).padStart(2,"0"),":").concat(String(t.getMinutes()).padStart(2,"0"))}},15599:function(e){e.exports={style:{fontFamily:"'__Istok_Web_aa6995', '__Istok_Web_Fallback_aa6995'",fontWeight:700,fontStyle:"normal"},className:"__className_aa6995"}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.