PageSourceSearch

https://hexabot.ai/_next/static/chunks/9905-d203bffcffa41320.js

js hexabot.ai collected 2026-10-02 05:15:15 UTC 14,447 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9905],{24654:function(){},60523:function(t,e,r){"use strict";r.d(e,{n:function(){return p},w:function(){return d}});var n=r(57437),i=r(83464),a=r(2265),s=r(92141),u=r(43056);let o={REGISTER:"/auth/register",CONFIRM_ACCOUNT:"/user/confirm",LOGIN:"/auth/local",GITHUB_LOGIN:"/auth/github",ME:"/auth/me",LOGOUT:"/auth/logout",PROFILE:"/user/edit",USER_PERMISSIONS:"/user/permissions",CSRF:"/csrftoken",FETCH_REMOTE_I18N:"/i18n",RESET:"/user/reset",[u.py.ROLE]:"/role",[u.py.USER]:"/user",[u.py.PERMISSION]:"/permission",[u.py.MODEL]:"/model",[u.py.SETTING]:"/setting",[u.py.LANGUAGE]:"/language",[u.py.LABEL]:"/label",[u.py.EXTENSION]:"/extension",[u.py.LICENSE_PRODUCT]:"/license/products"},c=t=>{let{id:e,attributes:r}=t;return{id:e,storeId:r.store_id,name:r.name,slug:r.slug,description:r.description,status:r.status,statusFormatted:r.status_formatted,thumbUrl:r.thumb_url,largeThumbUrl:r.large_thumb_url,price:r.price,priceFormatted:r.price_formatted,fromPrice:r.from_price,toPrice:r.to_price,fromPriceFormatted:r.from_price_formatted,toPriceFormatted:r.to_price_formatted,payWhatYouWant:r.pay_what_you_want,buyNowUrl:r.buy_now_url,testMode:r.test_mode,createdAt:r.created_at?new Date(r.created_at):new Date,updatedAt:r.updated_at?new Date(r.updated_at):new Date,format:u.ED.BASIC}};class l{async getCsrf(){let{data:t}=await this.request.get(o.CSRF);return t}async login(t){let{data:e}=await this.request.post(o.LOGIN,t);return e}async logout(){let{data:t}=await this.request.post(o.LOGOUT);return t}async getCurrentSession(){let{data:t}=await this.request.get(o.ME);return t||void 0}async updateProfile(t,e){let{_csrf:r}=await this.getCsrf(),{data:n}=await this.request.patch("".concat(o.PROFILE,"/").concat(t),{...e,_csrf:r});return n}async createAccount(t){let{_csrf:e}=await this.getCsrf(),{data:r}=await this.request.post("".concat(o.REGISTER),{...t,_csrf:e});return r}async confirmAccount(t){let{_csrf:e}=await this.getCsrf(),{data:r}=await this.request.post("".concat(o.CONFIRM_ACCOUNT),{...t,_csrf:e});return r}async getUserPermissions(t){let{data:e}=await this.request.get("".concat(o.USER_PERMISSIONS,"/").concat(t));return e}async refreshExtensionPackage(t){let{_csrf:e}=await this.getCsrf(),{data:r}=await this.request.patch("".concat(o[u.py.EXTENSION],"/").concat(t,"/refresh-package"),{_csrf:e});return r}async publishExtension(t){let{_csrf:e}=await this.getCsrf(),{data:r}=await this.request.patch("".concat(o[u.py.EXTENSION],"/").concat(t,"/publish"),{_csrf:e});return r}async unpublishExtension(t){let{_csrf:e}=await this.getCsrf(),{data:r}=await this.request.patch("".concat(o[u.py.EXTENSION],"/").concat(t,"/unpublish"),{_csrf:e});return r}async requestReset(t){let{data:e}=await this.request.post(o.RESET,t);return e}async fetchRemoteI18n(){let{data:t}=await this.request.get(o.FETCH_REMOTE_I18N);return t}async reset(t,e){let{data:r}=await this.request.post("".concat(o.RESET,"/").concat(t),e);return r}getRequest(){return this.request}buildEntityClient(t){return y.getInstance(this.request,t)}constructor(t){this.request=t}}class y extends l{static getInstance(t,e){return new y(t,e)}async create(t){let{_csrf:e}=await this.getCsrf(),{data:r}=await this.request.post(o[this.type],{...t,_csrf:e});return r}async upload(t){let{_csrf:e}=await this.getCsrf(),r=new FormData;r.append("file",t);let{data:n}=await this.request.post("".concat(o[this.type],"/upload?_csrf=").concat(e),r,{headers:{"Content-Type":"multipart/form-data"}});return n[0]}serializePopulate(t){return(t||[]).join(",")}async get(t,e){let{data:r}=await this.request.get("".concat(o[this.type]).concat(t?"/".concat(t):""),{params:{...Array.isArray(e)&&e.length&&{populate:this.serializePopulate(e)}}});return r}async find(t,e){let{data:r}=await this.request.get(o[this.type],{params:{...t,...Array.isArray(e)&&e.length&&{populate:this.serializePopulate(e)}}});return this.type===u.py.LICENSE_PRODUCT?(Array.isArray(r.data)?r.data:[]).map(t=>c(t)).sort((t,e)=>{var r,n;return(null!==(r=t.price)&&void 0!==r?r:Number.MAX_SAFE_INTEGER)-(null!==(n=e.price)&&void 0!==n?n:Number.MAX_SAFE_INTEGER)}):r}async update(t,e){let{_csrf:r}=await this.getCsrf(),{data:n}=await this.request.patch("".concat(o[this.type],"/").concat(t),{...e,_csrf:r});return n}async delete(t){let{_csrf:e}=await this.getCsrf(),{data:r}=await this.request.delete("".concat(o[this.type],"/").concat(t),{data:{_csrf:e}});return r}async deleteMany(t){let{_csrf:e}=await this.getCsrf(),{data:r}=await this.request.delete("".concat(o[this.type]),{data:{_csrf:e,ids:t}});return r}async count(t){let{data:e}=await this.request.get("".concat(o[this.type],"/count"),{params:t});return{count:e.count}}constructor(t,e){super(t),this.type=e}}let p=(0,a.createContext)({apiClient:new l(i.Z.create()),getApiClientByEntity:()=>{throw Error("getApiClientByEntity must be used within an ApiClientProvider")}}),d=t=>{let{children:e}=t,r=new l((0,s.a8)());return(0,n.jsx)(p.Provider,{value:{apiClient:r,getApiClientByEntity:t=>(0,s.zU)(t,r)},children:e})}},34757:function(t,e,r){"use strict";r.d(e,{V:function(){return d},H:function(){return E}});var n=r(57437),i=r(99376),a=r(2265),s=r(86484),u=r(42777),o=r(92141),c=r(98734);let l=t=>{let{key:e,search:r,defaultValue:n=""}=t;try{let t=r||window.location.search;return new URLSearchParams(t).get(e)||n}catch(t){return n}};var y=r(43056),p=r(14438);let d=(0,a.createContext)(null);d.displayName="AuthContext";let E=t=>{let{children:e}=t,r=(0,i.useRouter)(),{logoutRedirection:a}=(0,c.qY)(),E=(0,s.useQueryClient)(),{mutateAsync:h}=(0,u.aU)(),f=async()=>{E.removeQueries([c.gm]),await h(),a(),p.Am.success("Logout has been successful")},w=async t=>{if(t){let t=l({search:window.location.search,key:"redirect"}),e=t&&decodeURIComponent(t);
1(null==e?void 0:e.startsWith("/"))?r.push(e):r.push(y.MG.HOME)}},{apiClient:g}=(0,o.mb)(),{data:m,error:S,isLoading:C,refetch:N}=(0,s.useQuery)({queryKey:[c.gm],queryFn:async()=>await g.getCurrentSession()}),A=t=>{E.setQueryData([c.gm],t)},L=!!m;return(0,n.jsx)(d.Provider,{value:{user:m,isAuthenticated:!!L,isLoading:C,error:S,setUser:A,authenticate:t=>{A(t),w(!!(null==t?void 0:t.id))},refetchUser:N,logout:f},children:e})}},2787:function(t,e,r){"use strict";r.d(e,{E:function(){return a},i:function(){return s}});var n=r(57437),i=r(2265);let a=(0,i.createContext)(null),s=t=>{let{children:e,initialConfig:r}=t,[s,u]=(0,i.useState)(null!=r?r:null);return((0,i.useEffect)(()=>{s||(async()=>{try{let t=await fetch("/config"),e=await t.json();u(e)}catch(t){console.error("Failed to fetch configuration:",t)}})()},[s]),s)?(0,n.jsx)(a.Provider,{value:s,children:e}):null}},31687:function(t,e,r){"use strict";r.d(e,{Q:function(){return g},a:function(){return w}});var n=r(79091),i=r(86484),a=r(43056);let s=t=>({...t,...t.createdAt&&{createdAt:new Date(t.createdAt)},...t.updatedAt&&{updatedAt:new Date(t.updatedAt)}}),u=new n.fK.Entity(a.py.ROLE,void 0,{idAttribute:t=>{let{id:e}=t;return e},processStrategy:s}),o=new n.fK.Entity(a.py.USER,{roles:[u]},{idAttribute:t=>{let{id:e}=t;return e},processStrategy:s}),c=new n.fK.Entity(a.py.PERMISSION,void 0,{idAttribute:t=>{let{id:e}=t;return e},processStrategy:s}),l=new n.fK.Entity(a.py.MODEL,{permissions:[c]},{idAttribute:t=>{let{id:e}=t;return e}}),y=new n.fK.Entity(a.py.SETTING,{idAttribute:t=>{let{id:e}=t;return e},processStrategy:s}),p=new n.fK.Entity(a.py.LANGUAGE,void 0,{idAttribute:t=>{let{id:e}=t;return e},processStrategy:s}),d=new n.fK.Entity(a.py.LABEL,void 0,{idAttribute:t=>{let{id:e}=t;return e},processStrategy:s}),E=new n.fK.Entity(a.py.EXTENSION,{labels:[d],author:o},{idAttribute:t=>{let{id:e}=t;return e},processStrategy:s}),h=new n.fK.Entity(a.py.LICENSE_PRODUCT,void 0,{idAttribute:t=>{let{id:e}=t;return e},processStrategy:s});d.define({extensions:[E]}),o.define({roles:[u],likes:[E]});let f={[a.py.ROLE]:u,[a.py.USER]:o,[a.py.PERMISSION]:c,[a.py.MODEL]:l,[a.py.SETTING]:y,[a.py.LANGUAGE]:p,[a.py.LABEL]:d,[a.py.EXTENSION]:E,[a.py.LICENSE_PRODUCT]:h},w=t=>{let e=(0,i.useQueryClient)();return r=>{if(!(t in f))throw Error("Entity ".concat(t," is missing in ENTITY_MAP"));if(!r)throw Error("No data to normalize !");let i=f[t],{entities:s,result:u}=(0,n.Fv)(r,Array.isArray(r)?[i]:i);return Object.entries(s).forEach(t=>{let[r,n]=t;n&&Object.entries(n).forEach(t=>{let[n,i]=t;n&&i&&e.setQueryData([a.xL.item,r,n],t=>({...t,...i}))})}),{entities:s,result:u}}},g=(t,e)=>"string"==typeof t&&t.split("/")[0]===e},68230:function(t,e,r){"use strict";r.d(e,{p:function(){return y}});var n=r(86484),i=r(43056),a=r(9638),s=r(92141),u=r(52153),o=r(31687);let c=(t,e,r)=>{let a=(0,s.rh)(t);return(0,n.useQuery)({...r,queryFn:()=>a.count({where:e}),queryKey:[i.xL.count,t,JSON.stringify(e)]})};var l=r(31973);let y=(t,e,r)=>{let{entity:y,format:p}=t,{params:d={},hasCount:E=!0,initialSortState:h,initialPaginationState:f}=e||{},{onSuccess:w,...g}=r||{},m=(0,s.rh)(y),S=(0,o.a)(y),C=(0,l.P)(y),{data:N}=c(y,d.where,{enabled:E}),{pageQueryPayload:A}=(0,u.h)(null==N?void 0:N.count,f,h,E),L={...A,...d||{}},I=!!N||!E,{data:v,...O}=(0,n.useQuery)({enabled:I,queryFn:async()=>{let{result:t}=S(await m.find(L,p===i.ED.FULL&&a.s[y]));return t},queryKey:[i.xL.collection,y,L],onSuccess:t=>{w&&w((t||[]).map(t=>C(t)))},...g}),R=(v||[]).map(t=>C(t)).filter(t=>!!t);return{...O,data:R,dataGridProps:{rows:R||[],loading:O.isLoading}}}},31973:function(t,e,r){"use strict";r.d(e,{P:function(){return c},X:function(){return o}});var n=r(86484),i=r(43056),a=r(9638),s=r(92141),u=r(31687);let o=(t,e,r)=>{let{entity:o,format:c}=e,l=(0,s.rh)(o),y=(0,u.a)(o),{cacheScope:p,...d}=r||{};return(0,n.useQuery)({queryFn:async()=>{var e;let{entities:r,result:n}=y(await l.get(t,c===i.ED.FULL?a.s[o]:void 0));return null===(e=r[o])||void 0===e?void 0:e[n]},queryKey:[i.xL.item,o,t,p],enabled:d.enabled&&!!t,...d})},c=t=>{let e=(0,n.useQueryClient)();return r=>{let[n]=t.split("/");return e.getQueryData([i.xL.item,n,r])}}},42777:function(t,e,r){"use strict";r.d(e,{Gn:function(){return d},Qe:function(){return l},Vb:function(){return p},aU:function(){return o},f0:function(){return u},mr:function(){return y}});var n=r(2265),i=r(86484);r(43056),r(68230);var a=r(92141),s=r(98734);let u=t=>{let{apiClient:e}=(0,a.mb)();return(0,i.useMutation)({...t,mutationFn:async t=>await e.login(t)})},o=t=>{let{apiClient:e}=(0,a.mb)();return(0,i.useMutation)({...t,mutationFn:async()=>await e.logout(),onSuccess:()=>{}})},c="current-permissions",l=()=>{let{apiClient:t}=(0,a.mb)(),{user:e,isAuthenticated:r,isLoading:u}=(0,s.aC)(),o=(0,i.useQueryClient)(),l=null==e?void 0:e.id,y=(0,i.useQuery)({enabled:!u&&r&&!!l,queryKey:[c,l],queryFn:async()=>await t.getUserPermissions(l)});return(0,n.useEffect)(()=>{u||r||o.removeQueries([c])},[u,r,o]),y},y=t=>{let{apiClient:e}=(0,a.mb)();return(0,i.useMutation)({...t,mutationFn:async t=>await e.createAccount(t)})},p=t=>{let{apiClient:e}=(0,a.mb)();return(0,i.useMutation)({...t,mutationFn:async t=>await e.confirmAccount(t)})},d=t=>{let{apiClient:e}=(0,a.mb)(),{user:r}=(0,s.aC)();return(0,i.useMutation)({...t,mutationFn:async t=>await e.updateProfile(null==r?void 0:r.id,t)})}},92141:function(t,e,r){"use strict";r.d(e,{zU:function(){return d},mb:function(){return E},a8:function(){return y},rh:function(){return h}});
1var n=r(83464),i=r(64927),a=r(2265),s=r(60523),u=r(14438),o=r(98734),c=r(2787);let l=()=>{let t=(0,a.useContext)(c.E);if(!t)throw Error("useConfig must be used within a ConfigProvider");return t},y=()=>{let{apiUrl:t}=l(),{logoutRedirection:e}=(0,o.qY)();return(0,a.useMemo)(()=>{let r=n.Z.create({baseURL:t,withCredentials:!0});return r.defaults.paramsSerializer=function(t){return(0,i.stringify)(t,{arrayFormat:"indices",charsetSentinel:!1,skipNulls:!0,charset:"utf-8"})},r.interceptors.response.use(t=>t,t=>t.response?(401===t.response.status&&e(!0),Promise.reject(t.response.data)):(u.Am.error("Network error ..."),Promise.reject(Error("Network error")))),r},[e])},p=new Map,d=(t,e)=>{if(!p.has(t)){let r=e.buildEntityClient(t);p.set(t,r)}return p.get(t)},E=()=>{let t=(0,a.useContext)(s.n);if(!t)throw Error("useApiClient must be used within an ApiClientContext");return t},h=t=>{let{getApiClientByEntity:e}=E();return e(t)}},98734:function(t,e,r){"use strict";r.d(e,{aC:function(){return c},gm:function(){return u},qY:function(){return l}});var n=r(99376),i=r(2265),a=r(34757),s=r(43056);let u="current-user",o=["/extensions/submit","/account","/account/edit"],c=()=>{let t=(0,i.useContext)(a.V);if(!t)throw Error("useAuth must be used within an AuthProvider");return t},l=()=>{let t=(0,n.useRouter)(),e=(0,n.usePathname)(),r=o.includes(e);return{logoutRedirection:async function(){let n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(r){let r="/".concat(s.MG.LOGIN,"?redirect=").concat(encodeURIComponent(e));n?window.location.replace(r):t.replace(r)}}}}},52153:function(t,e,r){"use strict";r.d(e,{h:function(){return a},x:function(){return i}});var n=r(2265);function i(t,e){return{skip:t?t.page*t.pageSize:void 0,limit:t?t.pageSize:void 0,sort:e&&e.length?"".concat(e[0].field," ").concat(e[0].sort):void 0}}let a=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{page:0,pageSize:10},r=arguments.length>2?arguments[2]:void 0,a=!(arguments.length>
13)||void 0===arguments[3]||arguments[3],[s,u]=(0,n.useState)(e),[o,c]=(0,n.useState)(r);return{pageQueryPayload:i(a?s:void 0,o),rowCount:t,setSortModel:c,setPaginationModel:u}}},43056:function(t,e,r){"use strict";var n,i,a,s,u,o,c,l;r.d(e,{ED:function(){return i},MG:function(){return a},py:function(){return n},xL:function(){return s}}),(u=n||(n={})).ROLE="Role",u.USER="User",u.PERMISSION="Permission",u.MODEL="Model",u.SETTING="Setting",u.LANGUAGE="Language",u.LABEL="Label",u.EXTENSION="Extension",u.LICENSE_PRODUCT="LicenseProduct",(o=i||(i={}))[o.NONE=0]="NONE",o[o.STUB=1]="STUB",o[o.BASIC=2]="BASIC",o[o.FULL=3]="FULL",(c=a||(a={})).HOME="/extensions",c.LOGIN="signin",c.RESET="reset",(l=s||(s={})).item="item",l.collection="collection",l.count="count",l.infinite="infinite"},9638:function(t,e,r){"use strict";r.d(e,{s:function(){return i}});var n=r(43056);let i={[n.py.ROLE]:["users","permissions"],[n.py.USER]:["roles","avatar"],[n.py.MODEL]:["permissions"],[n.py.PERMISSION]:["model","role"],[n.py.SETTING]:[],[n.py.LANGUAGE]:[],[n.py.LABEL]:["extensions"],[n.py.EXTENSION]:["labels","author"],[n.py.LICENSE_PRODUCT]:[]}}}]);

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