1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,603295,e=>{"use strict";var t,n,r,i,o,a=e.i(393362),s=e.i(844847),c=e.i(164309),u=e.i(784544),l=e.i(177619),d=e.i(164863),f=e.i(14929),_=e.i(966792),h=e.i(396784),p=e.i(401157),v=e.i(785337),g=e.i(103297),m=e.i(94e4),w=function(e){function t(e,n){(0,p._)(this,t),(0,m._)(e,Error)?r=(0,h._)(this,t,[void 0,{cause:(0,c._)({err:e},e.cause,n)}]):"string"==typeof e?((0,m._)(n,Error)&&(n=(0,c._)({err:n},n.cause)),r=(0,h._)(this,t,[e,n])):r=(0,h._)(this,t,[void 0,e]),(0,g._)(r).name=(0,g._)(r).constructor.name,(0,g._)(r).type=null!=(a=(0,g._)(r).constructor.type)?a:"AuthError",(0,g._)(r).kind=null!=(s=(0,g._)(r).constructor.kind)?s:"error",null==(i=(o=Error).captureStackTrace)||i.call(o,(0,g._)(r),(0,g._)(r).constructor);var r,i,o,a,s,u="https://errors.authjs.dev#".concat((0,g._)(r).type.toLowerCase());return(0,g._)(r).message+="".concat((0,g._)(r).message?". ":"","Read more at ").concat(u),(0,g._)(r)}return(0,v._)(t,e),t}((0,e.i(232256)._)(Error)),y=function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w);y.kind="signIn",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="AdapterError",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="AccessDenied",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="CallbackRouteError",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="ErrorPageLoop",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="EventError",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="InvalidCallbackUrl",function(e){function t(){var e;return(0,p._)(this,t),e=(0,h._)(this,t,arguments),e.code="credentials",e}return(0,v._)(t,e),t}(y).type="CredentialsSignin",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="InvalidEndpoints",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="InvalidCheck",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="JWTSessionError",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="MissingAdapter",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="MissingAdapterMethods",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="MissingAuthorize",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="MissingSecret",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(y).type="OAuthAccountNotLinked",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(y).type="OAuthCallbackError",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="OAuthProfileParseError",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="SessionTokenError",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(y).type="OAuthSignInError",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(y).type="EmailSignInError",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="SignOutError",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="UnknownAction",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="UnsupportedStrategy",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="InvalidProvider",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="UntrustedHost",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="Verification",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(y).type="MissingCSRF",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="DuplicateConditionalUI",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="MissingWebAuthnAutocomplete",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="WebAuthnVerificationError",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(y).type="AccountNotLinked",function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w).type="ExperimentalFeatureNotEnabled";var k=function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w),b=function(e){function t(){return(0,p._)(this,t),(0,h._)(this,t,arguments)}return(0,v._)(t,e),t}(w);function S(e,t,n){return(0,s._)(function(e,t,n){var r,i,o,a,s,u,l,f=arguments;return(0,d._)(this,function(d){switch(d.label){case 0:r=f.length>3&&void 0!==f[3]?f[3]:{},i="".concat(E(t),"/").concat(e),d.label=1;case 1:return d.trys.push([1,4,,5]),a={headers:(0,c._)({"Content-Type":"application/json"},(null==r||null==(o=r.headers)?void 0:o.cookie)?{cookie:r.headers.cookie}:{})},(null==r?void 0:r.body)&&(a.body=JSON.stringify(r.body),a.method="POST"),[4,fetch(i,a)];case 2:return[4,(s=d.sent()).json()];case 3:if(u=d.sent(),!s.ok)throw u;return[2,u];case 4:return l=d.sent(),n.error(new k(l.message,l)),[2,null];case 5:return[2]}})}).apply(this,arguments)}function E(e){return"undefined"==typeof window?"".concat(e.baseUrlServer).concat(e.basePathServer):e.basePath}function C(){return Math.floor(Date.now()/1e3)}function x(e){var t=new URL("http://localhost:3000/api/auth");e&&!e.startsWith("http")&&(e="https://".concat(e));var n=new URL(e||t),r=("/"===n.pathname?t.pathname:n.pathname).replace(/\/$/,""),i="".concat(n.origin).concat(r);return{origin:n.origin,host:n.host,path:r,base:i,toString:function(){return i}}}var T={baseUrl:x(null!=(n=a.default.env.NEXTAUTH_URL)?n:a.default.env.VERCEL_URL).origin,basePath:x(a.default.env.NEXTAUTH_URL).path,baseUrlServer:x(null!=(i=null!=(r=a.default.env.NEXTAUTH_URL_INTERNAL)?r:a.default.env.NEXTAUTH_URL)?i:a.default.env.VERCEL_URL).origin,basePathServer:x(null!=(o=a.default.env.NEXTAUTH_URL_INTERNAL)?o:a.default.env.NEXTAUTH_URL).path,_lastSync:0,_session:void 0,_getSession:function(){}},U=null;function I(){return new BroadcastChannel("next-auth")}function N(){return"undefined"==typeof BroadcastChannel?{postMessage:function(){},addEventListener:function(){},removeEventListener:function(){}}:(null===U&&(U=I()),U)}var P={debug:console.debug,error:console.error,warn:console.warn},A=null==(t=_.createContext)?void 0:t.call(_,void 0);function L(e){if(!A)throw Error("React Context is unavailable in Server Components");var t=_.useContext(A),n=null!=e?e:{},r=n.required,i=n.onUnauthenticated,o=r&&"unauthenticated"===t.status;return(_.useEffect(function(){if(o){var e="".concat(T.basePath,"/signin?").concat(new
1URLSearchParams({error:"SessionRequired",callbackUrl:window.location.href}));i?i():window.location.href=e}},[o,i]),o)?{data:t.data,update:t.update,status:"loading"}:t}function R(e){return(0,s._)(function(){var t,n;return(0,d._)(this,function(r){switch(r.label){case 0:return[4,S("session",T,P,e)];case 1:return t=r.sent(),(null==(n=null==e?void 0:e.broadcast)||n)&&I().postMessage({event:"session",data:{trigger:"getSession"}}),[2,t]}})})()}function j(){return(0,s._)(function(){var e,t;return(0,d._)(this,function(n){switch(n.label){case 0:return[4,S("csrf",T,P)];case 1:return[2,null!=(t=null==(e=n.sent())?void 0:e.csrfToken)?t:""]}})})()}function O(e,t,n){return(0,s._)(function(){var r,i,o,a,l,f,_,h,p,v,g,m,w,y,k,b,C,x;return(0,d._)(this,function(U){switch(U.label){case 0:return i=void 0===(r=(null!=t?t:{}).redirect)||r,l=null!=(a=null!=(o=null==t?void 0:t.redirectTo)?o:null==t?void 0:t.callbackUrl)?a:window.location.href,f=E(T),[4,(0,s._)(function(){return(0,d._)(this,function(e){return[2,S("providers",T,P)]})})()];case 1:if(!(_=U.sent()))return window.location.href="".concat(f,"/error"),[2];if(!e||!(e in _))return window.location.href="".concat(f,"/signin?").concat(new URLSearchParams({callbackUrl:l})),[2];return h="credentials"===_[e].type,p="email"===_[e].type,v=h||p,g="".concat(f,"/").concat(h?"callback":"signin","/").concat(e),[4,j()];case 2:return m=U.sent(),[4,fetch("".concat(g,"?").concat(new URLSearchParams(n)),{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Auth-Return-Redirect":"1"},body:new URLSearchParams((0,u._)((0,c._)({},t),{csrfToken:m,callbackUrl:l}))})];case 3:return[4,(w=U.sent()).json()];case 4:if(y=U.sent(),i||!v)return b=null!=(k=y.url)?k:l,window.location.href=b,b.includes("#")&&window.location.reload(),[2];if(C=new URL(y.url).searchParams.get("error"),x=new URL(y.url).searchParams.get("code"),!w.ok)return[3,6];return[4,T._getSession({event:"storage"})];case 5:U.sent(),U.label=6;case 6:return[2,{error:C,code:x,status:w.status,ok:w.ok,url:C?null:y.url}]}})})()}function D(e){return(0,s._)(function(){var t,n,r,i,o,a,s,c,u;return(0,d._)(this,function(l){switch(l.label){case 0:return r=null!=(n=null!=(t=null==e?void 0:e.redirectTo)?t:null==e?void 0:e.callbackUrl)?n:window.location.href,i=E(T),[4,j()];case 1:return o=l.sent(),[4,fetch("".concat(i,"/signout"),{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Auth-Return-Redirect":"1"},body:new URLSearchParams({csrfToken:o,callbackUrl:r})})];case 2:return[4,l.sent().json()];case 3:if(a=l.sent(),N().postMessage({event:"session",data:{trigger:"signout"}}),null==(s=null==e?void 0:e.redirect)||s)return u=null!=(c=a.url)?c:r,window.location.href=u,u.includes("#")&&window.location.reload(),[2];return[4,T._getSession({event:"storage"})];case 4:return l.sent(),[2,a]}})})()}function M(e){if(!A)throw Error("React Context is unavailable in Server Components");var t,n,r,i,o,a=e.children,c=e.basePath,u=e.refetchInterval,h=e.refetchWhenOffline;c&&(T.basePath=c);var p=void 0!==e.session;T._lastSync=p?C():0;var v=(0,l._)(_.useState(function(){return p&&(T._session=e.session),e.session}),2),g=v[0],m=v[1],w=(0,l._)(_.useState(!p),2),y=w[0],k=w[1];_.useEffect(function(){return T._getSession=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).event;return(0,s._)(function(){var t,n;return(0,d._)(this,function(r){switch(r.label){case 0:if(r.trys.push([0,4,5,6]),!((t="storage"===e)||void 0===T._session))return[3,2];return T._lastSync=C(),[4,R({broadcast:!t})];case 1:return T._session=r.sent(),m(T._session),[2];case 2:if(!e||null===T._session||C()<T._lastSync)return[2];return T._lastSync=C(),[4,R()];case 3:return T._session=r.sent(),m(T._session),[3,6];case 4:return n=r.sent(),P.error(new b(n.message,n)),[3,6];case 5:return k(!1),[7];case 6:return[2]}})})()},T._getSession(),function(){T._lastSync=0,T._session=void 0,T._getSession=function(){}}},[]),_.useEffect(function(){var e=function(){return T._getSession({event:"storage"})};return N().addEventListener("message",e),function(){return N().removeEventListener("message",e)}},[]),_.useEffect(function(){var t=e.refetchOnWindowFocus,n=void 0===t||t,r=function(){n&&"visible"===document.visibilityState&&T._getSession({event:"visibilitychange"})};return document.addEventListener("visibilitychange",r,!1),function(){return document.removeEventListener("visibilitychange",r,!1)}},[e.refetchOnWindowFocus]);var E=(n=(t=(0,l._)(_.useState("undefined"!=typeof navigator&&navigator.onLine),2))[0],r=t[1],i=function(){return r(!0)},o=function(){return r(!1)},_.useEffect(function(){return window.addEventListener("online",i),window.addEventListener("offline",o),function(){window.removeEventListener("online",i),window.removeEventListener("offline",o)}},[]),n),x=!1!==h||E;_.useEffect(function(){if(u&&x){var e=setInterval(function(){T._session&&T._getSession({event:"poll"})},1e3*u);return function(){return clearInterval(e)}}},[u,x]);var U=_.useMemo(function(){return{data:g,status:y?"loading":g?"authenticated":"unauthenticated",update:function(e){return(0,s._)(function(){var t,n,r,i,o;return(0,d._)(this,function(a){switch(a.label){case 0:if(y)return[2];if(k(!0),n=["session",T,P],void 0!==e)return[3,1];return r=void 0,[3,3];case 1:return i={},o={},[4,j()];case 2:i.body=(o.csrfToken=a.sent(),o.data=e,o),r=i,a.label=3;case 3:return[4,S.apply(void 0,n.concat([r]))];case 4:return t=a.sent(),k(!1),t&&(m(t),N().postMessage({event:"session",data:{trigger:"getSession"}})),[2,t]}})})()}}},[g,y]);return(0,f.jsx)(A.Provider,{value:U,children:a})}e.s(["SessionProvider",()=>M,"signIn",()=>O,"signOut",()=>D,"useSession",()=>L],603295)},906498,e=>{"use strict";var t=(0,e.i(122436).default)("coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);e.s(["default",()=>t])},528446,e=>{"use strict";
1var t=(0,e.i(122436).default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);e.s(["default",()=>t])},975891,e=>{"use strict";e.i(393362);var t="ugc_funnel_anonymous_id",n="ugc_funnel_anonymous_id",r="ugc_funnel_session_id",i=["site_entry","landing_page_viewed","pricing_page_viewed","tool_page_viewed","credits_exhausted","paywall_shown","promo_banner_shown","promo_banner_click","emote_variant_selected","emote_precheck_result","emote_export","emote_upload_guide_opened","clothing_rig_start","clothing_rig_completed","clothing_rig_download","clothing_rig_guide_opened","cage_tool_upload_start","cage_tool_upload_succeeded","cage_tool_upload_rate_limited","checker_upload_start","checker_upload_succeeded","checker_issue_found","cross_to_cage","event_banner_shown","event_banner_click","tester_upload_succeeded","tester_model_changed","tester_cross_to_maker","tester_templates_click"],o=/bot|crawler|spider|headless|vercel-screenshot|lighthouse|facebookexternalhit|meta-webindexer|googlebot/i;function a(e){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?"".concat(e,"_").concat(crypto.randomUUID()):"".concat(e,"_").concat(Date.now(),"_").concat(Math.random().toString(36).slice(2,10))}function s(e,t,n){document.cookie="".concat(e,"=").concat(encodeURIComponent(t),"; path=/; max-age=").concat(n,"; SameSite=Lax")}function c(e){return i.includes(e)}var u=null,l=null;function d(e,t){try{return("local"===e?window.localStorage:window.sessionStorage).getItem(t)}catch(e){return null}}function f(e,t,n){try{("local"===e?window.localStorage:window.sessionStorage).setItem(t,n)}catch(e){}}function _(){var e=d("session",r);if(e)return e;if(l)return l;var t=a("session");return l=t,f("session",r,t),t}function h(e,r){if(!("undefined"!=typeof navigator&&(navigator.webdriver||o.test(navigator.userAgent||"")))){var i=JSON.stringify({eventName:e,anonymousId:function(){var e=d("local",n);if(e)return s(t,e,31536e3),e;if(u)return u;var r=a("anon");return u=r,f("local",n,r),s(t,r,31536e3),r}(),sessionId:_(),clientEventId:a("event"),occurredAt:new Date().toISOString(),props:r||{}});"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon&&navigator.sendBeacon("/api/analytics/funnel/collect",new Blob([i],{type:"application/json"}))||fetch("/api/analytics/funnel/collect",{method:"POST",headers:{"Content-Type":"application/json"},body:i,keepalive:!0}).catch(function(){})}}e.s(["collectFunnelClientEvent",()=>h,"ensureSessionId",()=>_,"isClientFunnelEventName",()=>c,"safeStorageGet",()=>d,"safeStorageSet",()=>f],975891)},869205,e=>{"use strict";var t=e.i(164309),n=e.i(784544),r=e.i(177619),i=e.i(536038),o=e.i(975891),a="G-K4XF42BLEW",s="ugcraft_plausible_user_properties",c=new Set(["sign_up","trial_credits_claimed","tool_page_viewed","generation_complete","credits_exhausted","paywall_shown","begin_checkout","purchase"]),u={},l=!1;function d(e){var t={};if(!e)return t;var n=!0,o=!1,a=void 0;try{for(var s,c=Object.entries(e)[Symbol.iterator]();!(n=(s=c.next()).done);n=!0){var u=(0,r._)(s.value,2),l=u[0],d=u[1];if(!(null==d||Array.isArray(d))&&((void 0===d?"undefined":(0,i._)(d))!=="object"||null===d)){if("string"==typeof d||"number"==typeof d||"boolean"==typeof d){var f,_=(f=d,"string"!=typeof f?f:f.trim()||void 0);if(void 0!==_){if("user_type"===l){t.user_plan=_;continue}t[l]=_}}}}}catch(e){o=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw a}}return t}function f(){return"function"==typeof window.plausible}function _(){if(!l){l=!0;try{var e=window.localStorage.getItem(s);if(!e)return;var t=JSON.parse(e);if(!t||(void 0===t?"undefined":(0,i._)(t))!=="object"||Array.isArray(t))return;Object.assign(u,d(t))}catch(e){}}}function h(){try{if(0===Object.keys(u).length)return void window.localStorage.removeItem(s);window.localStorage.setItem(s,JSON.stringify(u))}catch(e){}}function p(){return _(),(0,t._)({},u)}var v=function(){return"function"==typeof window.gtag&&!!a},g=function(e,r){var i=v(),s=c.has(e)&&f();i&&window.gtag("event",e,(0,n._)((0,t._)({},r),{send_to:a})),s&&function(e,n){if(f()){_();var r,i,o=d(n),a=(0,t._)({},u,o),s={};if(Object.keys(a).length>0&&(s.props=a),"purchase"===e){var c="number"==typeof a.value?a.value:NaN,l="string"==typeof a.currency?a.currency:void 0;Number.isFinite(c)&&c>0&&l&&(s.revenue={amount:c,currency:l})}null==(r=(i=window).plausible)||r.call(i,e,s)}}
1(e,r),(0,o.isClientFunnelEventName)(e)&&(_(),(0,o.collectFunnelClientEvent)(e,(0,t._)({},u,d(r))))},m=function(e){_(),Object.assign(u,d(e)),h(),v()&&window.gtag("set","user_properties",e)},w=function(e){if(null===e){_();var t=!0,n=!1,r=void 0;try{for(var i,o=Object.keys(u)[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var s=i.value;delete u[s]}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}h()}v()&&window.gtag("config",a,{user_id:e})},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];v()&&window.gtag("event","exception",{description:e.slice(0,150),fatal:t})};e.s(["getPlausibleUserPropertiesSnapshot",()=>p,"setUserId",()=>w,"setUserProperties",()=>m,"trackEvent",()=>g,"trackException",()=>y])},405728,e=>{"use strict";var t=(0,e.i(122436).default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);e.s(["default",()=>t])},659619,794008,e=>{"use strict";var t=e.i(869205),n=e.i(164309),r=e.i(966792),i=function(){var e=(0,r.useCallback)(function(e){(0,t.trackEvent)("login",{method:e})},[]),i=(0,r.useCallback)(function(e){(0,t.trackEvent)("sign_up",{method:e})},[]),o=(0,r.useCallback)(function(){(0,t.trackEvent)("logout")},[]),a=(0,r.useCallback)(function(){(0,t.trackEvent)("one_tap_show")},[]),s=(0,r.useCallback)(function(){(0,t.trackEvent)("one_tap_click")},[]),c=(0,r.useCallback)(function(e,n){(0,t.trackEvent)("creation_start",{creation_type:e,source:n})},[]),u=(0,r.useCallback)(function(e,n){(0,t.trackEvent)("creation_complete",{creation_type:e,duration_seconds:n})},[]),l=(0,r.useCallback)(function(e){(0,t.trackEvent)("creation_save",{creation_type:e})},[]),d=(0,r.useCallback)(function(e,n){(0,t.trackEvent)("creation_export",{creation_type:e,export_format:n})},[]),f=(0,r.useCallback)(function(e){(0,t.trackEvent)("ai_generate_start",{model:e.model,prompt_length:e.promptLength,generation_type:e.generationType})},[]),_=(0,r.useCallback)(function(e){(0,t.trackEvent)("ai_generate_complete",{model:e.model,duration_seconds:e.durationSeconds,output_type:e.outputType})},[]),h=(0,r.useCallback)(function(e){var n;(0,t.trackEvent)("ai_generate_fail",{model:e.model,error:null==(n=e.error)?void 0:n.slice(0,100)})},[]),p=(0,r.useCallback)(function(e,n){(0,t.trackEvent)("tool_use",{tool_name:e,action:n})},[]),v=(0,r.useCallback)(function(e,n){(0,t.trackEvent)("file_upload",{file_type:e,file_size_kb:n})},[]),g=(0,r.useCallback)(function(e,n){(0,t.trackEvent)("file_download",{file_type:e,file_name:n})},[]),m=(0,r.useCallback)(function(e){(0,t.trackEvent)("view_item_list",{item_list_id:"pricing_plans",item_list_name:"Pricing Plans",source:e})},[]),w=(0,r.useCallback)(function(e,n,r){(0,t.trackEvent)("view_item",{currency:"USD",value:r,items:[{item_id:"".concat(n,"_").concat(e),item_name:"".concat(e," Plan (").concat(n,")"),price:r,quantity:1}]})},[]),y=(0,r.useCallback)(function(e){(0,t.trackEvent)("begin_checkout",{currency:e.currency||"USD",value:e.value,items:[{item_id:"".concat(e.billingCycle,"_").concat(e.plan),item_name:"".concat(e.plan," Plan (").concat(e.billingCycle,")"),price:e.value,quantity:1}]})},[]),k=(0,r.useCallback)(function(e){(0,t.trackEvent)("purchase",{transaction_id:e.transactionId,currency:e.currency||"USD",value:e.value,items:[{item_id:"".concat(e.billingCycle,"_").concat(e.plan),item_name:"".concat(e.plan," Plan (").concat(e.billingCycle,")"),price:e.value,quantity:1}]})},[]),b=(0,r.useCallback)(function(e){(0,t.trackEvent)("trial_credits_claimed",e)},[]),S=(0,r.useCallback)(function(e){(0,t.trackEvent)("tool_page_viewed",e)},[]),E=(0,r.useCallback)(function(e){(0,t.trackEvent)("generation_complete",e),e.is_first&&(0,t.setUserProperties)({first_tool:e.asset_kind})},[]),C=(0,r.useCallback)(function(e){(0,t.trackEvent)("credits_exhausted",e)},[]),x=(0,r.useCallback)(function(e){(0,t.trackEvent)("paywall_shown",e)},[]),T=(0,r.useCallback)(function(e,n){(0,t.trackEvent)("cta_click",{cta_name:e,location:n})},[]),U=(0,r.useCallback)(function(e,n,r){(0,t.trackEvent)("share",{method:e,content_type:n,item_id:r})},[]),I=(0,r.useCallback)(function(e){(0,t.trackEvent)("search",{search_term:e})},[]),N=(0,r.useCallback)(function(e,n,r){(0,t.trackEvent)("error_occur",{error_type:e,error_message:n.slice(0,100),component:r}),(0,t.trackException)("".concat(e,": ").concat(n),!1)},[]),P=(0,r.useCallback)(function(e,r){(0,t.trackEvent)("feature_use",(0,n._)({feature_name:e},r))},[]);return{trackEvent:t.trackEvent,setUserId:t.setUserId,setUserProperties:t.setUserProperties,trackException:t.trackException,trackLogin:e,trackSignUp:i,trackLogout:o,trackOneTapShow:a,trackOneTapClick:s,trackCreationStart:c,trackCreationComplete:u,trackCreationSave:l,trackCreationExport:d,trackAIGenerateStart:f,trackAIGenerateComplete:_,trackAIGenerateFail:h,trackToolUse:p,trackFileUpload:v,trackFileDownload:g,trackViewPricing:m,trackViewPlan:w,trackBeginCheckout:y,trackPurchase:k,trackTrialCreditsClaimed:b,trackToolPageViewed:S,trackGenerationComplete:E,trackCreditsExhausted:C,trackPaywallShown:x,trackCTAClick:T,trackShare:U,trackSearch:I,trackError:N,trackFeatureUse:P}};e.s(["useAnalytics",()=>i],794008),e.s([],659619)},852872,e=>{"use strict";var t=new Set(["US","GB","AU","SE","CA","NZ","GE","DK","KR","IL","DE","FR","PL","ES","CY"]),n=new Set(["BR","NL","CH","BE","AT","FI","IE","IT","JP","NO","SG","HK","TW","MX","AR","CL","CO","CZ","HU","RO","PT","GR","TR","TH","MY","SA","AE","QA","KW"]);function r(e){var r=(e||"").toUpperCase().trim();return t.has(r)?1:n.has(r)?2:3}function i(e){switch(r(e)){case 1:return 20;case 2:return 10;case 3:return 0}}Array.from(t);var o=new Date("2026-08-12T00:00:00Z"),a="shipped",s=new Set(["0","2","4","6","8","a","c","e"]);
1function c(e,t,n){var c,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a,l=i(t);if(1!==r(t)||"rolled_back"===u)return l;var d=n?n.getTime():NaN;return Number.isNaN(d)||d<o.getTime()?l:"shipped"===u?10:"T"==(c=(e||"").replace(/-/g,"").toLowerCase().slice(-1),s.has(c)?"T":"C")?10:l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),s=i(e);return 1!==r(e)||"rolled_back"===t||"shipped"!==t&&n<o.getTime()?s:10}e.s(["TIER1_CREDITS",()=>20,"getCreditTier",()=>r,"getTrialCreditsDisplayForGuest",()=>u,"getTrialCreditsForUser",()=>c])},167173,879734,e=>{"use strict";var t=e.i(393362),n=e.i(844847),r=e.i(177619),i=e.i(164863),o=e.i(14929),a=e.i(966792),s=e.i(603295),c=e.i(218668);e.i(659619);var u=e.i(869205),l="google-one-tap",d="google-one-tap-dismissed-at",f=null;function _(e){window.localStorage.setItem(d,JSON.stringify({ts:Date.now(),duration:e}))}var h=e.i(852872),p=e.i(765008),v=e.i(995403),g=e.i(906498),m=e.i(528446),w=e.i(786164),y=e.i(405728),k=e.i(519455),b=e.i(975157),S=e.i(520133),E=e.i(160625);function C(){return"/home"}function x(e){var t=e.type,n=e.onDismiss,r=e.onAction,i=e.credits,a=(0,E.useTranslations)("trial_claim"),s=C(),c="success"===t;return(0,o.jsxs)("div",{className:(0,b.cn)("relative w-full max-w-sm overflow-hidden rounded-xl border p-4 shadow-xl backdrop-blur-xl transition-all",c?"border-white/10 bg-zinc-950/70":"border-orange-500/20 bg-zinc-950/70"),children:[(0,o.jsx)("div",{className:(0,b.cn)("absolute -left-10 -top-10 h-32 w-32 rounded-full blur-3xl op
1acity-40 pointer-events-none",c?"bg-amber-500":"bg-orange-600")}),(0,o.jsxs)("div",{className:"relative flex items-start gap-4",children:[(0,o.jsx)("div",{className:(0,b.cn)("flex h-10 w-10 shrink-0 items-center justify-center rounded-full border shadow-inner",c?"bg-amber-500/10 border-amber-500/20 text-amber-400":"bg-orange-500/10 border-orange-500/20 text-orange-500"),children:c?(0,o.jsx)(g.default,{className:"h-5 w-5"}):(0,o.jsx)(m.default,{className:"h-5 w-5"})}),(0,o.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,o.jsxs)("div",{className:"flex items-start justify-between",children:[(0,o.jsx)("h4",{className:"font-semibold text-foreground tracking-tight",children:c?a("success_title",{credits:null!=i?i:0}):a("limit_title")}),(0,o.jsx)("button",{onClick:n,className:"rounded-full p-1 text-muted-foreground hover:bg-white/10 hover:text-foreground transition-colors -mr-2 -mt-2",children:(0,o.jsx)(w.default,{className:"h-4 w-4"})})]}),(0,o.jsx)("p",{className:"text-sm text-muted-foreground leading-snug",children:a(c?"success_desc":"limit_desc")}),(0,o.jsx)("div",{className:"mt-3",children:c?(0,o.jsxs)(S.Link,{href:s,className:"inline-flex items-center text-sm font-medium text-amber-400 hover:text-amber-300 transition-colors group",onClick:n,children:[a("success_action")," ",(0,o.jsx)(y.default,{className:"ml-1 h-3 w-3 transition-transform group-hover:translate-x-0.5"})]}):(0,o.jsx)(k.Button,{onClick:r,className:"w-full bg-orange-600 hover:bg-orange-500 text-white border-none shadow-orange-900/20 shadow-lg",size:"sm",children:a("limit_action")})})]})]})]})}e.s(["getCreationPathFromCookie",()=>C],879734);var T=new Set(["success","rate_limited","already_granted","not_eligible"]),U=function(){},I={showSignModal:!1,signModalScene:"default",setShowSignModal:U,user:null,setUser:U,refreshUser:function(){return(0,n._)(function(){return(0,i._)(this,function(e){return[2]})})()},showFeedback:!1,setShowFeedback:U,isSigningIn:!1,setIsSigningIn:U},N=(0,a.createContext)(I),P=function(){return(0,a.useContext)(N)};function A(e){var t=e.children;return(0,o.jsx)(N.Provider,{value:I,children:t})}function L(e){var g,m,w,y=e.children,k=e.enableOneTap;!function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=(0,s.useSession)().status,o=(0,c.useRouter)(),h=(0,a.useRef)(!1);(0,a.useEffect)(function(){if(e&&"unauthenticated"===r&&!h.current){var a="https://ugcraft.ai,https://www.ugcraft.ai,https://ug-craft-869xxpgi8-yussdais-projects.vercel.app".split(",").map(function(e){return e.trim()}).filter(Boolean);if((a.length>0?a:["https://ugcraft.ai","https://www.ugcraft.ai"]).includes(window.location.origin)&&!function(){var e=window.localStorage.getItem(d);if(!e)return!1;try{var t=JSON.parse(e);if(null==t?void 0:t.ts){var n=Number.isFinite(t.duration)?t.duration:864e5;return Date.now()-t.ts<n}}catch(t){var r=Number(e);if(!Number.isNaN(r)&&Date.now()-r<864e5)return!0}return!1}()){var c,p,v="true"===t.default.env.NEXT_PUBLIC_GOOGLE_ONE_TAP_USE_FEDCM,g=!1,m=null,w=function(){return(0,n._)(function(){var e,t;return(0,i._)(this,function(r){switch(r.label){case 0:var a,c;return r.trys.push([0,2,,3]),[4,(null==(c=window.google)||null==(a=c.accounts)?void 0:a.id)?Promise.resolve():f||(f=new Promise(function(e,t){var n=document.getElementById(l);if(n){n.addEventListener("load",function(){return e()},{once:!0}),n.addEventListener("error",t,{once:!0});return}var r=document.createElement("script");r.src="https://accounts.google.com/gsi/client",r.async=!0,r.defer=!0,r.id=l,r.onload=function(){return e()},r.onerror=function(){return t(Error("Failed to load Google One Tap script"))},document.head.appendChild(r)}))];case 1:if(r.sent(),g||!(null==(t=window.google)||null==(e=t.accounts)?void 0:e.id))return[2];h.current=!0,window.google.accounts.id.initialize({client_id:"559782907294-bb6qaq6k4j1o4lrgmvnteiq368t95944.apps.googleusercontent.com",auto_select:!1,cancel_on_tap_outside:!1,context:"signin",use_fedcm_for_prompt:v,callback:function(e){var t=e.credential;return(0,n._)(function(){var e;return(0,i._)(this,function(n){switch(n.label){case 0:if(!t)return[2];return(0,u.trackEvent)("one_tap_click"),[4,(0,s.signIn)("google-one-tap",{credential:t,redirect:!1})];case 1:if(null==(e=n.sent())?void 0:e.error)return console.error("One Tap sign-in failed",e.error),_(6e5),[2];return(0,u.trackEvent)("login",{method:"one_tap"}),window.localStorage.removeItem(d),o.refresh(),[2]}})})()}}),(0,u.trackEvent)("one_tap_show");try{window.google.accounts.id.prompt(function(e){var t,n,r;if((null==(t=e.isDismissedMoment)?void 0:t.call(e))||(null==(n=e.isNotDisplayed)?void 0:n.call(e))||(null==(r=e.isSkippedMoment)?void 0:r.call(e))){var i,o=(null==(i=e.isDismissedMoment)?void 0:i.call(e))?864e5:6e5;_(o)}})}catch(e){console.warn("One Tap prompt skipped due to FedCM error",e),_(6e5)}return[3,3];case 2:return console.error("Failed to initialize Google One Tap",r.sent()),_(6e5),[3,3];case 3:return[2]}})})()};return c=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),(null==(p=navigator.connection)?void 0:p.effectiveType)==="2g"||(null==p?void 0:p.effectiveType)==="slow-2g"||(null==p?void 0:p.saveData)===!0?m=setTimeout(function(){g||w()},8e3):c?m=setTimeout(function(){g||w()},5e3):"requestIdleCallback"in window?window.requestIdleCallback(function(){g||w()},{timeout:2500}):m=setTimeout(function(){g||w()},1500),function(){var e,t,n,r;g=!0,m&&clearTimeout(m),null==(r=window.google)||null==(n=r.accounts)||null==(t=n.id)||null==(e=t.cancel)||e.call(t)}}}},[e,o,r])}((void 0===k||k)&&!0);
1var b=(0,s.useSession)(),S=b.data,E=b.status,C=(0,r._)((0,a.useState)(!1),2),U=C[0],I=C[1],P=(0,r._)((0,a.useState)("default"),2),A=P[0],L=P[1],R=(0,r._)((0,a.useState)(!1),2),j=R[0],O=R[1],D=(0,r._)((0,a.useState)(null),2),M=D[0],F=D[1],B=(0,r._)((0,a.useState)(!1),2),G=B[0],J=B[1],q=(0,a.useRef)(null),H=(0,a.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";I(e),e&&L(t)},[]),X=(0,a.useCallback)(function(e){return(0,n._)(function(){return(0,i._)(this,function(e){return console.log("[DEPRECATED] updateInvite is no longer used. Invite binding happens at signup."),[2]})})()},[]),W=(0,a.useCallback)(function(){if(!(null==S?void 0:S.user))return void console.error("â æ sessionæ°æ®å¯ç¨ï¼ç¨æ·ä¿¡æ¯è·åå®å
¨å¤±è´¥");var e={uuid:S.user.uuid||"",email:S.user.email||"",nickname:S.user.nickname||S.user.name||"",avatar_url:S.user.avatar_url||S.user.image||"",created_at:S.user.created_at||"",invited_by:"",invite_code:"",pricing_plan:"free"};console.log("ð ä½¿ç¨ session å¤ç¨ç¨æ·ä¿¡æ¯"),F(e),e.uuid?((0,u.setUserId)(e.uuid),(0,u.setUserProperties)({user_type:e.pricing_plan||"free",has_credits:!1})):(0,u.setUserId)(null);try{X(e)}catch(e){console.warn("é请å
³ç³»æ´æ°å¤±è´¥:",e)}},[S,X]),z=(0,a.useCallback)(function(){return(0,n._)(function(){var e;return(0,i._)(this,function(t){return q.current?[2,q.current]:(e=(0,n._)(function(){var e,t,n,r,o,a,s,c,l,d;return(0,i._)(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,4,5]),[4,fetch("/api/get-user-info",{method:"POST",headers:{"Content-Type":"application/json"}})];case 1:if(!(e=i.sent()).ok)throw Error("fetch user info failed with status: ".concat(e.status));return[4,e.json()];case 2:if(n=(t=i.sent()).code,r=t.message,o=t.data,0!==n)throw Error(r);return F(o),X(o),o.uuid&&((0,u.setUserId)(o.uuid),(0,u.setUserProperties)({user_type:o.effective_plan||o.pricing_plan||"free",has_credits:((null==(a=o.credits)?void 0:a.left_credits)||0)>0,user_tier:String((0,h.getCreditTier)(o.country||"")),user_country:o.country||""}),o.created_at&&(s=new Date(o.created_at).getTime(),c=Date.now()-s<3e5,l="ugcraft_signup_tracked_".concat(o.uuid),c&&!sessionStorage.getItem(l)&&(sessionStorage.setItem(l,"1"),d=o.signin_provider||"email",(0,u.trackEvent)("sign_up",{method:d})))),console.log("â
ç¨æ·ä¿¡æ¯è·åæå"),[3,5];case 3:return console.warn("â ï¸ ç¨æ·ä¿¡æ¯è·å失败ï¼éçº§ä½¿ç¨ session æ°æ®:",i.sent()),W(),[3,5];case 4:return q.current=null,[7];case 5:return[2]}})})(),q.current=e,[2,e])})})()},[W,S,X]);(0,a.useEffect)(function(){"true"===window.sessionStorage.getItem("isSigningIn")&&O(!0)},[]),(0,a.useEffect)(function(){"loading"!==E&&(S&&S.user?(z(),O(!1),window.sessionStorage.removeItem("isSigningIn")):(F(null),O(!1),window.sessionStorage.removeItem("isSigningIn"),(0,u.setUserId)(null),(0,u.setUserProperties)({user_type:"anonymous",has_credits:!1})))},[z,S,E]);var V=(0,a.useCallback)(function(){return(0,n._)(function(){return(0,i._)(this,function(e){switch(e.label){case 0:return[4,z()];case 1:return e.sent(),[2]}})})()},[z]);m=(0,c.useRouter)(),w=(0,a.useRef)(!1),(0,a.useEffect)(function(){if(M&&M.uuid){var e,t=Date.now();if(!0===M.trial_claim_pending&&!0!==M.initial_credits_granted&&(!M.pricing_plan||"free"===M.pricing_plan)&&(null==(e=M.credits)||!e.is_recharged)){var r="trial_claim_attempt_".concat(M.uuid),a=localStorage.getItem(r);if(a)try{var s=JSON.parse(a),c=s.timestamp,l=s.status,d=t-Number(c||0);if(Number.isNaN(d)||d<0)localStorage.removeItem(r);else if(d<6048e5&&T.has(l))return;else if(d<6e5&&("failed"===l||"error"===l))return}catch(e){localStorage.removeItem(r)}w.current||(w.current=!0,(0,n._)(function(){var e,n,a,s,c;return(0,i._)(this,function(i){switch(i.label){case 0:i.trys.push([0,11,12,13]),e=null,i.label=1;case 1:return i.trys.push([1,4,,5]),[4,p.default.load()];case 2:return[4,i.sent().get()];case 3:return e=i.sent().visitorId||null,[3,5];case 4:return console.warn("Failed to generate fingerprint",i.sent()),[3,5];case 5:return[4,fetch("/api/user/claim-trial",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fingerprint:e})})];case 6:n=i.sent(),a=null,i.label=7;case 7:return i.trys.push([7,9,,10]),[4,n.json()];case 8:return a=i.sent(),[3,10];case 9:return console.warn("Failed to parse trial claim response",i.sent()),[3,10];case 10:return s=(null==a?void 0:a.reason)||(null==a?void 0:a.code),c=(null==a?void 0:a.success)?"success":s||(n.ok?"failed":"error"),localStorage.setItem(r,JSON.stringify({timestamp:t,status:c})),(null==a?void 0:a.success)?((0,u.trackEvent)("trial_credits_claimed",{credits:a.credits||0,tier:String(a.tier||""),country:a.country||""}),a.credits>0&&v.toast.custom(function(e){return(0,o.jsx)(x,{type:"success",credits:a.credits,onDismiss:function(){return v.toast.dismiss(e)}})},{duration:6e3}),V()):"rate_limited"===s?v.toast.custom(function(e){return(0,o.jsx)(x,{type:"limit",onDismiss:function(){return v.toast.dismiss(e)},onAction:function(){v.toast.dismiss(e),m.push("/pricing")}})},{duration:6e3}):"missing_fingerprint"===s&&console.warn("Trial claim denied: Missing fingerprint"),[3,13];case 11:return console.error("Trial claim error",i.sent()),localStorage.setItem(r,JSON.stringify({timestamp:t,status:"failed"})),[3,13];case 12:return w.current=!1,[7];case 13:return[2]}})})())}}},[null==M?void 0:M.uuid,null==M?void 0:M.initial_credits_granted,null==M?void 0:M.trial_claim_pending,null==M?void 0:M.pricing_plan,null==M||null==(g=M.credits)?void 0:g.is_recharged,V,m]);var K=(0,a.useMemo)(function(){return{showSignModal:U,signModalScene:A,setShowSignModal:H,user:M,setUser:F,refreshUser:V,showFeedback:G,setShowFeedback:J,isSigningIn:j,setIsSigningIn:O}},[U,A,H,M,V,G,j]);return(0,o.jsx)(N.Provider,{value:K,children:y})}
1var R=function(e){var t=e.children,n=e.enableAuth,r=e.enableOneTap;return void 0===n||n?(0,o.jsx)(L,{enableOneTap:void 0===r||r,children:t}):(0,o.jsx)(A,{children:t})};e.s(["AppContextProvider",()=>R,"useAppContext",()=>P],167173)}]);
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.