iboot-http-client 1.3.2 → 1.3.3

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