!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0879f-7680-7660-a577-204216d12ecb")}catch(e){}}();(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,540427,e=>{"use strict";var t=e.i(270401),r=e.i(281334);let a=t.forwardRef(function(e,t){let{className:a,render:i,orientation:s="horizontal",style:o,...n}=e;return(0,r.useRenderElement)("div",e,{state:{orientation:s},ref:t,props:[{role:"separator","aria-orientation":s},n]})});e.s(["Separator",0,a])},871565,e=>{"use strict";e.s(["safeDecodeURIComponent",0,function(e){try{return decodeURIComponent(e)}catch{return e}}])},81331,e=>{"use strict";var t=e.i(222666),r=e.i(505962),a=e.i(850658),i=e.i(871565);e.i(204067);var s=e.i(796805);let o="ready",n=s.z.object({data:s.z.custom(function(e){if("object"!=typeof e||null===e||!("status"in e))return!1;let t=e.status;return"signed_out"===t||"not_found"===t||t===o&&"model"in e&&"object"==typeof e.model&&null!==e.model&&"endpoints"in e&&Array.isArray(e.endpoints)&&"activeVariant"in e&&"string"==typeof e.activeVariant&&"basePath"in e&&"string"==typeof e.basePath},{message:"Invalid private model page payload"})});var u=e.i(79247),c=e.i(749509),l=e.i(270401),d=e.i(612960),p=e.i(151960),m=e.i(626824),f=e.i(10684),y=e.i(8842);let v=(0,m.createQueryKeys)("private-model-redirect",{access:e=>[e]});function g(e){var t;let a,s,c,m,g=(0,r.c)(10),h=(0,d.useLocalizedRouter)();g[0]!==e?(a=(0,y.queryOptions)({queryKey:v.access(e),queryFn:({signal:t})=>(0,p.fetchAPIQuery)("/api/frontend/v1/private/model-page",{searchParams:e.params,signal:t,schema:n.shape.data}),select:e=>e.status===o,staleTime:f.StaleTime.ALWAYS,gcTime:f.GcTime.ON_UNMOUNT}),g[0]=e,g[1]=a):a=g[1];let{data:R,isFetching:P}=(0,u.useQuery)(a);g[2]!==e.params?(t=e.params,s=`/private/${(0,i.safeDecodeURIComponent)(t["maker-id"])}/${(0,i.safeDecodeURIComponent)(t.slug)}`,g[2]=e.params,g[3]=s):s=g[3];let T=s;return g[4]!==T||g[5]!==R||g[6]!==P||g[7]!==h?(c=()=>{R&&!P&&h.replace(T)},m=[T,R,P,h],g[4]=T,g[5]=R,g[6]=P,g[7]=h,g[8]=c,g[9]=m):(c=g[8],m=g[9]),(0,l.useEffect)(c,m),null}e.s(["PrivateModelRedirect",0,function(){let e,i,s=(0,r.c)(7),{isLoaded:o,userId:n,orgId:u}=(0,a.useAuth)(),l=(0,c.useParams)(),d=l?.["maker-id"],p=l?.slug;if(!o||!n||"string"!=typeof d||"string"!=typeof p)return null;let m=u??null;return s[0]!==d||s[1]!==p?(e={"maker-id":d,slug:p},s[0]=d,s[1]=p,s[2]=e):e=s[2],s[3]!==m||s[4]!==e||s[5]!==n?(i=(0,t.jsx)(g,{userId:n,orgId:m,params:e}),s[3]=m,s[4]=e,s[5]=n,s[6]=i):i=s[6],i},"PrivateModelRedirectForUser",0,g],81331)}]); //# sourceMappingURL=0t1hajcgyvhqy.js.map //# chunkId=01a0879f-7680-7660-a577-204216d12ecb