icms-api 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/icms-api.cjs.js +2 -2
- package/dist/icms-api.cjs.js.map +1 -1
- package/dist/icms-api.es.js +306 -367
- package/dist/icms-api.es.js.map +1 -1
- package/dist/icms-api.umd.js +2 -2
- package/dist/icms-api.umd.js.map +1 -1
- package/dist/types/router.d.ts +1 -1
- package/dist/types/server.d.ts +5 -3
- package/package.json +3 -2
package/dist/icms-api.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`pino`);c=s(c);let l=require(`pino-pretty`);l=s(l);let u=require(`js-md5`);u=s(u);let d=require(`crypto-js`);d=s(d),require(`h3`);var f={GENERAL:0,PHONE:1,EMAIL:2},p={TYPE_MGT:0,TYPE_C:1,TYPE_B:2},m={FROM_WEB:1,FROM_PC:2,FROM_WX_MINI_PRO:3,FROM_WX_PLU:4,FROM_WX_E:5,FROM_APP:6,FROM_DEVICE:7},h={unknown:0,male:1,female:2},g=(0,l.default)({colorize:!0,destination:process.stdout,translateTime:`SYS:yyyy-mm-dd HH:MM:ss`,ignore:`pid,hostname`,messageFormat:`{msg}`,singleLine:!0}),_=(0,c.default)({name:process.env.APP_NAME??`iBoot`,level:process.env.APP_ENV===`production`?`info`:`debug`,nestedKey:`payload`},g),v=e=>Array.isArray(e)||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Array]`,y=e=>{let t=e||32,n=``;for(let e=0;e<t;e++)n+=`ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678`.charAt(Math.floor(Math.random()*48));return n},b=(e,t)=>{let n={};return e.split(`&`).forEach(e=>{let r=e.split(`=`);r[1]&&(!t||t.indexOf(r[0])==-1)&&(n[r[0]]=r[1])}),n},x=e=>!e||e==``||e.length==0?``:encodeURIComponent(e).replace(/\(/g,`%28`).replace(/\)/g,`%29`).replace(/\'/g,`%27`).replace(/\!/g,`%21`).replace(/\~/g,`%7E`),S=(e,t)=>{let n={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};if(/(y+)/.test(t)){let n=new RegExp(/(y+)/).exec(t),r=0;n&&n.length>0&&(r=n[0].length),t=t.replace(/(y+)/,e.getFullYear()+``).substring(4-r)}for(let e in n){let r=`(`+e+`)`,i=new RegExp(r);if(i.test(t)){let r=i.exec(t),a=0;r&&r.length>0&&(a=r[0].length),t=t.replace(i,a==1?n[e].toString():(`00`+n[e]).substring(n[e].toString().length))}}return t},C={exports:{}},w={},T={},E={},ee;function te(){return ee||(ee=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`detectDomainLocale`,{enumerable:!0,get:function(){return t}});function t(e,t,n){if(e){n&&=n.toLowerCase();for(let i of e){var r;if(t===i.domain?.split(`:`,1)[0].toLowerCase()||n===i.defaultLocale.toLowerCase()||(r=i.locales)!=null&&r.some(e=>e.toLowerCase()===n))return i}}}})(E)),E}var D={},O={},ne;function k(){return ne||(ne=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`removeTrailingSlash`,{enumerable:!0,get:function(){return t}});function t(e){return e.replace(/\/$/,``)||`/`}})(O)),O}var A={},j={},M;function N(){return M||(M=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`parsePath`,{enumerable:!0,get:function(){return t}});function t(e){let t=e.indexOf(`#`),n=e.indexOf(`?`),r=n>-1&&(t<0||n<t);return r||t>-1?{pathname:e.substring(0,r?n:t),query:r?e.substring(n,t>-1?t:void 0):``,hash:t>-1?e.slice(t):``}:{pathname:e,query:``,hash:``}}})(j)),j}var P;function F(){return P||(P=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`addPathPrefix`,{enumerable:!0,get:function(){return n}});let t=N();function n(e,n){if(!e.startsWith(`/`)||!n)return e;let{pathname:r,query:i,hash:a}=(0,t.parsePath)(e);return``+n+r+i+a}})(A)),A}var I={},re;function L(){return re||(re=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`addPathSuffix`,{enumerable:!0,get:function(){return n}});let t=N();function n(e,n){if(!e.startsWith(`/`)||!n)return e;let{pathname:r,query:i,hash:a}=(0,t.parsePath)(e);return``+r+n+i+a}})(I)),I}var R={},z={},B;function V(){return B||(B=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`pathHasPrefix`,{enumerable:!0,get:function(){return n}});let t=N();function n(e,n){if(typeof e!=`string`)return!1;let{pathname:r}=(0,t.parsePath)(e);return r===n||r.startsWith(n+`/`)}})(z)),z}var ie;function H(){return ie||(ie=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`addLocale`,{enumerable:!0,get:function(){return r}});let t=F(),n=V();function r(e,r,i,a){if(!r||r===i)return e;let o=e.toLowerCase();return!a&&((0,n.pathHasPrefix)(o,`/api`)||(0,n.pathHasPrefix)(o,`/`+r.toLowerCase()))?e:(0,t.addPathPrefix)(e,`/`+r)}})(R)),R}var U;function ae(){return U||(U=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`formatNextPathnameInfo`,{enumerable:!0,get:function(){return a}});let t=k(),n=F(),r=L(),i=H();function a(e){let a=(0,i.addLocale)(e.pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix);return(e.buildId||!e.trailingSlash)&&(a=(0,t.removeTrailingSlash)(a)),e.buildId&&(a=(0,r.addPathSuffix)((0,n.addPathPrefix)(a,`/_next/data/`+e.buildId),e.pathname===`/`?`index.json`:`.json`)),a=(0,n.addPathPrefix)(a,e.basePath),!e.buildId&&e.trailingSlash?a.endsWith(`/`)?a:(0,r.addPathSuffix)(a,`/`):(0,t.removeTrailingSlash)(a)}})(D)),D}var W={},oe;function se(){return oe||(oe=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`getHostname`,{enumerable:!0,get:function(){return t}});function t(e,t){let n;if(t?.host&&!Array.isArray(t.host))n=t.host.toString().split(`:`,1)[0];else if(e.hostname)n=e.hostname;else return;return n.toLowerCase()}})(W)),W}var G={},K={},ce;function le(){return ce||(ce=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`normalizeLocalePath`,{enumerable:!0,get:function(){return t}});function t(e,t){let n,r=e.split(`/`);return(t||[]).some(t=>r[1]&&r[1].toLowerCase()===t.toLowerCase()?(n=t,r.splice(1,1),e=r.join(`/`)||`/`,!0):!1),{pathname:e,detectedLocale:n}}})(K)),K}var ue={},q;function J(){return q||(q=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`removePathPrefix`,{enumerable:!0,get:function(){return n}});let t=V();function n(e,n){if(!(0,t.pathHasPrefix)(e,n))return e;let r=e.slice(n.length);return r.startsWith(`/`)?r:`/`+r}})(ue)),ue}var Y;function de(){return Y||(Y=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`getNextPathnameInfo`,{enumerable:!0,get:function(){return i}});let t=le(),n=J(),r=V();function i(e,i){let{basePath:a,i18n:o,trailingSlash:s}=i.nextConfig??{},c={pathname:e,trailingSlash:e===`/`?s:e.endsWith(`/`)};a&&(0,r.pathHasPrefix)(c.pathname,a)&&(c.pathname=(0,n.removePathPrefix)(c.pathname,a),c.basePath=a);let l=c.pathname;if(c.pathname.startsWith(`/_next/data/`)&&c.pathname.endsWith(`.json`)){let e=c.pathname.replace(/^\/_next\/data\//,``).replace(/\.json$/,``).split(`/`);c.buildId=e[0],l=e[1]===`index`?`/`:`/`+e.slice(1).join(`/`),i.parseData===!0&&(c.pathname=l)}if(o){let e=i.i18nProvider?i.i18nProvider.analyze(c.pathname):(0,t.normalizeLocalePath)(c.pathname,o.locales);c.locale=e.detectedLocale,c.pathname=e.pathname??c.pathname,!e.detectedLocale&&c.buildId&&(e=i.i18nProvider?i.i18nProvider.analyze(l):(0,t.normalizeLocalePath)(l,o.locales),e.detectedLocale&&(c.locale=e.detectedLocale))}return c}})(G)),G}var fe;function pe(){return fe||(fe=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`NextURL`,{enumerable:!0,get:function(){return c}});let t=te(),n=ae(),r=se(),i=de(),a=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function o(e,t){return new URL(String(e).replace(a,`localhost`),t&&String(t).replace(a,`localhost`))}let s=Symbol(`NextURLInternal`);class c{constructor(e,t,n){let r,i;typeof t==`object`&&`pathname`in t||typeof t==`string`?(r=t,i=n||{}):i=n||t||{},this[s]={url:o(e,r??i.base),options:i,basePath:``},this.analyze()}analyze(){var e,n,a,o;let c=(0,i.getNextPathnameInfo)(this[s].url.pathname,{nextConfig:this[s].options.nextConfig,parseData:!process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,i18nProvider:this[s].options.i18nProvider}),l=(0,r.getHostname)(this[s].url,this[s].options.headers);this[s].domainLocale=this[s].options.i18nProvider?this[s].options.i18nProvider.detectDomainLocale(l):(0,t.detectDomainLocale)((n=this[s].options.nextConfig)==null||(e=n.i18n)==null?void 0:e.domains,l);let u=this[s].domainLocale?.defaultLocale||((o=this[s].options.nextConfig)==null||(a=o.i18n)==null?void 0:a.defaultLocale);this[s].url.pathname=c.pathname,this[s].defaultLocale=u,this[s].basePath=c.basePath??``,this[s].buildId=c.buildId,this[s].locale=c.locale??u,this[s].trailingSlash=c.trailingSlash}formatPathname(){return(0,n.formatNextPathnameInfo)({basePath:this[s].basePath,buildId:this[s].buildId,defaultLocale:this[s].options.forceLocale?void 0:this[s].defaultLocale,locale:this[s].locale,pathname:this[s].url.pathname,trailingSlash:this[s].trailingSlash})}formatSearch(){return this[s].url.search}get buildId(){return this[s].buildId}set buildId(e){this[s].buildId=e}get locale(){return this[s].locale??``}set locale(e){var t,n;if(!this[s].locale||!(!((n=this[s].options.nextConfig)==null||(t=n.i18n)==null)&&t.locales.includes(e)))throw TypeError(`The NextURL configuration includes no locale "${e}"`);this[s].locale=e}get defaultLocale(){return this[s].defaultLocale}get domainLocale(){return this[s].domainLocale}get searchParams(){return this[s].url.searchParams}get host(){return this[s].url.host}set host(e){this[s].url.host=e}get hostname(){return this[s].url.hostname}set hostname(e){this[s].url.hostname=e}get port(){return this[s].url.port}set port(e){this[s].url.port=e}get protocol(){return this[s].url.protocol}set protocol(e){this[s].url.protocol=e}get href(){let e=this.formatPathname(),t=this.formatSearch();return`${this.protocol}//${this.host}${e}${t}${this.hash}`}set href(e){this[s].url=o(e),this.analyze()}get origin(){return this[s].url.origin}get pathname(){return this[s].url.pathname}set pathname(e){this[s].url.pathname=e}get hash(){return this[s].url.hash}set hash(e){this[s].url.hash=e}get search(){return this[s].url.search}set search(e){this[s].url.search=e}get password(){return this[s].url.password}set password(e){this[s].url.password=e}get username(){return this[s].url.username}set username(e){this[s].url.username=e}get basePath(){return this[s].basePath}set basePath(e){this[s].basePath=e.startsWith(`/`)?e:`/${e}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for(`edge-runtime.inspect.custom`)](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new c(String(this),this[s].options)}}})(T)),T}var me={},he={},ge;function _e(){return ge||(ge=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}t(e,{ACTION_SUFFIX:function(){return c},APP_DIR_ALIAS:function(){return ee},CACHE_ONE_YEAR:function(){return b},DOT_NEXT_ALIAS:function(){return T},ESLINT_DEFAULT_DIRS:function(){return V},GSP_NO_RETURNED_VALUE:function(){return I},GSSP_COMPONENT_MEMBER_ERROR:function(){return R},GSSP_NO_RETURNED_VALUE:function(){return re},INSTRUMENTATION_HOOK_FILENAME:function(){return C},MIDDLEWARE_FILENAME:function(){return x},MIDDLEWARE_LOCATION_REGEXP:function(){return S},NEXT_BODY_SUFFIX:function(){return d},NEXT_CACHE_IMPLICIT_TAG_ID:function(){return y},NEXT_CACHE_REVALIDATED_TAGS_HEADER:function(){return m},NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER:function(){return h},NEXT_CACHE_SOFT_TAGS_HEADER:function(){return p},NEXT_CACHE_SOFT_TAG_MAX_LENGTH:function(){return v},NEXT_CACHE_TAGS_HEADER:function(){return f},NEXT_CACHE_TAG_MAX_ITEMS:function(){return g},NEXT_CACHE_TAG_MAX_LENGTH:function(){return _},NEXT_DATA_SUFFIX:function(){return l},NEXT_INTERCEPTION_MARKER_PREFIX:function(){return r},NEXT_META_SUFFIX:function(){return u},NEXT_QUERY_PARAM_PREFIX:function(){return n},NON_STANDARD_NODE_ENV:function(){return z},PAGES_DIR_ALIAS:function(){return w},PRERENDER_REVALIDATE_HEADER:function(){return i},PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER:function(){return a},PUBLIC_DIR_MIDDLEWARE_CONFLICT:function(){return A},ROOT_DIR_ALIAS:function(){return E},RSC_ACTION_CLIENT_WRAPPER_ALIAS:function(){return k},RSC_ACTION_ENCRYPTION_ALIAS:function(){return ne},RSC_ACTION_PROXY_ALIAS:function(){return O},RSC_ACTION_VALIDATE_ALIAS:function(){return D},RSC_MOD_REF_PROXY_ALIAS:function(){return te},RSC_PREFETCH_SUFFIX:function(){return o},RSC_SUFFIX:function(){return s},SERVER_PROPS_EXPORT_ERROR:function(){return F},SERVER_PROPS_GET_INIT_PROPS_CONFLICT:function(){return M},SERVER_PROPS_SSG_CONFLICT:function(){return N},SERVER_RUNTIME:function(){return ie},SSG_FALLBACK_EXPORT_ERROR:function(){return B},SSG_GET_INITIAL_PROPS_CONFLICT:function(){return j},STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR:function(){return P},UNSTABLE_REVALIDATE_RENAME_ERROR:function(){return L},WEBPACK_LAYERS:function(){return U},WEBPACK_RESOURCE_QUERIES:function(){return ae}});let n=`nxtP`,r=`nxtI`,i=`x-prerender-revalidate`,a=`x-prerender-revalidate-if-generated`,o=`.prefetch.rsc`,s=`.rsc`,c=`.action`,l=`.json`,u=`.meta`,d=`.body`,f=`x-next-cache-tags`,p=`x-next-cache-soft-tags`,m=`x-next-revalidated-tags`,h=`x-next-revalidate-tag-token`,g=128,_=256,v=1024,y=`_N_T_`,b=31536e3,x=`middleware`,S=`(?:src/)?${x}`,C=`instrumentation`,w=`private-next-pages`,T=`private-dot-next`,E=`private-next-root-dir`,ee=`private-next-app-dir`,te=`private-next-rsc-mod-ref-proxy`,D=`private-next-rsc-action-validate`,O=`private-next-rsc-server-reference`,ne=`private-next-rsc-action-encryption`,k=`private-next-rsc-action-client-wrapper`,A=`You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict`,j=`You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps`,M=`You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.`,N=`You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps`,P=`can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props`,F="pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export",I="Your `getStaticProps` function did not return an object. Did you forget to add a `return`?",re="Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?",L="The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.",R=`can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member`,z=`You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env`,B="Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export",V=[`app`,`pages`,`components`,`lib`,`src`],ie={edge:`edge`,experimentalEdge:`experimental-edge`,nodejs:`nodejs`},H={shared:`shared`,reactServerComponents:`rsc`,serverSideRendering:`ssr`,actionBrowser:`action-browser`,api:`api`,middleware:`middleware`,instrument:`instrument`,edgeAsset:`edge-asset`,appPagesBrowser:`app-pages-browser`,appMetadataRoute:`app-metadata-route`,appRouteHandler:`app-route-handler`},U={...H,GROUP:{serverOnly:[H.reactServerComponents,H.actionBrowser,H.appMetadataRoute,H.appRouteHandler,H.instrument],clientOnly:[H.serverSideRendering,H.appPagesBrowser],nonClientServerTarget:[H.middleware,H.api],app:[H.reactServerComponents,H.actionBrowser,H.appMetadataRoute,H.appRouteHandler,H.serverSideRendering,H.appPagesBrowser,H.shared,H.instrument]}},ae={edgeSSREntry:`__next_edge_ssr_entry__`,metadata:`__next_metadata__`,metadataRoute:`__next_metadata_route__`,metadataImageMeta:`__next_metadata_image_meta__`}})(he)),he}var ve;function ye(){return ve||(ve=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}t(e,{fromNodeOutgoingHttpHeaders:function(){return r},normalizeNextQueryParam:function(){return s},splitCookiesString:function(){return i},toNodeOutgoingHttpHeaders:function(){return a},validateURL:function(){return o}});let n=_e();function r(e){let t=new Headers;for(let[n,r]of Object.entries(e)){let e=Array.isArray(r)?r:[r];for(let r of e)typeof r>`u`||(typeof r==`number`&&(r=r.toString()),t.append(n,r))}return t}function i(e){var t=[],n=0,r,i,a,o,s;function c(){for(;n<e.length&&/\s/.test(e.charAt(n));)n+=1;return n<e.length}function l(){return i=e.charAt(n),i!==`=`&&i!==`;`&&i!==`,`}for(;n<e.length;){for(r=n,s=!1;c();)if(i=e.charAt(n),i===`,`){for(a=n,n+=1,c(),o=n;n<e.length&&l();)n+=1;n<e.length&&e.charAt(n)===`=`?(s=!0,n=o,t.push(e.substring(r,a)),r=n):n=a+1}else n+=1;(!s||n>=e.length)&&t.push(e.substring(r,e.length))}return t}function a(e){let t={},n=[];if(e)for(let[r,a]of e.entries())r.toLowerCase()===`set-cookie`?(n.push(...i(a)),t[r]=n.length===1?n[0]:n):t[r]=a;return t}function o(e){try{return String(new URL(String(e)))}catch(t){throw Error(`URL is malformed "${String(e)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:t})}}function s(e,t){let r=[n.NEXT_QUERY_PARAM_PREFIX,n.NEXT_INTERCEPTION_MARKER_PREFIX];for(let n of r)e!==n&&e.startsWith(n)&&t(e.substring(n.length))}})(me)),me}var be={},xe;function Se(){return xe||(xe=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}t(e,{PageSignatureError:function(){return n},RemovedPageError:function(){return r},RemovedUAError:function(){return i}});class n extends Error{constructor({page:e}){super(`The middleware "${e}" accepts an async API directly with the form:
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`pino`);c=s(c);let l=require(`pino-pretty`);l=s(l);let u=require(`js-md5`);u=s(u);let d=require(`crypto-js`);d=s(d),require(`h3`);var f={GENERAL:0,PHONE:1,EMAIL:2},p={TYPE_MGT:0,TYPE_C:1,TYPE_B:2},m={FROM_WEB:1,FROM_PC:2,FROM_WX_MINI_PRO:3,FROM_WX_PLU:4,FROM_WX_E:5,FROM_APP:6,FROM_DEVICE:7},h={unknown:0,male:1,female:2},g=(0,l.default)({colorize:!0,destination:process.stdout,translateTime:`SYS:yyyy-mm-dd HH:MM:ss`,ignore:`pid,hostname`,messageFormat:`{msg}`,singleLine:!0}),_=(0,c.default)({name:process.env.APP_NAME??`iBoot`,level:process.env.APP_ENV===`production`?`info`:`debug`,nestedKey:`payload`},g),v={},y=e=>Array.isArray(e)||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Array]`,b=e=>{let t=e||32,n=``;for(let e=0;e<t;e++)n+=`ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678`.charAt(Math.floor(Math.random()*48));return n},x=(e,t)=>{let n={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};if(/(y+)/.test(t)){let n=new RegExp(/(y+)/).exec(t),r=0;n&&n.length>0&&(r=n[0].length),t=t.replace(/(y+)/,e.getFullYear()+``).substring(4-r)}for(let e in n){let r=`(`+e+`)`,i=new RegExp(r);if(i.test(t)){let r=i.exec(t),a=0;r&&r.length>0&&(a=r[0].length),t=t.replace(i,a==1?n[e].toString():(`00`+n[e]).substring(n[e].toString().length))}}return t};function S(){try{let e=v.networkInterfaces();for(let t of Object.keys(e)){let n=e[t];if(n){for(let e of n)if(e.mac&&e.mac!==`00:00:00:00:00:00`)return e.mac.replace(/:/g,``).toUpperCase()}}return crypto.randomUUID().replace(/-/g,``).toUpperCase()}catch{return b(10)}}var C={exports:{}},w={},T={},E={},ee;function te(){return ee||(ee=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`detectDomainLocale`,{enumerable:!0,get:function(){return t}});function t(e,t,n){if(e){n&&=n.toLowerCase();for(let i of e){var r;if(t===i.domain?.split(`:`,1)[0].toLowerCase()||n===i.defaultLocale.toLowerCase()||(r=i.locales)!=null&&r.some(e=>e.toLowerCase()===n))return i}}}})(E)),E}var D={},O={},ne;function k(){return ne||(ne=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`removeTrailingSlash`,{enumerable:!0,get:function(){return t}});function t(e){return e.replace(/\/$/,``)||`/`}})(O)),O}var A={},j={},M;function N(){return M||(M=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`parsePath`,{enumerable:!0,get:function(){return t}});function t(e){let t=e.indexOf(`#`),n=e.indexOf(`?`),r=n>-1&&(t<0||n<t);return r||t>-1?{pathname:e.substring(0,r?n:t),query:r?e.substring(n,t>-1?t:void 0):``,hash:t>-1?e.slice(t):``}:{pathname:e,query:``,hash:``}}})(j)),j}var P;function F(){return P||(P=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`addPathPrefix`,{enumerable:!0,get:function(){return n}});let t=N();function n(e,n){if(!e.startsWith(`/`)||!n)return e;let{pathname:r,query:i,hash:a}=(0,t.parsePath)(e);return``+n+r+i+a}})(A)),A}var I={},re;function L(){return re||(re=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`addPathSuffix`,{enumerable:!0,get:function(){return n}});let t=N();function n(e,n){if(!e.startsWith(`/`)||!n)return e;let{pathname:r,query:i,hash:a}=(0,t.parsePath)(e);return``+r+n+i+a}})(I)),I}var R={},z={},B;function V(){return B||(B=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`pathHasPrefix`,{enumerable:!0,get:function(){return n}});let t=N();function n(e,n){if(typeof e!=`string`)return!1;let{pathname:r}=(0,t.parsePath)(e);return r===n||r.startsWith(n+`/`)}})(z)),z}var ie;function H(){return ie||(ie=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`addLocale`,{enumerable:!0,get:function(){return r}});let t=F(),n=V();function r(e,r,i,a){if(!r||r===i)return e;let o=e.toLowerCase();return!a&&((0,n.pathHasPrefix)(o,`/api`)||(0,n.pathHasPrefix)(o,`/`+r.toLowerCase()))?e:(0,t.addPathPrefix)(e,`/`+r)}})(R)),R}var U;function ae(){return U||(U=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`formatNextPathnameInfo`,{enumerable:!0,get:function(){return a}});let t=k(),n=F(),r=L(),i=H();function a(e){let a=(0,i.addLocale)(e.pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix);return(e.buildId||!e.trailingSlash)&&(a=(0,t.removeTrailingSlash)(a)),e.buildId&&(a=(0,r.addPathSuffix)((0,n.addPathPrefix)(a,`/_next/data/`+e.buildId),e.pathname===`/`?`index.json`:`.json`)),a=(0,n.addPathPrefix)(a,e.basePath),!e.buildId&&e.trailingSlash?a.endsWith(`/`)?a:(0,r.addPathSuffix)(a,`/`):(0,t.removeTrailingSlash)(a)}})(D)),D}var W={},oe;function se(){return oe||(oe=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`getHostname`,{enumerable:!0,get:function(){return t}});function t(e,t){let n;if(t?.host&&!Array.isArray(t.host))n=t.host.toString().split(`:`,1)[0];else if(e.hostname)n=e.hostname;else return;return n.toLowerCase()}})(W)),W}var G={},K={},ce;function le(){return ce||(ce=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`normalizeLocalePath`,{enumerable:!0,get:function(){return t}});function t(e,t){let n,r=e.split(`/`);return(t||[]).some(t=>r[1]&&r[1].toLowerCase()===t.toLowerCase()?(n=t,r.splice(1,1),e=r.join(`/`)||`/`,!0):!1),{pathname:e,detectedLocale:n}}})(K)),K}var ue={},q;function J(){return q||(q=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`removePathPrefix`,{enumerable:!0,get:function(){return n}});let t=V();function n(e,n){if(!(0,t.pathHasPrefix)(e,n))return e;let r=e.slice(n.length);return r.startsWith(`/`)?r:`/`+r}})(ue)),ue}var Y;function de(){return Y||(Y=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`getNextPathnameInfo`,{enumerable:!0,get:function(){return i}});let t=le(),n=J(),r=V();function i(e,i){let{basePath:a,i18n:o,trailingSlash:s}=i.nextConfig??{},c={pathname:e,trailingSlash:e===`/`?s:e.endsWith(`/`)};a&&(0,r.pathHasPrefix)(c.pathname,a)&&(c.pathname=(0,n.removePathPrefix)(c.pathname,a),c.basePath=a);let l=c.pathname;if(c.pathname.startsWith(`/_next/data/`)&&c.pathname.endsWith(`.json`)){let e=c.pathname.replace(/^\/_next\/data\//,``).replace(/\.json$/,``).split(`/`);c.buildId=e[0],l=e[1]===`index`?`/`:`/`+e.slice(1).join(`/`),i.parseData===!0&&(c.pathname=l)}if(o){let e=i.i18nProvider?i.i18nProvider.analyze(c.pathname):(0,t.normalizeLocalePath)(c.pathname,o.locales);c.locale=e.detectedLocale,c.pathname=e.pathname??c.pathname,!e.detectedLocale&&c.buildId&&(e=i.i18nProvider?i.i18nProvider.analyze(l):(0,t.normalizeLocalePath)(l,o.locales),e.detectedLocale&&(c.locale=e.detectedLocale))}return c}})(G)),G}var fe;function pe(){return fe||(fe=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`NextURL`,{enumerable:!0,get:function(){return c}});let t=te(),n=ae(),r=se(),i=de(),a=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function o(e,t){return new URL(String(e).replace(a,`localhost`),t&&String(t).replace(a,`localhost`))}let s=Symbol(`NextURLInternal`);class c{constructor(e,t,n){let r,i;typeof t==`object`&&`pathname`in t||typeof t==`string`?(r=t,i=n||{}):i=n||t||{},this[s]={url:o(e,r??i.base),options:i,basePath:``},this.analyze()}analyze(){var e,n,a,o;let c=(0,i.getNextPathnameInfo)(this[s].url.pathname,{nextConfig:this[s].options.nextConfig,parseData:!process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,i18nProvider:this[s].options.i18nProvider}),l=(0,r.getHostname)(this[s].url,this[s].options.headers);this[s].domainLocale=this[s].options.i18nProvider?this[s].options.i18nProvider.detectDomainLocale(l):(0,t.detectDomainLocale)((n=this[s].options.nextConfig)==null||(e=n.i18n)==null?void 0:e.domains,l);let u=this[s].domainLocale?.defaultLocale||((o=this[s].options.nextConfig)==null||(a=o.i18n)==null?void 0:a.defaultLocale);this[s].url.pathname=c.pathname,this[s].defaultLocale=u,this[s].basePath=c.basePath??``,this[s].buildId=c.buildId,this[s].locale=c.locale??u,this[s].trailingSlash=c.trailingSlash}formatPathname(){return(0,n.formatNextPathnameInfo)({basePath:this[s].basePath,buildId:this[s].buildId,defaultLocale:this[s].options.forceLocale?void 0:this[s].defaultLocale,locale:this[s].locale,pathname:this[s].url.pathname,trailingSlash:this[s].trailingSlash})}formatSearch(){return this[s].url.search}get buildId(){return this[s].buildId}set buildId(e){this[s].buildId=e}get locale(){return this[s].locale??``}set locale(e){var t,n;if(!this[s].locale||!(!((n=this[s].options.nextConfig)==null||(t=n.i18n)==null)&&t.locales.includes(e)))throw TypeError(`The NextURL configuration includes no locale "${e}"`);this[s].locale=e}get defaultLocale(){return this[s].defaultLocale}get domainLocale(){return this[s].domainLocale}get searchParams(){return this[s].url.searchParams}get host(){return this[s].url.host}set host(e){this[s].url.host=e}get hostname(){return this[s].url.hostname}set hostname(e){this[s].url.hostname=e}get port(){return this[s].url.port}set port(e){this[s].url.port=e}get protocol(){return this[s].url.protocol}set protocol(e){this[s].url.protocol=e}get href(){let e=this.formatPathname(),t=this.formatSearch();return`${this.protocol}//${this.host}${e}${t}${this.hash}`}set href(e){this[s].url=o(e),this.analyze()}get origin(){return this[s].url.origin}get pathname(){return this[s].url.pathname}set pathname(e){this[s].url.pathname=e}get hash(){return this[s].url.hash}set hash(e){this[s].url.hash=e}get search(){return this[s].url.search}set search(e){this[s].url.search=e}get password(){return this[s].url.password}set password(e){this[s].url.password=e}get username(){return this[s].url.username}set username(e){this[s].url.username=e}get basePath(){return this[s].basePath}set basePath(e){this[s].basePath=e.startsWith(`/`)?e:`/${e}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for(`edge-runtime.inspect.custom`)](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new c(String(this),this[s].options)}}})(T)),T}var me={},he={},ge;function _e(){return ge||(ge=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}t(e,{ACTION_SUFFIX:function(){return c},APP_DIR_ALIAS:function(){return ee},CACHE_ONE_YEAR:function(){return b},DOT_NEXT_ALIAS:function(){return T},ESLINT_DEFAULT_DIRS:function(){return V},GSP_NO_RETURNED_VALUE:function(){return I},GSSP_COMPONENT_MEMBER_ERROR:function(){return R},GSSP_NO_RETURNED_VALUE:function(){return re},INSTRUMENTATION_HOOK_FILENAME:function(){return C},MIDDLEWARE_FILENAME:function(){return x},MIDDLEWARE_LOCATION_REGEXP:function(){return S},NEXT_BODY_SUFFIX:function(){return d},NEXT_CACHE_IMPLICIT_TAG_ID:function(){return y},NEXT_CACHE_REVALIDATED_TAGS_HEADER:function(){return m},NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER:function(){return h},NEXT_CACHE_SOFT_TAGS_HEADER:function(){return p},NEXT_CACHE_SOFT_TAG_MAX_LENGTH:function(){return v},NEXT_CACHE_TAGS_HEADER:function(){return f},NEXT_CACHE_TAG_MAX_ITEMS:function(){return g},NEXT_CACHE_TAG_MAX_LENGTH:function(){return _},NEXT_DATA_SUFFIX:function(){return l},NEXT_INTERCEPTION_MARKER_PREFIX:function(){return r},NEXT_META_SUFFIX:function(){return u},NEXT_QUERY_PARAM_PREFIX:function(){return n},NON_STANDARD_NODE_ENV:function(){return z},PAGES_DIR_ALIAS:function(){return w},PRERENDER_REVALIDATE_HEADER:function(){return i},PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER:function(){return a},PUBLIC_DIR_MIDDLEWARE_CONFLICT:function(){return A},ROOT_DIR_ALIAS:function(){return E},RSC_ACTION_CLIENT_WRAPPER_ALIAS:function(){return k},RSC_ACTION_ENCRYPTION_ALIAS:function(){return ne},RSC_ACTION_PROXY_ALIAS:function(){return O},RSC_ACTION_VALIDATE_ALIAS:function(){return D},RSC_MOD_REF_PROXY_ALIAS:function(){return te},RSC_PREFETCH_SUFFIX:function(){return o},RSC_SUFFIX:function(){return s},SERVER_PROPS_EXPORT_ERROR:function(){return F},SERVER_PROPS_GET_INIT_PROPS_CONFLICT:function(){return M},SERVER_PROPS_SSG_CONFLICT:function(){return N},SERVER_RUNTIME:function(){return ie},SSG_FALLBACK_EXPORT_ERROR:function(){return B},SSG_GET_INITIAL_PROPS_CONFLICT:function(){return j},STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR:function(){return P},UNSTABLE_REVALIDATE_RENAME_ERROR:function(){return L},WEBPACK_LAYERS:function(){return U},WEBPACK_RESOURCE_QUERIES:function(){return ae}});let n=`nxtP`,r=`nxtI`,i=`x-prerender-revalidate`,a=`x-prerender-revalidate-if-generated`,o=`.prefetch.rsc`,s=`.rsc`,c=`.action`,l=`.json`,u=`.meta`,d=`.body`,f=`x-next-cache-tags`,p=`x-next-cache-soft-tags`,m=`x-next-revalidated-tags`,h=`x-next-revalidate-tag-token`,g=128,_=256,v=1024,y=`_N_T_`,b=31536e3,x=`middleware`,S=`(?:src/)?${x}`,C=`instrumentation`,w=`private-next-pages`,T=`private-dot-next`,E=`private-next-root-dir`,ee=`private-next-app-dir`,te=`private-next-rsc-mod-ref-proxy`,D=`private-next-rsc-action-validate`,O=`private-next-rsc-server-reference`,ne=`private-next-rsc-action-encryption`,k=`private-next-rsc-action-client-wrapper`,A=`You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict`,j=`You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps`,M=`You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.`,N=`You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps`,P=`can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props`,F="pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export",I="Your `getStaticProps` function did not return an object. Did you forget to add a `return`?",re="Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?",L="The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.",R=`can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member`,z=`You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env`,B="Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export",V=[`app`,`pages`,`components`,`lib`,`src`],ie={edge:`edge`,experimentalEdge:`experimental-edge`,nodejs:`nodejs`},H={shared:`shared`,reactServerComponents:`rsc`,serverSideRendering:`ssr`,actionBrowser:`action-browser`,api:`api`,middleware:`middleware`,instrument:`instrument`,edgeAsset:`edge-asset`,appPagesBrowser:`app-pages-browser`,appMetadataRoute:`app-metadata-route`,appRouteHandler:`app-route-handler`},U={...H,GROUP:{serverOnly:[H.reactServerComponents,H.actionBrowser,H.appMetadataRoute,H.appRouteHandler,H.instrument],clientOnly:[H.serverSideRendering,H.appPagesBrowser],nonClientServerTarget:[H.middleware,H.api],app:[H.reactServerComponents,H.actionBrowser,H.appMetadataRoute,H.appRouteHandler,H.serverSideRendering,H.appPagesBrowser,H.shared,H.instrument]}},ae={edgeSSREntry:`__next_edge_ssr_entry__`,metadata:`__next_metadata__`,metadataRoute:`__next_metadata_route__`,metadataImageMeta:`__next_metadata_image_meta__`}})(he)),he}var ve;function ye(){return ve||(ve=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}t(e,{fromNodeOutgoingHttpHeaders:function(){return r},normalizeNextQueryParam:function(){return s},splitCookiesString:function(){return i},toNodeOutgoingHttpHeaders:function(){return a},validateURL:function(){return o}});let n=_e();function r(e){let t=new Headers;for(let[n,r]of Object.entries(e)){let e=Array.isArray(r)?r:[r];for(let r of e)typeof r>`u`||(typeof r==`number`&&(r=r.toString()),t.append(n,r))}return t}function i(e){var t=[],n=0,r,i,a,o,s;function c(){for(;n<e.length&&/\s/.test(e.charAt(n));)n+=1;return n<e.length}function l(){return i=e.charAt(n),i!==`=`&&i!==`;`&&i!==`,`}for(;n<e.length;){for(r=n,s=!1;c();)if(i=e.charAt(n),i===`,`){for(a=n,n+=1,c(),o=n;n<e.length&&l();)n+=1;n<e.length&&e.charAt(n)===`=`?(s=!0,n=o,t.push(e.substring(r,a)),r=n):n=a+1}else n+=1;(!s||n>=e.length)&&t.push(e.substring(r,e.length))}return t}function a(e){let t={},n=[];if(e)for(let[r,a]of e.entries())r.toLowerCase()===`set-cookie`?(n.push(...i(a)),t[r]=n.length===1?n[0]:n):t[r]=a;return t}function o(e){try{return String(new URL(String(e)))}catch(t){throw Error(`URL is malformed "${String(e)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:t})}}function s(e,t){let r=[n.NEXT_QUERY_PARAM_PREFIX,n.NEXT_INTERCEPTION_MARKER_PREFIX];for(let n of r)e!==n&&e.startsWith(n)&&t(e.substring(n.length))}})(me)),me}var be={},xe;function Se(){return xe||(xe=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}t(e,{PageSignatureError:function(){return n},RemovedPageError:function(){return r},RemovedUAError:function(){return i}});class n extends Error{constructor({page:e}){super(`The middleware "${e}" accepts an async API directly with the form:
|
|
2
2
|
|
|
3
3
|
export function middleware(request, event) {
|
|
4
4
|
return NextResponse.redirect('/new-location')
|
|
@@ -9,5 +9,5 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
9
9
|
Read more: https://nextjs.org/docs/messages/middleware-request-page
|
|
10
10
|
`)}}class i extends Error{constructor(){super(`The request.ua has been removed in favour of \`userAgent\` function.
|
|
11
11
|
Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
|
|
12
|
-
`)}}})(be)),be}var Ce={},we,Te;function Ee(){if(Te)return we;Te=1;var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})},a=(i,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(let c of n(a))!r.call(i,c)&&c!==o&&e(i,c,{get:()=>a[c],enumerable:!(s=t(a,c))||s.enumerable});return i},o=t=>a(e({},`__esModule`,{value:!0}),t),s={};i(s,{RequestCookies:()=>_,ResponseCookies:()=>v,parseCookie:()=>l,parseSetCookie:()=>u,stringifyCookie:()=>c}),we=o(s);function c(e){let t=[`path`in e&&e.path&&`Path=${e.path}`,`expires`in e&&(e.expires||e.expires===0)&&`Expires=${(typeof e.expires==`number`?new Date(e.expires):e.expires).toUTCString()}`,`maxAge`in e&&typeof e.maxAge==`number`&&`Max-Age=${e.maxAge}`,`domain`in e&&e.domain&&`Domain=${e.domain}`,`secure`in e&&e.secure&&`Secure`,`httpOnly`in e&&e.httpOnly&&`HttpOnly`,`sameSite`in e&&e.sameSite&&`SameSite=${e.sameSite}`,`partitioned`in e&&e.partitioned&&`Partitioned`,`priority`in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent(e.value??``)}`;return t.length===0?n:`${n}; ${t.join(`; `)}`}function l(e){let t=new Map;for(let n of e.split(/; */)){if(!n)continue;let e=n.indexOf(`=`);if(e===-1){t.set(n,`true`);continue}let[r,i]=[n.slice(0,e),n.slice(e+1)];try{t.set(r,decodeURIComponent(i??`true`))}catch{}}return t}function u(e){if(!e)return;let[[t,n],...r]=l(e),{domain:i,expires:a,httponly:o,maxage:s,path:c,samesite:u,secure:f,partitioned:m,priority:g}=Object.fromEntries(r.map(([e,t])=>[e.toLowerCase(),t]));return d({name:t,value:decodeURIComponent(n),domain:i,...a&&{expires:new Date(a)},...o&&{httpOnly:!0},...typeof s==`string`&&{maxAge:Number(s)},path:c,...u&&{sameSite:p(u)},...f&&{secure:!0},...g&&{priority:h(g)},...m&&{partitioned:!0}})}function d(e){let t={};for(let n in e)e[n]&&(t[n]=e[n]);return t}var f=[`strict`,`lax`,`none`];function p(e){return e=e.toLowerCase(),f.includes(e)?e:void 0}var m=[`low`,`medium`,`high`];function h(e){return e=e.toLowerCase(),m.includes(e)?e:void 0}function g(e){if(!e)return[];var t=[],n=0,r,i,a,o,s;function c(){for(;n<e.length&&/\s/.test(e.charAt(n));)n+=1;return n<e.length}function l(){return i=e.charAt(n),i!==`=`&&i!==`;`&&i!==`,`}for(;n<e.length;){for(r=n,s=!1;c();)if(i=e.charAt(n),i===`,`){for(a=n,n+=1,c(),o=n;n<e.length&&l();)n+=1;n<e.length&&e.charAt(n)===`=`?(s=!0,n=o,t.push(e.substring(r,a)),r=n):n=a+1}else n+=1;(!s||n>=e.length)&&t.push(e.substring(r,e.length))}return t}var _=class{constructor(e){this._parsed=new Map,this._headers=e;let t=e.get(`cookie`);if(t){let e=l(t);for(let[t,n]of e)this._parsed.set(t,{name:t,value:n})}}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t=typeof e[0]==`string`?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){let t=Array.from(this._parsed);if(!e.length)return t.map(([e,t])=>t);let n=typeof e[0]==`string`?e[0]:e[0]?.name;return t.filter(([e])=>e===n).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,n]=e.length===1?[e[0].name,e[0].value]:e,r=this._parsed;return r.set(t,{name:t,value:n}),this._headers.set(`cookie`,Array.from(r).map(([e,t])=>c(t)).join(`; `)),this}delete(e){let t=this._parsed,n=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set(`cookie`,Array.from(t).map(([e,t])=>c(t)).join(`; `)),n}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for(`edge-runtime.inspect.custom`)](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join(`; `)}},v=class{constructor(e){this._parsed=new Map,this._headers=e;let t=e.getSetCookie?.call(e)??e.get(`set-cookie`)??[],n=Array.isArray(t)?t:g(t);for(let e of n){let t=u(e);t&&this._parsed.set(t.name,t)}}get(...e){let t=typeof e[0]==`string`?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){let t=Array.from(this._parsed.values());if(!e.length)return t;let n=typeof e[0]==`string`?e[0]:e[0]?.name;return t.filter(e=>e.name===n)}has(e){return this._parsed.has(e)}set(...e){let[t,n,r]=e.length===1?[e[0].name,e[0].value,e[0]]:e,i=this._parsed;return i.set(t,b({name:t,value:n,...r})),y(i,this._headers),this}delete(...e){let[t,n,r]=typeof e[0]==`string`?[e[0]]:[e[0].name,e[0].path,e[0].domain];return this.set({name:t,path:n,domain:r,value:``,expires:new Date(0)})}[Symbol.for(`edge-runtime.inspect.custom`)](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(c).join(`; `)}};function y(e,t){t.delete(`set-cookie`);for(let[,n]of e){let e=c(n);t.append(`set-cookie`,e)}}function b(e={name:``,value:``}){return typeof e.expires==`number`&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+e.maxAge*1e3)),(e.path===null||e.path===void 0)&&(e.path=`/`),e}return we}var De;function Oe(){return De||(De=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}t(e,{RequestCookies:function(){return n.RequestCookies},ResponseCookies:function(){return n.ResponseCookies},stringifyCookie:function(){return n.stringifyCookie}});let n=Ee()})(Ce)),Ce}var ke;function Ae(){return ke||(ke=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}t(e,{INTERNALS:function(){return o},NextRequest:function(){return s}});let n=pe(),r=ye(),i=Se(),a=Oe(),o=Symbol(`internal request`);class s extends Request{constructor(e,t={}){let i=typeof e!=`string`&&`url`in e?e.url:String(e);(0,r.validateURL)(i),e instanceof Request?super(e,t):super(i,t);let s=new n.NextURL(i,{headers:(0,r.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:t.nextConfig});this[o]={cookies:new a.RequestCookies(this.headers),geo:t.geo||{},ip:t.ip,nextUrl:s,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?i:s.toString()}}[Symbol.for(`edge-runtime.inspect.custom`)](){return{cookies:this.cookies,geo:this.geo,ip:this.ip,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[o].cookies}get geo(){return this[o].geo}get ip(){return this[o].ip}get nextUrl(){return this[o].nextUrl}get page(){throw new i.RemovedPageError}get ua(){throw new i.RemovedUAError}get url(){return this[o].url}}})(w)),w}var je={},Me={},Ne;function Pe(){return Ne||(Ne=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`ReflectAdapter`,{enumerable:!0,get:function(){return t}});class t{static get(e,t,n){let r=Reflect.get(e,t,n);return typeof r==`function`?r.bind(e):r}static set(e,t,n,r){return Reflect.set(e,t,n,r)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}})(Me)),Me}var Fe;function Ie(){return Fe||(Fe=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`NextResponse`,{enumerable:!0,get:function(){return l}});let t=Oe(),n=pe(),r=ye(),i=Pe(),a=Oe(),o=Symbol(`internal response`),s=new Set([301,302,303,307,308]);function c(e,t){var n;if(!(e==null||(n=e.request)==null)&&n.headers){if(!(e.request.headers instanceof Headers))throw Error(`request.headers must be an instance of Headers`);let n=[];for(let[r,i]of e.request.headers)t.set(`x-middleware-request-`+r,i),n.push(r);t.set(`x-middleware-override-headers`,n.join(`,`))}}class l extends Response{constructor(e,s={}){super(e,s);let l=this.headers,u=new a.ResponseCookies(l);this[o]={cookies:new Proxy(u,{get(e,n,r){switch(n){case`delete`:case`set`:return(...r)=>{let i=Reflect.apply(e[n],e,r),o=new Headers(l);return i instanceof a.ResponseCookies&&l.set(`x-middleware-set-cookie`,i.getAll().map(e=>(0,t.stringifyCookie)(e)).join(`,`)),c(s,o),i};default:return i.ReflectAdapter.get(e,n,r)}}}),url:s.url?new n.NextURL(s.url,{headers:(0,r.toNodeOutgoingHttpHeaders)(l),nextConfig:s.nextConfig}):void 0}}[Symbol.for(`edge-runtime.inspect.custom`)](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[o].cookies}static json(e,t){let n=Response.json(e,t);return new l(n.body,n)}static redirect(e,t){let n=typeof t==`number`?t:t?.status??307;if(!s.has(n))throw RangeError(`Failed to execute "redirect" on "response": Invalid status code`);let i=typeof t==`object`?t:{},a=new Headers(i?.headers);return a.set(`Location`,(0,r.validateURL)(e)),new l(null,{...i,headers:a,status:n})}static rewrite(e,t){let n=new Headers(t?.headers);return n.set(`x-middleware-rewrite`,(0,r.validateURL)(e)),c(t,n),new l(null,{...t,headers:n})}static next(e){let t=new Headers(e?.headers);return t.set(`x-middleware-next`,`1`),c(e,t),new l(null,{...e,headers:t})}}})(je)),je}var Le={},Re;function ze(){return Re||(Re=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`ImageResponse`,{enumerable:!0,get:function(){return t}});function t(){throw Error(`ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead`)}})(Le)),Le}var Be={},Ve={exports:{}},He;function Ue(){return He||(He=1,(()=>{var e={226:function(e,t){(function(n,r){var i=`1.0.35`,a=``,o=`?`,s=`function`,c=`undefined`,l=`object`,u=`string`,d=`major`,f=`model`,p=`name`,m=`type`,h=`vendor`,g=`version`,_=`architecture`,v=`console`,y=`mobile`,b=`tablet`,x=`smarttv`,S=`wearable`,C=`embedded`,w=350,T=`Amazon`,E=`Apple`,ee=`ASUS`,te=`BlackBerry`,D=`Browser`,O=`Chrome`,ne=`Edge`,k=`Firefox`,A=`Google`,j=`Huawei`,M=`LG`,N=`Microsoft`,P=`Motorola`,F=`Opera`,I=`Samsung`,re=`Sharp`,L=`Sony`,R=`Xiaomi`,z=`Zebra`,B=`Facebook`,V=`Chromium OS`,ie=`Mac OS`,H=function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},U=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},ae=function(e,t){return typeof e===u?W(t).indexOf(W(e))!==-1:!1},W=function(e){return e.toLowerCase()},oe=function(e){return typeof e===u?e.replace(/[^\d\.]/g,a).split(`.`)[0]:r},se=function(e,t){if(typeof e===u)return e=e.replace(/^\s\s*/,a),typeof t===c?e:e.substring(0,w)},G=function(e,t){for(var n=0,i,a,o,c,u,d;n<t.length&&!u;){var f=t[n],p=t[n+1];for(i=a=0;i<f.length&&!u&&f[i];)if(u=f[i++].exec(e),u)for(o=0;o<p.length;o++)d=u[++a],c=p[o],typeof c===l&&c.length>0?c.length===2?typeof c[1]==s?this[c[0]]=c[1].call(this,d):this[c[0]]=c[1]:c.length===3?typeof c[1]===s&&!(c[1].exec&&c[1].test)?this[c[0]]=d?c[1].call(this,d,c[2]):r:this[c[0]]=d?d.replace(c[1],c[2]):r:c.length===4&&(this[c[0]]=d?c[3].call(this,d.replace(c[1],c[2])):r):this[c]=d||r;n+=2}},K=function(e,t){for(var n in t)if(typeof t[n]===l&&t[n].length>0){for(var i=0;i<t[n].length;i++)if(ae(t[n][i],e))return n===o?r:n}else if(ae(t[n],e))return n===o?r:n;return e},ce={"1.0":`/8`,1.2:`/1`,1.3:`/3`,"2.0":`/412`,"2.0.2":`/416`,"2.0.3":`/417`,"2.0.4":`/419`,"?":`/`},le={ME:`4.90`,"NT 3.11":`NT3.51`,"NT 4.0":`NT4.0`,2e3:`NT 5.0`,XP:[`NT 5.1`,`NT 5.2`],Vista:`NT 6.0`,7:`NT 6.1`,8:`NT 6.2`,8.1:`NT 6.3`,10:[`NT 6.4`,`NT 10.0`],RT:`ARM`},ue={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[g,[p,`Chrome`]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[g,[p,`Edge`]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,g],[/opios[\/ ]+([\w\.]+)/i],[g,[p,F+` Mini`]],[/\bopr\/([\w\.]+)/i],[g,[p,F]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[p,g],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[g,[p,`UC`+D]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[g,[p,`WeChat(Win) Desktop`]],[/micromessenger\/([\w\.]+)/i],[g,[p,`WeChat`]],[/konqueror\/([\w\.]+)/i],[g,[p,`Konqueror`]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[g,[p,`IE`]],[/ya(?:search)?browser\/([\w\.]+)/i],[g,[p,`Yandex`]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,`$1 Secure `+D],g],[/\bfocus\/([\w\.]+)/i],[g,[p,k+` Focus`]],[/\bopt\/([\w\.]+)/i],[g,[p,F+` Touch`]],[/coc_coc\w+\/([\w\.]+)/i],[g,[p,`Coc Coc`]],[/dolfin\/([\w\.]+)/i],[g,[p,`Dolphin`]],[/coast\/([\w\.]+)/i],[g,[p,F+` Coast`]],[/miuibrowser\/([\w\.]+)/i],[g,[p,`MIUI `+D]],[/fxios\/([-\w\.]+)/i],[g,[p,k]],[/\bqihu|(qi?ho?o?|360)browser/i],[[p,`360 `+D]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[p,/(.+)/,`$1 `+D],g],[/(comodo_dragon)\/([\w\.]+)/i],[[p,/_/g,` `],g],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[p,g],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,B],g],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[p,g],[/\bgsa\/([\w\.]+) .*safari\//i],[g,[p,`GSA`]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[g,[p,`TikTok`]],[/headlesschrome(?:\/([\w\.]+)| )/i],[g,[p,O+` Headless`]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,O+` WebView`],g],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[g,[p,`Android `+D]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,g],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[g,[p,`Mobile Safari`]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[g,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[g,K,ce]],[/(webkit|khtml)\/([\w\.]+)/i],[p,g],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,`Netscape`],g],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[g,[p,k+` Reality`]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[p,g],[/(cobalt)\/([\w\.]+)/i],[p,[g,/master.|lts./,``]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[_,`amd64`]],[/(ia32(?=;))/i],[[_,W]],[/((?:i[346]|x)86)[;\)]/i],[[_,`ia32`]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[_,`arm64`]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[_,`armhf`]],[/windows (ce|mobile); ppc;/i],[[_,`arm`]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[_,/ower/,a,W]],[/(sun4\w)[;\)]/i],[[_,`sparc`]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[_,W]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[f,[h,I],[m,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[f,[h,I],[m,y]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[f,[h,E],[m,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[f,[h,E],[m,b]],[/(macintosh);/i],[f,[h,E]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[f,[h,re],[m,y]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[f,[h,j],[m,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[f,[h,j],[m,y]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[f,/_/g,` `],[h,R],[m,y]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[f,/_/g,` `],[h,R],[m,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[f,[h,`OPPO`],[m,y]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[f,[h,`Vivo`],[m,y]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[f,[h,`Realme`],[m,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[f,[h,P],[m,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[f,[h,P],[m,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[f,[h,M],[m,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[f,[h,M],[m,y]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[f,[h,`Lenovo`],[m,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[f,/_/g,` `],[h,`Nokia`],[m,y]],[/(pixel c)\b/i],[f,[h,A],[m,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[f,[h,A],[m,y]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[f,[h,L],[m,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[f,`Xperia Tablet`],[h,L],[m,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[f,[h,`OnePlus`],[m,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[f,[h,T],[m,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[f,/(.+)/g,`Fire Phone $1`],[h,T],[m,y]],[/(playbook);[-\w\),; ]+(rim)/i],[f,h,[m,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[f,[h,te],[m,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[f,[h,ee],[m,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[f,[h,ee],[m,y]],[/(nexus 9)/i],[f,[h,`HTC`],[m,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[f,/_/g,` `],[m,y]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[f,[h,`Acer`],[m,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[f,[h,`Meizu`],[m,y]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,f,[m,y]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,f,[m,b]],[/(surface duo)/i],[f,[h,N],[m,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[f,[h,`Fairphone`],[m,y]],[/(u304aa)/i],[f,[h,`AT&T`],[m,y]],[/\bsie-(\w*)/i],[f,[h,`Siemens`],[m,y]],[/\b(rct\w+) b/i],[f,[h,`RCA`],[m,b]],[/\b(venue[\d ]{2,7}) b/i],[f,[h,`Dell`],[m,b]],[/\b(q(?:mv|ta)\w+) b/i],[f,[h,`Verizon`],[m,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[f,[h,`Barnes & Noble`],[m,b]],[/\b(tm\d{3}\w+) b/i],[f,[h,`NuVision`],[m,b]],[/\b(k88) b/i],[f,[h,`ZTE`],[m,b]],[/\b(nx\d{3}j) b/i],[f,[h,`ZTE`],[m,y]],[/\b(gen\d{3}) b.+49h/i],[f,[h,`Swiss`],[m,y]],[/\b(zur\d{3}) b/i],[f,[h,`Swiss`],[m,b]],[/\b((zeki)?tb.*\b) b/i],[f,[h,`Zeki`],[m,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,`Dragon Touch`],f,[m,b]],[/\b(ns-?\w{0,9}) b/i],[f,[h,`Insignia`],[m,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[f,[h,`NextBook`],[m,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,`Voice`],f,[m,y]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,`LvTel`],f,[m,y]],[/\b(ph-1) /i],[f,[h,`Essential`],[m,y]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[f,[h,`Envizen`],[m,b]],[/\b(trio[-\w\. ]+) b/i],[f,[h,`MachSpeed`],[m,b]],[/\btu_(1491) b/i],[f,[h,`Rotor`],[m,b]],[/(shield[\w ]+) b/i],[f,[h,`Nvidia`],[m,b]],[/(sprint) (\w+)/i],[h,f,[m,y]],[/(kin\.[onetw]{3})/i],[[f,/\./g,` `],[h,N],[m,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[f,[h,z],[m,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[f,[h,z],[m,y]],[/smart-tv.+(samsung)/i],[h,[m,x]],[/hbbtv.+maple;(\d+)/i],[[f,/^/,`SmartTV`],[h,I],[m,x]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,M],[m,x]],[/(apple) ?tv/i],[h,[f,E+` TV`],[m,x]],[/crkey/i],[[f,O+`cast`],[h,A],[m,x]],[/droid.+aft(\w)( bui|\))/i],[f,[h,T],[m,x]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[f,[h,re],[m,x]],[/(bravia[\w ]+)( bui|\))/i],[f,[h,L],[m,x]],[/(mitv-\w{5}) bui/i],[f,[h,R],[m,x]],[/Hbbtv.*(technisat) (.*);/i],[h,f,[m,x]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,se],[f,se],[m,x]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,x]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,f,[m,v]],[/droid.+; (shield) bui/i],[f,[h,`Nvidia`],[m,v]],[/(playstation [345portablevi]+)/i],[f,[h,L],[m,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[f,[h,N],[m,v]],[/((pebble))app/i],[h,f,[m,S]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[f,[h,E],[m,S]],[/droid.+; (glass) \d/i],[f,[h,A],[m,S]],[/droid.+; (wt63?0{2,3})\)/i],[f,[h,z],[m,S]],[/(quest( 2| pro)?)/i],[f,[h,B],[m,S]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[m,C]],[/(aeobc)\b/i],[f,[h,T],[m,C]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[f,[m,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[f,[m,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,y]],[/(android[-\w\. ]{0,9});.+buil/i],[f,[h,`Generic`]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[g,[p,ne+`HTML`]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[g,[p,`Blink`]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[p,g],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[g,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,g],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[p,[g,K,le]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,`Windows`],[g,K,le]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[g,/_/g,`.`],[p,`iOS`]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,ie],[g,/_/g,`.`]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[g,p],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[p,g],[/\(bb(10);/i],[g,[p,te]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[g,[p,`Symbian`]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[g,[p,k+` OS`]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[g,[p,`webOS`]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[g,[p,`watchOS`]],[/crkey\/([\d\.]+)/i],[g,[p,O+`cast`]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[p,V],g],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[p,g],[/(sunos) ?([\w\.\d]*)/i],[[p,`Solaris`],g],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[p,g]]},q=function(e,t){if(typeof e===l&&(t=e,e=r),!(this instanceof q))return new q(e,t).getResult();var i=typeof n!==c&&n.navigator?n.navigator:r,o=e||(i&&i.userAgent?i.userAgent:a),v=i&&i.userAgentData?i.userAgentData:r,x=t?H(ue,t):ue,S=i&&i.userAgent==o;return this.getBrowser=function(){var e={};return e[p]=r,e[g]=r,G.call(e,o,x.browser),e[d]=oe(e[g]),S&&i&&i.brave&&typeof i.brave.isBrave==s&&(e[p]=`Brave`),e},this.getCPU=function(){var e={};return e[_]=r,G.call(e,o,x.cpu),e},this.getDevice=function(){var e={};return e[h]=r,e[f]=r,e[m]=r,G.call(e,o,x.device),S&&!e[m]&&v&&v.mobile&&(e[m]=y),S&&e[f]==`Macintosh`&&i&&typeof i.standalone!==c&&i.maxTouchPoints&&i.maxTouchPoints>2&&(e[f]=`iPad`,e[m]=b),e},this.getEngine=function(){var e={};return e[p]=r,e[g]=r,G.call(e,o,x.engine),e},this.getOS=function(){var e={};return e[p]=r,e[g]=r,G.call(e,o,x.os),S&&!e[p]&&v&&v.platform!=`Unknown`&&(e[p]=v.platform.replace(/chrome os/i,V).replace(/macos/i,ie)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return o},this.setUA=function(e){return o=typeof e===u&&e.length>w?se(e,w):e,this},this.setUA(o),this};q.VERSION=i,q.BROWSER=U([p,g,d]),q.CPU=U([_]),q.DEVICE=U([f,h,m,v,y,x,b,S,C]),q.ENGINE=q.OS=U([p,g]),typeof t===c?typeof n!==c&&(n.UAParser=q):(e.exports&&(t=e.exports=q),t.UAParser=q);var J=typeof n!==c&&(n.jQuery||n.Zepto);if(J&&!J.ua){var Y=new q;J.ua=Y.getResult(),J.ua.get=function(){return Y.getUA()},J.ua.set=function(e){Y.setUA(e);var t=Y.getResult();for(var n in t)J.ua[n]=t[n]}}})(typeof window==`object`?window:this)}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}},o=!0;try{e[r].call(a.exports,a,a.exports,n),o=!1}finally{o&&delete t[r]}return a.exports}typeof n<`u`&&(n.ab={}.dirname+`/`),Ve.exports=n(226)})()),Ve.exports}var We;function Ge(){return We||(We=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}t(e,{isBot:function(){return i},userAgent:function(){return o},userAgentFromString:function(){return a}});let n=r(Ue());function r(e){return e&&e.__esModule?e:{default:e}}function i(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(e)}function a(e){return{...(0,n.default)(e),isBot:e===void 0?!1:i(e)}}function o({headers:e}){return a(e.get(`user-agent`)||void 0)}})(Be)),Be}var Ke={},qe;function Je(){return qe||(qe=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`URLPattern`,{enumerable:!0,get:function(){return t}});let t=typeof URLPattern>`u`?void 0:URLPattern})(Ke)),Ke}var Ye;function Xe(){return Ye||(Ye=1,(function(e,t){let n={NextRequest:Ae().NextRequest,NextResponse:Ie().NextResponse,ImageResponse:ze().ImageResponse,userAgentFromString:Ge().userAgentFromString,userAgent:Ge().userAgent,URLPattern:Je().URLPattern};e.exports=n,t.NextRequest=n.NextRequest,t.NextResponse=n.NextResponse,t.ImageResponse=n.ImageResponse,t.userAgentFromString=n.userAgentFromString,t.userAgent=n.userAgent,t.URLPattern=n.URLPattern})(C,C.exports)),C.exports}var Ze=Xe(),Qe=(e=>(e[e.login=0]=`login`,e[e.logout=1]=`logout`,e))(Qe||{}),$e={login:`login`,logout:`logout`,unknown:``},et=`Content-Type`,X={applicationJson:`application/json`,multipartFormData:`multipart/form-data`,applicationXwwwFormUrlencoded:`application/x-www-form-urlencoded`},tt=class{config;http;adapter;constructor({config:e,adapter:t,storage:n}){this.config=e;let r=ht(n.headers);(!r.deviceId||r.deviceId.trim().length===0)&&(r=_t(n.cookies)),this.http=new Tt({...r,userType:e.userType,helloURL:e.helloURL}),this.adapter=t}async handleRequest(e){try{let t=await this.adapter.parseRequest(e),n=await this.processRequest(t);return this.adapter.createResponse(n)}catch(e){_.error({error:e?.toString()||`Internal server error`},`ROUTE ERROR`);let t=this.createErrorResponse(500,e?.toString()||`Internal server error`);return this.adapter.createResponse(t)}}async processRequest(e){let t=e.url.searchParams,n=t.get(`m`)??`unknown`,r={...$e,...this.config.APIMAP}[n],i=e.cookies;if(this.http.setHttpOptsToCookies(i),!r||r.length===0)return this.createErrorResponse(404,`API not found`,i);let a;if((r.startsWith(`admin/`)||r.startsWith(`api/`))&&(a=bt(i),_.debug(a,`token`),!a||a.username.length===0||a.token.length===0))return this.createErrorResponse(409,`Authentication required`,i);_.debug({"content-type":e.contentType},`Content-Type`),_.debug({hostUrl:r,token:a?{...a}:``},`processRequest`);let o=e.method;if(o===`GET`){let n=b(t.toString(),[`m`]),i=await this.http.get({url:r,data:n,token:a});return this.createResponse({url:r,result:i,config:this.config,req:e})}else if(o===`POST`){let t,n=e.contentType;if(n.includes(X.applicationJson)||n.includes(X.applicationXwwwFormUrlencoded))e.body&&(t={...e.body});else if(n.includes(X.multipartFormData)){let r=n.match(/boundary=([^\s;]+)/);if(!r||!e.requestFormData)return this.createErrorResponse(411,`Missing boundary in form data`,i);let a=e.requestFormData.buffer;t={boundary:r[1],buffer:Buffer.from(a)};let o=e.requestFormData.formData;if(o)for(let[e,n]of Object.entries(o))e!==`file`&&(t[e]=n)}else return this.createErrorResponse(410,`Unsupported content type`,i);let o=await this.http.post({url:r,data:t,token:a});return this.createResponse({url:r,result:o,config:this.config,req:e})}return this.createErrorResponse(405,`Method not allowed, only supported GET or POST`,i)}createResponse({url:e,result:t,config:n,req:r}){let i={};i[et]=X.applicationJson;let a={status:t.success?200:t.code,headers:i,cookies:this.setCookies(r.cookies),body:t,context:r.context};if(t.success){switch(e){case $e[Qe[0]]:let e=t.data;Ct(e,a);break;case $e[Qe[1]]:a.cleanCookies=e=>wt(e);break}n.onHandlerSuccess&&n.onHandlerSuccess({url:e,data:t.data,req:r,res:a})}return a}createErrorResponse(e,t,n){let r={};return r[et]=X.applicationJson,{status:e,headers:r,cookies:n?this.setCookies(n):{},body:{code:e,success:!1,msg:t}}}setCookies(e){let t={};return Object.entries(e).forEach(([e,n])=>{t[e]={value:n}}),t}},nt=`zh-CN`,rt=`_device_id_key`,it=`_current_website_key`,at=`Get request error!`,ot=`Post request error!`,Z={IBOOT_DEVICE_ID:`dvid`,IBOOT_LANG:`lang`,IBOOT_WEBSITE_ID:`wid`,IBOOT_WEBSITE_NO:`wno`,IBOOT_TOKEN:`token`,IBOOT_USER:`user`},Q={DEVICE_ID:`Device-Id`,LANG:`Lang`,WEBSITE_ID:`Website-Id`,WEBSITE_NO:`Website-No`},st=e=>{if(!e.get)throw Error(`The get method of IStorage has not been implemented.`);let t=e.get(rt)??``,n=e.get(it),r=n==null?null:JSON.parse(n),i={};return t.length>0&&(i[`Device-Id`]=t),r&&(i.Lang=r.language,r.websiteId&&(i[`Website-Id`]=r.websiteId),r.websiteNo&&(i[`Website-No`]=r.websiteNo)),i},ct=({deviceId:e,website:t},n)=>{if(!n.set)throw Error(`The set method of IStorage has not been implemented.`);n.set(rt,e),t&&n.set(it,JSON.stringify(t))},lt=e=>`${process.env.BASE_URL||`/api/services`}?m=${e}`,ut=async(e,t)=>{let n=lt(e);if(t?.data){let e=new URLSearchParams(t.data);n+=`&${e}`}let r=t&&t.storage&&t.storage.get?st(t.storage):{},i=t?.headers;if(i)for(let e in i){let t=i[e];t&&(r[e]=t)}_.info({url:n,headers:r},`GET`);let a=await fetch(n,{method:`GET`,headers:r,cache:t?.useCache?`force-cache`:`default`});if(a.ok){let e=Object.fromEntries(a.headers.entries()),t={...await a.json(),headers:e};return _.debug(t,`GET_RESULT`),t}let o={code:a.status,success:!1,msg:a.statusText};return _.error(o),o},dt=async(e,t)=>{let n=t?.data??{},r=t?.headers,i,a=t&&t.storage&&t.storage.get?st(t.storage):{},o=new Headers(a);if(n instanceof FormData?i=n:(i=JSON.stringify(n),o.set(`Content-Type`,X.applicationJson)),r)for(let e in r){let t=r[e];t&&o.set(e,t)}_.info({url:e,headers:o},`POST`);let s=await fetch(e,{method:`POST`,headers:o,body:i});if(s.ok){let e=Object.fromEntries(s.headers.entries()),t={...await s.json(),headers:e};return _.debug(t,`POST_RESULT`),t}let c={code:s.status,success:!1,msg:s.statusText};return _.error(c),c},ft=async(e,t)=>{let n=await ut(e,t);if(n.success)return n.data;if(t?.showError){t.showError(n.msg??at);return}throw Error(n.msg??at)},pt=async(e,t)=>{let n=await dt(e,t);if(n.success)return n.data;if(t?.showError){t.showError(n.msg??ot);return}throw Error(n.msg??ot)},mt=async(e,t)=>{let n=await dt(e,t);return n.success?(t?.showSuccess&&t.showSuccess(n.msg??`SUCCESS`),!0):(t?.showError&&t.showError(n.msg??ot),!1)},ht=e=>{if(e.get){let t=e.get(Q.DEVICE_ID),n=e.get(Q.LANG),r=e.get(Q.WEBSITE_ID),i=e.get(Q.WEBSITE_NO),a={};return t&&t.length>0&&(a.deviceId=t),n&&n.length>0&&(a.lang=n),r&&r.length>0&&(a.websiteId=r),i&&i.length>0&&(a.websiteNo=i),a}throw Error(`The get method of IStorage has not been implemented.`)},gt=(e,t)=>{if(e.set)t.deviceId&&e.set(Q.DEVICE_ID,t.deviceId),t.lang&&e.set(Q.LANG,t.lang),t.websiteId&&e.set(Q.WEBSITE_ID,t.websiteId),t.websiteNo&&e.set(Q.WEBSITE_NO,t.websiteNo);else throw Error(`The set method of IStorage has not been implemented.`)},_t=e=>{if(e.get){let t=e.get(Z.IBOOT_DEVICE_ID),n=e.get(Z.IBOOT_LANG),r=e.get(Z.IBOOT_WEBSITE_ID),i=e.get(Z.IBOOT_WEBSITE_NO),a={};return t&&t.length>0&&(a.deviceId=t),n&&n.length>0&&(a.lang=n),r&&r.length>0&&(a.websiteId=r),i&&i.length>0&&(a.websiteNo=i),a}throw Error(`The get method of ICookies has not been implemented.`)},vt=(e,t)=>{if(e.set)t.deviceId&&e.set(Z.IBOOT_DEVICE_ID,t.deviceId),t.lang&&e.set(Z.IBOOT_LANG,t.lang),t.websiteId&&e.set(Z.IBOOT_WEBSITE_ID,t.websiteId),t.websiteNo&&e.set(Z.IBOOT_WEBSITE_NO,t.websiteNo);else throw Error(`The set method of ICookies has not been implemented.`)},yt=e=>{if(e.get){let t=e.get(Z.IBOOT_USER);if(t&&t.length>0)return JSON.parse(t)}},bt=e=>{if(e.get){let t=e[Z.IBOOT_USER];if(t&&t.length>0){let n=JSON.parse(t),r=n.username,i=n.userType.toString(),a=e[Z.IBOOT_TOKEN];if(a)return{username:r,utype:i,token:a}}}},xt=()=>({path:`/`,secure:process.env.APP_ENV===`production`,httpOnly:!0,sameSite:`strict`}),St={maxAge:-1,httpOnly:!0,path:`/`},Ct=(e,t)=>{let{id:n,name:r,username:i,nickname:a,headImg:o,token:s,lastLoginTime:c,deviceId:l,userType:u,mustChangePwd:d}=e,f={id:n,name:r,username:i,nickname:a||r,headImg:o,lastLoginTime:c,deviceId:l,userType:u,accountType:0,needToReview:!1,socketOnline:!1,mustChangePwd:d};t.cookies[Z.IBOOT_TOKEN]={value:s,options:xt()},t.cookies[Z.IBOOT_USER]={value:JSON.stringify(f),options:xt()}},wt=e=>{if(!e.set)throw Error(`cookies set function is undefined`);if(e.set(Z.IBOOT_TOKEN,``,St),e.set(Z.IBOOT_USER,``,St),!e.delete)throw Error(`cookies delete function is undefined`);e.delete(Z.IBOOT_TOKEN,St),e.delete(Z.IBOOT_USER,St)},Tt=class{baseUrl;helloMethod;apiKey;userType;userFrom;deviceId;version=`1`;lang;websiteId;websiteNo;constructor(e){process.env.APP_ENV===`production`||_.warn(`This is currently a development environment!`),this.baseUrl=process.env.APP_BASEURL,this.apiKey=process.env.APP_APIKEY,this.userFrom=process.env.APP_USERFROM??`1`,this.helloMethod=e.helloURL??``,this.userType=e.userType??p.TYPE_MGT,this.deviceId=e.deviceId??y(10),this.lang=e.lang??nt,this.websiteId=e.websiteId,this.websiteNo=e.websiteNo}encrypt(e){let t=d.default.enc.Utf8.parse(this.apiKey);return d.default.AES.encrypt(e,t).toString()}decrypt(e){let t=d.default.enc.Utf8.parse(this.apiKey);return d.default.AES.decrypt(e,t,{mode:d.default.mode.ECB}).toString(d.default.enc.Utf8)}setHttpOptsToCookies=e=>{this.deviceId&&this.deviceId.length>0&&(e[Z.IBOOT_DEVICE_ID]=this.deviceId),this.websiteId&&this.websiteId.length>0&&(e[Z.IBOOT_WEBSITE_ID]=this.websiteId),this.websiteNo&&this.websiteNo.length>0&&(e[Z.IBOOT_WEBSITE_NO]=this.websiteNo),this.lang&&this.lang.length>0&&(e[Z.IBOOT_LANG]=this.lang)};convertUrlParameter(e){let t=[];for(let n in e){let r=e[n];if(r&&typeof r==`string`)r=r.trim();else if(r&&typeof r==`object`){if(v(r)){if(r.length===0)continue;for(let e=0;e<r.length;e++){let i=r[e];for(let r in i){let a=i[r]??void 0;if(a){if(typeof a==`object`)v(a)&&a.forEach((i,a)=>{if(i)for(let o in i){let s=i[o];if(s&&s.toString().length>0){let i=`[${e.toString()}].${r+`[${a.toString()}].${o}`}=${x(s)}`;t.push(n+i)}}});else if(a.toString().length>0){let i=`[${e.toString()}].${r}=${x(a.toString())}`;t.push(n+i)}}}}}else for(let e in r){let i=r[e];if(i!=null&&i!=``&&i.length!=0){let r=`.${e}=${x(i)}`;t.push(n+r)}}continue}else r&&typeof r==`function`&&(r=null);r!=null&&r!=``&&r.length!=0&&t.push(n+`=`+x(r))}return t&&t.join(`&`)}async sign(e){let t=`&key=`+await this.helloIboot(),n=[];for(let t in e)n.push(t);n.sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()));let r=[];n.forEach(t=>{let n=e[t];typeof n==`object`&&(n=JSON.stringify(n)),r.push(t+`=`+n)});let i=r.join(`&`),a=u.default.md5((i+t).toLocaleUpperCase()),o={params:i,md5:a};return _.debug(o,`API_SIGN`),a}assemblyParameter(e,t){let n=e??{};return n.timestamp=Date.now()+``,n.echostr=y(10),n.version=this.version,n.deviceId=this.deviceId,n.webid=this.websiteId,n.apiKey=this.apiKey,t&&t.length>0&&(n.username=t),n}async assemblyHeader({urlParams:e,token:t}){let n={"Res-Type":`json`,"Device-Id":this.deviceId,"User-Type":t?.utype.toString()??this.userType.toString(),"User-From":this.userFrom,"Api-Key":this.apiKey};n[et]=X.applicationXwwwFormUrlencoded,this.lang&&this.lang.length>0&&(n.Lang=this.lang),this.websiteId&&this.websiteId.length>0&&(n[`Web-Id`]=this.websiteId),this.websiteNo&&this.websiteNo.length>0&&(n[`Web-No`]=this.websiteNo),t&&(t.token&&t.token.length>0&&t.username&&t.username.length>0&&(n.Authorization=t.token,n.Username=t.username),t.xcsrf&&(n[t.xcsrf.csrfHeader]=t.xcsrf.csrfToken));let r=b(e);return n.Sign=await this.sign(r),n}async helloIboot(){if(this.helloMethod.length<=0)return this.apiKey;let e=this.getApiUrl(this.helloMethod),t={"Res-Type":`json`,"Api-Key":this.apiKey};t[et]=X.applicationXwwwFormUrlencoded;let n={url:e,headers:t};_.debug(n,`HELLO`);let r=await fetch(e,{method:`GET`,headers:t,credentials:`include`,cache:`force-cache`});if(r.ok){let e=await r.json();return _.debug(e.data,`HELLO RESULT`),e.data}throw Error(`hello iBoot error!`)}getApiUrl(e){return`${this.baseUrl}/${e}`}async csrf(){let e=await this.get({url:`guest/csrf`});if(e.success){let t=e.data;if(t)return t.csrfToken.toString()}}async get({url:e,data:t,token:n,cache:r=`default`}){let i=this.assemblyParameter(t),a=this.convertUrlParameter(i),o=await this.assemblyHeader({urlParams:a,token:n}),s=`${this.getApiUrl(e)}?${a.toString()}`,c={url:s,headers:o};_.info(c,`GET`);let l=await fetch(s,{method:`GET`,headers:o,credentials:`include`,cache:r});if(l.ok){let e=Object.fromEntries(l.headers.entries()),t={...await l.json(),headers:e};return _.debug(t,`GET_RESULT`),t}let u={code:l.status,success:!1,msg:l.statusText};return _.error(u),u}async post({url:e,data:t,token:n,cache:r=`default`}){let i=t?{...t}:{},a=i.buffer??void 0,o=i.boundary??void 0;a&&delete i.buffer,o&&delete i.boundary;let s=this.assemblyParameter(i),c=this.convertUrlParameter(s),l=await this.assemblyHeader({urlParams:c,token:n});a&&o&&(l[`Content-Type`]=`multipart/form-data; boundary=${o}`);let u=this.getApiUrl(e),d={url:u,headers:l,params:s};_.info(d,`POST`);let f=a?`${u}?${c}`:u,p=await fetch(f,{method:`POST`,headers:l,body:a||c,credentials:`include`,cache:r});if(p.ok){let e=Object.fromEntries(p.headers.entries()),t={...await p.json(),headers:e};return _.debug(t,`POST_RESULT`),t}let m={code:p.status,success:!1,msg:p.statusText};return _.error(m),m}async stream({url:e,data:t,token:n}){t=t?{...t}:{};let r=t.buffer??void 0,i=t.boundary??void 0;r&&delete t.buffer,i&&delete t.boundary;let a=this.assemblyParameter(t),o=this.convertUrlParameter(a),s=await this.assemblyHeader({urlParams:o,token:n});r&&i&&(s[`Content-Type`]=`multipart/form-data; boundary=${i}`),s.Connection=`keep-alive`,s[`X-Accel-Buffering`]=`no`,s[`Cache-Control`]=`no-cache`;let c=this.getApiUrl(e);try{let e=r?`${c}?${o}`:c,t={url:c,headers:s,params:a};_.info(t,`STREAM`);let n=await fetch(e,{method:`POST`,headers:s,body:r||o.toString(),credentials:`include`});if(!n.ok)throw Error(`HTTP error! status: ${n.status}`);if(!n.body)throw Error(`No response body`);let i=Object.fromEntries(n.headers.entries());return new Response(n.body,{headers:i})}catch(e){throw e}}},$={site:`guest/site/`,shop:`guest/site/shop/`},Et=({pageNo:e,pageSize:t})=>({total:0,pageNo:e,pageSize:t,pageCount:0,first:!0,last:!0,content:[]});const Dt=`${$.site}helloIBoot`;var Ot=class{http;constructor(e){this.http=new Tt({deviceId:e?.deviceId,lang:e?.lang,websiteId:e?.websiteId,websiteNo:e?.websiteNo,userType:p.TYPE_C,helloURL:Dt}),console.log(`env >>> `,process.env.NODE_ENV)}async helloWebsite(e){let t=$.site+`helloWebsite`,n=await this.http.get({url:t});if(n.success){let t=n.headers;if(e&&t){let n=t[`device-id`],r=t.lang,i=t[`web-id`],a=t[`web-no`],o={};n&&n.length>0&&(o.deviceId=n),r&&r.length>0&&(o.lang=r),i&&i.length>0&&(o.websiteId=i),a&&a.length>0&&(o.websiteNo=a),gt(e,o)}}}async loadI18nList(){let e=$.site+`i18nList`,t=await this.http.get({url:e});return t.success?t.data??[]:[]}async loadWebsite(e){let t=$.site+`currentWebSite`,n=await this.http.get({url:t,data:{showNav:e?.showNav??`true`,showFriendLink:e?.showFriendLink??`false`}});if(n.success){let t=n.data,r=t.seoProps;return{website:t,metadata:{title:r?.title,description:r?.description,keywords:r?.keywords,authors:{url:`https://www.icms.xin`,name:`iCMS`}},i18nSites:e?.showI18NList?await this.loadI18nList():[]}}throw Error(n.msg)}async loadChannels(e){let t=$.site+`getChannelListByNo`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data??[];throw Error(n.msg)}async loadChannelById(e){let t=$.site+`getChannelById`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data;throw Error(n.msg)}async loadChannelByNo(e){let t=$.site+`getChannelByNo`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data;throw Error(n.msg)}async loadChannelByUri(e){let t=$.site+`getChannelByUrl`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data;throw Error(n.msg)}async loadProductDetail(e){let t=$.site+`getProduct`,n=await this.http.get({url:t,data:{proId:e}});if(n.success)return n.data;throw Error(n.msg)}async loadProductPageInfo(e){let t=$.site+`searchProductForPage`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data??Et({pageNo:e.pageNo,pageSize:e.pageSize});throw Error(n.msg)}async loadProductPageInfoByGroup(e){let t=$.site+`searchProductForPageByGroup`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data??Et({pageNo:e.pageNo,pageSize:e.pageSize});throw Error(n.msg)}async loadProductListByGroupId(e){let t=$.site+`searchProductByGroup`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data??[];throw Error(n.msg)}async loadNewsDetail(e){let t=$.site+`getNewsDetail`,n=await this.http.get({url:t,data:{newId:e}});if(n.success)return n.data;throw Error(n.msg)}async loadNewsPageInfo(e){let t=$.site+`searchNewsForPage`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data??Et({pageNo:e.pageNo,pageSize:e.pageSize});throw Error(n.msg)}async loadNewsPageInfoByGroupId(e){let t=$.site+`searchNewsForPageByGroup`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data??Et({pageNo:e.pageNo,pageSize:e.pageSize});throw Error(n.msg)}async loadNewsListByGroupId(e){let t=$.site+`searchNewsByGroup`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data??[];throw Error(n.msg)}async loadReviewList(e){let t=$.site+`getReviewList`,n=await this.http.get({url:t,data:{...e,rowCount:e.rowCount??20}});if(n.success)return n.data??[];throw Error(n.msg)}},kt={};const At=async({request:e,routeAdapter:t,storage:n})=>{let r=_t(n.cookies),i=new Ot(r);return(!r.websiteId||r.websiteId.trim().length===0)&&await i.helloWebsite(n.headers),await new tt({config:{userType:p.TYPE_B,APIMAP:kt,helloURL:Dt},adapter:t,storage:n}).handleRequest(e)};exports.ICMSServer=Ot,exports.helloURL=Dt,exports.icmsRouter=At;
|
|
12
|
+
`)}}})(be)),be}var Ce={},we,Te;function Ee(){if(Te)return we;Te=1;var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})},a=(i,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(let c of n(a))!r.call(i,c)&&c!==o&&e(i,c,{get:()=>a[c],enumerable:!(s=t(a,c))||s.enumerable});return i},o=t=>a(e({},`__esModule`,{value:!0}),t),s={};i(s,{RequestCookies:()=>_,ResponseCookies:()=>v,parseCookie:()=>l,parseSetCookie:()=>u,stringifyCookie:()=>c}),we=o(s);function c(e){let t=[`path`in e&&e.path&&`Path=${e.path}`,`expires`in e&&(e.expires||e.expires===0)&&`Expires=${(typeof e.expires==`number`?new Date(e.expires):e.expires).toUTCString()}`,`maxAge`in e&&typeof e.maxAge==`number`&&`Max-Age=${e.maxAge}`,`domain`in e&&e.domain&&`Domain=${e.domain}`,`secure`in e&&e.secure&&`Secure`,`httpOnly`in e&&e.httpOnly&&`HttpOnly`,`sameSite`in e&&e.sameSite&&`SameSite=${e.sameSite}`,`partitioned`in e&&e.partitioned&&`Partitioned`,`priority`in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent(e.value??``)}`;return t.length===0?n:`${n}; ${t.join(`; `)}`}function l(e){let t=new Map;for(let n of e.split(/; */)){if(!n)continue;let e=n.indexOf(`=`);if(e===-1){t.set(n,`true`);continue}let[r,i]=[n.slice(0,e),n.slice(e+1)];try{t.set(r,decodeURIComponent(i??`true`))}catch{}}return t}function u(e){if(!e)return;let[[t,n],...r]=l(e),{domain:i,expires:a,httponly:o,maxage:s,path:c,samesite:u,secure:f,partitioned:m,priority:g}=Object.fromEntries(r.map(([e,t])=>[e.toLowerCase(),t]));return d({name:t,value:decodeURIComponent(n),domain:i,...a&&{expires:new Date(a)},...o&&{httpOnly:!0},...typeof s==`string`&&{maxAge:Number(s)},path:c,...u&&{sameSite:p(u)},...f&&{secure:!0},...g&&{priority:h(g)},...m&&{partitioned:!0}})}function d(e){let t={};for(let n in e)e[n]&&(t[n]=e[n]);return t}var f=[`strict`,`lax`,`none`];function p(e){return e=e.toLowerCase(),f.includes(e)?e:void 0}var m=[`low`,`medium`,`high`];function h(e){return e=e.toLowerCase(),m.includes(e)?e:void 0}function g(e){if(!e)return[];var t=[],n=0,r,i,a,o,s;function c(){for(;n<e.length&&/\s/.test(e.charAt(n));)n+=1;return n<e.length}function l(){return i=e.charAt(n),i!==`=`&&i!==`;`&&i!==`,`}for(;n<e.length;){for(r=n,s=!1;c();)if(i=e.charAt(n),i===`,`){for(a=n,n+=1,c(),o=n;n<e.length&&l();)n+=1;n<e.length&&e.charAt(n)===`=`?(s=!0,n=o,t.push(e.substring(r,a)),r=n):n=a+1}else n+=1;(!s||n>=e.length)&&t.push(e.substring(r,e.length))}return t}var _=class{constructor(e){this._parsed=new Map,this._headers=e;let t=e.get(`cookie`);if(t){let e=l(t);for(let[t,n]of e)this._parsed.set(t,{name:t,value:n})}}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t=typeof e[0]==`string`?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){let t=Array.from(this._parsed);if(!e.length)return t.map(([e,t])=>t);let n=typeof e[0]==`string`?e[0]:e[0]?.name;return t.filter(([e])=>e===n).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,n]=e.length===1?[e[0].name,e[0].value]:e,r=this._parsed;return r.set(t,{name:t,value:n}),this._headers.set(`cookie`,Array.from(r).map(([e,t])=>c(t)).join(`; `)),this}delete(e){let t=this._parsed,n=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set(`cookie`,Array.from(t).map(([e,t])=>c(t)).join(`; `)),n}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for(`edge-runtime.inspect.custom`)](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join(`; `)}},v=class{constructor(e){this._parsed=new Map,this._headers=e;let t=e.getSetCookie?.call(e)??e.get(`set-cookie`)??[],n=Array.isArray(t)?t:g(t);for(let e of n){let t=u(e);t&&this._parsed.set(t.name,t)}}get(...e){let t=typeof e[0]==`string`?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){let t=Array.from(this._parsed.values());if(!e.length)return t;let n=typeof e[0]==`string`?e[0]:e[0]?.name;return t.filter(e=>e.name===n)}has(e){return this._parsed.has(e)}set(...e){let[t,n,r]=e.length===1?[e[0].name,e[0].value,e[0]]:e,i=this._parsed;return i.set(t,b({name:t,value:n,...r})),y(i,this._headers),this}delete(...e){let[t,n,r]=typeof e[0]==`string`?[e[0]]:[e[0].name,e[0].path,e[0].domain];return this.set({name:t,path:n,domain:r,value:``,expires:new Date(0)})}[Symbol.for(`edge-runtime.inspect.custom`)](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(c).join(`; `)}};function y(e,t){t.delete(`set-cookie`);for(let[,n]of e){let e=c(n);t.append(`set-cookie`,e)}}function b(e={name:``,value:``}){return typeof e.expires==`number`&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+e.maxAge*1e3)),(e.path===null||e.path===void 0)&&(e.path=`/`),e}return we}var De;function Oe(){return De||(De=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}t(e,{RequestCookies:function(){return n.RequestCookies},ResponseCookies:function(){return n.ResponseCookies},stringifyCookie:function(){return n.stringifyCookie}});let n=Ee()})(Ce)),Ce}var ke;function Ae(){return ke||(ke=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}t(e,{INTERNALS:function(){return o},NextRequest:function(){return s}});let n=pe(),r=ye(),i=Se(),a=Oe(),o=Symbol(`internal request`);class s extends Request{constructor(e,t={}){let i=typeof e!=`string`&&`url`in e?e.url:String(e);(0,r.validateURL)(i),e instanceof Request?super(e,t):super(i,t);let s=new n.NextURL(i,{headers:(0,r.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:t.nextConfig});this[o]={cookies:new a.RequestCookies(this.headers),geo:t.geo||{},ip:t.ip,nextUrl:s,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?i:s.toString()}}[Symbol.for(`edge-runtime.inspect.custom`)](){return{cookies:this.cookies,geo:this.geo,ip:this.ip,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[o].cookies}get geo(){return this[o].geo}get ip(){return this[o].ip}get nextUrl(){return this[o].nextUrl}get page(){throw new i.RemovedPageError}get ua(){throw new i.RemovedUAError}get url(){return this[o].url}}})(w)),w}var je={},Me={},Ne;function Pe(){return Ne||(Ne=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`ReflectAdapter`,{enumerable:!0,get:function(){return t}});class t{static get(e,t,n){let r=Reflect.get(e,t,n);return typeof r==`function`?r.bind(e):r}static set(e,t,n,r){return Reflect.set(e,t,n,r)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}})(Me)),Me}var Fe;function Ie(){return Fe||(Fe=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`NextResponse`,{enumerable:!0,get:function(){return l}});let t=Oe(),n=pe(),r=ye(),i=Pe(),a=Oe(),o=Symbol(`internal response`),s=new Set([301,302,303,307,308]);function c(e,t){var n;if(!(e==null||(n=e.request)==null)&&n.headers){if(!(e.request.headers instanceof Headers))throw Error(`request.headers must be an instance of Headers`);let n=[];for(let[r,i]of e.request.headers)t.set(`x-middleware-request-`+r,i),n.push(r);t.set(`x-middleware-override-headers`,n.join(`,`))}}class l extends Response{constructor(e,s={}){super(e,s);let l=this.headers,u=new a.ResponseCookies(l);this[o]={cookies:new Proxy(u,{get(e,n,r){switch(n){case`delete`:case`set`:return(...r)=>{let i=Reflect.apply(e[n],e,r),o=new Headers(l);return i instanceof a.ResponseCookies&&l.set(`x-middleware-set-cookie`,i.getAll().map(e=>(0,t.stringifyCookie)(e)).join(`,`)),c(s,o),i};default:return i.ReflectAdapter.get(e,n,r)}}}),url:s.url?new n.NextURL(s.url,{headers:(0,r.toNodeOutgoingHttpHeaders)(l),nextConfig:s.nextConfig}):void 0}}[Symbol.for(`edge-runtime.inspect.custom`)](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[o].cookies}static json(e,t){let n=Response.json(e,t);return new l(n.body,n)}static redirect(e,t){let n=typeof t==`number`?t:t?.status??307;if(!s.has(n))throw RangeError(`Failed to execute "redirect" on "response": Invalid status code`);let i=typeof t==`object`?t:{},a=new Headers(i?.headers);return a.set(`Location`,(0,r.validateURL)(e)),new l(null,{...i,headers:a,status:n})}static rewrite(e,t){let n=new Headers(t?.headers);return n.set(`x-middleware-rewrite`,(0,r.validateURL)(e)),c(t,n),new l(null,{...t,headers:n})}static next(e){let t=new Headers(e?.headers);return t.set(`x-middleware-next`,`1`),c(e,t),new l(null,{...e,headers:t})}}})(je)),je}var Le={},Re;function ze(){return Re||(Re=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`ImageResponse`,{enumerable:!0,get:function(){return t}});function t(){throw Error(`ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead`)}})(Le)),Le}var Be={},Ve={exports:{}},He;function Ue(){return He||(He=1,(()=>{var e={226:function(e,t){(function(n,r){var i=`1.0.35`,a=``,o=`?`,s=`function`,c=`undefined`,l=`object`,u=`string`,d=`major`,f=`model`,p=`name`,m=`type`,h=`vendor`,g=`version`,_=`architecture`,v=`console`,y=`mobile`,b=`tablet`,x=`smarttv`,S=`wearable`,C=`embedded`,w=350,T=`Amazon`,E=`Apple`,ee=`ASUS`,te=`BlackBerry`,D=`Browser`,O=`Chrome`,ne=`Edge`,k=`Firefox`,A=`Google`,j=`Huawei`,M=`LG`,N=`Microsoft`,P=`Motorola`,F=`Opera`,I=`Samsung`,re=`Sharp`,L=`Sony`,R=`Xiaomi`,z=`Zebra`,B=`Facebook`,V=`Chromium OS`,ie=`Mac OS`,H=function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},U=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},ae=function(e,t){return typeof e===u?W(t).indexOf(W(e))!==-1:!1},W=function(e){return e.toLowerCase()},oe=function(e){return typeof e===u?e.replace(/[^\d\.]/g,a).split(`.`)[0]:r},se=function(e,t){if(typeof e===u)return e=e.replace(/^\s\s*/,a),typeof t===c?e:e.substring(0,w)},G=function(e,t){for(var n=0,i,a,o,c,u,d;n<t.length&&!u;){var f=t[n],p=t[n+1];for(i=a=0;i<f.length&&!u&&f[i];)if(u=f[i++].exec(e),u)for(o=0;o<p.length;o++)d=u[++a],c=p[o],typeof c===l&&c.length>0?c.length===2?typeof c[1]==s?this[c[0]]=c[1].call(this,d):this[c[0]]=c[1]:c.length===3?typeof c[1]===s&&!(c[1].exec&&c[1].test)?this[c[0]]=d?c[1].call(this,d,c[2]):r:this[c[0]]=d?d.replace(c[1],c[2]):r:c.length===4&&(this[c[0]]=d?c[3].call(this,d.replace(c[1],c[2])):r):this[c]=d||r;n+=2}},K=function(e,t){for(var n in t)if(typeof t[n]===l&&t[n].length>0){for(var i=0;i<t[n].length;i++)if(ae(t[n][i],e))return n===o?r:n}else if(ae(t[n],e))return n===o?r:n;return e},ce={"1.0":`/8`,1.2:`/1`,1.3:`/3`,"2.0":`/412`,"2.0.2":`/416`,"2.0.3":`/417`,"2.0.4":`/419`,"?":`/`},le={ME:`4.90`,"NT 3.11":`NT3.51`,"NT 4.0":`NT4.0`,2e3:`NT 5.0`,XP:[`NT 5.1`,`NT 5.2`],Vista:`NT 6.0`,7:`NT 6.1`,8:`NT 6.2`,8.1:`NT 6.3`,10:[`NT 6.4`,`NT 10.0`],RT:`ARM`},ue={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[g,[p,`Chrome`]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[g,[p,`Edge`]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,g],[/opios[\/ ]+([\w\.]+)/i],[g,[p,F+` Mini`]],[/\bopr\/([\w\.]+)/i],[g,[p,F]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[p,g],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[g,[p,`UC`+D]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[g,[p,`WeChat(Win) Desktop`]],[/micromessenger\/([\w\.]+)/i],[g,[p,`WeChat`]],[/konqueror\/([\w\.]+)/i],[g,[p,`Konqueror`]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[g,[p,`IE`]],[/ya(?:search)?browser\/([\w\.]+)/i],[g,[p,`Yandex`]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,`$1 Secure `+D],g],[/\bfocus\/([\w\.]+)/i],[g,[p,k+` Focus`]],[/\bopt\/([\w\.]+)/i],[g,[p,F+` Touch`]],[/coc_coc\w+\/([\w\.]+)/i],[g,[p,`Coc Coc`]],[/dolfin\/([\w\.]+)/i],[g,[p,`Dolphin`]],[/coast\/([\w\.]+)/i],[g,[p,F+` Coast`]],[/miuibrowser\/([\w\.]+)/i],[g,[p,`MIUI `+D]],[/fxios\/([-\w\.]+)/i],[g,[p,k]],[/\bqihu|(qi?ho?o?|360)browser/i],[[p,`360 `+D]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[p,/(.+)/,`$1 `+D],g],[/(comodo_dragon)\/([\w\.]+)/i],[[p,/_/g,` `],g],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[p,g],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,B],g],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[p,g],[/\bgsa\/([\w\.]+) .*safari\//i],[g,[p,`GSA`]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[g,[p,`TikTok`]],[/headlesschrome(?:\/([\w\.]+)| )/i],[g,[p,O+` Headless`]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,O+` WebView`],g],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[g,[p,`Android `+D]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,g],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[g,[p,`Mobile Safari`]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[g,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[g,K,ce]],[/(webkit|khtml)\/([\w\.]+)/i],[p,g],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,`Netscape`],g],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[g,[p,k+` Reality`]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[p,g],[/(cobalt)\/([\w\.]+)/i],[p,[g,/master.|lts./,``]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[_,`amd64`]],[/(ia32(?=;))/i],[[_,W]],[/((?:i[346]|x)86)[;\)]/i],[[_,`ia32`]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[_,`arm64`]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[_,`armhf`]],[/windows (ce|mobile); ppc;/i],[[_,`arm`]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[_,/ower/,a,W]],[/(sun4\w)[;\)]/i],[[_,`sparc`]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[_,W]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[f,[h,I],[m,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[f,[h,I],[m,y]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[f,[h,E],[m,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[f,[h,E],[m,b]],[/(macintosh);/i],[f,[h,E]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[f,[h,re],[m,y]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[f,[h,j],[m,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[f,[h,j],[m,y]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[f,/_/g,` `],[h,R],[m,y]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[f,/_/g,` `],[h,R],[m,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[f,[h,`OPPO`],[m,y]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[f,[h,`Vivo`],[m,y]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[f,[h,`Realme`],[m,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[f,[h,P],[m,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[f,[h,P],[m,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[f,[h,M],[m,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[f,[h,M],[m,y]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[f,[h,`Lenovo`],[m,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[f,/_/g,` `],[h,`Nokia`],[m,y]],[/(pixel c)\b/i],[f,[h,A],[m,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[f,[h,A],[m,y]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[f,[h,L],[m,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[f,`Xperia Tablet`],[h,L],[m,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[f,[h,`OnePlus`],[m,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[f,[h,T],[m,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[f,/(.+)/g,`Fire Phone $1`],[h,T],[m,y]],[/(playbook);[-\w\),; ]+(rim)/i],[f,h,[m,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[f,[h,te],[m,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[f,[h,ee],[m,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[f,[h,ee],[m,y]],[/(nexus 9)/i],[f,[h,`HTC`],[m,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[f,/_/g,` `],[m,y]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[f,[h,`Acer`],[m,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[f,[h,`Meizu`],[m,y]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,f,[m,y]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,f,[m,b]],[/(surface duo)/i],[f,[h,N],[m,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[f,[h,`Fairphone`],[m,y]],[/(u304aa)/i],[f,[h,`AT&T`],[m,y]],[/\bsie-(\w*)/i],[f,[h,`Siemens`],[m,y]],[/\b(rct\w+) b/i],[f,[h,`RCA`],[m,b]],[/\b(venue[\d ]{2,7}) b/i],[f,[h,`Dell`],[m,b]],[/\b(q(?:mv|ta)\w+) b/i],[f,[h,`Verizon`],[m,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[f,[h,`Barnes & Noble`],[m,b]],[/\b(tm\d{3}\w+) b/i],[f,[h,`NuVision`],[m,b]],[/\b(k88) b/i],[f,[h,`ZTE`],[m,b]],[/\b(nx\d{3}j) b/i],[f,[h,`ZTE`],[m,y]],[/\b(gen\d{3}) b.+49h/i],[f,[h,`Swiss`],[m,y]],[/\b(zur\d{3}) b/i],[f,[h,`Swiss`],[m,b]],[/\b((zeki)?tb.*\b) b/i],[f,[h,`Zeki`],[m,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,`Dragon Touch`],f,[m,b]],[/\b(ns-?\w{0,9}) b/i],[f,[h,`Insignia`],[m,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[f,[h,`NextBook`],[m,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,`Voice`],f,[m,y]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,`LvTel`],f,[m,y]],[/\b(ph-1) /i],[f,[h,`Essential`],[m,y]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[f,[h,`Envizen`],[m,b]],[/\b(trio[-\w\. ]+) b/i],[f,[h,`MachSpeed`],[m,b]],[/\btu_(1491) b/i],[f,[h,`Rotor`],[m,b]],[/(shield[\w ]+) b/i],[f,[h,`Nvidia`],[m,b]],[/(sprint) (\w+)/i],[h,f,[m,y]],[/(kin\.[onetw]{3})/i],[[f,/\./g,` `],[h,N],[m,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[f,[h,z],[m,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[f,[h,z],[m,y]],[/smart-tv.+(samsung)/i],[h,[m,x]],[/hbbtv.+maple;(\d+)/i],[[f,/^/,`SmartTV`],[h,I],[m,x]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,M],[m,x]],[/(apple) ?tv/i],[h,[f,E+` TV`],[m,x]],[/crkey/i],[[f,O+`cast`],[h,A],[m,x]],[/droid.+aft(\w)( bui|\))/i],[f,[h,T],[m,x]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[f,[h,re],[m,x]],[/(bravia[\w ]+)( bui|\))/i],[f,[h,L],[m,x]],[/(mitv-\w{5}) bui/i],[f,[h,R],[m,x]],[/Hbbtv.*(technisat) (.*);/i],[h,f,[m,x]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,se],[f,se],[m,x]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,x]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,f,[m,v]],[/droid.+; (shield) bui/i],[f,[h,`Nvidia`],[m,v]],[/(playstation [345portablevi]+)/i],[f,[h,L],[m,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[f,[h,N],[m,v]],[/((pebble))app/i],[h,f,[m,S]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[f,[h,E],[m,S]],[/droid.+; (glass) \d/i],[f,[h,A],[m,S]],[/droid.+; (wt63?0{2,3})\)/i],[f,[h,z],[m,S]],[/(quest( 2| pro)?)/i],[f,[h,B],[m,S]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[m,C]],[/(aeobc)\b/i],[f,[h,T],[m,C]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[f,[m,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[f,[m,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,y]],[/(android[-\w\. ]{0,9});.+buil/i],[f,[h,`Generic`]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[g,[p,ne+`HTML`]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[g,[p,`Blink`]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[p,g],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[g,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,g],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[p,[g,K,le]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,`Windows`],[g,K,le]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[g,/_/g,`.`],[p,`iOS`]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,ie],[g,/_/g,`.`]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[g,p],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[p,g],[/\(bb(10);/i],[g,[p,te]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[g,[p,`Symbian`]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[g,[p,k+` OS`]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[g,[p,`webOS`]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[g,[p,`watchOS`]],[/crkey\/([\d\.]+)/i],[g,[p,O+`cast`]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[p,V],g],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[p,g],[/(sunos) ?([\w\.\d]*)/i],[[p,`Solaris`],g],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[p,g]]},q=function(e,t){if(typeof e===l&&(t=e,e=r),!(this instanceof q))return new q(e,t).getResult();var i=typeof n!==c&&n.navigator?n.navigator:r,o=e||(i&&i.userAgent?i.userAgent:a),v=i&&i.userAgentData?i.userAgentData:r,x=t?H(ue,t):ue,S=i&&i.userAgent==o;return this.getBrowser=function(){var e={};return e[p]=r,e[g]=r,G.call(e,o,x.browser),e[d]=oe(e[g]),S&&i&&i.brave&&typeof i.brave.isBrave==s&&(e[p]=`Brave`),e},this.getCPU=function(){var e={};return e[_]=r,G.call(e,o,x.cpu),e},this.getDevice=function(){var e={};return e[h]=r,e[f]=r,e[m]=r,G.call(e,o,x.device),S&&!e[m]&&v&&v.mobile&&(e[m]=y),S&&e[f]==`Macintosh`&&i&&typeof i.standalone!==c&&i.maxTouchPoints&&i.maxTouchPoints>2&&(e[f]=`iPad`,e[m]=b),e},this.getEngine=function(){var e={};return e[p]=r,e[g]=r,G.call(e,o,x.engine),e},this.getOS=function(){var e={};return e[p]=r,e[g]=r,G.call(e,o,x.os),S&&!e[p]&&v&&v.platform!=`Unknown`&&(e[p]=v.platform.replace(/chrome os/i,V).replace(/macos/i,ie)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return o},this.setUA=function(e){return o=typeof e===u&&e.length>w?se(e,w):e,this},this.setUA(o),this};q.VERSION=i,q.BROWSER=U([p,g,d]),q.CPU=U([_]),q.DEVICE=U([f,h,m,v,y,x,b,S,C]),q.ENGINE=q.OS=U([p,g]),typeof t===c?typeof n!==c&&(n.UAParser=q):(e.exports&&(t=e.exports=q),t.UAParser=q);var J=typeof n!==c&&(n.jQuery||n.Zepto);if(J&&!J.ua){var Y=new q;J.ua=Y.getResult(),J.ua.get=function(){return Y.getUA()},J.ua.set=function(e){Y.setUA(e);var t=Y.getResult();for(var n in t)J.ua[n]=t[n]}}})(typeof window==`object`?window:this)}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}},o=!0;try{e[r].call(a.exports,a,a.exports,n),o=!1}finally{o&&delete t[r]}return a.exports}typeof n<`u`&&(n.ab={}.dirname+`/`),Ve.exports=n(226)})()),Ve.exports}var We;function Ge(){return We||(We=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}t(e,{isBot:function(){return i},userAgent:function(){return o},userAgentFromString:function(){return a}});let n=r(Ue());function r(e){return e&&e.__esModule?e:{default:e}}function i(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(e)}function a(e){return{...(0,n.default)(e),isBot:e===void 0?!1:i(e)}}function o({headers:e}){return a(e.get(`user-agent`)||void 0)}})(Be)),Be}var Ke={},qe;function Je(){return qe||(qe=1,(function(e){Object.defineProperty(e,`__esModule`,{value:!0}),Object.defineProperty(e,`URLPattern`,{enumerable:!0,get:function(){return t}});let t=typeof URLPattern>`u`?void 0:URLPattern})(Ke)),Ke}var Ye;function Xe(){return Ye||(Ye=1,(function(e,t){let n={NextRequest:Ae().NextRequest,NextResponse:Ie().NextResponse,ImageResponse:ze().ImageResponse,userAgentFromString:Ge().userAgentFromString,userAgent:Ge().userAgent,URLPattern:Je().URLPattern};e.exports=n,t.NextRequest=n.NextRequest,t.NextResponse=n.NextResponse,t.ImageResponse=n.ImageResponse,t.userAgentFromString=n.userAgentFromString,t.userAgent=n.userAgent,t.URLPattern=n.URLPattern})(C,C.exports)),C.exports}var Ze=Xe(),Qe=(e=>(e[e.login=0]=`login`,e[e.logout=1]=`logout`,e))(Qe||{}),$e={login:`login`,logout:`logout`,unknown:``},et=`Content-Type`,X={applicationJson:`application/json`,multipartFormData:`multipart/form-data`,applicationXwwwFormUrlencoded:`application/x-www-form-urlencoded`},tt=class{config;http;adapter;constructor({config:e,adapter:t,storage:n}){this.config=e;let r=ht(n.headers);(!r.deviceId||r.deviceId.trim().length===0)&&(r=_t(n.cookies)),this.http=new Tt({...r,userType:e.userType,helloURL:e.helloURL}),this.adapter=t}async handleRequest(e){try{let t=await this.adapter.parseRequest(e),n=await this.processRequest(t);return this.adapter.createResponse(n)}catch(e){_.error({error:e?.toString()||`Internal server error`},`ROUTE ERROR`);let t=this.createErrorResponse(500,e?.toString()||`Internal server error`);return this.adapter.createResponse(t)}}async processRequest(e){let t=e.url.searchParams,n=t.get(`m`)??`unknown`,r={...$e,...this.config.APIMAP}[n],i=e.cookies;if(this.http.setHttpOptsToCookies(i),!r||r.length===0)return this.createErrorResponse(404,`API not found`,i);let a;if((r.startsWith(`admin/`)||r.startsWith(`api/`))&&(a=bt(i),_.debug(a,`token`),!a||a.username.length===0||a.token.length===0))return this.createErrorResponse(409,`Authentication required`,i);_.debug({"content-type":e.contentType},`Content-Type`),_.debug({hostUrl:r,token:a?{...a}:``},`processRequest`);let o=e.method;if(o===`GET`){let n={...t};n.delete(`m`);let i=await this.http.get({url:r,data:n,token:a});return this.createResponse({url:r,result:i,config:this.config,req:e})}else if(o===`POST`){let t,n=e.contentType;if(n.includes(X.applicationJson)||n.includes(X.applicationXwwwFormUrlencoded))e.body&&(t={...e.body});else if(n.includes(X.multipartFormData)){let r=n.match(/boundary=([^\s;]+)/);if(!r||!e.requestFormData)return this.createErrorResponse(411,`Missing boundary in form data`,i);let a=e.requestFormData.buffer;t={boundary:r[1],buffer:Buffer.from(a)};let o=e.requestFormData.formData;if(o)for(let[e,n]of Object.entries(o))e!==`file`&&(t[e]=n)}else return this.createErrorResponse(410,`Unsupported content type`,i);let o=await this.http.post({url:r,data:t,token:a});return this.createResponse({url:r,result:o,config:this.config,req:e})}return this.createErrorResponse(405,`Method not allowed, only supported GET or POST`,i)}createResponse({url:e,result:t,config:n,req:r}){let i={};i[et]=X.applicationJson;let a={status:t.success?200:t.code,headers:i,cookies:this.setCookies(r.cookies),body:t,context:r.context};if(t.success){switch(e){case $e[Qe[0]]:let e=t.data;Ct(e,a);break;case $e[Qe[1]]:a.cleanCookies=e=>wt(e);break}n.onHandlerSuccess&&n.onHandlerSuccess({url:e,data:t.data,req:r,res:a})}return a}createErrorResponse(e,t,n){let r={};return r[et]=X.applicationJson,{status:e,headers:r,cookies:n?this.setCookies(n):{},body:{code:e,success:!1,msg:t}}}setCookies(e){let t={};return Object.entries(e).forEach(([e,n])=>{t[e]={value:n}}),t}},nt=`zh-CN`,rt=`_device_id_key`,it=`_current_website_key`,at=`Get request error!`,ot=`Post request error!`,Z={IBOOT_DEVICE_ID:`dvid`,IBOOT_LANG:`lang`,IBOOT_WEBSITE_ID:`wid`,IBOOT_WEBSITE_NO:`wno`,IBOOT_TOKEN:`token`,IBOOT_USER:`user`},Q={DEVICE_ID:`Device-Id`,LANG:`Lang`,WEBSITE_ID:`Website-Id`,WEBSITE_NO:`Website-No`},st=e=>{if(!e.get)throw Error(`The get method of IStorage has not been implemented.`);let t=e.get(rt)??``,n=e.get(it),r=n==null?null:JSON.parse(n),i={};return t.length>0&&(i[`Device-Id`]=t),r&&(i.Lang=r.language,r.websiteId&&(i[`Website-Id`]=r.websiteId),r.websiteNo&&(i[`Website-No`]=r.websiteNo)),i},ct=({deviceId:e,website:t},n)=>{if(!n.set)throw Error(`The set method of IStorage has not been implemented.`);n.set(rt,e),t&&n.set(it,JSON.stringify(t))},lt=e=>`${process.env.BASE_URL||`/api/services`}?m=${e}`,ut=async(e,t)=>{let n=lt(e);if(t?.data){let e=new URLSearchParams(t.data);n+=`&${e}`}let r=t&&t.storage&&t.storage.get?st(t.storage):{},i=t?.headers;if(i)for(let e in i){let t=i[e];t&&(r[e]=t)}_.info({url:n,headers:r},`GET`);let a=await fetch(n,{method:`GET`,headers:r,cache:t?.useCache?`force-cache`:`default`});if(a.ok){let e=Object.fromEntries(a.headers.entries()),t={...await a.json(),headers:e};return _.debug(t,`GET_RESULT`),t}let o={code:a.status,success:!1,msg:a.statusText};return _.error(o),o},dt=async(e,t)=>{let n=t?.data??{},r=t?.headers,i,a=t&&t.storage&&t.storage.get?st(t.storage):{},o=new Headers(a);if(n instanceof FormData?i=n:(i=JSON.stringify(n),o.set(`Content-Type`,X.applicationJson)),r)for(let e in r){let t=r[e];t&&o.set(e,t)}_.info({url:e,headers:o},`POST`);let s=await fetch(e,{method:`POST`,headers:o,body:i});if(s.ok){let e=Object.fromEntries(s.headers.entries()),t={...await s.json(),headers:e};return _.debug(t,`POST_RESULT`),t}let c={code:s.status,success:!1,msg:s.statusText};return _.error(c),c},ft=async(e,t)=>{let n=await ut(e,t);if(n.success)return n.data;if(t?.showError){t.showError(n.msg??at);return}throw Error(n.msg??at)},pt=async(e,t)=>{let n=await dt(e,t);if(n.success)return n.data;if(t?.showError){t.showError(n.msg??ot);return}throw Error(n.msg??ot)},mt=async(e,t)=>{let n=await dt(e,t);return n.success?(t?.showSuccess&&t.showSuccess(n.msg??`SUCCESS`),!0):(t?.showError&&t.showError(n.msg??ot),!1)},ht=e=>{if(e.get){let t=e.get(Q.DEVICE_ID),n=e.get(Q.LANG),r=e.get(Q.WEBSITE_ID),i=e.get(Q.WEBSITE_NO),a={};return t&&t.length>0&&(a.deviceId=t),n&&n.length>0&&(a.lang=n),r&&r.length>0&&(a.websiteId=r),i&&i.length>0&&(a.websiteNo=i),a}throw Error(`The get method of IStorage has not been implemented.`)},gt=(e,t)=>{if(e.set)t.deviceId&&e.set(Q.DEVICE_ID,t.deviceId),t.lang&&e.set(Q.LANG,t.lang),t.websiteId&&e.set(Q.WEBSITE_ID,t.websiteId),t.websiteNo&&e.set(Q.WEBSITE_NO,t.websiteNo);else throw Error(`The set method of IStorage has not been implemented.`)},_t=e=>{if(e.get){let t=e.get(Z.IBOOT_DEVICE_ID),n=e.get(Z.IBOOT_LANG),r=e.get(Z.IBOOT_WEBSITE_ID),i=e.get(Z.IBOOT_WEBSITE_NO),a={};return t&&t.length>0&&(a.deviceId=t),n&&n.length>0&&(a.lang=n),r&&r.length>0&&(a.websiteId=r),i&&i.length>0&&(a.websiteNo=i),a}throw Error(`The get method of ICookies has not been implemented.`)},vt=(e,t)=>{if(e.set)t.deviceId&&e.set(Z.IBOOT_DEVICE_ID,t.deviceId),t.lang&&e.set(Z.IBOOT_LANG,t.lang),t.websiteId&&e.set(Z.IBOOT_WEBSITE_ID,t.websiteId),t.websiteNo&&e.set(Z.IBOOT_WEBSITE_NO,t.websiteNo);else throw Error(`The set method of ICookies has not been implemented.`)},yt=e=>{if(e.get){let t=e.get(Z.IBOOT_USER);if(t&&t.length>0)return JSON.parse(t)}},bt=e=>{if(e.get){let t=e[Z.IBOOT_USER];if(t&&t.length>0){let n=JSON.parse(t),r=n.username,i=n.userType.toString(),a=e[Z.IBOOT_TOKEN];if(a)return{username:r,utype:i,token:a}}}},xt=()=>({path:`/`,secure:process.env.APP_ENV===`production`,httpOnly:!0,sameSite:`strict`}),St={maxAge:-1,httpOnly:!0,path:`/`},Ct=(e,t)=>{let{id:n,name:r,username:i,nickname:a,headImg:o,token:s,lastLoginTime:c,deviceId:l,userType:u,mustChangePwd:d}=e,f={id:n,name:r,username:i,nickname:a||r,headImg:o,lastLoginTime:c,deviceId:l,userType:u,accountType:0,needToReview:!1,socketOnline:!1,mustChangePwd:d};t.cookies[Z.IBOOT_TOKEN]={value:s,options:xt()},t.cookies[Z.IBOOT_USER]={value:JSON.stringify(f),options:xt()}},wt=e=>{if(!e.set)throw Error(`cookies set function is undefined`);if(e.set(Z.IBOOT_TOKEN,``,St),e.set(Z.IBOOT_USER,``,St),!e.delete)throw Error(`cookies delete function is undefined`);e.delete(Z.IBOOT_TOKEN,St),e.delete(Z.IBOOT_USER,St)},Tt=class{baseUrl;helloMethod;apiKey;userType;userFrom;deviceId;version=`1`;lang;websiteId;websiteNo;constructor(e){process.env.APP_ENV===`production`||_.warn(`This is currently a development environment!`),this.baseUrl=process.env.APP_BASEURL,this.apiKey=process.env.APP_APIKEY,this.userFrom=process.env.APP_USERFROM??`1`,this.helloMethod=e.helloURL??``,this.userType=e.userType??p.TYPE_MGT,this.deviceId=e.deviceId??S(),this.lang=e.lang??nt,this.websiteId=e.websiteId,this.websiteNo=e.websiteNo}encrypt(e){let t=d.default.enc.Utf8.parse(this.apiKey);return d.default.AES.encrypt(e,t).toString()}decrypt(e){let t=d.default.enc.Utf8.parse(this.apiKey);return d.default.AES.decrypt(e,t,{mode:d.default.mode.ECB}).toString(d.default.enc.Utf8)}setHttpOptsToCookies=e=>{this.deviceId&&this.deviceId.length>0&&(e[Z.IBOOT_DEVICE_ID]=this.deviceId),this.websiteId&&this.websiteId.length>0&&(e[Z.IBOOT_WEBSITE_ID]=this.websiteId),this.websiteNo&&this.websiteNo.length>0&&(e[Z.IBOOT_WEBSITE_NO]=this.websiteNo),this.lang&&this.lang.length>0&&(e[Z.IBOOT_LANG]=this.lang)};async sign(e){let t=`&key=`+await this.helloIboot(),n=[];for(let t of e.keys())n.push(t);n.sort((e,t)=>{let n=e.match(/(\d+)/),r=t.match(/(\d+)/);return n&&r&&e.replace(/\d+/,``)===t.replace(/\d+/,``)?parseInt(n[1])-parseInt(r[1]):e.toLowerCase().localeCompare(t.toLowerCase(),void 0,{numeric:!0,sensitivity:`base`})});let r=[];n.forEach(t=>{let n=e.get(t);n&&r.push(t+`=`+n)});let i=r.join(`&`),a=u.default.md5((i+t).toLocaleUpperCase()),o={params:i,md5:a};return _.debug(o,`API_SIGN`),a}assemblyParameter(e,t){let n=e??new URLSearchParams,r=Intl.DateTimeFormat().resolvedOptions().timeZone;return n.set(`timezone`,r),n.set(`timestamp`,Date.now().toString()),n.set(`echostr`,b(10)),n.set(`version`,this.version),n.set(`deviceId`,this.deviceId),n.set(`webid`,this.websiteId??``),n.set(`apiKey`,this.apiKey),t&&t.length>0&&n.set(`username`,t),new URLSearchParams([...n].filter(([,e])=>e!==``))}async assemblyHeader({urlParams:e,token:t}){let n={"Res-Type":`json`,"Device-Id":this.deviceId,"User-Type":t?.utype.toString()??this.userType.toString(),"User-From":this.userFrom,"Api-Key":this.apiKey};return n[et]=X.applicationXwwwFormUrlencoded,this.lang&&this.lang.length>0&&(n.Lang=this.lang),this.websiteId&&this.websiteId.length>0&&(n[`Web-Id`]=this.websiteId),this.websiteNo&&this.websiteNo.length>0&&(n[`Web-No`]=this.websiteNo),t&&(t.token&&t.token.length>0&&t.username&&t.username.length>0&&(n.Authorization=t.token,n.Username=t.username),t.xcsrf&&(n[t.xcsrf.csrfHeader]=t.xcsrf.csrfToken)),n.Sign=await this.sign(e),n}async helloIboot(){if(this.helloMethod.length<=0)return this.apiKey;let e=this.getApiUrl(this.helloMethod),t={"Res-Type":`json`,"Api-Key":this.apiKey};t[et]=X.applicationXwwwFormUrlencoded;let n={url:e,headers:t};_.debug(n,`HELLO`);let r=await fetch(e,{method:`GET`,headers:t,credentials:`include`,cache:`force-cache`});if(r.ok){let e=await r.json();return _.debug(e.data,`HELLO RESULT`),e.data}throw Error(`hello iBoot error!`)}getApiUrl(e){return`${this.baseUrl}/${e}`}async csrf(){let e=await this.get({url:`guest/csrf`});if(e.success){let t=e.data;if(t)return t.csrfToken.toString()}}async get({url:e,data:t,token:n,cache:r=`default`}){let i=this.assemblyParameter(t?new URLSearchParams(t):void 0),a=await this.assemblyHeader({urlParams:i,token:n}),o=`${this.getApiUrl(e)}?${i.toString()}`,s={url:o,headers:a};_.info(s,`GET`);let c=await fetch(o,{method:`GET`,headers:a,credentials:`include`,cache:r});if(c.ok){let e=Object.fromEntries(c.headers.entries()),t={...await c.json(),headers:e};return _.debug(t,`GET_RESULT`),t}let l={code:c.status,success:!1,msg:c.statusText};return _.error(l),l}async post({url:e,data:t,token:n,cache:r=`default`}){let i=t?{...t}:{},a=i.buffer??void 0,o=i.boundary??void 0;a&&delete i.buffer,o&&delete i.boundary;let s=this.assemblyParameter(new URLSearchParams(i)),c=await this.assemblyHeader({urlParams:s,token:n});a&&o&&(c[`Content-Type`]=`multipart/form-data; boundary=${o}`);let l=this.getApiUrl(e),u={url:l,headers:c,params:s};_.info(u,`POST`);let d=a?`${l}?${s}`:l,f=await fetch(d,{method:`POST`,headers:c,body:a||s,credentials:`include`,cache:r});if(f.ok){let e=Object.fromEntries(f.headers.entries()),t={...await f.json(),headers:e};return _.debug(t,`POST_RESULT`),t}let p={code:f.status,success:!1,msg:f.statusText};return _.error(p),p}},$={site:`guest/site/`,shop:`guest/site/shop/`},Et=({pageNo:e,pageSize:t})=>({total:0,pageNo:e,pageSize:t,pageCount:0,first:!0,last:!0,content:[]});const Dt=`${$.site}helloIBoot`;var Ot=class{http;constructor(e){this.http=new Tt({...ht(e.headerStorage),userType:p.TYPE_C,helloURL:Dt})}async helloWebsite(e,t){let n=$.site+`helloWebsite`,r=await this.http.get({url:n});if(r.success){let n=r.headers;if(n){let r=n[`device-id`],i=n.lang,a=n[`web-id`],o=n[`web-no`],s={};r&&r.length>0&&(s.deviceId=r),i&&i.length>0&&(s.lang=i),a&&a.length>0&&(s.websiteId=a),o&&o.length>0&&(s.websiteNo=o),gt(e,s),vt(t,s)}}}async loadI18nList(){let e=$.site+`i18nList`,t=await this.http.get({url:e});return t.success?t.data??[]:[]}async loadWebsite(e){let t=$.site+`currentWebSite`,n=await this.http.get({url:t,data:{showNav:e?.showNav??`true`,showFriendLink:e?.showFriendLink??`false`}});if(n.success){let t=n.data,r=t.seoProps;return{website:t,metadata:{title:r?.title,description:r?.description,keywords:r?.keywords,authors:{url:`https://www.icms.xin`,name:`iCMS`}},i18nSites:e?.showI18NList?await this.loadI18nList():[]}}throw Error(n.msg)}async loadChannels(e){let t=$.site+`getChannelListByNo`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data??[];throw Error(n.msg)}async loadChannelById(e){let t=$.site+`getChannelById`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data;throw Error(n.msg)}async loadChannelByNo(e){let t=$.site+`getChannelByNo`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data;throw Error(n.msg)}async loadChannelByUri(e){let t=$.site+`getChannelByUrl`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data;throw Error(n.msg)}async loadProductDetail(e){let t=$.site+`getProduct`,n=await this.http.get({url:t,data:{proId:e}});if(n.success)return n.data;throw Error(n.msg)}async loadProductPageInfo(e){let t=$.site+`searchProductForPage`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data??Et({pageNo:e.pageNo,pageSize:e.pageSize});throw Error(n.msg)}async loadProductPageInfoByGroup(e){let t=$.site+`searchProductForPageByGroup`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data??Et({pageNo:e.pageNo,pageSize:e.pageSize});throw Error(n.msg)}async loadProductListByGroupId(e){let t=$.site+`searchProductByGroup`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data??[];throw Error(n.msg)}async loadNewsDetail(e){let t=$.site+`getNewsDetail`,n=await this.http.get({url:t,data:{newId:e}});if(n.success)return n.data;throw Error(n.msg)}async loadNewsPageInfo(e){let t=$.site+`searchNewsForPage`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data??Et({pageNo:e.pageNo,pageSize:e.pageSize});throw Error(n.msg)}async loadNewsPageInfoByGroupId(e){let t=$.site+`searchNewsForPageByGroup`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data??Et({pageNo:e.pageNo,pageSize:e.pageSize});throw Error(n.msg)}async loadNewsListByGroupId(e){let t=$.site+`searchNewsByGroup`,n=await this.http.get({url:t,data:{...e}});if(n.success)return n.data??[];throw Error(n.msg)}async loadReviewList(e){let t=$.site+`getReviewList`,n=await this.http.get({url:t,data:{...e,rowCount:e.rowCount??20}});if(n.success)return n.data??[];throw Error(n.msg)}},kt={};const At=async({request:e,routeAdapter:t,storage:n})=>await new tt({config:{userType:p.TYPE_B,APIMAP:kt,helloURL:Dt},adapter:t,storage:n}).handleRequest(e);exports.ICMSServer=Ot,exports.helloURL=Dt,exports.icmsRouter=At;
|
|
13
13
|
//# sourceMappingURL=icms-api.cjs.js.map
|