1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,570680,e=>{"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function o(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?r(Object(o),!0).forEach(function(t){!function(e,t,r){var o;(t="symbol"==typeof(o=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=typeof o)return o;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t,"string"))?o:o+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}var n={test:"https://test.checkout.dodopayments.com",live:"https://checkout.dodopayments.com"},i=new Set(["checkout.opened","checkout.payment_page_opened","checkout.customer_details_submitted","checkout.closed","checkout.error","checkout.redirect"]);function a(e){if(!e.mode)throw Error("Checkout mode is required");if(!Object.keys(n).includes(e.mode))throw Error("Invalid checkout mode")}function s(e){try{var t=new URL(e);if("https:"!==t.protocol&&"http:"!==t.protocol)throw Error("Invalid redirect URL protocol");if(e.length>2048)throw Error("Redirect URL exceeds maximum length")}catch(e){throw Error("Invalid redirect URL format")}}var l=null;function c(e){var t;if(l&&e.origin===l.allowedOrigin)try{var r=e.data;if(!r||!r.event_type)return void console.warn("Received message without event_type:",r);if(!i.has(r.event_type))return void console.warn("Received message with invalid event_type: ".concat(r.event_type));if(d(r.event_type,r.data||{}),"checkout.closed"===r.event_type&&setTimeout(function(){return u(!1)},100),"checkout.redirect"===r.event_type){var o,n=null==(o=r.data)||null==(o=o.message)?void 0:o.redirect_to;if(n)try{s(n),window.location.href=n}catch(e){console.error("Invalid redirect URL:",e),d("checkout.error",{message:"Invalid redirect URL"})}}}catch(e){console.error("Error processing checkout message:",e),d("checkout.error",{message:"Failed to process message"})}else console.warn("Ignored message from unexpected origin: ".concat(e.origin,", expected: ").concat(null==(t=l)?void 0:t.allowedOrigin))}function d(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(l)if(i.has(e)){var n=o(o({},r),{},{products:l.currentProducts,timestamp:Date.now()});if(l.config.onEvent)try{l.config.onEvent({event_type:e,data:n})}catch(t){console.error("Error in onEvent handler for ".concat(e,":"),t)}null!=(t=l.eventListeners[e])&&t.length&&l.eventListeners[e].forEach(function(t){try{t(n)}catch(t){console.error("Error in ".concat(e," event handler:"),t)}})}else console.warn("Attempted to emit invalid event type: ".concat(e))}function u(){var e,t,r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(null!=(e=l)&&e.container||null!=(t=l)&&t.iframe)try{l.container?(l.container.remove(),l.container=null):l.iframe&&l.iframe.remove(),l.iframe=null,l.currentProducts=[],document.body.style.overflow="",document.body.style.contain="",r&&d("checkout.closed",{message:"Checkout closed manually"})}catch(e){throw console.error("Error closing checkout:",e),d("checkout.error",{message:"Failed to close checkout"}),e}}var m=null;function h(e){if(!e||"string"!=typeof e)throw Error("URL must be a non-empty string");if(e.trim()!==e)throw Error("URL cannot have leading or trailing whitespace");try{t=new URL(e.trim())}catch(e){throw Error("Invalid URL format")}if("https:"!==t.protocol&&"http:"!==t.protocol)throw Error("URL must use HTTP or HTTPS protocol");var t,r=["test.checkout.dodopayments.com","checkout.dodopayments.com"];if(!r.includes(t.hostname))throw Error("URL must be a Dodo Payments checkout domain. Expected: ".concat(r.join(" or ")));var o=t.pathname.split("/").filter(function(e){return e.length>0});if(0===o.length)throw Error("URL must contain a session ID or payment link ID");
1if("session"===o[0]){if(2!==o.length)throw Error("Session URL must have exactly 2 path segments: /session/sessionId");var n=o[1];if(!n.startsWith("cks_"))throw Error("Session ID must start with 'cks_' prefix");if(25!==n.length)throw Error("Session ID must be exactly 25 characters including 'cks_' prefix");if(!/^cks_[a-zA-Z0-9_-]{21}$/.test(n))throw Error("Session ID contains invalid characters. Only alphanumeric, underscore, and dash allowed after 'cks_' prefix");t.pathname="/overlay/session/".concat(n)}else{if(1!==o.length){if("overlay"===o[0]){if(2===o.length){var i=o[1];if(8!==i.length||!/^[a-zA-Z0-9_-]{8}$/.test(i))throw Error("Invalid payment link ID in overlay URL")}else{if(3!==o.length||"session"!==o[1])throw Error("Overlay URL must have format: /overlay/paymentLinkId or /overlay/session/sessionId");var a=o[2];if(!a.startsWith("cks_")||25!==a.length||!/^cks_[a-zA-Z0-9_-]{21}$/.test(a))throw Error("Invalid session ID in overlay URL")}return t.toString()}throw Error("Invalid URL format. Expected formats:\n - /session/cks_sessionId (25 chars total)\n - /paymentLinkId (8 chars)\n - /overlay/id (already processed)\n \n Got: /".concat(o.join("/")))}var s=o[0];if(8!==s.length)throw Error("Payment link ID must be exactly 8 characters");if(!/^[a-zA-Z0-9_-]{8}$/.test(s))throw Error("Payment link ID contains invalid characters. Only alphanumeric, underscore, and dash allowed");t.pathname="/overlay/".concat(s)}var l=t.toString();if(!l.includes("/overlay/"))throw Error("Internal error: Failed to build overlay URL");return l}e.s(["DodoPayments",0,{Initialize:function(e){if(a(e),e.theme&&console.warn("â ï¸ DEPRECATION WARNING: 'theme' option is deprecated and will be removed in v2.0.0. Please configure theme in your checkout session instead."),e.linkType&&"session"!==e.linkType&&console.warn("â ï¸ DEPRECATION WARNING: 'linkType' option with value '"+e.linkType+"' is deprecated and will be removed in v2.0.0. Please use 'session' linkType with checkoutUrl instead."),m){if(!m)throw Error("Checkout not initialized");a(e),e.theme&&console.warn("â ï¸ DEPRECATION WARNING: 'theme' option is deprecated and will be removed in v2.0.0. Please configure theme in your checkout session instead."),e.linkType&&"session"!==e.linkType&&console.warn("â ï¸ DEPRECATION WARNING: 'linkType' option with value '"+e.linkType+"' is deprecated and will be removed in v2.0.0. Please use 'session' linkType with checkoutUrl instead.");var t=e.onEvent||m.config.onEvent;m.config=o(o({linkType:"session"},e),{},{onEvent:t}),m.baseUrl!==n[e.mode]&&(m.baseUrl=n[e.mode],m.allowedOrigin=new URL(m.baseUrl).origin)}else{var r=n[e.mode],i=new URL(r).origin;l=m={iframe:null,container:null,config:o({linkType:"session"},e),currentProducts:[],baseUrl:r,allowedOrigin:i,iframeId:"dodo-checkout-iframe",eventListeners:{}},window.addEventListener("message",c)}},Checkout:{open:function(e){!function(e){var r,o=e.products,n=e.paymentLink,i=e.queryParams,a=e.redirectUrl,l=e.checkoutUrl;if(o&&o.length>0&&console.warn("â ï¸ DEPRECATION WARNING: 'products' option is deprecated and will be removed in v2.0.0. Please use 'checkoutUrl' with session linkType instead."),n&&console.warn("â ï¸ DEPRECATION WARNING: 'paymentLink' option is deprecated and will be removed in v2.0.0. Please use 'checkoutUrl' with session linkType instead."),i&&console.warn("â ï¸ DEPRECATION WARNING: 'queryParams' option is deprecated and will be removed in v2.0.0. Please include query parameters in your 'checkoutUrl' instead."),a&&console.warn("â ï¸ DEPRECATION WARNING: 'redirectUrl' option is deprecated and will be removed in v2.0.0. Please include redirect URL in your checkout session configuration instead."),n&&(!function(e){try{var t=new URL(e);if("https:"!==t.protocol&&"http:"!==t.protocol)throw Error("Invalid payment URL protocol");if(e.length>2048)throw Error("Payment URL exceeds maximum length")}catch(e){throw Error("Invalid payment URL format")}}(n),r=n.slice(-8)),!m)throw Error("Checkout not initialized");if(m.iframe||m.container)console.warn("Checkout is already open");else{if(a&&s(a),l&&function(e){try{var t=new URL(e);if("https:"!==t.protocol&&"http:"!==t.protocol)throw Error("Invalid checkout URL protocol");if(e.length>2048)throw Error("Checkout URL exceeds maximum length");if("test.checkout.dodopayments.com"===t.hostname||"checkout.dodopayments.com"===t.hostname){var r=t.pathname.split("/").filter(function(e){return e.length>0});if(0===r.length)throw Error("Checkout URL must contain a session ID or payment link ID");if("session"===r[0]){if(2!==r.length)throw Error("Session URL must have format: /session/cks_sessionId");var o=r[1];if(!o.startsWith("cks_"))throw Error("Session ID must start with 'cks_' prefix");if(25!==o.length)throw Error("Session ID must be exactly 25 characters including 'cks_' prefix");if(!/^cks_[a-zA-Z0-9_-]+$/.test(o))throw Error("Session ID contains invali
1d characters")}else if(1===r.length){var n=r[0];if(8!==n.length)throw Error("Payment link ID must be exactly 8 characters");if(!/^[a-zA-Z0-9_-]+$/.test(n))throw Error("Payment link ID contains invalid characters")}else{if("overlay"!==r[0])throw Error("Invalid checkout URL format. Expected /session/cks_id or /paymentLinkId");if(2===r.length){var i=r[1];if(8!==i.length||!/^[a-zA-Z0-9_-]{8}$/.test(i))throw Error("Invalid payment link ID in overlay URL")}else{if(3!==r.length||"session"!==r[1])throw Error("Invalid overlay URL format. Expected /overlay/paymentLinkId or /overlay/session/sessionId");var a=r[2];if(!a.startsWith("cks_")||25!==a.length||!/^cks_[a-zA-Z0-9_-]{21}$/.test(a))throw Error("Invalid session ID in overlay URL")}}}}catch(e){if(e instanceof Error)throw e;throw Error("Invalid checkout URL format")}}(l),"session"===m.config.linkType){if(!l)throw Error("checkoutUrl is required for session checkout")}else if("static"===m.config.linkType){if(console.warn("â ï¸ DEPRECATION WARNING: 'static' linkType is deprecated and will be removed in v2.0.0. Please migrate to 'session' linkType with checkoutUrl."),null==o||!o.length)throw Error("Products are required for static checkout");if(o.length>1)throw Error("Only one product is supported for checkout at the moment");var c=o[0].productId;if(!c||"string"!=typeof c)throw Error("Invalid product ID");if(c.length>50)throw Error("Product ID exceeds maximum length");if(!/^[a-zA-Z0-9_-]+$/.test(c))throw Error("Product ID contains invalid characters")}else if("dynamic"===m.config.linkType&&(console.warn("â ï¸ DEPRECATION WARNING: 'dynamic' linkType is deprecated and will be removed in v2.0.0. Please migrate to 'session' linkType with checkoutUrl."),!r))throw Error("Payment link ID is required for dynamic checkout");r&&function(e){if(!e||"string"!=typeof e)throw Error("Invalid payment link ID");if(e.length>10)throw Error("Payment link ID exceeds maximum length");if(!/^[a-zA-Z0-9_-]+$/.test(e))throw Error("Payment link ID contains invalid characters")}(r),m.currentProducts=o||[];try{!function(e,r,o,n,i){if(m){var a=document.createElement("div");a.style.cssText="z-index: 6859456; position: fixed; top: 0px; display: block; left: 0px; height: 100%; width: 100%; max-height: 100dvh; backface-visibility: hidden; overflow-y: visible;",a.id="dodo-checkout-outer-div";var s=document.createElement("div");s.style.cssText="min-height: 100%; transition: 0.3s ease-out; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background: transparent;",s.id="dodo-checkout-inner-div";var l,c=document.createElement("iframe");if(c.id=m.iframeId,"session"===m.config.linkType&&i){var d=h(i);l=new URL(d)}else if("static"===m.config.linkType&&null!=e&&e[0])l=function(e,r,o){if(!m)throw Error("Checkout not initialized");var n=new URL("".concat(m.baseUrl,"/overlay/buy/").concat(e.productId),window.location.origin);return r&&Object.entries(r).forEach(function(e){var r=function(e){if(Array.isArray(e))return e}(e)||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,n,i,a=[],s=!0,l=!1;try{n=(t=t.call(e)).next,!1;for(;!(s=(r=n.call(t)).done)&&(a.push(r.value),2!==a.length);s=!0);}catch(e){l=!0,o=e}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(l)throw o}}return a}}(e)||function(e){if(e){if("string"==typeof e)return t(e,2);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,2):void 0}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=r[0],i=r[1];n.searchParams.append(o,i)}),o&&n.searchParams.append("redirect_url",o),n.searchParams.append("quantity",e.quantity.toString()),m.config.theme&&console.warn("â ï¸ DEPRECATION WARNING: Using 'theme' in static checkout is deprecated and will be removed in v2.0.0. Please configure theme in your checkout session instead."),n.searchParams.append("theme",m.config.theme||"light"),n}(e[0],o,n);else{if("dynamic"!==m.config.linkType||!r)throw Error("Invalid checkout configuration");l=function(e){if(!m)throw Error("Checkout not initialized");var t=new URL("".concat(m.baseUrl,"/overlay/").concat(e),window.location.origin);return m.config.theme&&console.warn("â ï¸ DEPRECATION WARNING: Using 'theme' in dynamic checkout is deprecated and will be removed in v2.0.0. Please configure theme in y
1our checkout session instead."),t.searchParams.append("theme",m.config.theme||"light"),t}(r)}c.src=l.toString(),c.style.cssText="\n width: 100dvw;\n height: 100dvh;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: none;\n background: transparent;\n z-index: 1000;\n",c.setAttribute("allowtransparency","true"),c.setAttribute("frameBorder","0"),c.allow="payment *",c.setAttribute("sandbox","allow-same-origin allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox"),c.setAttribute("referrerpolicy","strict-origin-when-cross-origin"),s.appendChild(c),a.appendChild(s),document.body.style.overflow="hidden",document.body.style.contain="initial",document.body.appendChild(a),m.iframe=c,m.container=a}}(o,r,i,a,l)}catch(e){throw console.error("Error creating checkout:",e),d("checkout.error",{message:"Failed to create checkout"}),e}}}(e)},close:u,isOpen:function(){var e,t;return!!(null!=(e=m)&&e.iframe||null!=(t=m)&&t.container)},buildUrl:h},Status:{libraryVersion:"1.3.1"}}])},518369,e=>{"use strict";let t={test_mode:{hobby:{monthly:{id:"pdt_gIj5NedsaQ6JA7308cjrl",credit:1e3,pricing:10},yearly:{id:"pdt_qU1wpUUV2HYQaYLKSlUt5",credit:12e3,pricing:120}},starter:{monthly:{id:"pdt_HoTeSbPVogcSc1SzO469j",credit:2500,pricing:24},yearly:{id:"pdt_yYnLR9Db2uTfalL5wXhOB",credit:3e4,pricing:260}},professional:{monthly:{id:"pdt_VGWeHc6bmYLoFv6B6U3Eg",credit:1e4,pricing:99},yearly:{id:"pdt_npYkM0bl6xqWkNoEH00zU",credit:12e4,pricing:1099}}},live_mode:{hobby:{monthly:{id:"pdt_Lb5Ny4b1YmOlGqjLW1TWX",credit:1e3,pricing:10},yearly:{id:"pdt_AMc6sSn9bwtA1ZQVTr2cN",credit:12e3,pricing:120}},starter:{monthly:{id:"pdt_0C6MiMiLJKc3DG28ZHzdP",credit:2500,pricing:24},yearly:{id:"pdt_i9quDSJtISxvQNiQmENJa",credit:3e4,pricing:260}},professional:{monthly:{id:"pdt_KjTIyxKOPin3xJ4VRi241",credit:1e4,pricing:99},yearly:{id:"pdt_hhmsCRErwfXxxvo9yQW1r",credit:12e4,pricing:1099}}}},r={name:"Addon Credits",minAmount:5,maxAmount:1e3,creditMultiplier:100,productIds:{test_mode:"pdt_eYYwNRJ9d4IphF3Q3bibC",live_mode:"pdt_QTHQ9PDMoZPfspyNQ5h9p"}};e.s(["ADDON_CREDIT_PRODUCT",0,r,"formatCreditsDisplay",0,(e,t)=>{let r="monthly"===t?e.credits.monthly:e.credits.yearly;return`${r.toLocaleString()} credits per ${"monthly"===t?"month":"year"}`},"getAddonCreditProductId",0,e=>r.productIds[e],"getDodoProductIds",0,e=>t[e],"plans",0,[{id:"hobby",title:"Hobby",description:"Best for developers trying to use the platform.",currency:"$",monthlyPrice:"10",yearlyPrice:"120",buttonText:"Select Plan",featured:!1,credits:{monthly:1e3,yearly:12e3},onClick:()=>{},features:[{name:"1000 credits per month",icon:"check",iconColor:"text-green-500"},{name:"Up to ~200 Image Generations/month",icon:"check",iconColor:"text-blue-500"},{name:"Up to ~12 Video Generations/month",icon:"check",iconColor:"text-orange-500"},{name:"Up to ~100 Image Upscales/month",icon:"check",iconColor:"text-purple-500"},{name:"No commercial use",icon:"check",iconColor:"text-red-500"},{name:"No credits rollover",icon:"check",iconColor:"text-gray-400"},{name:"Add-on credits supported",icon:"check",iconColor:"text-sky-500"}]},{id:"starter",title:"Ultimate",description:"Perfect for small businesses",currency:"$",monthlyPrice:"24",yearlyPrice:"260",buttonText:"Select Plan",featured:!0,badge:"Most popular",highlight:!0,credits:{monthly:2500,yearly:3e4},onClick:()=>{},features:[{name:"2500 credits per month",icon:"check",iconColor:"text-green-500"},{name:"Up to ~500 Image Generations/month",icon:"check",iconColor:"text-blue-500"},{name:"Up to ~31 Video Generations/month",icon:"check",iconColor:"text-orange-500"},{name:"Up to ~250 Image Upscales/month",icon:"check",iconColor:"text-purple-500"},{name:"General Commercial Terms",icon:"check",iconColor:"text-teal-500"},{name:"No credits rollover",icon:"check",iconColor:"text-gray-400"},{name:"Add-on credits supported",icon:"check",iconColor:"text-sky-500"}]},{id:"professional",title:"Creator",description:"Ideal for small to mid range startups",currency:"$",monthlyPrice:"99",yearlyPrice:"1099",buttonText:"Select Plan",featured:!1,credits:{monthly:1e4,yearly:12e4},onClick:()=>{},features:[{name:"10000 credits per month",icon:"check",iconColor:"text-green-500"},{name:"Up to ~2000 Image Generations/month",icon:"check",iconColor:"text-blue-500"},{name:"Up to ~125 Video Generations/month",icon:"check",iconColor:"text-orange-500"},{name:"Up to ~1000 Image Upscales/month",icon:"check",iconColor:"text-purple-500"},{name:"All styles and models",icon:"check",iconColor:"text-teal-500"},{name:"General Commercial Terms",icon:"check",iconColor:"text-zinc-500"},{name:"Priority Support",icon:"check",iconColor:"text-yellow-500"},{name:"No credits rollover",icon:"check",iconColor:"text-gray-400"},{name:"Add-on credits supported",icon:"check",iconColor:"text-sky-500"}]}]])},462497,e=>{"use strict";let t=(0,e.i(395362).default)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["HelpCircle",0,t],462497)},90382,e=>{"use strict";var t=e.i(542970),r=e.i(286104),o=e.i(527069),n=e.i(291967),i=e.i(355597),a=e.i(740060),s=e.i(589016),l=e.i(704640),c=e.i(456023),d=e.i(227294),u=e.i(977219),m=e.i(863546),h=["PageUp","PageDown"],p=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],f={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},y="Slider",[v,g,w]=(0,m.createCollection)(y),[x,b]=(0,a.createContextScope)(y,[w]),[k,E]=x(y),I=r.forwardRef((e,i)=>{let{name:a,min:l=0,max:c=100,step:d=1,orientation:u="horizontal",disabled:m=!1,minStepsBetweenThumbs:f=0,defaultValue:y=[l],value:g,onValueChange:w=()=>{},onValueCommit:x=()=>{},inverted:b=!1,form:E,...I}=e,P=r.useRef(new Set),R=r.useRef(0),j="horizontal"===u,[D=[],_]=(0,s.useControllableState)({prop:g,defaultProp:y,onChange:e=>{let t=[...P.current];t[R.current]?.focus(),w(e)}}),U=r.useRef(D);
1function A(e,t,{commit:r}={commit:!1}){let n,i=(String(d).split(".")[1]||"").length,a=Math.round((Math.round((e-l)/d)*d+l)*(n=Math.pow(10,i)))/n,s=(0,o.clamp)(a,[l,c]);_((e=[])=>{let o=function(e=[],t,r){let o=[...e];return o[r]=t,o.sort((e,t)=>e-t)}(e,s,t);if(!function(e,t){if(t>0)return Math.min(...e.slice(0,-1).map((t,r)=>e[r+1]-t))>=t;return!0}(o,f*d))return e;{R.current=o.indexOf(s);let t=String(o)!==String(e);return t&&r&&x(o),t?o:e}})}return(0,t.jsx)(k,{scope:e.__scopeSlider,name:a,disabled:m,min:l,max:c,valueIndexToChangeRef:R,thumbs:P.current,values:D,orientation:u,form:E,children:(0,t.jsx)(v.Provider,{scope:e.__scopeSlider,children:(0,t.jsx)(v.Slot,{scope:e.__scopeSlider,children:(0,t.jsx)(j?N:C,{"aria-disabled":m,"data-disabled":m?"":void 0,...I,ref:i,onPointerDown:(0,n.composeEventHandlers)(I.onPointerDown,()=>{m||(U.current=D)}),min:l,max:c,inverted:b,onSlideStart:m?void 0:function(e){let t=function(e,t){if(1===e.length)return 0;let r=e.map(e=>Math.abs(e-t)),o=Math.min(...r);return r.indexOf(o)}(D,e);A(e,t)},onSlideMove:m?void 0:function(e){A(e,R.current)},onSlideEnd:m?void 0:function(){let e=U.current[R.current];D[R.current]!==e&&x(D)},onHomeKeyDown:()=>!m&&A(l,0,{commit:!0}),onEndKeyDown:()=>!m&&A(c,D.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!m){let r=h.includes(e.key)||e.shiftKey&&p.includes(e.key),o=R.current;A(D[o]+d*(r?10:1)*t,o,{commit:!0})}}})})})})});I.displayName=y;var[P,R]=x(y,{startEdge:"left",endEdge:"right",size:"width",direction:1}),N=r.forwardRef((e,o)=>{let{min:n,max:a,dir:s,inverted:c,onSlideStart:d,onSlideMove:u,onSlideEnd:m,onStepKeyDown:h,...p}=e,[y,v]=r.useState(null),g=(0,i.useComposedRefs)(o,e=>v(e)),w=r.useRef(void 0),x=(0,l.useDirection)(s),b="ltr"===x,k=b&&!c||!b&&c;function E(e){let t=w.current||y.getBoundingClientRect(),r=$([0,t.width],k?[n,a]:[a,n]);return w.current=t,r(e-t.left)}return(0,t.jsx)(P,{scope:e.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:(0,t.jsx)(j,{dir:x,"data-orientation":"horizontal",...p,ref:g,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=E(e.clientX);d?.(t)},onSlideMove:e=>{let t=E(e.clientX);u?.(t)},onSlideEnd:()=>{w.current=void 0,m?.()},onStepKeyDown:e=>{let t=f[k?"from-left":"from-right"].includes(e.key);h?.({event:e,direction:t?-1:1})}})})}),C=r.forwardRef((e,o)=>{let{min:n,max:a,inverted:s,onSlideStart:l,onSlideMove:c,onSlideEnd:d,onStepKeyDown:u,...m}=e,h=r.useRef(null),p=(0,i.useComposedRefs)(o,h),y=r.useRef(void 0),v=!s;function g(e){let t=y.current||h.current.getBoundingClientRect(),r=$([0,t.height],v?[a,n]:[n,a]);return y.current=t,r(e-t.top)}return(0,t.jsx)(P,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:(0,t.jsx)(j,{"data-orientation":"vertical",...m,ref:p,style:{...m.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=g(e.clientY);l?.(t)},onSlideMove:e=>{let t=g(e.clientY);c?.(t)},onSlideEnd:()=>{y.current=void 0,d?.()},onStepKeyDown:e=>{let t=f[v?"from-bottom":"from-top"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),j=r.forwardRef((e,r)=>{let{__scopeSlider:o,onSlideStart:i,onSlideMove:a,onSlideEnd:s,onHomeKeyDown:l,onEndKeyDown:c,onStepKeyDown:d,...m}=e,f=E(y,o);return(0,t.jsx)(u.Primitive.span,{...m,ref:r,onKeyDown:(0,n.composeEventHandlers)(e.onKeyDown,e=>{"Home"===e.key?(l(e),e.preventDefault()):"End"===e.key?(c(e),e.preventDefault()):h.concat(p).includes(e.key)&&(d(e),e.preventDefault())}),onPointerDown:(0,n.composeEventHandlers)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),f.thumbs.has(t)?t.focus():i(e)}),onPointerMove:(0,n.composeEventHandlers)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:(0,n.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),s(e))})})}),D="SliderTrack",_=r.forwardRef((e,r)=>{let{__scopeSlider:o,...n}=e,i=E(D,o);return(0,t.jsx)(u.Primitive.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...n,ref:r})});_.displayName=D;var U="SliderRange",A=r.forwardRef((e,o)=>{let{__scopeSlider:n,...a}=e,s=E(U,n),l=R(U,n),c=r.useRef(null),d=(0,i.useComposedRefs)(o,c),m=s.values.length,h=s.values.map(e=>M(e,s.min,s.max)),p=m>1?Math.min(...h):0,f=100-Math.max(...h);return(0,t.jsx)(u.Primitive.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...a,ref:d,style:{...e.style,[l.startEdge]:p+"%",[l.endEdge]:f
1+"%"}})});A.displayName=U;var S="SliderThumb",T=r.forwardRef((e,o)=>{let n=g(e.__scopeSlider),[a,s]=r.useState(null),l=(0,i.useComposedRefs)(o,e=>s(e)),c=r.useMemo(()=>a?n().findIndex(e=>e.ref.current===a):-1,[n,a]);return(0,t.jsx)(L,{...e,ref:l,index:c})}),L=r.forwardRef((e,o)=>{var a,s,l,c,m;let h,p,{__scopeSlider:f,index:y,name:g,...w}=e,x=E(S,f),b=R(S,f),[k,I]=r.useState(null),P=(0,i.useComposedRefs)(o,e=>I(e)),N=!k||x.form||!!k.closest("form"),C=(0,d.useSize)(k),j=x.values[y],D=void 0===j?0:M(j,x.min,x.max),_=(a=y,(s=x.values.length)>2?`Value ${a+1} of ${s}`:2===s?["Minimum","Maximum"][a]:void 0),U=C?.[b.size],A=U?(l=U,c=D,m=b.direction,p=$([0,50],[0,h=l/2]),(h-p(c)*m)*m):0;return r.useEffect(()=>{if(k)return x.thumbs.add(k),()=>{x.thumbs.delete(k)}},[k,x.thumbs]),(0,t.jsxs)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[b.startEdge]:`calc(${D}% + ${A}px)`},children:[(0,t.jsx)(v.ItemSlot,{scope:e.__scopeSlider,children:(0,t.jsx)(u.Primitive.span,{role:"slider","aria-label":e["aria-label"]||_,"aria-valuemin":x.min,"aria-valuenow":j,"aria-valuemax":x.max,"aria-orientation":x.orientation,"data-orientation":x.orientation,"data-disabled":x.disabled?"":void 0,tabIndex:x.disabled?void 0:0,...w,ref:P,style:void 0===j?{display:"none"}:e.style,onFocus:(0,n.composeEventHandlers)(e.onFocus,()=>{x.valueIndexToChangeRef.current=y})})}),N&&(0,t.jsx)(O,{name:g??(x.name?x.name+(x.values.length>1?"[]":""):void 0),form:x.form,value:j},y)]})});T.displayName=S;var O=r.forwardRef(({__scopeSlider:e,value:o,...n},a)=>{let s=r.useRef(null),l=(0,i.useComposedRefs)(s,a),d=(0,c.usePrevious)(o);return r.useEffect(()=>{let e=s.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(d!==o&&t){let r=new Event("input",{bubbles:!0});t.call(e,o),e.dispatchEvent(r)}},[d,o]),(0,t.jsx)(u.Primitive.input,{style:{display:"none"},...n,ref:l,defaultValue:o})});function M(e,t,r){return(0,o.clamp)(100/(r-t)*(e-t),[0,100])}function $(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(r-e[0])}}O.displayName="RadioBubbleInput";var z=e.i(647163);e.s(["Slider",0,function({className:e,defaultValue:o,value:n,min:i=0,max:a=100,...s}){let l=r.useMemo(()=>Array.isArray(n)?n:Array.isArray(o)?o:[i,a],[n,o,i,a]);return(0,t.jsxs)(I,{className:(0,z.cn)("relative flex w-full touch-none select-none items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col data-[disabled]:opacity-50",e),"data-slot":"slider",defaultValue:o,max:a,min:i,value:n,...s,children:[(0,t.jsx)(_,{className:(0,z.cn)("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-1.5"),"data-slot":"slider-track",children:(0,t.jsx)(A,{className:(0,z.cn)("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"),"data-slot":"slider-range"})}),Array.from({length:l.length},(e,r)=>(0,t.jsx)(T,{className:"block size-4 shrink-0 cursor-pointer rounded-full border border-primary bg-background shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:outline-hidden focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50","data-slot":"slider-thumb"},r))]})}],90382)},834789,e=>{"use strict";let t=(0,e.i(395362).default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);e.s(["ArrowRight",0,t],834789)},986945,e=>{"use strict";var t=e.i(542970),r=e.i(697557),o=e.i(570680),n=e.i(834789),i=e.i(712589),i=i,a=e.i(462497),s=e.i(427923),l=e.i(182788),c=e.i(479016),d=e.i(286104),u=e.i(167881),m=e.i(630374),h=e.i(90382),p=e.i(238313),f=e.i(752737),y=e.i(435478),v=e.i(518369);let g=f.env.NEXT_PUBLIC_DODO_PAYMENTS_ENVIRONMENT,w=[{amount:5,label:"$5"},{amount:10,label:"$10"},{amount:20,label:"$20"},{amount:50,label:"$50"},{amount:100,label:"$100"}];e.s(["BuyCreditsModal",0,({children:e,open:f,onOpenChange:x})=>{let[b,k]=(0,d.useState)(!1),[E,I]=(0,d.useState)(5),[P,R]=(0,d.useState)(!1),[N,C]=(0,d.useState)(""),{user:j}=(0,r.useUser)(),{refreshCredits:D}=(0,p.useCredits)(),_=(0,c.useRouter)(),{subscriptionData:U}=(0,y.useSubscription)(),A=void 0!==f,S=A?x||(()=>{}):k,T=U?.status==="active";(0,d.useEffect)(()=>{o.DodoPayments.Initialize({mode:"live_mode"===g?"live":"test",displayType:"overlay",theme:"dark",linkType:"static",onEvent:e=>{switch(e.event_type){case"checkout.opened":R(!1);break;case"checkout.closed":R(!1),D(),S(!1),_.push("/subscription");break;case"checkout.error":R(!1),C("Payment failed. Please try again.")}}})},[D,_,S]);let L=E*v.ADDON_CREDIT_PRODUCT.creditMultiplier,O=E/L,M=Math.floor(L/5),$=Math.floor(L/28);return(0,t.jsxs)(m.Dialog,{onOpenChange:S,open:A?f:b,children:[(0,t.jsx)(m.DialogTrigger,{asChild:!0,children:e}),(0,t.jsxs)(m.DialogContent,{className:"max-w-md border-[#3d3d3d] bg-[#1a1a1a] p-0 text-white sm:max-w-md",showCloseButton:!1,children:[(0,t.jsxs)("div",{className:"relative border-[#3d3d3d] border-b p-6 pb-4",children:[(0,t.jsx)("button",{className:"absolute top-4 right-4 cursor-pointer rounded-full p-1.5 text-gray-400 transition-colors hover:bg-[#292929] hover:text-white",onClick:()=>S(!1),type:"button",children:(0,t.jsx)(l.X,{className:"h-5 w-5"})}),(0,t.jsxs)(m.DialogHeader,{children:[(0,t.jsx)(m.DialogTitle,{className:"text-left font-bold text-2xl text-white",children:"Buy credits"}),(0,t.jsx)("p",{className:"mt-1 text-left text-gray-400 text-sm",children:"Get access to more generations"})]})]}),(0,t.jsxs)("div",{className:"space-y-6 p-6 pt-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"font-bold text-4xl text-white",children:["$",E]}),(0,t.jsxs)("div",{className:"text-gray-400 text-sm",children:["Total credits: ",L.toLocaleStr
1ing()," ($",O.toFixed(2)," / credit)"]})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex w-full items-start justify-between gap-3 overflow-x-auto pb-2",children:w.map(e=>{var r;let o=E===e.amount;return(0,t.jsx)("button",{className:"flex flex-shrink-0 flex-col items-center gap-2",onClick:()=>{I(e.amount),C("")},type:"button",children:(0,t.jsx)("div",{className:`rounded-lg border-2 px-4 py-2.5 text-gray-300 transition-all ${o?"border-primary bg-primary/10 text-white":"border-[#3d3d3d] bg-[#292929] hover:border-[#4d4d4d]"}`,children:(0,t.jsx)("span",{className:"whitespace-nowrap font-medium text-sm",children:(r=e.amount)>=1e3?`$${(r/1e3).toFixed(1)}K`:`$${r}`})})},e.amount)})}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-gray-400 text-sm",children:[(0,t.jsx)("span",{children:"$5"}),(0,t.jsx)("span",{children:"$100"})]}),(0,t.jsx)(h.Slider,{className:"w-full [&_[data-slot=slider-range]]:bg-primary [&_[data-slot=slider-thumb]]:border-primary [&_[data-slot=slider-thumb]]:bg-white [&_[data-slot=slider-thumb]]:ring-primary/50 [&_[data-slot=slider-track]]:bg-[#3d3d3d]",max:100,min:5,onValueChange:e=>{I(Math.max(5,Math.min(100,5*Math.round(e[0]/5)))),C("")},step:5,value:[E]})]})]}),N&&(0,t.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-900/10 p-3 text-red-400 text-sm",children:N}),(0,t.jsx)(u.Button,{className:"w-full cursor-pointer rounded-lg bg-primary py-3 font-semibold text-base text-white hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",disabled:P||!T,onClick:()=>{if(!T)return void C("Active subscription required to purchase credits");if(!j)return void C("You must be logged in to purchase credits");if(E<5||E>100)return void C("Amount must be between $5 and $100");if(E%5!=0)return void C("Amount must be a multiple of $5");R(!0),C("");try{let e=100*E,t=E*v.ADDON_CREDIT_PRODUCT.creditMultiplier;o.DodoPayments.Checkout.open({products:[{productId:(0,v.getAddonCreditProductId)(g),quantity:1}],redirectUrl:`${window.location.origin}/subscription`,queryParams:{email:j?.emailAddresses?.[0]?.emailAddress||"",metadata_userId:j.id,metadata_credits:t.toString(),metadata_amount:E.toString(),metadata_amountInCents:e.toString(),metadata_type:"addon_credit",disableEmail:"true",paymentAmount:e.toString(),paymentCurrency:"USD"}})}catch(e){C(`Failed to open payment checkout. Please try again. ${e}`),R(!1)}},children:P?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.Loader2,{className:"mr-2 h-5 w-5 animate-spin"}),"Processing..."]}):(0,t.jsxs)(t.Fragment,{children:["Buy credits",(0,t.jsx)(n.ArrowRight,{className:"ml-2 h-5 w-5"})]})}),(0,t.jsxs)("div",{className:"space-y-3 border-[#3d3d3d] border-t pt-4",children:[(0,t.jsx)("div",{className:"font-medium text-sm text-white",children:"Includes:"}),(0,t.jsxs)("div",{className:"space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5 text-gray-300 text-sm",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)(i.default,{className:"h-4 w-4 text-green-500"})}),(0,t.jsx)("span",{children:"Credits will be valid for 30 days"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2.5 text-gray-300 text-sm",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)(i.default,{className:"h-4 w-4 text-green-500"})}),(0,t.jsxs)("span",{children:[L.toLocaleString()," credits - One time topup"]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2.5 text-gray-300 text-sm",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)(i.default,{className:"h-4 w-4 text-green-500"})}),(0,t.jsxs)("span",{children:["~",M," Image generations"]}),(0,t.jsxs)("button",{"aria-label":"Image generation info",className:"group relative ml-1",type:"button",children:[(0,t.jsx)(a.HelpCircle,{className:"h-3.5 w-3.5 text-gray-500"}),(0,t.jsxs)("span",{className:"-translate-x-1/2 invisible absolute bottom-full left-1/2 mb-2 whitespace-nowrap rounded bg-[#292929] px-2 py-1 text-gray-300 text-xs opacity-0 shadow-lg transition-opacity group-hover:visible group-hover:opacity-100",children:["Average ",5," credits per image"]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2.5 text-gray-300 text-sm",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)(i.default,{className:"h-4 w-4 text-green-500"})}),(0,t.jsxs)("span",{children:["~",$," Video generations"]}),(0,t.jsxs)("button",{"aria-label":"Video generation info",className:"group relative ml-1",type:"button",children:[(0,t.jsx)(a.HelpCircle,{className:"h-3.5 w-3.5 text-gray-500"}),(0,t.jsxs)("span",{className:"-translate-x-1/2 invisible absolute bottom-full left-1/2 mb-2 whitespace-nowrap rounded bg-[#292929] px-2 py-1 text-gray-300 text-xs opacity-0 shadow-lg transition-opacity group-hover:visible group-hover:opacity-100",children:["Average ",28," credits per video"]})]})]})]})]})]})]})]})}],986945)}]); 2 3//# sourceMappingURL=09l4ph19f56mc.js.map
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.