iboot-http-client 1.2.7 → 1.2.9
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/iboot-http-client.cjs.js +2 -2
- package/dist/iboot-http-client.cjs.js.map +1 -1
- package/dist/iboot-http-client.es.js +487 -472
- package/dist/iboot-http-client.es.js.map +1 -1
- package/dist/iboot-http-client.umd.js +2 -2
- package/dist/iboot-http-client.umd.js.map +1 -1
- package/dist/types/http-client.d.ts +2 -1
- package/dist/types/router.d.ts +15 -1
- package/dist/types/types/http.d.ts +3 -1
- package/dist/types/types/router.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Qt=require("pino"),Zt=require("pino-pretty"),er=require("js-md5"),ne=require("crypto-js"),tr={GENERAL:0,PHONE:1,EMAIL:2},rt={TYPE_MGT:0,TYPE_C:1,TYPE_B:2},rr={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},nr={unknown:0,male:1,female:2},ir=Zt({colorize:!0,destination:process.stdout,translateTime:"SYS:yyyy-mm-dd HH:MM:ss",ignore:"pid,hostname",messageFormat:"{msg}",singleLine:!0}),k=Qt({name:process.env.APP_NAME??"iBoot",level:process.env.APP_ENV==="production"?"info":"debug",nestedKey:"payload"},ir),Je=i=>Array.isArray(i)||typeof i=="object"&&Object.prototype.toString.call(i)==="[object Array]",Qe=i=>{const e=i||32,t="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",o=t.length;let n="";for(let a=0;a<e;a++)n+=t.charAt(Math.floor(Math.random()*o));return n},ve=(i,e)=>{const t={};return i.split("&").forEach(n=>{const a=n.split("=");a[1]&&(!e||e.indexOf(a[0])==-1)&&(t[a[0]]=a[1])}),t},de=i=>!i||i==""||i.length==0?"":encodeURIComponent(i).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\'/g,"%27").replace(/\!/g,"%21").replace(/\~/g,"%7E"),or=(i,e)=>{const t={"M+":i.getMonth()+1,"d+":i.getDate(),"h+":i.getHours(),"m+":i.getMinutes(),"s+":i.getSeconds(),"q+":Math.floor((i.getMonth()+3)/3),S:i.getMilliseconds()};if(/(y+)/.test(e)){const n=new RegExp(/(y+)/).exec(e);let a=0;n&&n.length>0&&(a=n[0].length),e=e.replace(/(y+)/,i.getFullYear()+"").substring(4-a)}for(const o in t){const n="("+o+")",a=new RegExp(n);if(a.test(e)){const u=a.exec(e);let r=0;u&&u.length>0&&(r=u[0].length),e=e.replace(a,r==1?t[o].toString():("00"+t[o]).substring(t[o].toString().length))}}return e};var Ee={exports:{}},Se={},Te={},Ae={},lt;function sr(){return lt||(lt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"detectDomainLocale",{enumerable:!0,get:function(){return e}});function e(t,o,n){if(t){n&&(n=n.toLowerCase());for(const r of t){var a,u;const d=(a=r.domain)==null?void 0:a.split(":",1)[0].toLowerCase();if(o===d||n===r.defaultLocale.toLowerCase()||(u=r.locales)!=null&&u.some(_=>_.toLowerCase()===n))return r}}}})(Ae)),Ae}var Ie={},Oe={},dt;function ar(){return dt||(dt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"removeTrailingSlash",{enumerable:!0,get:function(){return e}});function e(t){return t.replace(/\/$/,"")||"/"}})(Oe)),Oe}var xe={},Ne={},ht;function nt(){return ht||(ht=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"parsePath",{enumerable:!0,get:function(){return e}});function e(t){const o=t.indexOf("#"),n=t.indexOf("?"),a=n>-1&&(o<0||n<o);return a||o>-1?{pathname:t.substring(0,a?n:o),query:a?t.substring(n,o>-1?o:void 0):"",hash:o>-1?t.slice(o):""}:{pathname:t,query:"",hash:""}}})(Ne)),Ne}var ft;function jt(){return ft||(ft=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"addPathPrefix",{enumerable:!0,get:function(){return t}});const e=nt();function t(o,n){if(!o.startsWith("/")||!n)return o;const{pathname:a,query:u,hash:r}=(0,e.parsePath)(o);return""+n+a+u+r}})(xe)),xe}var Ce={},pt;function ur(){return pt||(pt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"addPathSuffix",{enumerable:!0,get:function(){return t}});const e=nt();function t(o,n){if(!o.startsWith("/")||!n)return o;const{pathname:a,query:u,hash:r}=(0,e.parsePath)(o);return""+a+n+u+r}})(Ce)),Ce}var Le={},ke={},mt;function it(){return mt||(mt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"pathHasPrefix",{enumerable:!0,get:function(){return t}});const e=nt();function t(o,n){if(typeof o!="string")return!1;const{pathname:a}=(0,e.parsePath)(o);return a===n||a.startsWith(n+"/")}})(ke)),ke}var _t;function cr(){return _t||(_t=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"addLocale",{enumerable:!0,get:function(){return o}});const e=jt(),t=it();function o(n,a,u,r){if(!a||a===u)return n;const d=n.toLowerCase();return!r&&((0,t.pathHasPrefix)(d,"/api")||(0,t.pathHasPrefix)(d,"/"+a.toLowerCase()))?n:(0,e.addPathPrefix)(n,"/"+a)}})(Le)),Le}var gt;function lr(){return gt||(gt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"formatNextPathnameInfo",{enumerable:!0,get:function(){return a}});const e=ar(),t=jt(),o=ur(),n=cr();function a(u){let r=(0,n.addLocale)(u.pathname,u.locale,u.buildId?void 0:u.defaultLocale,u.ignorePrefix);return(u.buildId||!u.trailingSlash)&&(r=(0,e.removeTrailingSlash)(r)),u.buildId&&(r=(0,o.addPathSuffix)((0,t.addPathPrefix)(r,"/_next/data/"+u.buildId),u.pathname==="/"?"index.json":".json")),r=(0,t.addPathPrefix)(r,u.basePath),!u.buildId&&u.trailingSlash?r.endsWith("/")?r:(0,o.addPathSuffix)(r,"/"):(0,e.removeTrailingSlash)(r)}})(Ie)),Ie}var Ue={},bt;function dr(){return bt||(bt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"getHostname",{enumerable:!0,get:function(){return e}});function e(t,o){let n;if(o?.host&&!Array.isArray(o.host))n=o.host.toString().split(":",1)[0];else if(t.hostname)n=t.hostname;else return;return n.toLowerCase()}})(Ue)),Ue}var De={},Me={},wt;function hr(){return wt||(wt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"normalizeLocalePath",{enumerable:!0,get:function(){return e}});function e(t,o){let n;const a=t.split("/");return(o||[]).some(u=>a[1]&&a[1].toLowerCase()===u.toLowerCase()?(n=u,a.splice(1,1),t=a.join("/")||"/",!0):!1),{pathname:t,detectedLocale:n}}})(Me)),Me}var je={},Et;function fr(){return Et||(Et=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"removePathPrefix",{enumerable:!0,get:function(){return t}});const e=it();function t(o,n){if(!(0,e.pathHasPrefix)(o,n))return o;const a=o.slice(n.length);return a.startsWith("/")?a:"/"+a}})(je)),je}var vt;function pr(){return vt||(vt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"getNextPathnameInfo",{enumerable:!0,get:function(){return n}});const e=hr(),t=fr(),o=it();function n(a,u){var r;const{basePath:d,i18n:_,trailingSlash:c}=(r=u.nextConfig)!=null?r:{},f={pathname:a,trailingSlash:a!=="/"?a.endsWith("/"):c};d&&(0,o.pathHasPrefix)(f.pathname,d)&&(f.pathname=(0,t.removePathPrefix)(f.pathname,d),f.basePath=d);let g=f.pathname;if(f.pathname.startsWith("/_next/data/")&&f.pathname.endsWith(".json")){const S=f.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),x=S[0];f.buildId=x,g=S[1]!=="index"?"/"+S.slice(1).join("/"):"/",u.parseData===!0&&(f.pathname=g)}if(_){let S=u.i18nProvider?u.i18nProvider.analyze(f.pathname):(0,e.normalizeLocalePath)(f.pathname,_.locales);f.locale=S.detectedLocale;var R;f.pathname=(R=S.pathname)!=null?R:f.pathname,!S.detectedLocale&&f.buildId&&(S=u.i18nProvider?u.i18nProvider.analyze(g):(0,e.normalizeLocalePath)(g,_.locales),S.detectedLocale&&(f.locale=S.detectedLocale))}return f}})(De)),De}var Rt;function qt(){return Rt||(Rt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"NextURL",{enumerable:!0,get:function(){return d}});const e=sr(),t=lr(),o=dr(),n=pr(),a=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function u(_,c){return new URL(String(_).replace(a,"localhost"),c&&String(c).replace(a,"localhost"))}const r=Symbol("NextURLInternal");class d{constructor(c,f,g){let R,S;typeof f=="object"&&"pathname"in f||typeof f=="string"?(R=f,S=g||{}):S=g||f||{},this[r]={url:u(c,R??S.base),options:S,basePath:""},this.analyze()}analyze(){var c,f,g,R,S;const x=(0,n.getNextPathnameInfo)(this[r].url.pathname,{nextConfig:this[r].options.nextConfig,parseData:!process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,i18nProvider:this[r].options.i18nProvider}),l=(0,o.getHostname)(this[r].url,this[r].options.headers);this[r].domainLocale=this[r].options.i18nProvider?this[r].options.i18nProvider.detectDomainLocale(l):(0,e.detectDomainLocale)((f=this[r].options.nextConfig)==null||(c=f.i18n)==null?void 0:c.domains,l);const b=((g=this[r].domainLocale)==null?void 0:g.defaultLocale)||((S=this[r].options.nextConfig)==null||(R=S.i18n)==null?void 0:R.defaultLocale);this[r].url.pathname=x.pathname,this[r].defaultLocale=b,this[r].basePath=x.basePath??"",this[r].buildId=x.buildId,this[r].locale=x.locale??b,this[r].trailingSlash=x.trailingSlash}formatPathname(){return(0,t.formatNextPathnameInfo)({basePath:this[r].basePath,buildId:this[r].buildId,defaultLocale:this[r].options.forceLocale?void 0:this[r].defaultLocale,locale:this[r].locale,pathname:this[r].url.pathname,trailingSlash:this[r].trailingSlash})}formatSearch(){return this[r].url.search}get buildId(){return this[r].buildId}set buildId(c){this[r].buildId=c}get locale(){return this[r].locale??""}set locale(c){var f,g;if(!this[r].locale||!(!((g=this[r].options.nextConfig)==null||(f=g.i18n)==null)&&f.locales.includes(c)))throw new TypeError(`The NextURL configuration includes no locale "${c}"`);this[r].locale=c}get defaultLocale(){return this[r].defaultLocale}get domainLocale(){return this[r].domainLocale}get searchParams(){return this[r].url.searchParams}get host(){return this[r].url.host}set host(c){this[r].url.host=c}get hostname(){return this[r].url.hostname}set hostname(c){this[r].url.hostname=c}get port(){return this[r].url.port}set port(c){this[r].url.port=c}get protocol(){return this[r].url.protocol}set protocol(c){this[r].url.protocol=c}get href(){const c=this.formatPathname(),f=this.formatSearch();return`${this.protocol}//${this.host}${c}${f}${this.hash}`}set href(c){this[r].url=u(c),this.analyze()}get origin(){return this[r].url.origin}get pathname(){return this[r].url.pathname}set pathname(c){this[r].url.pathname=c}get hash(){return this[r].url.hash}set hash(c){this[r].url.hash=c}get search(){return this[r].url.search}set search(c){this[r].url.search=c}get password(){return this[r].url.password}set password(c){this[r].url.password=c}get username(){return this[r].url.username}set username(c){this[r].url.username=c}get basePath(){return this[r].basePath}set basePath(c){this[r].basePath=c.startsWith("/")?c:`/${c}`}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 d(String(this),this[r].options)}}})(Te)),Te}var qe={},He={},Pt;function mr(){return Pt||(Pt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(ge,be){for(var $ in be)Object.defineProperty(ge,$,{enumerable:!0,get:be[$]})}e(i,{ACTION_SUFFIX:function(){return d},APP_DIR_ALIAS:function(){return M},CACHE_ONE_YEAR:function(){return E},DOT_NEXT_ALIAS:function(){return P},ESLINT_DEFAULT_DIRS:function(){return te},GSP_NO_RETURNED_VALUE:function(){return oe},GSSP_COMPONENT_MEMBER_ERROR:function(){return ee},GSSP_NO_RETURNED_VALUE:function(){return se},INSTRUMENTATION_HOOK_FILENAME:function(){return p},MIDDLEWARE_FILENAME:function(){return s},MIDDLEWARE_LOCATION_REGEXP:function(){return v},NEXT_BODY_SUFFIX:function(){return f},NEXT_CACHE_IMPLICIT_TAG_ID:function(){return m},NEXT_CACHE_REVALIDATED_TAGS_HEADER:function(){return S},NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER:function(){return x},NEXT_CACHE_SOFT_TAGS_HEADER:function(){return R},NEXT_CACHE_SOFT_TAG_MAX_LENGTH:function(){return h},NEXT_CACHE_TAGS_HEADER:function(){return g},NEXT_CACHE_TAG_MAX_ITEMS:function(){return l},NEXT_CACHE_TAG_MAX_LENGTH:function(){return b},NEXT_DATA_SUFFIX:function(){return _},NEXT_INTERCEPTION_MARKER_PREFIX:function(){return o},NEXT_META_SUFFIX:function(){return c},NEXT_QUERY_PARAM_PREFIX:function(){return t},NON_STANDARD_NODE_ENV:function(){return ae},PAGES_DIR_ALIAS:function(){return w},PRERENDER_REVALIDATE_HEADER:function(){return n},PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER:function(){return a},PUBLIC_DIR_MIDDLEWARE_CONFLICT:function(){return F},ROOT_DIR_ALIAS:function(){return N},RSC_ACTION_CLIENT_WRAPPER_ALIAS:function(){return Q},RSC_ACTION_ENCRYPTION_ALIAS:function(){return J},RSC_ACTION_PROXY_ALIAS:function(){return j},RSC_ACTION_VALIDATE_ALIAS:function(){return H},RSC_MOD_REF_PROXY_ALIAS:function(){return D},RSC_PREFETCH_SUFFIX:function(){return u},RSC_SUFFIX:function(){return r},SERVER_PROPS_EXPORT_ERROR:function(){return he},SERVER_PROPS_GET_INIT_PROPS_CONFLICT:function(){return ie},SERVER_PROPS_SSG_CONFLICT:function(){return V},SERVER_RUNTIME:function(){return ue},SSG_FALLBACK_EXPORT_ERROR:function(){return pe},SSG_GET_INITIAL_PROPS_CONFLICT:function(){return z},STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR:function(){return Z},UNSTABLE_REVALIDATE_RENAME_ERROR:function(){return fe},WEBPACK_LAYERS:function(){return me},WEBPACK_RESOURCE_QUERIES:function(){return _e}});const t="nxtP",o="nxtI",n="x-prerender-revalidate",a="x-prerender-revalidate-if-generated",u=".prefetch.rsc",r=".rsc",d=".action",_=".json",c=".meta",f=".body",g="x-next-cache-tags",R="x-next-cache-soft-tags",S="x-next-revalidated-tags",x="x-next-revalidate-tag-token",l=128,b=256,h=1024,m="_N_T_",E=31536e3,s="middleware",v=`(?:src/)?${s}`,p="instrumentation",w="private-next-pages",P="private-dot-next",N="private-next-root-dir",M="private-next-app-dir",D="private-next-rsc-mod-ref-proxy",H="private-next-rsc-action-validate",j="private-next-rsc-server-reference",J="private-next-rsc-action-encryption",Q="private-next-rsc-action-client-wrapper",F="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",z="You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps",ie="You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.",V="You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps",Z="can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props",he="pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export",oe="Your `getStaticProps` function did not return an object. Did you forget to add a `return`?",se="Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?",fe="The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.",ee="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",ae='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',pe="Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export",te=["app","pages","components","lib","src"],ue={edge:"edge",experimentalEdge:"experimental-edge",nodejs:"nodejs"},L={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"},me={...L,GROUP:{serverOnly:[L.reactServerComponents,L.actionBrowser,L.appMetadataRoute,L.appRouteHandler,L.instrument],clientOnly:[L.serverSideRendering,L.appPagesBrowser],nonClientServerTarget:[L.middleware,L.api],app:[L.reactServerComponents,L.actionBrowser,L.appMetadataRoute,L.appRouteHandler,L.serverSideRendering,L.appPagesBrowser,L.shared,L.instrument]}},_e={edgeSSREntry:"__next_edge_ssr_entry__",metadata:"__next_metadata__",metadataRoute:"__next_metadata_route__",metadataImageMeta:"__next_metadata_image_meta__"}})(He)),He}var yt;function Ht(){return yt||(yt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(d,_){for(var c in _)Object.defineProperty(d,c,{enumerable:!0,get:_[c]})}e(i,{fromNodeOutgoingHttpHeaders:function(){return o},normalizeNextQueryParam:function(){return r},splitCookiesString:function(){return n},toNodeOutgoingHttpHeaders:function(){return a},validateURL:function(){return u}});const t=mr();function o(d){const _=new Headers;for(let[c,f]of Object.entries(d)){const g=Array.isArray(f)?f:[f];for(let R of g)typeof R>"u"||(typeof R=="number"&&(R=R.toString()),_.append(c,R))}return _}function n(d){var _=[],c=0,f,g,R,S,x;function l(){for(;c<d.length&&/\s/.test(d.charAt(c));)c+=1;return c<d.length}function b(){return g=d.charAt(c),g!=="="&&g!==";"&&g!==","}for(;c<d.length;){for(f=c,x=!1;l();)if(g=d.charAt(c),g===","){for(R=c,c+=1,l(),S=c;c<d.length&&b();)c+=1;c<d.length&&d.charAt(c)==="="?(x=!0,c=S,_.push(d.substring(f,R)),f=c):c=R+1}else c+=1;(!x||c>=d.length)&&_.push(d.substring(f,d.length))}return _}function a(d){const _={},c=[];if(d)for(const[f,g]of d.entries())f.toLowerCase()==="set-cookie"?(c.push(...n(g)),_[f]=c.length===1?c[0]:c):_[f]=g;return _}function u(d){try{return String(new URL(String(d)))}catch(_){throw new Error(`URL is malformed "${String(d)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:_})}}function r(d,_){const c=[t.NEXT_QUERY_PARAM_PREFIX,t.NEXT_INTERCEPTION_MARKER_PREFIX];for(const f of c)if(d!==f&&d.startsWith(f)){const g=d.substring(f.length);_(g)}}})(qe)),qe}var Fe={},St;function _r(){return St||(St=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(a,u){for(var r in u)Object.defineProperty(a,r,{enumerable:!0,get:u[r]})}e(i,{PageSignatureError:function(){return t},RemovedPageError:function(){return o},RemovedUAError:function(){return n}});class t extends Error{constructor({page:u}){super(`The middleware "${u}" accepts an async API directly with the form:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const er=require("pino"),tr=require("pino-pretty"),rr=require("js-md5"),ne=require("crypto-js"),nr={GENERAL:0,PHONE:1,EMAIL:2},nt={TYPE_MGT:0,TYPE_C:1,TYPE_B:2},ir={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},or={unknown:0,male:1,female:2},sr=tr({colorize:!0,destination:process.stdout,translateTime:"SYS:yyyy-mm-dd HH:MM:ss",ignore:"pid,hostname",messageFormat:"{msg}",singleLine:!0}),k=er({name:process.env.APP_NAME??"iBoot",level:process.env.APP_ENV==="production"?"info":"debug",nestedKey:"payload"},sr),Qe=i=>Array.isArray(i)||typeof i=="object"&&Object.prototype.toString.call(i)==="[object Array]",Ze=i=>{const e=i||32,t="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",o=t.length;let n="";for(let a=0;a<e;a++)n+=t.charAt(Math.floor(Math.random()*o));return n},Re=(i,e)=>{const t={};return i.split("&").forEach(n=>{const a=n.split("=");a[1]&&(!e||e.indexOf(a[0])==-1)&&(t[a[0]]=a[1])}),t},de=i=>!i||i==""||i.length==0?"":encodeURIComponent(i).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\'/g,"%27").replace(/\!/g,"%21").replace(/\~/g,"%7E"),ar=(i,e)=>{const t={"M+":i.getMonth()+1,"d+":i.getDate(),"h+":i.getHours(),"m+":i.getMinutes(),"s+":i.getSeconds(),"q+":Math.floor((i.getMonth()+3)/3),S:i.getMilliseconds()};if(/(y+)/.test(e)){const n=new RegExp(/(y+)/).exec(e);let a=0;n&&n.length>0&&(a=n[0].length),e=e.replace(/(y+)/,i.getFullYear()+"").substring(4-a)}for(const o in t){const n="("+o+")",a=new RegExp(n);if(a.test(e)){const u=a.exec(e);let r=0;u&&u.length>0&&(r=u[0].length),e=e.replace(a,r==1?t[o].toString():("00"+t[o]).substring(t[o].toString().length))}}return e};var Ee={exports:{}},Te={},Ae={},Ie={},dt;function ur(){return dt||(dt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"detectDomainLocale",{enumerable:!0,get:function(){return e}});function e(t,o,n){if(t){n&&(n=n.toLowerCase());for(const r of t){var a,u;const d=(a=r.domain)==null?void 0:a.split(":",1)[0].toLowerCase();if(o===d||n===r.defaultLocale.toLowerCase()||(u=r.locales)!=null&&u.some(g=>g.toLowerCase()===n))return r}}}})(Ie)),Ie}var Oe={},xe={},ht;function cr(){return ht||(ht=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"removeTrailingSlash",{enumerable:!0,get:function(){return e}});function e(t){return t.replace(/\/$/,"")||"/"}})(xe)),xe}var Ne={},Ce={},ft;function it(){return ft||(ft=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"parsePath",{enumerable:!0,get:function(){return e}});function e(t){const o=t.indexOf("#"),n=t.indexOf("?"),a=n>-1&&(o<0||n<o);return a||o>-1?{pathname:t.substring(0,a?n:o),query:a?t.substring(n,o>-1?o:void 0):"",hash:o>-1?t.slice(o):""}:{pathname:t,query:"",hash:""}}})(Ce)),Ce}var pt;function Ht(){return pt||(pt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"addPathPrefix",{enumerable:!0,get:function(){return t}});const e=it();function t(o,n){if(!o.startsWith("/")||!n)return o;const{pathname:a,query:u,hash:r}=(0,e.parsePath)(o);return""+n+a+u+r}})(Ne)),Ne}var Le={},mt;function lr(){return mt||(mt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"addPathSuffix",{enumerable:!0,get:function(){return t}});const e=it();function t(o,n){if(!o.startsWith("/")||!n)return o;const{pathname:a,query:u,hash:r}=(0,e.parsePath)(o);return""+a+n+u+r}})(Le)),Le}var ke={},Ue={},_t;function ot(){return _t||(_t=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"pathHasPrefix",{enumerable:!0,get:function(){return t}});const e=it();function t(o,n){if(typeof o!="string")return!1;const{pathname:a}=(0,e.parsePath)(o);return a===n||a.startsWith(n+"/")}})(Ue)),Ue}var gt;function dr(){return gt||(gt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"addLocale",{enumerable:!0,get:function(){return o}});const e=Ht(),t=ot();function o(n,a,u,r){if(!a||a===u)return n;const d=n.toLowerCase();return!r&&((0,t.pathHasPrefix)(d,"/api")||(0,t.pathHasPrefix)(d,"/"+a.toLowerCase()))?n:(0,e.addPathPrefix)(n,"/"+a)}})(ke)),ke}var bt;function hr(){return bt||(bt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"formatNextPathnameInfo",{enumerable:!0,get:function(){return a}});const e=cr(),t=Ht(),o=lr(),n=dr();function a(u){let r=(0,n.addLocale)(u.pathname,u.locale,u.buildId?void 0:u.defaultLocale,u.ignorePrefix);return(u.buildId||!u.trailingSlash)&&(r=(0,e.removeTrailingSlash)(r)),u.buildId&&(r=(0,o.addPathSuffix)((0,t.addPathPrefix)(r,"/_next/data/"+u.buildId),u.pathname==="/"?"index.json":".json")),r=(0,t.addPathPrefix)(r,u.basePath),!u.buildId&&u.trailingSlash?r.endsWith("/")?r:(0,o.addPathSuffix)(r,"/"):(0,e.removeTrailingSlash)(r)}})(Oe)),Oe}var De={},wt;function fr(){return wt||(wt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"getHostname",{enumerable:!0,get:function(){return e}});function e(t,o){let n;if(o?.host&&!Array.isArray(o.host))n=o.host.toString().split(":",1)[0];else if(t.hostname)n=t.hostname;else return;return n.toLowerCase()}})(De)),De}var Me={},je={},Et;function pr(){return Et||(Et=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"normalizeLocalePath",{enumerable:!0,get:function(){return e}});function e(t,o){let n;const a=t.split("/");return(o||[]).some(u=>a[1]&&a[1].toLowerCase()===u.toLowerCase()?(n=u,a.splice(1,1),t=a.join("/")||"/",!0):!1),{pathname:t,detectedLocale:n}}})(je)),je}var qe={},vt;function mr(){return vt||(vt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"removePathPrefix",{enumerable:!0,get:function(){return t}});const e=ot();function t(o,n){if(!(0,e.pathHasPrefix)(o,n))return o;const a=o.slice(n.length);return a.startsWith("/")?a:"/"+a}})(qe)),qe}var Rt;function _r(){return Rt||(Rt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"getNextPathnameInfo",{enumerable:!0,get:function(){return n}});const e=pr(),t=mr(),o=ot();function n(a,u){var r;const{basePath:d,i18n:g,trailingSlash:c}=(r=u.nextConfig)!=null?r:{},_={pathname:a,trailingSlash:a!=="/"?a.endsWith("/"):c};d&&(0,o.pathHasPrefix)(_.pathname,d)&&(_.pathname=(0,t.removePathPrefix)(_.pathname,d),_.basePath=d);let p=_.pathname;if(_.pathname.startsWith("/_next/data/")&&_.pathname.endsWith(".json")){const S=_.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),x=S[0];_.buildId=x,p=S[1]!=="index"?"/"+S.slice(1).join("/"):"/",u.parseData===!0&&(_.pathname=p)}if(g){let S=u.i18nProvider?u.i18nProvider.analyze(_.pathname):(0,e.normalizeLocalePath)(_.pathname,g.locales);_.locale=S.detectedLocale;var R;_.pathname=(R=S.pathname)!=null?R:_.pathname,!S.detectedLocale&&_.buildId&&(S=u.i18nProvider?u.i18nProvider.analyze(p):(0,e.normalizeLocalePath)(p,g.locales),S.detectedLocale&&(_.locale=S.detectedLocale))}return _}})(Me)),Me}var Pt;function Ft(){return Pt||(Pt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"NextURL",{enumerable:!0,get:function(){return d}});const e=ur(),t=hr(),o=fr(),n=_r(),a=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function u(g,c){return new URL(String(g).replace(a,"localhost"),c&&String(c).replace(a,"localhost"))}const r=Symbol("NextURLInternal");class d{constructor(c,_,p){let R,S;typeof _=="object"&&"pathname"in _||typeof _=="string"?(R=_,S=p||{}):S=p||_||{},this[r]={url:u(c,R??S.base),options:S,basePath:""},this.analyze()}analyze(){var c,_,p,R,S;const x=(0,n.getNextPathnameInfo)(this[r].url.pathname,{nextConfig:this[r].options.nextConfig,parseData:!process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,i18nProvider:this[r].options.i18nProvider}),l=(0,o.getHostname)(this[r].url,this[r].options.headers);this[r].domainLocale=this[r].options.i18nProvider?this[r].options.i18nProvider.detectDomainLocale(l):(0,e.detectDomainLocale)((_=this[r].options.nextConfig)==null||(c=_.i18n)==null?void 0:c.domains,l);const b=((p=this[r].domainLocale)==null?void 0:p.defaultLocale)||((S=this[r].options.nextConfig)==null||(R=S.i18n)==null?void 0:R.defaultLocale);this[r].url.pathname=x.pathname,this[r].defaultLocale=b,this[r].basePath=x.basePath??"",this[r].buildId=x.buildId,this[r].locale=x.locale??b,this[r].trailingSlash=x.trailingSlash}formatPathname(){return(0,t.formatNextPathnameInfo)({basePath:this[r].basePath,buildId:this[r].buildId,defaultLocale:this[r].options.forceLocale?void 0:this[r].defaultLocale,locale:this[r].locale,pathname:this[r].url.pathname,trailingSlash:this[r].trailingSlash})}formatSearch(){return this[r].url.search}get buildId(){return this[r].buildId}set buildId(c){this[r].buildId=c}get locale(){return this[r].locale??""}set locale(c){var _,p;if(!this[r].locale||!(!((p=this[r].options.nextConfig)==null||(_=p.i18n)==null)&&_.locales.includes(c)))throw new TypeError(`The NextURL configuration includes no locale "${c}"`);this[r].locale=c}get defaultLocale(){return this[r].defaultLocale}get domainLocale(){return this[r].domainLocale}get searchParams(){return this[r].url.searchParams}get host(){return this[r].url.host}set host(c){this[r].url.host=c}get hostname(){return this[r].url.hostname}set hostname(c){this[r].url.hostname=c}get port(){return this[r].url.port}set port(c){this[r].url.port=c}get protocol(){return this[r].url.protocol}set protocol(c){this[r].url.protocol=c}get href(){const c=this.formatPathname(),_=this.formatSearch();return`${this.protocol}//${this.host}${c}${_}${this.hash}`}set href(c){this[r].url=u(c),this.analyze()}get origin(){return this[r].url.origin}get pathname(){return this[r].url.pathname}set pathname(c){this[r].url.pathname=c}get hash(){return this[r].url.hash}set hash(c){this[r].url.hash=c}get search(){return this[r].url.search}set search(c){this[r].url.search=c}get password(){return this[r].url.password}set password(c){this[r].url.password=c}get username(){return this[r].url.username}set username(c){this[r].url.username=c}get basePath(){return this[r].basePath}set basePath(c){this[r].basePath=c.startsWith("/")?c:`/${c}`}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 d(String(this),this[r].options)}}})(Ae)),Ae}var He={},Fe={},yt;function gr(){return yt||(yt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(ge,be){for(var $ in be)Object.defineProperty(ge,$,{enumerable:!0,get:be[$]})}e(i,{ACTION_SUFFIX:function(){return d},APP_DIR_ALIAS:function(){return M},CACHE_ONE_YEAR:function(){return E},DOT_NEXT_ALIAS:function(){return P},ESLINT_DEFAULT_DIRS:function(){return te},GSP_NO_RETURNED_VALUE:function(){return oe},GSSP_COMPONENT_MEMBER_ERROR:function(){return ee},GSSP_NO_RETURNED_VALUE:function(){return se},INSTRUMENTATION_HOOK_FILENAME:function(){return f},MIDDLEWARE_FILENAME:function(){return s},MIDDLEWARE_LOCATION_REGEXP:function(){return v},NEXT_BODY_SUFFIX:function(){return _},NEXT_CACHE_IMPLICIT_TAG_ID:function(){return m},NEXT_CACHE_REVALIDATED_TAGS_HEADER:function(){return S},NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER:function(){return x},NEXT_CACHE_SOFT_TAGS_HEADER:function(){return R},NEXT_CACHE_SOFT_TAG_MAX_LENGTH:function(){return h},NEXT_CACHE_TAGS_HEADER:function(){return p},NEXT_CACHE_TAG_MAX_ITEMS:function(){return l},NEXT_CACHE_TAG_MAX_LENGTH:function(){return b},NEXT_DATA_SUFFIX:function(){return g},NEXT_INTERCEPTION_MARKER_PREFIX:function(){return o},NEXT_META_SUFFIX:function(){return c},NEXT_QUERY_PARAM_PREFIX:function(){return t},NON_STANDARD_NODE_ENV:function(){return ae},PAGES_DIR_ALIAS:function(){return w},PRERENDER_REVALIDATE_HEADER:function(){return n},PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER:function(){return a},PUBLIC_DIR_MIDDLEWARE_CONFLICT:function(){return F},ROOT_DIR_ALIAS:function(){return N},RSC_ACTION_CLIENT_WRAPPER_ALIAS:function(){return Q},RSC_ACTION_ENCRYPTION_ALIAS:function(){return J},RSC_ACTION_PROXY_ALIAS:function(){return j},RSC_ACTION_VALIDATE_ALIAS:function(){return H},RSC_MOD_REF_PROXY_ALIAS:function(){return D},RSC_PREFETCH_SUFFIX:function(){return u},RSC_SUFFIX:function(){return r},SERVER_PROPS_EXPORT_ERROR:function(){return he},SERVER_PROPS_GET_INIT_PROPS_CONFLICT:function(){return ie},SERVER_PROPS_SSG_CONFLICT:function(){return V},SERVER_RUNTIME:function(){return ue},SSG_FALLBACK_EXPORT_ERROR:function(){return pe},SSG_GET_INITIAL_PROPS_CONFLICT:function(){return z},STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR:function(){return Z},UNSTABLE_REVALIDATE_RENAME_ERROR:function(){return fe},WEBPACK_LAYERS:function(){return me},WEBPACK_RESOURCE_QUERIES:function(){return _e}});const t="nxtP",o="nxtI",n="x-prerender-revalidate",a="x-prerender-revalidate-if-generated",u=".prefetch.rsc",r=".rsc",d=".action",g=".json",c=".meta",_=".body",p="x-next-cache-tags",R="x-next-cache-soft-tags",S="x-next-revalidated-tags",x="x-next-revalidate-tag-token",l=128,b=256,h=1024,m="_N_T_",E=31536e3,s="middleware",v=`(?:src/)?${s}`,f="instrumentation",w="private-next-pages",P="private-dot-next",N="private-next-root-dir",M="private-next-app-dir",D="private-next-rsc-mod-ref-proxy",H="private-next-rsc-action-validate",j="private-next-rsc-server-reference",J="private-next-rsc-action-encryption",Q="private-next-rsc-action-client-wrapper",F="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",z="You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps",ie="You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.",V="You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps",Z="can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props",he="pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export",oe="Your `getStaticProps` function did not return an object. Did you forget to add a `return`?",se="Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?",fe="The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.",ee="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",ae='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',pe="Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export",te=["app","pages","components","lib","src"],ue={edge:"edge",experimentalEdge:"experimental-edge",nodejs:"nodejs"},L={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"},me={...L,GROUP:{serverOnly:[L.reactServerComponents,L.actionBrowser,L.appMetadataRoute,L.appRouteHandler,L.instrument],clientOnly:[L.serverSideRendering,L.appPagesBrowser],nonClientServerTarget:[L.middleware,L.api],app:[L.reactServerComponents,L.actionBrowser,L.appMetadataRoute,L.appRouteHandler,L.serverSideRendering,L.appPagesBrowser,L.shared,L.instrument]}},_e={edgeSSREntry:"__next_edge_ssr_entry__",metadata:"__next_metadata__",metadataRoute:"__next_metadata_route__",metadataImageMeta:"__next_metadata_image_meta__"}})(Fe)),Fe}var St;function Gt(){return St||(St=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(d,g){for(var c in g)Object.defineProperty(d,c,{enumerable:!0,get:g[c]})}e(i,{fromNodeOutgoingHttpHeaders:function(){return o},normalizeNextQueryParam:function(){return r},splitCookiesString:function(){return n},toNodeOutgoingHttpHeaders:function(){return a},validateURL:function(){return u}});const t=gr();function o(d){const g=new Headers;for(let[c,_]of Object.entries(d)){const p=Array.isArray(_)?_:[_];for(let R of p)typeof R>"u"||(typeof R=="number"&&(R=R.toString()),g.append(c,R))}return g}function n(d){var g=[],c=0,_,p,R,S,x;function l(){for(;c<d.length&&/\s/.test(d.charAt(c));)c+=1;return c<d.length}function b(){return p=d.charAt(c),p!=="="&&p!==";"&&p!==","}for(;c<d.length;){for(_=c,x=!1;l();)if(p=d.charAt(c),p===","){for(R=c,c+=1,l(),S=c;c<d.length&&b();)c+=1;c<d.length&&d.charAt(c)==="="?(x=!0,c=S,g.push(d.substring(_,R)),_=c):c=R+1}else c+=1;(!x||c>=d.length)&&g.push(d.substring(_,d.length))}return g}function a(d){const g={},c=[];if(d)for(const[_,p]of d.entries())_.toLowerCase()==="set-cookie"?(c.push(...n(p)),g[_]=c.length===1?c[0]:c):g[_]=p;return g}function u(d){try{return String(new URL(String(d)))}catch(g){throw new Error(`URL is malformed "${String(d)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:g})}}function r(d,g){const c=[t.NEXT_QUERY_PARAM_PREFIX,t.NEXT_INTERCEPTION_MARKER_PREFIX];for(const _ of c)if(d!==_&&d.startsWith(_)){const p=d.substring(_.length);g(p)}}})(He)),He}var Ge={},Tt;function br(){return Tt||(Tt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(a,u){for(var r in u)Object.defineProperty(a,r,{enumerable:!0,get:u[r]})}e(i,{PageSignatureError:function(){return t},RemovedPageError:function(){return o},RemovedUAError:function(){return n}});class t extends Error{constructor({page:u}){super(`The middleware "${u}" accepts an async API directly with the form:
|
|
2
2
|
|
|
3
3
|
export function middleware(request, event) {
|
|
4
4
|
return NextResponse.redirect('/new-location')
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
Read more: https://nextjs.org/docs/messages/middleware-new-signature
|
|
8
|
-
`)}}class o extends Error{constructor(){super("The request.page has been deprecated in favour of `URLPattern`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n ")}}class n extends Error{constructor(){super("The request.ua has been removed in favour of `userAgent` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n ")}}})(Fe)),Fe}var Ge={},Be,Tt;function gr(){if(Tt)return Be;Tt=1;var i=Object.defineProperty,e=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,n=(s,v)=>{for(var p in v)i(s,p,{get:v[p],enumerable:!0})},a=(s,v,p,w)=>{if(v&&typeof v=="object"||typeof v=="function")for(let P of t(v))!o.call(s,P)&&P!==p&&i(s,P,{get:()=>v[P],enumerable:!(w=e(v,P))||w.enumerable});return s},u=s=>a(i({},"__esModule",{value:!0}),s),r={};n(r,{RequestCookies:()=>b,ResponseCookies:()=>h,parseCookie:()=>_,parseSetCookie:()=>c,stringifyCookie:()=>d}),Be=u(r);function d(s){var v;const p=["path"in s&&s.path&&`Path=${s.path}`,"expires"in s&&(s.expires||s.expires===0)&&`Expires=${(typeof s.expires=="number"?new Date(s.expires):s.expires).toUTCString()}`,"maxAge"in s&&typeof s.maxAge=="number"&&`Max-Age=${s.maxAge}`,"domain"in s&&s.domain&&`Domain=${s.domain}`,"secure"in s&&s.secure&&"Secure","httpOnly"in s&&s.httpOnly&&"HttpOnly","sameSite"in s&&s.sameSite&&`SameSite=${s.sameSite}`,"partitioned"in s&&s.partitioned&&"Partitioned","priority"in s&&s.priority&&`Priority=${s.priority}`].filter(Boolean),w=`${s.name}=${encodeURIComponent((v=s.value)!=null?v:"")}`;return p.length===0?w:`${w}; ${p.join("; ")}`}function _(s){const v=new Map;for(const p of s.split(/; */)){if(!p)continue;const w=p.indexOf("=");if(w===-1){v.set(p,"true");continue}const[P,N]=[p.slice(0,w),p.slice(w+1)];try{v.set(P,decodeURIComponent(N??"true"))}catch{}}return v}function c(s){if(!s)return;const[[v,p],...w]=_(s),{domain:P,expires:N,httponly:M,maxage:D,path:H,samesite:j,secure:J,partitioned:Q,priority:F}=Object.fromEntries(w.map(([ie,V])=>[ie.toLowerCase(),V])),z={name:v,value:decodeURIComponent(p),domain:P,...N&&{expires:new Date(N)},...M&&{httpOnly:!0},...typeof D=="string"&&{maxAge:Number(D)},path:H,...j&&{sameSite:R(j)},...J&&{secure:!0},...F&&{priority:x(F)},...Q&&{partitioned:!0}};return f(z)}function f(s){const v={};for(const p in s)s[p]&&(v[p]=s[p]);return v}var g=["strict","lax","none"];function R(s){return s=s.toLowerCase(),g.includes(s)?s:void 0}var S=["low","medium","high"];function x(s){return s=s.toLowerCase(),S.includes(s)?s:void 0}function l(s){if(!s)return[];var v=[],p=0,w,P,N,M,D;function H(){for(;p<s.length&&/\s/.test(s.charAt(p));)p+=1;return p<s.length}function j(){return P=s.charAt(p),P!=="="&&P!==";"&&P!==","}for(;p<s.length;){for(w=p,D=!1;H();)if(P=s.charAt(p),P===","){for(N=p,p+=1,H(),M=p;p<s.length&&j();)p+=1;p<s.length&&s.charAt(p)==="="?(D=!0,p=M,v.push(s.substring(w,N)),w=p):p=N+1}else p+=1;(!D||p>=s.length)&&v.push(s.substring(w,s.length))}return v}var b=class{constructor(s){this._parsed=new Map,this._headers=s;const v=s.get("cookie");if(v){const p=_(v);for(const[w,P]of p)this._parsed.set(w,{name:w,value:P})}}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...s){const v=typeof s[0]=="string"?s[0]:s[0].name;return this._parsed.get(v)}getAll(...s){var v;const p=Array.from(this._parsed);if(!s.length)return p.map(([P,N])=>N);const w=typeof s[0]=="string"?s[0]:(v=s[0])==null?void 0:v.name;return p.filter(([P])=>P===w).map(([P,N])=>N)}has(s){return this._parsed.has(s)}set(...s){const[v,p]=s.length===1?[s[0].name,s[0].value]:s,w=this._parsed;return w.set(v,{name:v,value:p}),this._headers.set("cookie",Array.from(w).map(([P,N])=>d(N)).join("; ")),this}delete(s){const v=this._parsed,p=Array.isArray(s)?s.map(w=>v.delete(w)):v.delete(s);return this._headers.set("cookie",Array.from(v).map(([w,P])=>d(P)).join("; ")),p}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(s=>`${s.name}=${encodeURIComponent(s.value)}`).join("; ")}},h=class{constructor(s){this._parsed=new Map;var v,p,w;this._headers=s;const P=(w=(p=(v=s.getSetCookie)==null?void 0:v.call(s))!=null?p:s.get("set-cookie"))!=null?w:[],N=Array.isArray(P)?P:l(P);for(const M of N){const D=c(M);D&&this._parsed.set(D.name,D)}}get(...s){const v=typeof s[0]=="string"?s[0]:s[0].name;return this._parsed.get(v)}getAll(...s){var v;const p=Array.from(this._parsed.values());if(!s.length)return p;const w=typeof s[0]=="string"?s[0]:(v=s[0])==null?void 0:v.name;return p.filter(P=>P.name===w)}has(s){return this._parsed.has(s)}set(...s){const[v,p,w]=s.length===1?[s[0].name,s[0].value,s[0]]:s,P=this._parsed;return P.set(v,E({name:v,value:p,...w})),m(P,this._headers),this}delete(...s){const[v,p,w]=typeof s[0]=="string"?[s[0]]:[s[0].name,s[0].path,s[0].domain];return this.set({name:v,path:p,domain:w,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(d).join("; ")}};function m(s,v){v.delete("set-cookie");for(const[,p]of s){const w=d(p);v.append("set-cookie",w)}}function E(s={name:"",value:""}){return typeof s.expires=="number"&&(s.expires=new Date(s.expires)),s.maxAge&&(s.expires=new Date(Date.now()+s.maxAge*1e3)),(s.path===null||s.path===void 0)&&(s.path="/"),s}return Be}var At;function Ze(){return At||(At=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(o,n){for(var a in n)Object.defineProperty(o,a,{enumerable:!0,get:n[a]})}e(i,{RequestCookies:function(){return t.RequestCookies},ResponseCookies:function(){return t.ResponseCookies},stringifyCookie:function(){return t.stringifyCookie}});const t=gr()})(Ge)),Ge}var It;function br(){return It||(It=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(d,_){for(var c in _)Object.defineProperty(d,c,{enumerable:!0,get:_[c]})}e(i,{INTERNALS:function(){return u},NextRequest:function(){return r}});const t=qt(),o=Ht(),n=_r(),a=Ze(),u=Symbol("internal request");class r extends Request{constructor(_,c={}){const f=typeof _!="string"&&"url"in _?_.url:String(_);(0,o.validateURL)(f),_ instanceof Request?super(_,c):super(f,c);const g=new t.NextURL(f,{headers:(0,o.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:c.nextConfig});this[u]={cookies:new a.RequestCookies(this.headers),geo:c.geo||{},ip:c.ip,nextUrl:g,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?f:g.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[u].cookies}get geo(){return this[u].geo}get ip(){return this[u].ip}get nextUrl(){return this[u].nextUrl}get page(){throw new n.RemovedPageError}get ua(){throw new n.RemovedUAError}get url(){return this[u].url}}})(Se)),Se}var Xe={},We={},Ot;function wr(){return Ot||(Ot=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"ReflectAdapter",{enumerable:!0,get:function(){return e}});class e{static get(o,n,a){const u=Reflect.get(o,n,a);return typeof u=="function"?u.bind(o):u}static set(o,n,a,u){return Reflect.set(o,n,a,u)}static has(o,n){return Reflect.has(o,n)}static deleteProperty(o,n){return Reflect.deleteProperty(o,n)}}})(We)),We}var xt;function Er(){return xt||(xt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"NextResponse",{enumerable:!0,get:function(){return _}});const e=Ze(),t=qt(),o=Ht(),n=wr(),a=Ze(),u=Symbol("internal response"),r=new Set([301,302,303,307,308]);function d(c,f){var g;if(!(c==null||(g=c.request)==null)&&g.headers){if(!(c.request.headers instanceof Headers))throw new Error("request.headers must be an instance of Headers");const R=[];for(const[S,x]of c.request.headers)f.set("x-middleware-request-"+S,x),R.push(S);f.set("x-middleware-override-headers",R.join(","))}}class _ extends Response{constructor(f,g={}){super(f,g);const R=this.headers,S=new a.ResponseCookies(R),x=new Proxy(S,{get(l,b,h){switch(b){case"delete":case"set":return(...m)=>{const E=Reflect.apply(l[b],l,m),s=new Headers(R);return E instanceof a.ResponseCookies&&R.set("x-middleware-set-cookie",E.getAll().map(v=>(0,e.stringifyCookie)(v)).join(",")),d(g,s),E};default:return n.ReflectAdapter.get(l,b,h)}}});this[u]={cookies:x,url:g.url?new t.NextURL(g.url,{headers:(0,o.toNodeOutgoingHttpHeaders)(R),nextConfig:g.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[u].cookies}static json(f,g){const R=Response.json(f,g);return new _(R.body,R)}static redirect(f,g){const R=typeof g=="number"?g:g?.status??307;if(!r.has(R))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');const S=typeof g=="object"?g:{},x=new Headers(S?.headers);return x.set("Location",(0,o.validateURL)(f)),new _(null,{...S,headers:x,status:R})}static rewrite(f,g){const R=new Headers(g?.headers);return R.set("x-middleware-rewrite",(0,o.validateURL)(f)),d(g,R),new _(null,{...g,headers:R})}static next(f){const g=new Headers(f?.headers);return g.set("x-middleware-next","1"),d(f,g),new _(null,{...f,headers:g})}}})(Xe)),Xe}var ze={},Nt;function vr(){return Nt||(Nt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"ImageResponse",{enumerable:!0,get:function(){return e}});function e(){throw new Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead')}})(ze)),ze}var Ve={},Ye={exports:{}},Ct;function Rr(){return Ct||(Ct=1,(()=>{var i={226:function(n,a){(function(u,r){var d="1.0.35",_="",c="?",f="function",g="undefined",R="object",S="string",x="major",l="model",b="name",h="type",m="vendor",E="version",s="architecture",v="console",p="mobile",w="tablet",P="smarttv",N="wearable",M="embedded",D=350,H="Amazon",j="Apple",J="ASUS",Q="BlackBerry",F="Browser",z="Chrome",ie="Edge",V="Firefox",Z="Google",he="Huawei",oe="LG",se="Microsoft",fe="Motorola",ee="Opera",ae="Samsung",pe="Sharp",te="Sony",ue="Xiaomi",L="Zebra",me="Facebook",_e="Chromium OS",ge="Mac OS",be=function(A,O){var T={};for(var C in A)O[C]&&O[C].length%2===0?T[C]=O[C].concat(A[C]):T[C]=A[C];return T},$=function(A){for(var O={},T=0;T<A.length;T++)O[A[T].toUpperCase()]=A[T];return O},st=function(A,O){return typeof A===S?ce(O).indexOf(ce(A))!==-1:!1},ce=function(A){return A.toLowerCase()},$t=function(A){return typeof A===S?A.replace(/[^\d\.]/g,_).split(".")[0]:r},Re=function(A,O){if(typeof A===S)return A=A.replace(/^\s\s*/,_),typeof O===g?A:A.substring(0,D)},le=function(A,O){for(var T=0,C,Y,B,I,y,X;T<O.length&&!y;){var ye=O[T],ct=O[T+1];for(C=Y=0;C<ye.length&&!y&&ye[C];)if(y=ye[C++].exec(A),y)for(B=0;B<ct.length;B++)X=y[++Y],I=ct[B],typeof I===R&&I.length>0?I.length===2?typeof I[1]==f?this[I[0]]=I[1].call(this,X):this[I[0]]=I[1]:I.length===3?typeof I[1]===f&&!(I[1].exec&&I[1].test)?this[I[0]]=X?I[1].call(this,X,I[2]):r:this[I[0]]=X?X.replace(I[1],I[2]):r:I.length===4&&(this[I[0]]=X?I[3].call(this,X.replace(I[1],I[2])):r):this[I]=X||r;T+=2}},Pe=function(A,O){for(var T in O)if(typeof O[T]===R&&O[T].length>0){for(var C=0;C<O[T].length;C++)if(st(O[T][C],A))return T===c?r:T}else if(st(O[T],A))return T===c?r:T;return A},Jt={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},at={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"},ut={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[E,[b,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[E,[b,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[b,E],[/opios[\/ ]+([\w\.]+)/i],[E,[b,ee+" Mini"]],[/\bopr\/([\w\.]+)/i],[E,[b,ee]],[/(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],[b,E],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[E,[b,"UC"+F]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[E,[b,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[E,[b,"WeChat"]],[/konqueror\/([\w\.]+)/i],[E,[b,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[E,[b,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[E,[b,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[b,/(.+)/,"$1 Secure "+F],E],[/\bfocus\/([\w\.]+)/i],[E,[b,V+" Focus"]],[/\bopt\/([\w\.]+)/i],[E,[b,ee+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[E,[b,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[E,[b,"Dolphin"]],[/coast\/([\w\.]+)/i],[E,[b,ee+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[E,[b,"MIUI "+F]],[/fxios\/([-\w\.]+)/i],[E,[b,V]],[/\bqihu|(qi?ho?o?|360)browser/i],[[b,"360 "+F]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[b,/(.+)/,"$1 "+F],E],[/(comodo_dragon)\/([\w\.]+)/i],[[b,/_/g," "],E],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[b,E],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[b],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[b,me],E],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[b,E],[/\bgsa\/([\w\.]+) .*safari\//i],[E,[b,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[E,[b,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[E,[b,z+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[b,z+" WebView"],E],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[E,[b,"Android "+F]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[b,E],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[E,[b,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[E,b],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[b,[E,Pe,Jt]],[/(webkit|khtml)\/([\w\.]+)/i],[b,E],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[b,"Netscape"],E],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[E,[b,V+" 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],[b,E],[/(cobalt)\/([\w\.]+)/i],[b,[E,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[s,"amd64"]],[/(ia32(?=;))/i],[[s,ce]],[/((?:i[346]|x)86)[;\)]/i],[[s,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[s,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[s,"armhf"]],[/windows (ce|mobile); ppc;/i],[[s,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[s,/ower/,_,ce]],[/(sun4\w)[;\)]/i],[[s,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[s,ce]]],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],[l,[m,ae],[h,w]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[m,ae],[h,p]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[m,j],[h,p]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[m,j],[h,w]],[/(macintosh);/i],[l,[m,j]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[m,pe],[h,p]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[m,he],[h,w]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[m,he],[h,p]],[/\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],[[l,/_/g," "],[m,ue],[h,p]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[m,ue],[h,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[m,"OPPO"],[h,p]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[m,"Vivo"],[h,p]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[m,"Realme"],[h,p]],[/\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],[l,[m,fe],[h,p]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[m,fe],[h,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[m,oe],[h,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[m,oe],[h,p]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[m,"Lenovo"],[h,w]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[m,"Nokia"],[h,p]],[/(pixel c)\b/i],[l,[m,Z],[h,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[m,Z],[h,p]],[/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],[l,[m,te],[h,p]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[m,te],[h,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[m,"OnePlus"],[h,p]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[m,H],[h,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[m,H],[h,p]],[/(playbook);[-\w\),; ]+(rim)/i],[l,m,[h,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[m,Q],[h,p]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[m,J],[h,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[m,J],[h,p]],[/(nexus 9)/i],[l,[m,"HTC"],[h,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[m,[l,/_/g," "],[h,p]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[m,"Acer"],[h,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[m,"Meizu"],[h,p]],[/(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],[m,l,[h,p]],[/(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],[m,l,[h,w]],[/(surface duo)/i],[l,[m,se],[h,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[m,"Fairphone"],[h,p]],[/(u304aa)/i],[l,[m,"AT&T"],[h,p]],[/\bsie-(\w*)/i],[l,[m,"Siemens"],[h,p]],[/\b(rct\w+) b/i],[l,[m,"RCA"],[h,w]],[/\b(venue[\d ]{2,7}) b/i],[l,[m,"Dell"],[h,w]],[/\b(q(?:mv|ta)\w+) b/i],[l,[m,"Verizon"],[h,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[m,"Barnes & Noble"],[h,w]],[/\b(tm\d{3}\w+) b/i],[l,[m,"NuVision"],[h,w]],[/\b(k88) b/i],[l,[m,"ZTE"],[h,w]],[/\b(nx\d{3}j) b/i],[l,[m,"ZTE"],[h,p]],[/\b(gen\d{3}) b.+49h/i],[l,[m,"Swiss"],[h,p]],[/\b(zur\d{3}) b/i],[l,[m,"Swiss"],[h,w]],[/\b((zeki)?tb.*\b) b/i],[l,[m,"Zeki"],[h,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[m,"Dragon Touch"],l,[h,w]],[/\b(ns-?\w{0,9}) b/i],[l,[m,"Insignia"],[h,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[m,"NextBook"],[h,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[m,"Voice"],l,[h,p]],[/\b(lvtel\-)?(v1[12]) b/i],[[m,"LvTel"],l,[h,p]],[/\b(ph-1) /i],[l,[m,"Essential"],[h,p]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[m,"Envizen"],[h,w]],[/\b(trio[-\w\. ]+) b/i],[l,[m,"MachSpeed"],[h,w]],[/\btu_(1491) b/i],[l,[m,"Rotor"],[h,w]],[/(shield[\w ]+) b/i],[l,[m,"Nvidia"],[h,w]],[/(sprint) (\w+)/i],[m,l,[h,p]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[m,se],[h,p]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[m,L],[h,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[m,L],[h,p]],[/smart-tv.+(samsung)/i],[m,[h,P]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[m,ae],[h,P]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[m,oe],[h,P]],[/(apple) ?tv/i],[m,[l,j+" TV"],[h,P]],[/crkey/i],[[l,z+"cast"],[m,Z],[h,P]],[/droid.+aft(\w)( bui|\))/i],[l,[m,H],[h,P]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[m,pe],[h,P]],[/(bravia[\w ]+)( bui|\))/i],[l,[m,te],[h,P]],[/(mitv-\w{5}) bui/i],[l,[m,ue],[h,P]],[/Hbbtv.*(technisat) (.*);/i],[m,l,[h,P]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[m,Re],[l,Re],[h,P]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,P]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[m,l,[h,v]],[/droid.+; (shield) bui/i],[l,[m,"Nvidia"],[h,v]],[/(playstation [345portablevi]+)/i],[l,[m,te],[h,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[m,se],[h,v]],[/((pebble))app/i],[m,l,[h,N]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[m,j],[h,N]],[/droid.+; (glass) \d/i],[l,[m,Z],[h,N]],[/droid.+; (wt63?0{2,3})\)/i],[l,[m,L],[h,N]],[/(quest( 2| pro)?)/i],[l,[m,me],[h,N]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[m,[h,M]],[/(aeobc)\b/i],[l,[m,H],[h,M]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[h,p]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[h,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[h,p]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[m,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[E,[b,ie+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[E,[b,"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],[b,E],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[E,b]],os:[[/microsoft (windows) (vista|xp)/i],[b,E],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[b,[E,Pe,at]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[b,"Windows"],[E,Pe,at]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[E,/_/g,"."],[b,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[b,ge],[E,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[E,b],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[b,E],[/\(bb(10);/i],[E,[b,Q]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[E,[b,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[E,[b,V+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[E,[b,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[E,[b,"watchOS"]],[/crkey\/([\d\.]+)/i],[E,[b,z+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[b,_e],E],[/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],[b,E],[/(sunos) ?([\w\.\d]*)/i],[[b,"Solaris"],E],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[b,E]]},q=function(A,O){if(typeof A===R&&(O=A,A=r),!(this instanceof q))return new q(A,O).getResult();var T=typeof u!==g&&u.navigator?u.navigator:r,C=A||(T&&T.userAgent?T.userAgent:_),Y=T&&T.userAgentData?T.userAgentData:r,B=O?be(ut,O):ut,I=T&&T.userAgent==C;return this.getBrowser=function(){var y={};return y[b]=r,y[E]=r,le.call(y,C,B.browser),y[x]=$t(y[E]),I&&T&&T.brave&&typeof T.brave.isBrave==f&&(y[b]="Brave"),y},this.getCPU=function(){var y={};return y[s]=r,le.call(y,C,B.cpu),y},this.getDevice=function(){var y={};return y[m]=r,y[l]=r,y[h]=r,le.call(y,C,B.device),I&&!y[h]&&Y&&Y.mobile&&(y[h]=p),I&&y[l]=="Macintosh"&&T&&typeof T.standalone!==g&&T.maxTouchPoints&&T.maxTouchPoints>2&&(y[l]="iPad",y[h]=w),y},this.getEngine=function(){var y={};return y[b]=r,y[E]=r,le.call(y,C,B.engine),y},this.getOS=function(){var y={};return y[b]=r,y[E]=r,le.call(y,C,B.os),I&&!y[b]&&Y&&Y.platform!="Unknown"&&(y[b]=Y.platform.replace(/chrome os/i,_e).replace(/macos/i,ge)),y},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 C},this.setUA=function(y){return C=typeof y===S&&y.length>D?Re(y,D):y,this},this.setUA(C),this};q.VERSION=d,q.BROWSER=$([b,E,x]),q.CPU=$([s]),q.DEVICE=$([l,m,h,v,p,P,w,N,M]),q.ENGINE=q.OS=$([b,E]),typeof a!==g?(n.exports&&(a=n.exports=q),a.UAParser=q):typeof u!==g&&(u.UAParser=q);var re=typeof u!==g&&(u.jQuery||u.Zepto);if(re&&!re.ua){var we=new q;re.ua=we.getResult(),re.ua.get=function(){return we.getUA()},re.ua.set=function(A){we.setUA(A);var O=we.getResult();for(var T in O)re.ua[T]=O[T]}}})(typeof window=="object"?window:this)}},e={};function t(n){var a=e[n];if(a!==void 0)return a.exports;var u=e[n]={exports:{}},r=!0;try{i[n].call(u.exports,u,u.exports,t),r=!1}finally{r&&delete e[n]}return u.exports}typeof t<"u"&&(t.ab=__dirname+"/");var o=t(226);Ye.exports=o})()),Ye.exports}var Lt;function kt(){return Lt||(Lt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(r,d){for(var _ in d)Object.defineProperty(r,_,{enumerable:!0,get:d[_]})}e(i,{isBot:function(){return n},userAgent:function(){return u},userAgentFromString:function(){return a}});const t=o(Rr());function o(r){return r&&r.__esModule?r:{default:r}}function n(r){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(r)}function a(r){return{...(0,t.default)(r),isBot:r===void 0?!1:n(r)}}function u({headers:r}){return a(r.get("user-agent")||void 0)}})(Ve)),Ve}var Ke={},Ut;function Pr(){return Ut||(Ut=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"URLPattern",{enumerable:!0,get:function(){return e}});const e=typeof URLPattern>"u"?void 0:URLPattern})(Ke)),Ke}var Dt;function yr(){return Dt||(Dt=1,(function(i,e){const t={NextRequest:br().NextRequest,NextResponse:Er().NextResponse,ImageResponse:vr().ImageResponse,userAgentFromString:kt().userAgentFromString,userAgent:kt().userAgent,URLPattern:Pr().URLPattern};i.exports=t,e.NextRequest=t.NextRequest,e.NextResponse=t.NextResponse,e.ImageResponse=t.ImageResponse,e.userAgentFromString=t.userAgentFromString,e.userAgent=t.userAgent,e.URLPattern=t.URLPattern})(Ee,Ee.exports)),Ee.exports}var Sr=yr();class Tr{async parseRequest(e){const t=new URL(e.url);let o,n;if(e.method!=="GET"){const r=e.headers.get(W)||"";if(r.includes(G.applicationJson))try{o=await e.json()}catch{k.warn("request body is null!")}else if(r.includes(G.multipartFormData))n=await e.formData();else if(r.includes(G.applicationXwwwFormUrlencoded)){const d=await e.text();o=ve(d)}}const a=e.headers,u={};return e.cookies.getAll().forEach(r=>{u[r.name]=r.value}),{url:t,headers:a,body:o,formData:n,cookies:u,raw:e,clone(){return e.clone()}}}createResponse(e){const t=Sr.NextResponse.json(e.body,{status:e.status,headers:e.headers});return Object.entries(e.cookies).forEach(([o,n])=>{typeof n=="object"&&n.value?t.cookies.set(o,n.value,n.options):typeof n=="string"&&t.cookies.set(o,n)}),t}setCookie(e,t,o,n){e.cookies[t]={value:o,options:n}}}var et=(i=>(i[i.login=0]="login",i[i.logout=1]="logout",i))(et||{});const $e={login:"login",logout:"logout",unknown:""},W="Content-Type",G={applicationJson:"application/json",multipartFormData:"multipart/form-data",applicationXwwwFormUrlencoded:"application/x-www-form-urlencoded"};class Ar{config;http;cookies;adapter;constructor(e,t,o,n){this.config=e;const a=Wt(o);this.http=new Kt({...a,userType:rt.TYPE_C}),this.cookies=n,this.adapter=t}async handleRequest(e){try{const t=await this.adapter.parseRequest(e),o=await this.processRequest(t);return this.adapter.createResponse(o)}catch(t){console.error("Router error:",t);const o={};o[W]=G.applicationJson;const n={status:500,headers:o,cookies:{},body:{code:500,success:!1,msg:"Internal server error"}};return this.adapter.createResponse(n)}}async processRequest(e){const t=e.url.searchParams,o=t.get("m")??"unknown",a={...$e,...this.config.APIMAP}[o];if(!a||a.length===0)return this.createErrorResponse(404,"API not found");let u;if((a.startsWith("admin/")||a.startsWith("api/"))&&(u=zt(this.cookies),!u||u.username.length===0||u.token.length===0))return this.createErrorResponse(409,"Authentication required");let r;const d=e.method,_=e.headers.get(W)||"";try{if(d==="GET"){const f=ve(t.toString(),["m"]);r=await this.http.get({url:a,data:f,token:u})}else if(d==="POST"){let f;if(_.includes(G.applicationJson)||_.includes(G.applicationXwwwFormUrlencoded))f=e.body;else if(_.includes(G.multipartFormData)){const g=_.match(/boundary=([^\s;]+)/);if(!g)return this.createErrorResponse(411,"Missing boundary in form data");const S=await e.clone().arrayBuffer();f={boundary:g[1],buffer:Buffer.from(S)};const l=e.formData;if(l)for(const[b,h]of Object.entries(l))b!=="file"&&(f[b]=h)}else return this.createErrorResponse(410,"Unsupported content type");r=await this.http.post({url:a,data:f,token:u})}else return this.createErrorResponse(405,"Method not allowed")}catch(f){return k.error({"error:":f},"API request error"),this.createErrorResponse(500,"API request failed")}const c={status:r.success?200:r.code,headers:{CONTENT_TYPE_KEY:_},cookies:{},body:r};if(r.success)switch(a){case $e[et[0]]:const f=r.data;Vt(f,this.cookies);break;case $e[et[1]]:Yt(this.cookies);break}return c}createErrorResponse(e,t){return{status:e,headers:{"content-type":"application/json"},cookies:{},body:{code:e,success:!1,msg:t}}}}const Ir="zh-CN",Ft="_device_id_key",Gt="_current_website_key",Mt="Get request error!",tt="Post request error!",U={IBOOT_DEVICE_ID:"dvid",IBOOT_LANG:"lang",IBOOT_WEBSITE_ID:"wid",IBOOT_WEBSITE_NO:"wno",IBOOT_TOKEN:"token",IBOOT_USER:"user"},K={DEVICE_ID:"Device-Id",LANG:"Lang",WEBSITE_ID:"Website-Id",WEBSITE_NO:"Website-No"},Bt=i=>{if(!i.get)throw new Error("The get method of IStorage has not been implemented.");const e=i.get(Ft)??"",t=i.get(Gt),o=t!=null?JSON.parse(t):null,n={};return e.length>0&&(n["Device-Id"]=e),o&&(n.Lang=o.language,o.websiteId&&(n["Website-Id"]=o.websiteId),o.websiteNo&&(n["Website-No"]=o.websiteNo)),n},Or=({deviceId:i,website:e},t)=>{if(!t.set)throw new Error("The set method of IStorage has not been implemented.");t.set(Ft,i),e&&t.set(Gt,JSON.stringify(e))},xr=i=>`${process.env.BASE_URL||"/api/services"}?m=${i}`,Xt=async(i,e)=>{let t=xr(i);if(e?.data){const r=new URLSearchParams(e.data);t+=`&${r}`}const o=e&&e.storage&&e.storage.get?Bt(e.storage):{},n=e?.headers;if(n)for(const r in n){const d=n[r];d&&(o[r]=d)}k.info({url:t,headers:o},"GET");const a=await fetch(t,{method:"GET",headers:o,cache:e?.useCache?"force-cache":"default"});if(a.ok){const r=Object.fromEntries(a.headers.entries()),d={...await a.json(),headers:r};return k.debug(d,"GET_RESULT"),d}const u={code:a.status,success:!1,msg:a.statusText};return k.error(u),u},ot=async(i,e)=>{const t=e?.data??{},o=e?.headers;let n;const a=e&&e.storage&&e.storage.get?Bt(e.storage):{},u=new Headers(a);if(t instanceof FormData?n=t:(n=JSON.stringify(t),u.set(W,G.applicationJson)),o)for(let _ in o){const c=o[_];c&&u.set(_,c)}k.info({url:i,headers:u},"POST");const r=await fetch(i,{method:"POST",headers:u,body:n});if(r.ok){const _=Object.fromEntries(r.headers.entries()),c={...await r.json(),headers:_};return k.debug(c,"POST_RESULT"),c}const d={code:r.status,success:!1,msg:r.statusText};return k.error(d),d},Nr=async(i,e)=>{const t=await Xt(i,e);if(t.success)return t.data;if(e?.showError){e.showError(t.msg??Mt);return}throw Error(t.msg??Mt)},Cr=async(i,e)=>{const t=await ot(i,e);if(t.success)return t.data;if(e?.showError){e.showError(t.msg??tt);return}throw Error(t.msg??tt)},Lr=async(i,e)=>{const t=await ot(i,e);return t.success?(e?.showSuccess&&e.showSuccess(t.msg??"SUCCESS"),!0):(e?.showError&&e.showError(t.msg??tt),!1)},Wt=i=>{if(i.get){const e=i.get(K.DEVICE_ID),t=i.get(K.LANG),o=i.get(K.WEBSITE_ID),n=i.get(K.WEBSITE_NO),a={};return e&&e.length>0&&(a.deviceId=e),t&&t.length>0&&(a.lang=t),o&&o.length>0&&(a.websiteId=o),n&&n.length>0&&(a.websiteNo=n),a}throw new Error("The get method of IStorage has not been implemented.")},kr=(i,e)=>{if(i.set)e.deviceId&&i.set(K.DEVICE_ID,e.deviceId),e.lang&&i.set(K.LANG,e.lang),e.websiteId&&i.set(K.WEBSITE_ID,e.websiteId),e.websiteNo&&i.set(K.WEBSITE_NO,e.websiteNo);else throw new Error("The set method of IStorage has not been implemented.")},Ur=i=>{if(i.get){const e=i.get(U.IBOOT_DEVICE_ID),t=i.get(U.IBOOT_LANG),o=i.get(U.IBOOT_WEBSITE_ID),n=i.get(U.IBOOT_WEBSITE_NO),a={};return e&&e.length>0&&(a.deviceId=e),t&&t.length>0&&(a.lang=t),o&&o.length>0&&(a.websiteId=o),n&&n.length>0&&(a.websiteNo=n),a}throw new Error("The get method of ICookies has not been implemented.")},Dr=(i,e)=>{if(i.set)e.deviceId&&i.set(U.IBOOT_DEVICE_ID,e.deviceId),e.lang&&i.set(U.IBOOT_LANG,e.lang),e.websiteId&&i.set(U.IBOOT_WEBSITE_ID,e.websiteId),e.websiteNo&&i.set(U.IBOOT_WEBSITE_NO,e.websiteNo);else throw new Error("The set method of ICookies has not been implemented.")},Mr=i=>{if(i.get){const e=i.get(U.IBOOT_USER);if(e&&e.length>0)return JSON.parse(e)}},zt=i=>{if(i.get){const e=i.get(U.IBOOT_USER);if(e&&e.length>0){const t=JSON.parse(e),o=t.username,n=t.userType.toString(),a=i.get(U.IBOOT_TOKEN);if(a)return{username:o,utype:n,token:a}}}},Vt=(i,e)=>{const{id:t,name:o,username:n,nickname:a,headImg:u,token:r,lastLoginTime:d,deviceId:_,userType:c,mustChangePwd:f}=i,g={id:t,name:o,username:n,nickname:a||o,headImg:u,lastLoginTime:d,deviceId:_,userType:c,accountType:0,needToReview:!1,socketOnline:!1,mustChangePwd:f};if(!e.set)throw new Error("cookies set function is undefined");e.set(U.IBOOT_TOKEN,r,{path:"/",secure:process.env.APP_ENV==="production",httpOnly:!0,sameSite:"strict"}),e.set(U.IBOOT_USER,JSON.stringify(g))},Yt=i=>{if(!i.set)throw new Error("cookies set function is undefined");if(i.set(U.IBOOT_TOKEN,"",{maxAge:-1,httpOnly:!0,path:"/"}),i.set(U.IBOOT_USER,"",{maxAge:-1,httpOnly:!0,path:"/"}),!i.delete)throw new Error("cookies delete function is undefined");i.delete(U.IBOOT_TOKEN),i.delete(U.IBOOT_USER)};class Kt{baseUrl;helloMethod;apiKey;userType;userFrom;deviceId;version="1";lang;websiteId;websiteNo;constructor(e){process.env.APP_ENV==="production"||k.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??rt.TYPE_MGT,this.deviceId=e.deviceId??Qe(10),this.lang=e.lang??Ir,this.websiteId=e.websiteId,this.websiteNo=e.websiteNo}encrypt(e){const t=ne.enc.Utf8.parse(this.apiKey);return ne.AES.encrypt(e,t).toString()}decrypt(e){const t=ne.enc.Utf8.parse(this.apiKey);return ne.AES.decrypt(e,t,{mode:ne.mode.ECB}).toString(ne.enc.Utf8)}convertUrlParameter(e){const t=[];for(const o in e){let n=e[o];if(n&&typeof n=="string")n=n.trim();else if(n&&typeof n=="object"){if(Je(n)){if(n.length===0)continue;for(let a=0;a<n.length;a++){const u=n[a];for(const r in u){const d=u[r]??void 0;if(d){if(typeof d=="object")Je(d)&&d.forEach((_,c)=>{if(_)for(const f in _){const g=_[f];if(g&&g.toString().length>0){const R=`[${a.toString()}].${r+`[${c.toString()}].${f}`}=${de(g)}`;t.push(o+R)}}});else if(d.toString().length>0){const _=`[${a.toString()}].${r}=${de(d.toString())}`;t.push(o+_)}}}}}else for(const a in n){const u=n[a];if(u!=null&&u!=""&&u.length!=0){const r=`.${a}=${de(u)}`;t.push(o+r)}}continue}else n&&typeof n=="function"&&(n=null);n!=null&&n!=""&&n.length!=0&&t.push(o+"="+de(n))}return t&&t.join("&")}async sign(e){const t="&key="+await this.helloIboot(),o=[];for(const d in e)o.push(d);o.sort((d,_)=>d.toLowerCase().localeCompare(_.toLowerCase()));const n=[];o.forEach(d=>{let _=e[d];typeof _=="object"&&(_=JSON.stringify(_)),n.push(d+"="+_)});const a=n.join("&"),u=er.md5((a+t).toLocaleUpperCase()),r={params:a,md5:u};return k.debug(r,"API_SIGN"),u}assemblyParameter(e,t){const o=e??{};return o.timestamp=Date.now()+"",o.echostr=Qe(10),o.version=this.version,o.deviceId=this.deviceId,o.webid=this.websiteId,o.apiKey=this.apiKey,t&&t.length>0&&(o.username=t),o}async assemblyHeader({urlParams:e,token:t}){const o={"Res-Type":"json","Device-Id":this.deviceId,"User-Type":t?.utype.toString()??this.userType.toString(),"User-From":this.userFrom,"Api-Key":this.apiKey};o[W]=G.applicationXwwwFormUrlencoded,this.lang&&this.lang.length>0&&(o.Lang=this.lang),this.websiteId&&this.websiteId.length>0&&(o["Web-Id"]=this.websiteId),this.websiteNo&&this.websiteNo.length>0&&(o["Web-No"]=this.websiteNo),t&&(t.token&&t.token.length>0&&t.username&&t.username.length>0&&(o.Authorization=t.token,o.Username=t.username),t.xcsrf&&(o[t.xcsrf.csrfHeader]=t.xcsrf.csrfToken));const n=ve(e),a=await this.sign(n);return o.Sign=a,o}async helloIboot(){if(this.helloMethod.length<=0)return this.apiKey;const e=this.getApiUrl(this.helloMethod),t={"Res-Type":"json","Api-Key":this.apiKey};t[W]=G.applicationXwwwFormUrlencoded;const o={url:e,headers:t};k.debug(o,"HELLO");const n=await fetch(e,{method:"GET",headers:t,credentials:"include",cache:"force-cache"});if(n.ok){const a=await n.json();return k.debug(a.data,"HELLO RESULT"),a.data}throw new Error("hello iBoot error!")}getApiUrl(e){return`${this.baseUrl}/${e}`}async csrf(){const e=await this.get({url:"guest/csrf"});if(e.success){const t=e.data;if(t)return t.csrfToken.toString()}}async get({url:e,data:t,token:o,cache:n="default"}){const a=this.assemblyParameter(t),u=this.convertUrlParameter(a),r=await this.assemblyHeader({urlParams:u,token:o}),d=`${this.getApiUrl(e)}?${u.toString()}`,_={url:d,headers:r};k.info(_,"GET");const c=await fetch(d,{method:"GET",headers:r,credentials:"include",cache:n});if(c.ok){const g=Object.fromEntries(c.headers.entries()),R={...await c.json(),headers:g};return k.debug(R,"GET_RESULT"),R}const f={code:c.status,success:!1,msg:c.statusText};return k.error(f),f}async post({url:e,data:t,token:o,cache:n="default"}){t=t?{...t}:{};const a=t.buffer??void 0,u=t.boundary??void 0;a&&delete t.buffer,u&&delete t.boundary;const r=this.assemblyParameter(t),d=this.convertUrlParameter(r),_=await this.assemblyHeader({urlParams:d,token:o});a&&u&&(_[W]=`multipart/form-data; boundary=${u}`);const c=this.getApiUrl(e),f={url:c,headers:_,params:r};k.info(f,"POST");const g=a?`${c}?${d}`:c,R=await fetch(g,{method:"POST",headers:_,body:a||d.toString(),credentials:"include",cache:n});if(R.ok){const x=Object.fromEntries(R.headers.entries()),l={...await R.json(),headers:x};return k.debug(l,"POST_RESULT"),l}const S={code:R.status,success:!1,msg:R.statusText};return k.error(S),S}async stream({url:e,data:t,token:o}){t=t?{...t}:{};const n=t.buffer??void 0,a=t.boundary??void 0;n&&delete t.buffer,a&&delete t.boundary;const u=this.assemblyParameter(t),r=this.convertUrlParameter(u),d=await this.assemblyHeader({urlParams:r,token:o});n&&a&&(d[W]=`multipart/form-data; boundary=${a}`),d.Connection="keep-alive",d["X-Accel-Buffering"]="no",d["Cache-Control"]="no-cache";const _=this.getApiUrl(e);try{const c=n?`${_}?${r}`:_,f={url:_,headers:d,params:u};k.info(f,"STREAM");const g=await fetch(c,{method:"POST",headers:d,body:n||r.toString(),credentials:"include"});if(!g.ok)throw new Error(`HTTP error! status: ${g.status}`);if(!g.body)throw new Error("No response body");const R=Object.fromEntries(g.headers.entries());return new Response(g.body,{headers:R})}catch(c){throw c}}}exports.ACCOUNT_TYPE_MAP=tr;exports.CONTENT_TYPE_KEY=W;exports.CONTENT_TYPE_MAP=G;exports.HTTPRouter=Ar;exports.HttpClient=Kt;exports.NextJsAdapter=Tr;exports.USER_FORM_MAP=rr;exports.USER_SEX_MAP=nr;exports.USER_TYPE_MAP=rt;exports.cleanToken=Yt;exports.dateFormat=or;exports.get=Xt;exports.getLoginUser=Mr;exports.getServerHttpCookies=Ur;exports.getServerHttpOpts=Wt;exports.getToken=zt;exports.iGet=Nr;exports.iPost=Cr;exports.iPostSuccess=Lr;exports.isArray=Je;exports.logger=k;exports.post=ot;exports.randomString=Qe;exports.setClientRequestHeader=Or;exports.setServerHttpCookies=Dr;exports.setServerHttpHeaders=kr;exports.setToken=Vt;exports.urlEncode=de;exports.urlParamToJson=ve;
|
|
8
|
+
`)}}class o extends Error{constructor(){super("The request.page has been deprecated in favour of `URLPattern`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n ")}}class n extends Error{constructor(){super("The request.ua has been removed in favour of `userAgent` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n ")}}})(Ge)),Ge}var Be={},Xe,At;function wr(){if(At)return Xe;At=1;var i=Object.defineProperty,e=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,n=(s,v)=>{for(var f in v)i(s,f,{get:v[f],enumerable:!0})},a=(s,v,f,w)=>{if(v&&typeof v=="object"||typeof v=="function")for(let P of t(v))!o.call(s,P)&&P!==f&&i(s,P,{get:()=>v[P],enumerable:!(w=e(v,P))||w.enumerable});return s},u=s=>a(i({},"__esModule",{value:!0}),s),r={};n(r,{RequestCookies:()=>b,ResponseCookies:()=>h,parseCookie:()=>g,parseSetCookie:()=>c,stringifyCookie:()=>d}),Xe=u(r);function d(s){var v;const f=["path"in s&&s.path&&`Path=${s.path}`,"expires"in s&&(s.expires||s.expires===0)&&`Expires=${(typeof s.expires=="number"?new Date(s.expires):s.expires).toUTCString()}`,"maxAge"in s&&typeof s.maxAge=="number"&&`Max-Age=${s.maxAge}`,"domain"in s&&s.domain&&`Domain=${s.domain}`,"secure"in s&&s.secure&&"Secure","httpOnly"in s&&s.httpOnly&&"HttpOnly","sameSite"in s&&s.sameSite&&`SameSite=${s.sameSite}`,"partitioned"in s&&s.partitioned&&"Partitioned","priority"in s&&s.priority&&`Priority=${s.priority}`].filter(Boolean),w=`${s.name}=${encodeURIComponent((v=s.value)!=null?v:"")}`;return f.length===0?w:`${w}; ${f.join("; ")}`}function g(s){const v=new Map;for(const f of s.split(/; */)){if(!f)continue;const w=f.indexOf("=");if(w===-1){v.set(f,"true");continue}const[P,N]=[f.slice(0,w),f.slice(w+1)];try{v.set(P,decodeURIComponent(N??"true"))}catch{}}return v}function c(s){if(!s)return;const[[v,f],...w]=g(s),{domain:P,expires:N,httponly:M,maxage:D,path:H,samesite:j,secure:J,partitioned:Q,priority:F}=Object.fromEntries(w.map(([ie,V])=>[ie.toLowerCase(),V])),z={name:v,value:decodeURIComponent(f),domain:P,...N&&{expires:new Date(N)},...M&&{httpOnly:!0},...typeof D=="string"&&{maxAge:Number(D)},path:H,...j&&{sameSite:R(j)},...J&&{secure:!0},...F&&{priority:x(F)},...Q&&{partitioned:!0}};return _(z)}function _(s){const v={};for(const f in s)s[f]&&(v[f]=s[f]);return v}var p=["strict","lax","none"];function R(s){return s=s.toLowerCase(),p.includes(s)?s:void 0}var S=["low","medium","high"];function x(s){return s=s.toLowerCase(),S.includes(s)?s:void 0}function l(s){if(!s)return[];var v=[],f=0,w,P,N,M,D;function H(){for(;f<s.length&&/\s/.test(s.charAt(f));)f+=1;return f<s.length}function j(){return P=s.charAt(f),P!=="="&&P!==";"&&P!==","}for(;f<s.length;){for(w=f,D=!1;H();)if(P=s.charAt(f),P===","){for(N=f,f+=1,H(),M=f;f<s.length&&j();)f+=1;f<s.length&&s.charAt(f)==="="?(D=!0,f=M,v.push(s.substring(w,N)),w=f):f=N+1}else f+=1;(!D||f>=s.length)&&v.push(s.substring(w,s.length))}return v}var b=class{constructor(s){this._parsed=new Map,this._headers=s;const v=s.get("cookie");if(v){const f=g(v);for(const[w,P]of f)this._parsed.set(w,{name:w,value:P})}}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...s){const v=typeof s[0]=="string"?s[0]:s[0].name;return this._parsed.get(v)}getAll(...s){var v;const f=Array.from(this._parsed);if(!s.length)return f.map(([P,N])=>N);const w=typeof s[0]=="string"?s[0]:(v=s[0])==null?void 0:v.name;return f.filter(([P])=>P===w).map(([P,N])=>N)}has(s){return this._parsed.has(s)}set(...s){const[v,f]=s.length===1?[s[0].name,s[0].value]:s,w=this._parsed;return w.set(v,{name:v,value:f}),this._headers.set("cookie",Array.from(w).map(([P,N])=>d(N)).join("; ")),this}delete(s){const v=this._parsed,f=Array.isArray(s)?s.map(w=>v.delete(w)):v.delete(s);return this._headers.set("cookie",Array.from(v).map(([w,P])=>d(P)).join("; ")),f}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(s=>`${s.name}=${encodeURIComponent(s.value)}`).join("; ")}},h=class{constructor(s){this._parsed=new Map;var v,f,w;this._headers=s;const P=(w=(f=(v=s.getSetCookie)==null?void 0:v.call(s))!=null?f:s.get("set-cookie"))!=null?w:[],N=Array.isArray(P)?P:l(P);for(const M of N){const D=c(M);D&&this._parsed.set(D.name,D)}}get(...s){const v=typeof s[0]=="string"?s[0]:s[0].name;return this._parsed.get(v)}getAll(...s){var v;const f=Array.from(this._parsed.values());if(!s.length)return f;const w=typeof s[0]=="string"?s[0]:(v=s[0])==null?void 0:v.name;return f.filter(P=>P.name===w)}has(s){return this._parsed.has(s)}set(...s){const[v,f,w]=s.length===1?[s[0].name,s[0].value,s[0]]:s,P=this._parsed;return P.set(v,E({name:v,value:f,...w})),m(P,this._headers),this}delete(...s){const[v,f,w]=typeof s[0]=="string"?[s[0]]:[s[0].name,s[0].path,s[0].domain];return this.set({name:v,path:f,domain:w,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(d).join("; ")}};function m(s,v){v.delete("set-cookie");for(const[,f]of s){const w=d(f);v.append("set-cookie",w)}}function E(s={name:"",value:""}){return typeof s.expires=="number"&&(s.expires=new Date(s.expires)),s.maxAge&&(s.expires=new Date(Date.now()+s.maxAge*1e3)),(s.path===null||s.path===void 0)&&(s.path="/"),s}return Xe}var It;function et(){return It||(It=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(o,n){for(var a in n)Object.defineProperty(o,a,{enumerable:!0,get:n[a]})}e(i,{RequestCookies:function(){return t.RequestCookies},ResponseCookies:function(){return t.ResponseCookies},stringifyCookie:function(){return t.stringifyCookie}});const t=wr()})(Be)),Be}var Ot;function Er(){return Ot||(Ot=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(d,g){for(var c in g)Object.defineProperty(d,c,{enumerable:!0,get:g[c]})}e(i,{INTERNALS:function(){return u},NextRequest:function(){return r}});const t=Ft(),o=Gt(),n=br(),a=et(),u=Symbol("internal request");class r extends Request{constructor(g,c={}){const _=typeof g!="string"&&"url"in g?g.url:String(g);(0,o.validateURL)(_),g instanceof Request?super(g,c):super(_,c);const p=new t.NextURL(_,{headers:(0,o.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:c.nextConfig});this[u]={cookies:new a.RequestCookies(this.headers),geo:c.geo||{},ip:c.ip,nextUrl:p,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?_:p.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[u].cookies}get geo(){return this[u].geo}get ip(){return this[u].ip}get nextUrl(){return this[u].nextUrl}get page(){throw new n.RemovedPageError}get ua(){throw new n.RemovedUAError}get url(){return this[u].url}}})(Te)),Te}var We={},ze={},xt;function vr(){return xt||(xt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"ReflectAdapter",{enumerable:!0,get:function(){return e}});class e{static get(o,n,a){const u=Reflect.get(o,n,a);return typeof u=="function"?u.bind(o):u}static set(o,n,a,u){return Reflect.set(o,n,a,u)}static has(o,n){return Reflect.has(o,n)}static deleteProperty(o,n){return Reflect.deleteProperty(o,n)}}})(ze)),ze}var Nt;function Rr(){return Nt||(Nt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"NextResponse",{enumerable:!0,get:function(){return g}});const e=et(),t=Ft(),o=Gt(),n=vr(),a=et(),u=Symbol("internal response"),r=new Set([301,302,303,307,308]);function d(c,_){var p;if(!(c==null||(p=c.request)==null)&&p.headers){if(!(c.request.headers instanceof Headers))throw new Error("request.headers must be an instance of Headers");const R=[];for(const[S,x]of c.request.headers)_.set("x-middleware-request-"+S,x),R.push(S);_.set("x-middleware-override-headers",R.join(","))}}class g extends Response{constructor(_,p={}){super(_,p);const R=this.headers,S=new a.ResponseCookies(R),x=new Proxy(S,{get(l,b,h){switch(b){case"delete":case"set":return(...m)=>{const E=Reflect.apply(l[b],l,m),s=new Headers(R);return E instanceof a.ResponseCookies&&R.set("x-middleware-set-cookie",E.getAll().map(v=>(0,e.stringifyCookie)(v)).join(",")),d(p,s),E};default:return n.ReflectAdapter.get(l,b,h)}}});this[u]={cookies:x,url:p.url?new t.NextURL(p.url,{headers:(0,o.toNodeOutgoingHttpHeaders)(R),nextConfig:p.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[u].cookies}static json(_,p){const R=Response.json(_,p);return new g(R.body,R)}static redirect(_,p){const R=typeof p=="number"?p:p?.status??307;if(!r.has(R))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');const S=typeof p=="object"?p:{},x=new Headers(S?.headers);return x.set("Location",(0,o.validateURL)(_)),new g(null,{...S,headers:x,status:R})}static rewrite(_,p){const R=new Headers(p?.headers);return R.set("x-middleware-rewrite",(0,o.validateURL)(_)),d(p,R),new g(null,{...p,headers:R})}static next(_){const p=new Headers(_?.headers);return p.set("x-middleware-next","1"),d(_,p),new g(null,{..._,headers:p})}}})(We)),We}var Ve={},Ct;function Pr(){return Ct||(Ct=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"ImageResponse",{enumerable:!0,get:function(){return e}});function e(){throw new Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead')}})(Ve)),Ve}var Ye={},Ke={exports:{}},Lt;function yr(){return Lt||(Lt=1,(()=>{var i={226:function(n,a){(function(u,r){var d="1.0.35",g="",c="?",_="function",p="undefined",R="object",S="string",x="major",l="model",b="name",h="type",m="vendor",E="version",s="architecture",v="console",f="mobile",w="tablet",P="smarttv",N="wearable",M="embedded",D=350,H="Amazon",j="Apple",J="ASUS",Q="BlackBerry",F="Browser",z="Chrome",ie="Edge",V="Firefox",Z="Google",he="Huawei",oe="LG",se="Microsoft",fe="Motorola",ee="Opera",ae="Samsung",pe="Sharp",te="Sony",ue="Xiaomi",L="Zebra",me="Facebook",_e="Chromium OS",ge="Mac OS",be=function(A,O){var T={};for(var C in A)O[C]&&O[C].length%2===0?T[C]=O[C].concat(A[C]):T[C]=A[C];return T},$=function(A){for(var O={},T=0;T<A.length;T++)O[A[T].toUpperCase()]=A[T];return O},at=function(A,O){return typeof A===S?ce(O).indexOf(ce(A))!==-1:!1},ce=function(A){return A.toLowerCase()},Qt=function(A){return typeof A===S?A.replace(/[^\d\.]/g,g).split(".")[0]:r},Pe=function(A,O){if(typeof A===S)return A=A.replace(/^\s\s*/,g),typeof O===p?A:A.substring(0,D)},le=function(A,O){for(var T=0,C,Y,B,I,y,X;T<O.length&&!y;){var Se=O[T],lt=O[T+1];for(C=Y=0;C<Se.length&&!y&&Se[C];)if(y=Se[C++].exec(A),y)for(B=0;B<lt.length;B++)X=y[++Y],I=lt[B],typeof I===R&&I.length>0?I.length===2?typeof I[1]==_?this[I[0]]=I[1].call(this,X):this[I[0]]=I[1]:I.length===3?typeof I[1]===_&&!(I[1].exec&&I[1].test)?this[I[0]]=X?I[1].call(this,X,I[2]):r:this[I[0]]=X?X.replace(I[1],I[2]):r:I.length===4&&(this[I[0]]=X?I[3].call(this,X.replace(I[1],I[2])):r):this[I]=X||r;T+=2}},ye=function(A,O){for(var T in O)if(typeof O[T]===R&&O[T].length>0){for(var C=0;C<O[T].length;C++)if(at(O[T][C],A))return T===c?r:T}else if(at(O[T],A))return T===c?r:T;return A},Zt={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},ut={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"},ct={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[E,[b,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[E,[b,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[b,E],[/opios[\/ ]+([\w\.]+)/i],[E,[b,ee+" Mini"]],[/\bopr\/([\w\.]+)/i],[E,[b,ee]],[/(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],[b,E],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[E,[b,"UC"+F]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[E,[b,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[E,[b,"WeChat"]],[/konqueror\/([\w\.]+)/i],[E,[b,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[E,[b,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[E,[b,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[b,/(.+)/,"$1 Secure "+F],E],[/\bfocus\/([\w\.]+)/i],[E,[b,V+" Focus"]],[/\bopt\/([\w\.]+)/i],[E,[b,ee+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[E,[b,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[E,[b,"Dolphin"]],[/coast\/([\w\.]+)/i],[E,[b,ee+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[E,[b,"MIUI "+F]],[/fxios\/([-\w\.]+)/i],[E,[b,V]],[/\bqihu|(qi?ho?o?|360)browser/i],[[b,"360 "+F]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[b,/(.+)/,"$1 "+F],E],[/(comodo_dragon)\/([\w\.]+)/i],[[b,/_/g," "],E],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[b,E],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[b],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[b,me],E],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[b,E],[/\bgsa\/([\w\.]+) .*safari\//i],[E,[b,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[E,[b,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[E,[b,z+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[b,z+" WebView"],E],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[E,[b,"Android "+F]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[b,E],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[E,[b,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[E,b],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[b,[E,ye,Zt]],[/(webkit|khtml)\/([\w\.]+)/i],[b,E],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[b,"Netscape"],E],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[E,[b,V+" 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],[b,E],[/(cobalt)\/([\w\.]+)/i],[b,[E,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[s,"amd64"]],[/(ia32(?=;))/i],[[s,ce]],[/((?:i[346]|x)86)[;\)]/i],[[s,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[s,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[s,"armhf"]],[/windows (ce|mobile); ppc;/i],[[s,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[s,/ower/,g,ce]],[/(sun4\w)[;\)]/i],[[s,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[s,ce]]],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],[l,[m,ae],[h,w]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[m,ae],[h,f]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[m,j],[h,f]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[m,j],[h,w]],[/(macintosh);/i],[l,[m,j]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[m,pe],[h,f]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[m,he],[h,w]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[m,he],[h,f]],[/\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],[[l,/_/g," "],[m,ue],[h,f]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[m,ue],[h,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[m,"OPPO"],[h,f]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[m,"Vivo"],[h,f]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[m,"Realme"],[h,f]],[/\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],[l,[m,fe],[h,f]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[m,fe],[h,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[m,oe],[h,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[m,oe],[h,f]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[m,"Lenovo"],[h,w]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[m,"Nokia"],[h,f]],[/(pixel c)\b/i],[l,[m,Z],[h,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[m,Z],[h,f]],[/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],[l,[m,te],[h,f]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[m,te],[h,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[m,"OnePlus"],[h,f]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[m,H],[h,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[m,H],[h,f]],[/(playbook);[-\w\),; ]+(rim)/i],[l,m,[h,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[m,Q],[h,f]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[m,J],[h,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[m,J],[h,f]],[/(nexus 9)/i],[l,[m,"HTC"],[h,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[m,[l,/_/g," "],[h,f]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[m,"Acer"],[h,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[m,"Meizu"],[h,f]],[/(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],[m,l,[h,f]],[/(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],[m,l,[h,w]],[/(surface duo)/i],[l,[m,se],[h,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[m,"Fairphone"],[h,f]],[/(u304aa)/i],[l,[m,"AT&T"],[h,f]],[/\bsie-(\w*)/i],[l,[m,"Siemens"],[h,f]],[/\b(rct\w+) b/i],[l,[m,"RCA"],[h,w]],[/\b(venue[\d ]{2,7}) b/i],[l,[m,"Dell"],[h,w]],[/\b(q(?:mv|ta)\w+) b/i],[l,[m,"Verizon"],[h,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[m,"Barnes & Noble"],[h,w]],[/\b(tm\d{3}\w+) b/i],[l,[m,"NuVision"],[h,w]],[/\b(k88) b/i],[l,[m,"ZTE"],[h,w]],[/\b(nx\d{3}j) b/i],[l,[m,"ZTE"],[h,f]],[/\b(gen\d{3}) b.+49h/i],[l,[m,"Swiss"],[h,f]],[/\b(zur\d{3}) b/i],[l,[m,"Swiss"],[h,w]],[/\b((zeki)?tb.*\b) b/i],[l,[m,"Zeki"],[h,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[m,"Dragon Touch"],l,[h,w]],[/\b(ns-?\w{0,9}) b/i],[l,[m,"Insignia"],[h,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[m,"NextBook"],[h,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[m,"Voice"],l,[h,f]],[/\b(lvtel\-)?(v1[12]) b/i],[[m,"LvTel"],l,[h,f]],[/\b(ph-1) /i],[l,[m,"Essential"],[h,f]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[m,"Envizen"],[h,w]],[/\b(trio[-\w\. ]+) b/i],[l,[m,"MachSpeed"],[h,w]],[/\btu_(1491) b/i],[l,[m,"Rotor"],[h,w]],[/(shield[\w ]+) b/i],[l,[m,"Nvidia"],[h,w]],[/(sprint) (\w+)/i],[m,l,[h,f]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[m,se],[h,f]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[m,L],[h,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[m,L],[h,f]],[/smart-tv.+(samsung)/i],[m,[h,P]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[m,ae],[h,P]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[m,oe],[h,P]],[/(apple) ?tv/i],[m,[l,j+" TV"],[h,P]],[/crkey/i],[[l,z+"cast"],[m,Z],[h,P]],[/droid.+aft(\w)( bui|\))/i],[l,[m,H],[h,P]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[m,pe],[h,P]],[/(bravia[\w ]+)( bui|\))/i],[l,[m,te],[h,P]],[/(mitv-\w{5}) bui/i],[l,[m,ue],[h,P]],[/Hbbtv.*(technisat) (.*);/i],[m,l,[h,P]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[m,Pe],[l,Pe],[h,P]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,P]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[m,l,[h,v]],[/droid.+; (shield) bui/i],[l,[m,"Nvidia"],[h,v]],[/(playstation [345portablevi]+)/i],[l,[m,te],[h,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[m,se],[h,v]],[/((pebble))app/i],[m,l,[h,N]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[m,j],[h,N]],[/droid.+; (glass) \d/i],[l,[m,Z],[h,N]],[/droid.+; (wt63?0{2,3})\)/i],[l,[m,L],[h,N]],[/(quest( 2| pro)?)/i],[l,[m,me],[h,N]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[m,[h,M]],[/(aeobc)\b/i],[l,[m,H],[h,M]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[h,f]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[h,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[h,f]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[m,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[E,[b,ie+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[E,[b,"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],[b,E],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[E,b]],os:[[/microsoft (windows) (vista|xp)/i],[b,E],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[b,[E,ye,ut]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[b,"Windows"],[E,ye,ut]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[E,/_/g,"."],[b,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[b,ge],[E,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[E,b],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[b,E],[/\(bb(10);/i],[E,[b,Q]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[E,[b,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[E,[b,V+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[E,[b,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[E,[b,"watchOS"]],[/crkey\/([\d\.]+)/i],[E,[b,z+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[b,_e],E],[/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],[b,E],[/(sunos) ?([\w\.\d]*)/i],[[b,"Solaris"],E],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[b,E]]},q=function(A,O){if(typeof A===R&&(O=A,A=r),!(this instanceof q))return new q(A,O).getResult();var T=typeof u!==p&&u.navigator?u.navigator:r,C=A||(T&&T.userAgent?T.userAgent:g),Y=T&&T.userAgentData?T.userAgentData:r,B=O?be(ct,O):ct,I=T&&T.userAgent==C;return this.getBrowser=function(){var y={};return y[b]=r,y[E]=r,le.call(y,C,B.browser),y[x]=Qt(y[E]),I&&T&&T.brave&&typeof T.brave.isBrave==_&&(y[b]="Brave"),y},this.getCPU=function(){var y={};return y[s]=r,le.call(y,C,B.cpu),y},this.getDevice=function(){var y={};return y[m]=r,y[l]=r,y[h]=r,le.call(y,C,B.device),I&&!y[h]&&Y&&Y.mobile&&(y[h]=f),I&&y[l]=="Macintosh"&&T&&typeof T.standalone!==p&&T.maxTouchPoints&&T.maxTouchPoints>2&&(y[l]="iPad",y[h]=w),y},this.getEngine=function(){var y={};return y[b]=r,y[E]=r,le.call(y,C,B.engine),y},this.getOS=function(){var y={};return y[b]=r,y[E]=r,le.call(y,C,B.os),I&&!y[b]&&Y&&Y.platform!="Unknown"&&(y[b]=Y.platform.replace(/chrome os/i,_e).replace(/macos/i,ge)),y},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 C},this.setUA=function(y){return C=typeof y===S&&y.length>D?Pe(y,D):y,this},this.setUA(C),this};q.VERSION=d,q.BROWSER=$([b,E,x]),q.CPU=$([s]),q.DEVICE=$([l,m,h,v,f,P,w,N,M]),q.ENGINE=q.OS=$([b,E]),typeof a!==p?(n.exports&&(a=n.exports=q),a.UAParser=q):typeof u!==p&&(u.UAParser=q);var re=typeof u!==p&&(u.jQuery||u.Zepto);if(re&&!re.ua){var we=new q;re.ua=we.getResult(),re.ua.get=function(){return we.getUA()},re.ua.set=function(A){we.setUA(A);var O=we.getResult();for(var T in O)re.ua[T]=O[T]}}})(typeof window=="object"?window:this)}},e={};function t(n){var a=e[n];if(a!==void 0)return a.exports;var u=e[n]={exports:{}},r=!0;try{i[n].call(u.exports,u,u.exports,t),r=!1}finally{r&&delete e[n]}return u.exports}typeof t<"u"&&(t.ab=__dirname+"/");var o=t(226);Ke.exports=o})()),Ke.exports}var kt;function Ut(){return kt||(kt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(r,d){for(var g in d)Object.defineProperty(r,g,{enumerable:!0,get:d[g]})}e(i,{isBot:function(){return n},userAgent:function(){return u},userAgentFromString:function(){return a}});const t=o(yr());function o(r){return r&&r.__esModule?r:{default:r}}function n(r){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(r)}function a(r){return{...(0,t.default)(r),isBot:r===void 0?!1:n(r)}}function u({headers:r}){return a(r.get("user-agent")||void 0)}})(Ye)),Ye}var $e={},Dt;function Sr(){return Dt||(Dt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"URLPattern",{enumerable:!0,get:function(){return e}});const e=typeof URLPattern>"u"?void 0:URLPattern})($e)),$e}var Mt;function Tr(){return Mt||(Mt=1,(function(i,e){const t={NextRequest:Er().NextRequest,NextResponse:Rr().NextResponse,ImageResponse:Pr().ImageResponse,userAgentFromString:Ut().userAgentFromString,userAgent:Ut().userAgent,URLPattern:Sr().URLPattern};i.exports=t,e.NextRequest=t.NextRequest,e.NextResponse=t.NextResponse,e.ImageResponse=t.ImageResponse,e.userAgentFromString=t.userAgentFromString,e.userAgent=t.userAgent,e.URLPattern=t.URLPattern})(Ee,Ee.exports)),Ee.exports}var Ar=Tr();class Ir{async parseRequest(e){const t=new URL(e.url);let o,n;if(e.method!=="GET"){const r=e.headers.get(W)||"";if(r.includes(G.applicationJson))try{o=await e.json()}catch{k.warn("request body is null!")}else if(r.includes(G.multipartFormData))n=await e.formData();else if(r.includes(G.applicationXwwwFormUrlencoded)){const d=await e.text();o=Re(d)}}const a=e.headers,u={};return e.cookies.getAll().forEach(r=>{u[r.name]=r.value}),{url:t,headers:a,body:o,formData:n,cookies:u,raw:e,clone(){return e.clone()}}}createResponse(e){const t=Ar.NextResponse.json(e.body,{status:e.status,headers:e.headers});if(Object.entries(e.cookies).forEach(([o,n])=>{typeof n=="object"&&n.value?t.cookies.set(o,n.value,n.options):typeof n=="string"&&t.cookies.set(o,n)}),e.cleanCookies){const o={set(n,a,u){t.cookies.set(n,a,u)},delete(n,a){t.cookies.delete({...a,name:n})}};e.cleanCookies(o)}return t}setCookie(e,t,o,n){e.cookies[t]={value:o,options:n}}}var tt=(i=>(i[i.login=0]="login",i[i.logout=1]="logout",i))(tt||{});const Je={login:"login",logout:"logout",unknown:""},W="Content-Type",G={applicationJson:"application/json",multipartFormData:"multipart/form-data",applicationXwwwFormUrlencoded:"application/x-www-form-urlencoded"};class Or{config;http;cookies;adapter;constructor({config:e,adapter:t,storage:o,cookies:n}){this.config=e;const a=Vt(o);this.http=new Jt({...a,userType:nt.TYPE_C}),this.cookies=n,this.adapter=t}async handleRequest(e){try{const t=await this.adapter.parseRequest(e),o=await this.processRequest(t);return this.adapter.createResponse(o)}catch(t){console.error("Router error:",t);const o={};o[W]=G.applicationJson;const n={status:500,headers:o,cookies:{},body:{code:500,success:!1,msg:"Internal server error"}};return this.adapter.createResponse(n)}}async processRequest(e){const t=e.url.searchParams,o=t.get("m")??"unknown",a={...Je,...this.config.APIMAP}[o];if(!a||a.length===0)return this.createErrorResponse(404,"API not found");let u;if((a.startsWith("admin/")||a.startsWith("api/"))&&(u=Yt(this.cookies),!u||u.username.length===0||u.token.length===0))return this.createErrorResponse(409,"Authentication required");let r;const d=e.clone(),g=d.method,c=e.headers.get(W)||"";try{if(g==="GET"){const p=Re(t.toString(),["m"]);r=await this.http.get({url:a,data:p,token:u})}else if(g==="POST"){let p;if(c.includes(G.applicationJson)||c.includes(G.applicationXwwwFormUrlencoded))p=e.body;else if(c.includes(G.multipartFormData)){const R=c.match(/boundary=([^\s;]+)/);if(!R)return this.createErrorResponse(411,"Missing boundary in form data");const S=await d.arrayBuffer();p={boundary:R[1],buffer:Buffer.from(S)};const l=e.formData;if(l)for(const[b,h]of Object.entries(l))b!=="file"&&(p[b]=h)}else return this.createErrorResponse(410,"Unsupported content type");r=await this.http.post({url:a,data:p,token:u})}else return this.createErrorResponse(405,"Method not allowed, only supported GET or POST")}catch(p){return k.error({"error:":p},"API request error"),this.createErrorResponse(500,"API request failed")}const _={status:r.success?200:r.code,headers:{CONTENT_TYPE_KEY:c},cookies:{},body:r};if(r.success)switch(a){case Je[tt[0]]:const p=r.data;Kt(p,_);break;case Je[tt[1]]:_.cleanCookies=R=>$t(R);break}return _}createErrorResponse(e,t){return{status:e,headers:{"content-type":"application/json"},cookies:{},body:{code:e,success:!1,msg:t}}}}const xr="zh-CN",Bt="_device_id_key",Xt="_current_website_key",jt="Get request error!",rt="Post request error!",U={IBOOT_DEVICE_ID:"dvid",IBOOT_LANG:"lang",IBOOT_WEBSITE_ID:"wid",IBOOT_WEBSITE_NO:"wno",IBOOT_TOKEN:"token",IBOOT_USER:"user"},K={DEVICE_ID:"Device-Id",LANG:"Lang",WEBSITE_ID:"Website-Id",WEBSITE_NO:"Website-No"},Wt=i=>{if(!i.get)throw new Error("The get method of IStorage has not been implemented.");const e=i.get(Bt)??"",t=i.get(Xt),o=t!=null?JSON.parse(t):null,n={};return e.length>0&&(n["Device-Id"]=e),o&&(n.Lang=o.language,o.websiteId&&(n["Website-Id"]=o.websiteId),o.websiteNo&&(n["Website-No"]=o.websiteNo)),n},Nr=({deviceId:i,website:e},t)=>{if(!t.set)throw new Error("The set method of IStorage has not been implemented.");t.set(Bt,i),e&&t.set(Xt,JSON.stringify(e))},Cr=i=>`${process.env.BASE_URL||"/api/services"}?m=${i}`,zt=async(i,e)=>{let t=Cr(i);if(e?.data){const r=new URLSearchParams(e.data);t+=`&${r}`}const o=e&&e.storage&&e.storage.get?Wt(e.storage):{},n=e?.headers;if(n)for(const r in n){const d=n[r];d&&(o[r]=d)}k.info({url:t,headers:o},"GET");const a=await fetch(t,{method:"GET",headers:o,cache:e?.useCache?"force-cache":"default"});if(a.ok){const r=Object.fromEntries(a.headers.entries()),d={...await a.json(),headers:r};return k.debug(d,"GET_RESULT"),d}const u={code:a.status,success:!1,msg:a.statusText};return k.error(u),u},st=async(i,e)=>{const t=e?.data??{},o=e?.headers;let n;const a=e&&e.storage&&e.storage.get?Wt(e.storage):{},u=new Headers(a);if(t instanceof FormData?n=t:(n=JSON.stringify(t),u.set(W,G.applicationJson)),o)for(let g in o){const c=o[g];c&&u.set(g,c)}k.info({url:i,headers:u},"POST");const r=await fetch(i,{method:"POST",headers:u,body:n});if(r.ok){const g=Object.fromEntries(r.headers.entries()),c={...await r.json(),headers:g};return k.debug(c,"POST_RESULT"),c}const d={code:r.status,success:!1,msg:r.statusText};return k.error(d),d},Lr=async(i,e)=>{const t=await zt(i,e);if(t.success)return t.data;if(e?.showError){e.showError(t.msg??jt);return}throw Error(t.msg??jt)},kr=async(i,e)=>{const t=await st(i,e);if(t.success)return t.data;if(e?.showError){e.showError(t.msg??rt);return}throw Error(t.msg??rt)},Ur=async(i,e)=>{const t=await st(i,e);return t.success?(e?.showSuccess&&e.showSuccess(t.msg??"SUCCESS"),!0):(e?.showError&&e.showError(t.msg??rt),!1)},Vt=i=>{if(i.get){const e=i.get(K.DEVICE_ID),t=i.get(K.LANG),o=i.get(K.WEBSITE_ID),n=i.get(K.WEBSITE_NO),a={};return e&&e.length>0&&(a.deviceId=e),t&&t.length>0&&(a.lang=t),o&&o.length>0&&(a.websiteId=o),n&&n.length>0&&(a.websiteNo=n),a}throw new Error("The get method of IStorage has not been implemented.")},Dr=(i,e)=>{if(i.set)e.deviceId&&i.set(K.DEVICE_ID,e.deviceId),e.lang&&i.set(K.LANG,e.lang),e.websiteId&&i.set(K.WEBSITE_ID,e.websiteId),e.websiteNo&&i.set(K.WEBSITE_NO,e.websiteNo);else throw new Error("The set method of IStorage has not been implemented.")},Mr=i=>{if(i.get){const e=i.get(U.IBOOT_DEVICE_ID),t=i.get(U.IBOOT_LANG),o=i.get(U.IBOOT_WEBSITE_ID),n=i.get(U.IBOOT_WEBSITE_NO),a={};return e&&e.length>0&&(a.deviceId=e),t&&t.length>0&&(a.lang=t),o&&o.length>0&&(a.websiteId=o),n&&n.length>0&&(a.websiteNo=n),a}throw new Error("The get method of ICookies has not been implemented.")},jr=(i,e)=>{if(i.set)e.deviceId&&i.set(U.IBOOT_DEVICE_ID,e.deviceId),e.lang&&i.set(U.IBOOT_LANG,e.lang),e.websiteId&&i.set(U.IBOOT_WEBSITE_ID,e.websiteId),e.websiteNo&&i.set(U.IBOOT_WEBSITE_NO,e.websiteNo);else throw new Error("The set method of ICookies has not been implemented.")},qr=i=>{if(i.get){const e=i.get(U.IBOOT_USER);if(e&&e.length>0)return JSON.parse(e)}},Yt=i=>{if(i.get){const e=i.get(U.IBOOT_USER);if(e&&e.length>0){const t=JSON.parse(e),o=t.username,n=t.userType.toString(),a=i.get(U.IBOOT_TOKEN);if(a)return{username:o,utype:n,token:a}}}},qt=()=>({path:"/",secure:process.env.APP_ENV==="production",httpOnly:!0,sameSite:"strict"}),ve={maxAge:-1,httpOnly:!0,path:"/"},Kt=(i,e)=>{const{id:t,name:o,username:n,nickname:a,headImg:u,token:r,lastLoginTime:d,deviceId:g,userType:c,mustChangePwd:_}=i,p={id:t,name:o,username:n,nickname:a||o,headImg:u,lastLoginTime:d,deviceId:g,userType:c,accountType:0,needToReview:!1,socketOnline:!1,mustChangePwd:_};e.cookies[U.IBOOT_TOKEN]={value:r,options:qt()},e.cookies[U.IBOOT_USER]={value:JSON.stringify(p),options:qt()}},$t=i=>{if(!i.set)throw new Error("cookies set function is undefined");if(i.set(U.IBOOT_TOKEN,"",ve),i.set(U.IBOOT_USER,"",ve),!i.delete)throw new Error("cookies delete function is undefined");i.delete(U.IBOOT_TOKEN,ve),i.delete(U.IBOOT_USER,ve)};class Jt{baseUrl;helloMethod;apiKey;userType;userFrom;deviceId;version="1";lang;websiteId;websiteNo;constructor(e){process.env.APP_ENV==="production"||k.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??nt.TYPE_MGT,this.deviceId=e.deviceId??Ze(10),this.lang=e.lang??xr,this.websiteId=e.websiteId,this.websiteNo=e.websiteNo}encrypt(e){const t=ne.enc.Utf8.parse(this.apiKey);return ne.AES.encrypt(e,t).toString()}decrypt(e){const t=ne.enc.Utf8.parse(this.apiKey);return ne.AES.decrypt(e,t,{mode:ne.mode.ECB}).toString(ne.enc.Utf8)}convertUrlParameter(e){const t=[];for(const o in e){let n=e[o];if(n&&typeof n=="string")n=n.trim();else if(n&&typeof n=="object"){if(Qe(n)){if(n.length===0)continue;for(let a=0;a<n.length;a++){const u=n[a];for(const r in u){const d=u[r]??void 0;if(d){if(typeof d=="object")Qe(d)&&d.forEach((g,c)=>{if(g)for(const _ in g){const p=g[_];if(p&&p.toString().length>0){const R=`[${a.toString()}].${r+`[${c.toString()}].${_}`}=${de(p)}`;t.push(o+R)}}});else if(d.toString().length>0){const g=`[${a.toString()}].${r}=${de(d.toString())}`;t.push(o+g)}}}}}else for(const a in n){const u=n[a];if(u!=null&&u!=""&&u.length!=0){const r=`.${a}=${de(u)}`;t.push(o+r)}}continue}else n&&typeof n=="function"&&(n=null);n!=null&&n!=""&&n.length!=0&&t.push(o+"="+de(n))}return t&&t.join("&")}async sign(e){const t="&key="+await this.helloIboot(),o=[];for(const d in e)o.push(d);o.sort((d,g)=>d.toLowerCase().localeCompare(g.toLowerCase()));const n=[];o.forEach(d=>{let g=e[d];typeof g=="object"&&(g=JSON.stringify(g)),n.push(d+"="+g)});const a=n.join("&"),u=rr.md5((a+t).toLocaleUpperCase()),r={params:a,md5:u};return k.debug(r,"API_SIGN"),u}assemblyParameter(e,t){const o=e??{};return o.timestamp=Date.now()+"",o.echostr=Ze(10),o.version=this.version,o.deviceId=this.deviceId,o.webid=this.websiteId,o.apiKey=this.apiKey,t&&t.length>0&&(o.username=t),o}async assemblyHeader({urlParams:e,token:t}){const o={"Res-Type":"json","Device-Id":this.deviceId,"User-Type":t?.utype.toString()??this.userType.toString(),"User-From":this.userFrom,"Api-Key":this.apiKey};o[W]=G.applicationXwwwFormUrlencoded,this.lang&&this.lang.length>0&&(o.Lang=this.lang),this.websiteId&&this.websiteId.length>0&&(o["Web-Id"]=this.websiteId),this.websiteNo&&this.websiteNo.length>0&&(o["Web-No"]=this.websiteNo),t&&(t.token&&t.token.length>0&&t.username&&t.username.length>0&&(o.Authorization=t.token,o.Username=t.username),t.xcsrf&&(o[t.xcsrf.csrfHeader]=t.xcsrf.csrfToken));const n=Re(e),a=await this.sign(n);return o.Sign=a,o}async helloIboot(){if(this.helloMethod.length<=0)return this.apiKey;const e=this.getApiUrl(this.helloMethod),t={"Res-Type":"json","Api-Key":this.apiKey};t[W]=G.applicationXwwwFormUrlencoded;const o={url:e,headers:t};k.debug(o,"HELLO");const n=await fetch(e,{method:"GET",headers:t,credentials:"include",cache:"force-cache"});if(n.ok){const a=await n.json();return k.debug(a.data,"HELLO RESULT"),a.data}throw new Error("hello iBoot error!")}getApiUrl(e){return`${this.baseUrl}/${e}`}async csrf(){const e=await this.get({url:"guest/csrf"});if(e.success){const t=e.data;if(t)return t.csrfToken.toString()}}async get({url:e,data:t,token:o,cache:n="default"}){const a=this.assemblyParameter(t),u=this.convertUrlParameter(a),r=await this.assemblyHeader({urlParams:u,token:o}),d=`${this.getApiUrl(e)}?${u.toString()}`,g={url:d,headers:r};k.info(g,"GET");const c=await fetch(d,{method:"GET",headers:r,credentials:"include",cache:n});if(c.ok){const p=Object.fromEntries(c.headers.entries()),R={...await c.json(),headers:p};return k.debug(R,"GET_RESULT"),R}const _={code:c.status,success:!1,msg:c.statusText};return k.error(_),_}async post({url:e,data:t,token:o,cache:n="default"}){t=t?{...t}:{};const a=t.buffer??void 0,u=t.boundary??void 0;a&&delete t.buffer,u&&delete t.boundary;const r=this.assemblyParameter(t),d=this.convertUrlParameter(r),g=await this.assemblyHeader({urlParams:d,token:o});a&&u&&(g[W]=`multipart/form-data; boundary=${u}`);const c=this.getApiUrl(e),_={url:c,headers:g,params:r};k.info(_,"POST");const p=a?`${c}?${d}`:c,R=await fetch(p,{method:"POST",headers:g,body:a||d.toString(),credentials:"include",cache:n});if(R.ok){const x=Object.fromEntries(R.headers.entries()),l={...await R.json(),headers:x};return k.debug(l,"POST_RESULT"),l}const S={code:R.status,success:!1,msg:R.statusText};return k.error(S),S}async stream({url:e,data:t,token:o}){t=t?{...t}:{};const n=t.buffer??void 0,a=t.boundary??void 0;n&&delete t.buffer,a&&delete t.boundary;const u=this.assemblyParameter(t),r=this.convertUrlParameter(u),d=await this.assemblyHeader({urlParams:r,token:o});n&&a&&(d[W]=`multipart/form-data; boundary=${a}`),d.Connection="keep-alive",d["X-Accel-Buffering"]="no",d["Cache-Control"]="no-cache";const g=this.getApiUrl(e);try{const c=n?`${g}?${r}`:g,_={url:g,headers:d,params:u};k.info(_,"STREAM");const p=await fetch(c,{method:"POST",headers:d,body:n||r.toString(),credentials:"include"});if(!p.ok)throw new Error(`HTTP error! status: ${p.status}`);if(!p.body)throw new Error("No response body");const R=Object.fromEntries(p.headers.entries());return new Response(p.body,{headers:R})}catch(c){throw c}}}exports.ACCOUNT_TYPE_MAP=nr;exports.CONTENT_TYPE_KEY=W;exports.CONTENT_TYPE_MAP=G;exports.HTTPRouter=Or;exports.HttpClient=Jt;exports.NextJsAdapter=Ir;exports.USER_FORM_MAP=ir;exports.USER_SEX_MAP=or;exports.USER_TYPE_MAP=nt;exports.cleanToken=$t;exports.dateFormat=ar;exports.get=zt;exports.getLoginUser=qr;exports.getServerHttpCookies=Mr;exports.getServerHttpOpts=Vt;exports.getToken=Yt;exports.iGet=Lr;exports.iPost=kr;exports.iPostSuccess=Ur;exports.isArray=Qe;exports.logger=k;exports.post=st;exports.randomString=Ze;exports.setClientRequestHeader=Nr;exports.setServerHttpCookies=jr;exports.setServerHttpHeaders=Dr;exports.setToken=Kt;exports.urlEncode=de;exports.urlParamToJson=Re;
|
|
9
9
|
//# sourceMappingURL=iboot-http-client.cjs.js.map
|