1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="38a27e6b-f9bb-478f-8643-9c60b5a1586d",e._sentryDebugIdIdentifier="sentry-dbid-38a27e6b-f9bb-478f-8643-9c60b5a1586d")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2682],{22005:(e,t,a)=>{a.d(t,{x:()=>s});var s=JSON.parse('{"Jn":[{"id":"nano-banana-2","label":"Nano Banana 2","group":"featured","is_default":true,"purposes":["scene","artwork"],"aspect_ratios":["1:1","4:5","3:2","2:3","4:3","3:4","16:9","9:16"],"resolutions":["1K","2K","4K"],"qualities":[],"supports_seed":true,"credit_options":[{"resolution":"1K","credits":132},{"resolution":"2K","credits":199},{"resolution":"4K","credits":265}],"generation_available":true,"pricing_status":"configured"},{"id":"gpt-image-2.5-sunburst","label":"GPT-Image-2.5 Sunburst","group":"featured","is_default":false,"purposes":["scene","artwork"],"aspect_ratios":["1:1","4:3","3:4","16:9","9:16"],"resolutions":["native"],"qualities":["auto","low","medium","high","xhigh","max"],"supports_seed":false,"credit_options":[],"minimum_credit_options":[{"resolution":"native","quality":"auto","aspect_ratio":"1:1","credits":9},{"resolution":"native","quality":"low","aspect_ratio":"1:1","credits":9},{"resolution":"native","quality":"medium","aspect_ratio":"1:1","credits":21},{"resolution":"native","quality":"high","aspect_ratio":"1:1","credits":87},{"resolution":"native","quality":"xhigh","aspect_ratio":"1:1","credits":155},{"resolution":"native","quality":"max","aspect_ratio":"1:1","credits":349},{"resolution":"native","quality":"auto","aspect_ratio":"4:3","credits":6},{"resolution":"native","quality":"low","aspect_ratio":"4:3","credits":6},{"resolution":"native","quality":"medium","aspect_ratio":"4:3","credits":15},{"resolution":"native","quality":"high","aspect_ratio":"4:3","credits":60},{"resolution":"native","quality":"xhigh","aspect_ratio":"4:3","credits":106},{"resolution":"native","quality":"max","aspect_ratio":"4:3","credits":239},{"resolution":"native","quality":"auto","aspect_ratio":"3:4","credits":6},{"resolution":"native","quality":"low","aspect_ratio":"3:4","credits":6},{"resolution":"native","quality":"medium","aspect_ratio":"3:4","credits":15},{"resolution":"native","quality":"high","aspect_ratio":"3:4","credits":60},{"resolution":"native","quality":"xhigh","aspect_ratio":"3:4","credits":106},{"resolution":"native","quality":"max","aspect_ratio":"3:4","credits":239},{"resolution":"native","quality":"auto","aspect_ratio":"16:9","credits":5},{"resolution":"native","quality":"low","aspect_ratio":"16:9","credits":5},{"resolution":"native","quality":"medium","aspect_ratio":"16:9","credits":13},{"resolution":"native","quality":"high","aspect_ratio":"16:9","credits":53},{"resolution":"native","quality":"xhigh","aspect_ratio":"16:9","credits":95},{"resolution":"native","quality":"max","aspect_ratio":"16:9","credits":214},{"resolution":"native","quality":"auto","aspect_ratio":"9:16","credits":5},{"resolution":"native","quality":"low","aspect_ratio":"9:16","credits":5},{"resolution":"native","quality":"medium","aspect_ratio":"9:16","credits":13},{"resolution":"native","quality":"high","aspect_ratio":"9:16","credits":53},{"resolution":"native","quality":"xhigh","aspect_ratio":"9:16","credits":95},{"resolution":"native","quality":"max","aspect_ratio":"9:16","credits":214}],"generation_available":true,"pricing_status":"configured"},{"id":"gpt-image-2.5-flare","label":"GPT-Image-2.5 Flare","group":"featured","is_default":false,"purposes":["scene","artwork"],"aspect_ratios":["1:1","4:3","3:4","16:9","9:16"],"resolutions":["native"],"qualities":["auto","low","medium","high","xhigh","max"],"supports_seed":false,"credit_options":[],"minimum_credit_options":[{"resolution":"native","quality":"auto","aspect_ratio":"1:1","credits":9},{"resolution":"native","quality":"low","aspect_ratio":"1:1","credits":9},{"resolution":"native","quality":"medium","aspect_ratio":"1:1","credits":21},{"resolution":"native","quality":"high","aspect_ratio":"1:1","credits":87},{"resolution":"native","quality":"xhigh","aspect_ratio":"1:1","credits":155},{"resolution":"native","quality":"max","aspect_ratio":"1:1","credits":349},{"resolution":"native","quality":"auto","aspect_ratio":"4:3","credits":6},{"resolution":"native","quality":"low","aspect_ratio":"4:3","credits":6},{"resolution":"native","quality":"medium","aspect_ratio":"4:3","credits":15},{"resolution":"native","quality":"high","aspect_ratio":"4:3","credits":60},{"resolution":"native","quality":"xhigh","aspect_ratio":"4:3","credits":106},{"resolution":"native","quality":"max","aspect_ratio":"4:3","credits":239},{"resolution":"native","quality":"auto","aspect_ratio":"3:4","credits":6},{"resolution":"native","quality":"low","aspect_ratio":"3:4","credits":6},{"resolution":"native","quality":"medium","aspect_ratio":"3:4","credits":15},{"resolution":"native","quality":"high","aspect_ratio":"3:4","credits":60},{"resolution":"native","quality":"xhigh","aspect_ratio":"3:4","credits":106},{"resolution":"native","quality":"max","aspect_ratio":"3:4","credits":239},{"resolution":"native","quality":"auto","aspect_ratio":"16:9","credits":5},{"resolution":"native","quality":"low","aspect_ratio":"16:9","credits":5},{"resolution":"native","quality":"medium","aspect_ratio":"16:9","credits":13},{"resolution":"native","quality":"high","aspect_ratio":"16:9","credits":53},{"resolution":"native","quality":"xhigh","aspect_ratio":"16:9","credits":95},{"resolution":"native","quality":"max","aspect_ratio":"16:9","credits":214},{"resolution":"native","quality":"auto","aspect_ratio":"9:16","credits":5},{"resolution":"native","quality":"low","aspect_ratio":"9:16","credits":5},{"resolution":"native","quality":"medium","aspect_ratio":"9:16","credits":13},{"resolution":"native","quality":"high","aspect_ratio":"9:16","credits":53},{"resolution":"native","quality":"xhigh","aspect_ratio":"9:16","credits":95},{"resolution":"native","quality":"max","aspect_ratio":"9:16","credits":214}],"generation_available":true,"pricing_status":"configured"},{"id":"grok-imagine-image-2","label":"Grok Imagine Image 2.0","group":"featured","is_default":false,"purposes":["scene","artwork"],"aspect_ratios":["1:1","3:2","2:3","4:3","3:4","16:9","9:16"],"resolutions":["1K","2K"],"qualities":["low","medium"],"supports_seed":false,"credit_options":[{"resolution":"1K","quality":"low","credits":66},{"resolution":"1K","quality":"medium","credits":99},{"resolution":"2K","quality":"low","credits":99},{"resolution":"2K","quality":"medium","credits":132}],"generation_available":true,"pricing_status":"configured"},{"id":"reve-2.1","label":"Reve 2.1","group":"others","is_default":false,"purposes":["scene","artwork"],"aspect_ratios":["1:1","4:5","3:2","2:3","4:3","3:4","16:9","9:16"],"resolutions":["native"],"qualities":[],"supports_seed":false,"credit_options":[{"resolution":"native","credits":415}],"generation_available":true,"pricing_status":"configured"},{"id":"meta-muse-image","label":"Meta Muse Image","group":"others","is_default":false,"purposes":["scene","artwork"],"aspect_ratios":["1:1","3:2","2:3","4:3","3:4","16:9","9:16"],"resolutions":["native"],"qualities":[],"supports_seed":false,"credit_options":[{"resolution":"native","credits":16}],"generation_available":true,"pricing_status":"configured"},{"id":"seedream-5-pro","label":"Seedream 5.0 Pro","group":"others","is_default":false,"purposes":["scene","artwork"],"aspect_ratios":["1:1","4:5","3:2","2:3","4:3","3:4","16:9","9:16"],"resolutions":["1K","2K"],"qualities":[],"supports_seed":false,"credit_options":[{"resolution":"1K","credits":112},{"resolution":"2K","credits":224}],"generation_available":true,"pricing_status":"configured"},{"id":"nano-banana-pro","label":"Nano Banana Pro","group":"others","is_default":false,"purposes":["scene","artwork"],"aspect_ratios":["1:1","4:5","3:2","2:3","4:3","3:4","16:9","9:16"],"resolutions":["1K","2K","4K"],"qualities":[],"supports_seed":true,"credit_options":[{"resolution":"1K","credits":249},{"resolution":"2K","credits":249},{"resolution":"4K","credits":498}],"generation_available":true,"pricing_status":"configured"},{"id":"uni-1","label":"Luma UNI-1","group":"others","is_default":false,"purposes":["scene","artwork"],"aspect_ratios":["1:1","3:2","2:3","16:9","9:16"],"resolutions":["native"],"qualities":[],"supports_seed":false,"credit_options":[{"resolution":"native","credits":69}],"generation_available":true,"pricing_status":"configured"},{"id":"uni-1-max","label":"Luma UNI-1 Max","group":"others","is_default":false,"purposes":["scene","artwork"],"aspect_ratios":["1:1","3:2","2:3","16:9","9:16"],"resolutions":["native"],"qualities":[],"supports_seed":false,"credit_options":[{"resolution":"native","credits":169}],"generation_available":true,"pricing_status":"configured"},{"id":"ideogram-4","label":"Ideogram 4.0","group":"others","is_default":false,"purposes":["scene","artwork"],"aspect_ratios":["1:1","4:3","3:4","16:9","9:16"],"resolutions":["native"],"qualities":["TURBO","BALANCED","QUALITY"],"supports_seed":true,"credit_options":[{"resolution":"native","quality":"TURBO","aspect_ratio":"1:1","credits":12},{"resolution":"native","quality":"TURBO","aspect_ratio":"4:3","credits":9},{"resolution":"native","quality":"TURBO","aspect_ratio":"3:4","credits":9},{"resolution":"native","quality":"TURBO","aspect_ratio":"16:9","credits":7},{"resolution":"native","quality":"TURBO","aspect_ratio":"9:16","credits":7},{"resolution":"native","quality":"BALANCED","aspect_ratio":"1:1","credits":24},{"resolution":"native","quality":"BALANCED","aspect_ratio":"4:3","credits":18},{"resolution":"native","quality":"BALANCED","aspect_ratio":"3:4","credits":18},{"resolution":"native","quality":"BALANCED","aspect_ratio":"16:9","credits":14},{"resolution":"native","quality":"BALANCED","aspect_ratio":"9:16","credits":14}
1,{"resolution":"native","quality":"QUALITY","aspect_ratio":"1:1","credits":41},{"resolution":"native","quality":"QUALITY","aspect_ratio":"4:3","credits":31},{"resolution":"native","quality":"QUALITY","aspect_ratio":"3:4","credits":31},{"resolution":"native","quality":"QUALITY","aspect_ratio":"16:9","credits":23},{"resolution":"native","quality":"QUALITY","aspect_ratio":"9:16","credits":23}],"generation_available":true,"pricing_status":"configured"},{"id":"recraft-4.1","label":"Recraft V4.1","group":"others","is_default":false,"purposes":["scene","artwork"],"aspect_ratios":["1:1","4:3","3:4","16:9","9:16"],"resolutions":["native"],"qualities":[],"supports_seed":false,"credit_options":[{"resolution":"native","credits":58}],"generation_available":true,"pricing_status":"configured"},{"id":"flux-2-max","label":"FLUX.2 Max","group":"others","is_default":false,"purposes":["scene","artwork"],"aspect_ratios":["1:1","4:3","3:4","16:9","9:16"],"resolutions":["native"],"qualities":[],"supports_seed":true,"credit_options":[{"resolution":"native","credits":116}],"generation_available":true,"pricing_status":"configured"},{"id":"flux-2-pro","label":"FLUX.2 Pro","group":"others","is_default":false,"purposes":["scene","artwork"],"aspect_ratios":["1:1","4:3","3:4","16:9","9:16"],"resolutions":["native"],"qualities":[],"supports_seed":true,"credit_options":[{"resolution":"native","credits":49}],"generation_available":true,"pricing_status":"configured"},{"id":"krea-2-large","label":"Krea 2 Large","group":"others","is_default":false,"purposes":["scene","artwork"],"aspect_ratios":["1:1","4:5","3:2","2:3","4:3","16:9","9:16"],"resolutions":["native"],"qualities":[],"supports_seed":true,"credit_options":[{"resolution":"native","credits":99}],"generation_available":true,"pricing_status":"configured"},{"id":"krea-2-medium","label":"Krea 2 Medium","group":"others","is_default":false,"purposes":["scene","artwork"],"aspect_ratios":["1:1","4:5","3:2","2:3","4:3","16:9","9:16"],"resolutions":["native"],"qualities":[],"supports_seed":true,"credit_options":[{"resolution":"native","credits":49}],"generation_available":true,"pricing_status":"configured"},{"id":"wan-2.7-pro","label":"Wan 2.7 Pro","group":"others","is_default":false,"purposes":["scene","artwork"],"aspect_ratios":["1:1","4:3","3:4","16:9","9:16"],"resolutions":["native"],"qualities":[],"supports_seed":true,"credit_options":[{"resolution":"native","credits":124}],"generation_available":true,"pricing_status":"configured"}]}').Jn},33789:(e,t,a)=>{a.d(t,{p:()=>l});var s=a(82732),r=a(17389),o=a(95155),n=a(12115),i=a(43564),l=n.forwardRef(function(e,t){var a=e.className,n=e.type,l=(0,r._)(e,["className","type"]);return(0,o.jsx)("input",(0,s._)({type:n,className:(0,i.cn)("flex h-10 w-full rounded-lg border border-white/5 bg-zinc-900/50 px-3 py-2 text-sm text-white placeholder:text-zinc-400 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-white/20 disabled:cursor-not-allowed disabled:opacity-50",a),ref:t},l))});l.displayName="Input"},52682:(e,t,a)=>{a.r(t),a.d(t,{CreateWorkspace:()=>eY});var s=a(61975),r=a(79703),o=a(82732),n=a(45849),i=a(22043),l=a(45377),c=a(71450),d=a(95155),u=a(12115),p=a(47650),h=a(15239),m=a(52619),f=a.n(m),g=a(20063),b=a(53455),w=a(99776),k=a(67364),v=a(83437),y=a(59046),_=a(23916),x=a(25352),j=a(37230),C=a(34788),N=a(97454),q=a(27906),S=a(28215),A=a(67081),P=a(33229),I=a(58103),U=a(66122),L=a(66005),R=a(69746),z=a(80325),M=a(61475),T=a(40209),E=a(6029),O=a(97003),D=a(17389),F=a(43564),K=u.forwardRef(function(e,t){var a=e.className,s=(0,D._)(e,["className"]);return(0,d.jsx)("textarea",(0,o._)({ref:t,"data-slot":"textarea",className:(0,F.cn)("flex min-h-24 w-full rounded-md border border-white/10 bg-transparent px-3 py-2 text-sm placeholder:text-zinc-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-400 disabled:cursor-not-allowed disabled:opacity-50",a)},s))});K.displayName="Textarea";var B=a(68122),G=a(33789),Y=a(54679);let Q=JSON.parse('{"Y":[{"name":"create_2d_mockup","description":"Create a reusable photo mockup from a public image URL. Returns the mockup ID and public render targets synchronously. Costs 25 credits. If the image is unsuitable, the 25 credits are refunded automatically. Set is_async=true to queue instead and receive a job_id to poll with get_job or wait_for_job. Use the dashboard for visual fine-tuning."},{"name":"create_photo_mockup","description":"Create a reusable photo mockup from a public image URL. Returns the mockup ID and public render targets synchronously. Costs 25 credits. If the image is unsuitable, the 25 credits are refunded automatically. Set is_async=true to queue instead and receive a job_id to poll with get_job or wait_for_job. Use the dashboard for visual fine-tuning. Family-name spelling of create_2d_mockup: one tool under two names, same arguments, same behavior. Either name works."},{"name":"create_upload_url","description":"Get a place to send a file that only exists on your machine. Every other tool takes a URL, so a local file has to be uploaded first. Returns an upload_url to PUT the bytes to and the file_url they will have afterwards; pass that file_url as psd_file_url to upload_psd, or as artwork_url to any render tool. Set kind to \\"psd\\" for a .psd or .psb template, or \\"artwork\\" for a .png, .jpg, .webp or .gif image. The upload target is scoped to a single file and cannot be overwritten or read back through the same URL. When the file is on the machine running this server, upload_local_file uploads it in one step. Costs 0 credits."},{"name":"create_webhook_endpoint","description":"Register a webhook endpoint that SudoMock calls when async jobs finish. The signing secret is returned IN FULL exactly once here -- store it to verify the HMAC carried in the X-SudoMock-Signature header (with X-SudoMock-Timestamp) on incoming deliveries. URL must be https and publicly routable."},{"name":"delete_2d_mockup","description":"Permanently delete a photo mockup template and all of its data. Cannot be undone. Costs 0 credits."},{"name":"delete_mockup","description":"Permanently delete a mockup template. Cannot be undone."},{"name":"delete_photo_mockup","description":"Permanently delete a photo mockup template and all of its data. Cannot be undone. Costs 0 credits. Family-name spelling of delete_2d_mockup: one tool under two names, same arguments, same behavior. Either name works."},{"name":"delete_psd_mockup","description":"Permanently delete a mockup template. Cannot be undone. Family-name spelling of delete_mockup: one tool under two names, same arguments, same behavior. Either name works."},{"name":"delete_webhook_endpoint","description":"Permanently delete a webhook endpoint. SudoMock stops delivering to it. Cannot be undone."},{"name":"get_2d_mockup","description":"Get one photo mockup\'s full details: the saved print_areas[] somebody drew on it, and the surfaces[], one entry per printable product in the photo. Pass a print_area_id to render_2d_print_area, or a surfaces[].surface_uuid to render_2d_surface. Costs 0 credits."},{"name":"get_2d_mockup_details","description":"Get one photo mockup\'s full details: the saved print_areas[] somebody drew on it, and the surfaces[], one entry per printable product in the photo. Pass a print_area_id to render_2d_print_area, or a surfaces[].surface_uuid to render_2d_surface. Costs 0 credits. Second name of get_2d_mockup: one tool under two names, same arguments, same behavior. Either name works."},{"name":"get_account","description":"Get your account info: the organization the API key belongs to, subscription plan, remaining credits, prepaid balance, usage stats, billing period, and API key details. The plan, credits and balance belong to that organization, so name it when you report them. An account is funded by a subscription allowance or by a prepaid balance, so read both: an account paying as it goes reports 0 credits and pays from its balance. Quote funding_summary rather than reading the credits fields alone."},{"name":"get_job","description":"Get the current status of any async render, video, upload, or photo mockup job by its job_id. Returns status (queued|running|succeeded|failed), completed-result details and credits charged, or an error if failed. To block until done, use wait_for_job instead."},{"name":"get_mockup_details","description":"Get full details of a mockup: smart object UUIDs, layer names, dimensions, positions, blend modes, and thumbnail URLs."},{"name":"get_photo_mockup","description":"Get one photo mockup\'s full details: the saved print_areas[] somebody drew on it, and the surfaces[], one entry per printable product in the photo. Pass a print_area_id to render_2d_print_area, or a surfaces[].surface_uuid to render_2d_surface. Costs 0 credits. Family-name spelling of get_2d_mockup: one tool under two names, same arguments, same behavior. Either name works."},{"name":"get_psd_mockup","description":"Get full details of a mockup: smart object UUIDs, layer names, dimensions, positions, blend modes, and thumbnail URLs. Family-name spelling of get_mockup_details: one tool under two names, same arguments, same behavior. Either name works."},{"name":"list_2d_mockups","description":"List your saved photo mockup templates (no PSD). Returns each mockup\'s mockup_id, name, status, thumbnail, dimensions, and print_areas. Use the mockup_id with get_2d_mockup to read the print-area and surface UUIDs a render needs. Costs 0 credits."}
1,{"name":"list_fonts","description":"List fonts available for text layers: the shared system catalog plus any fonts you have uploaded. Filter by family name (search), by category (serif, sans-serif, display), or by scope (\'all\', \'system\', or \'custom\' for your uploads only); results are paginated (per_page up to 100). Use a font\'s uuid or postscript_name as the font of a text_layers entry when rendering with render_mockup. Costs 0 credits."},{"name":"list_jobs","description":"List your async jobs, including PSD renders, videos, uploads, and photo mockup creation and renders, newest first. Use this when you do not already hold a job_id. Pass the returned next_cursor to fetch the next page."},{"name":"list_mockups","description":"List your uploaded mockup templates with UUIDs, names, and thumbnails. Use returned UUIDs with render_mockup or get_mockup_details."},{"name":"list_photo_mockups","description":"List your saved photo mockup templates (no PSD). Returns each mockup\'s mockup_id, name, status, thumbnail, dimensions, and print_areas. Use the mockup_id with get_2d_mockup to read the print-area and surface UUIDs a render needs. Costs 0 credits. Family-name spelling of list_2d_mockups: one tool under two names, same arguments, same behavior. Either name works."},{"name":"list_psd_mockups","description":"List your uploaded mockup templates with UUIDs, names, and thumbnails. Use returned UUIDs with render_mockup or get_mockup_details. Family-name spelling of list_mockups: one tool under two names, same arguments, same behavior. Either name works."},{"name":"list_webhook_deliveries","description":"List delivery attempts for a webhook endpoint (status, event_type, response code, timestamps). Use this to debug failed deliveries before replaying them."},{"name":"list_webhook_endpoints","description":"List your registered webhook endpoints (id, url, subscribed event_types, enabled state). Secrets are NOT returned here -- only at creation and rotation."},{"name":"remove_background","description":"Remove the background from any image and return a transparent-PNG cutout with clean, production-ready edges. The returned URL is valid for 7 days and can be used as artwork_url during that window. Costs 25 credits per image; credits are refunded automatically if processing fails."},{"name":"render_2d_mockup","description":"Render artwork onto a saved photo mockup. Name exactly one target: a print_area_uuid (a bounded zone somebody drew on the product, such as a chest logo; sized by fit or by width + height) or a surface_uuid (a whole printable product, for an all-over print; sized by coverage or by width + height). Read both from get_2d_mockup. Returns print_files (each with an export_path) and a render_uuid. Costs 5 credits. Second name of render_photo_mockup: the same tool and behavior, with the mockup passed as mockup_uuid. Use the dashboard for visual fine-tuning."},{"name":"render_2d_print_area","description":"Render artwork onto one saved print area -- a bounded zone somebody drew on the product, such as a chest logo. Read the print_area_id values from get_2d_mockup. Returns print_files (each with an export_path) and a render_uuid. Costs 5 credits. Use the dashboard for visual fine-tuning."},{"name":"render_2d_surface","description":"Render artwork across a whole product surface -- an all-over print. Every printable product in the photo is a surface with its own surface_uuid, listed by get_2d_mockup. Returns print_files (each with an export_path) and a render_uuid. Costs 5 credits. Use the dashboard for visual fine-tuning."},{"name":"render_mockup","description":"Render a PSD mockup with artwork, editable text, or both. Supports one or multiple smart objects and preserves the template\'s authored appearance. Returns the rendered image URL. Costs 1 credit. Use list_mockups and get_mockup_details to find target UUIDs."},{"name":"render_photo_mockup","description":"Render artwork onto a saved photo mockup. Name exactly one target: a print_area_uuid (a bounded zone somebody drew on the product, such as a chest logo; sized by fit or by width + height) or a surface_uuid (a whole printable product, for an all-over print; sized by coverage or by width + height). Read both from get_photo_mockup. Returns print_files (each with an export_path) and a render_uuid. Costs 5 credits. Family-name spelling of render_2d_surface and render_2d_print_area, which stay available and behave exactly as they did. Use the dashboard for visual fine-tuning."},{"name":"render_psd_mockup","description":"Render a PSD mockup with artwork, editable text, or both. Supports one or multiple smart objects and preserves the template\'s authored appearance. Returns the rendered image URL. Costs 1 credit. Use list_mockups and get_mockup_details to find target UUIDs. Family-name spelling of render_mockup: one tool under two names, same arguments, same behavior. Either name works."},{"name":"render_video","description":"Create a short AI video from either a mockup with artwork or a public image URL. Supply exactly one input mode. Always async: returns a job_id immediately for get_job or wait_for_job. Credit cost depends on clip length, audio, and the automatically selected quality. Unsupported durations are rejected."},{"name":"replay_failed_webhook_deliveries","description":"Re-send every failed or dead delivery for a
1webhook endpoint in one call, e.g. after fixing your endpoint. Returns status and count: how many deliveries were queued to be sent again. To re-send a single delivery, use replay_webhook_delivery."},{"name":"replay_webhook_delivery","description":"Replay a single webhook delivery while preserving its event identity, e.g. after fixing your endpoint. Get delivery_id from list_webhook_deliveries."},{"name":"rotate_webhook_secret","description":"Rotate the signing secret for a webhook endpoint. A new secret is returned IN FULL exactly once -- update your verifier with it. The old secret stops being valid."},{"name":"send_webhook_test_event","description":"Send a signed webhook.test event to verify endpoint reachability and signature handling. Returns a test job_id; check the result with list_webhook_deliveries. Second name of test_webhook_endpoint: one tool under two names, same arguments, same behavior. Either name works."},{"name":"test_webhook_endpoint","description":"Send a signed webhook.test event to verify endpoint reachability and signature handling. Returns a test job_id; check the result with list_webhook_deliveries."},{"name":"update_2d_print_areas","description":"Replace a photo mockup\'s print areas with up to 8 four-point quads and return the updated geometry. An empty list is accepted only for verified full product surfaces. Costs 0 credits."},{"name":"update_mockup","description":"Rename a mockup template."},{"name":"update_photo_mockup_print_areas","description":"Replace a photo mockup\'s print areas with up to 8 four-point quads and return the updated geometry. An empty list is accepted only for verified full product surfaces. Costs 0 credits. Family-name spelling of update_2d_print_areas: one tool under two names, same arguments, same behavior. Either name works."},{"name":"update_psd_mockup","description":"Rename a mockup template. Family-name spelling of update_mockup: one tool under two names, same arguments, same behavior. Either name works."},{"name":"update_webhook_endpoint","description":"Update a webhook endpoint in place: change its url, description, subscribed event_types, its event_naming pin, or enable/disable it (enabled:false pauses deliveries without losing the signing secret). All fields optional -- only the ones you pass are changed. The secret is NOT rotated or returned here."},{"name":"upload_local_file","description":"Upload a file from this machine and get back a URL for it. Use this when the file exists on disk and a tool needs a URL: pass the returned file_url as psd_file_url to upload_psd, or as artwork_url to any render tool. Set kind to \\"psd\\" for a .psd/.psb template or \\"artwork\\" for a .png/.jpg/.webp/.gif image. Costs 0 credits."},{"name":"upload_psd","description":"Upload a Photoshop PSD/PSB file as a new mockup template. The PSD must have at least one Smart Object layer. Processing takes 5-30 seconds."},{"name":"wait_for_job","description":"Poll any async render, video, upload, or photo mockup job until it succeeds or fails, then return the final result and credits charged. Blocks while polling."}]}');var $="Fetch the SudoMock setup instructions from ".concat("https://sudomock.com/agent-setup/prompt.md"," and help me connect this client. Keep my current task and existing configuration. Verify the connection before continuing my task.");Q.Y.map(function(e){return e.name});var H=a(42572),W=a(92626),J=a(77459),V=a(73690),Z=a(26161),X=a(22574),ee=a(252),et=a(44476),ea=a(13131),es=a(25950),er=a(94236),eo=a(86105),en=a(41674),ei=[{id:"3f465531-a052-58a2-93e1-6529a3e52349",thumb:"https://assets.sudomock.com/workspace/977ee5ba0907/workspace-start/product-thumbnails/977ee5ba090794ffb85b890f47c298d83dae0d48c86263c51f299acba9411887.png"},{id:"5e189731-95ed-5da1-9e56-ad3f8df06ccb",thumb:"https://assets.sudomock.com/workspace/468b1270194f/workspace-start/product-thumbnails/468b1270194ffda5836170a0d9a9bedea26f296723de8d1a15510b07991843b4.png"},{id:"776e88a2-78f5-5a62-99f4-0113d04d3b2c",thumb:"https://assets.sudomock.com/workspace/87451b037783/workspace-start/product-thumbnails/87451b03778342cd0e806cc94379a7ad687b5dd1857f84e229fe02962b4d711b.png"},{id:"d9fb2f11-22d7-50e2-8ccf-cbcf64ce15f0",thumb:"https://assets.sudomock.com/wor
1kspace/e02b18bac036/workspace-start/product-thumbnails/e02b18bac03607135ec962d11af240100899744e8721e7c4a2256fa07c4af55c.png"},{id:"0f4dcbbd-291e-5162-8e58-68e956a29956",thumb:"https://assets.sudomock.com/workspace/fb0d584ff232/workspace-start/product-thumbnails/fb0d584ff232c7ba1cf1d1da91ddaa30fca5d820da1dbc06d429f9b845fc725b.png"},{id:"3256aabb-1d90-5cd5-b565-e6ce0458e7ad",thumb:"https://assets.sudomock.com/workspace/1761efd15d15/workspace-start/product-thumbnails/1761efd15d154d6201e5c08cd7201d10c83902414b4c61066bba3ac6ccf06a8c.png"},{id:"7fad9f82-16b1-570a-920c-5d328210149a",thumb:"https://assets.sudomock.com/workspace/9501da0da96d/workspace-start/product-thumbnails/9501da0da96d617d828d76f4e636e3319891618a2a773daf797e0d4e4f4c8570.png"},{id:"95dc4571-c9fb-5c3a-8a4d-5010038c01c9",thumb:"https://assets.sudomock.com/workspace/04ac1557b7fa/workspace-start/product-thumbnails/04ac1557b7faa8d9ce85c90682075bb8724b8d5a44a1522ff6f8c0005a2f6fce.png"},{id:"f3c4aa14-ede6-5ad9-ba43-662c86a472be",thumb:"https://assets.sudomock.com/workspace/6860f1c10af7/workspace-start/product-thumbnails/6860f1c10af70289353344811ad637b11b623a730e99be1667622b116397e94f.png"},{id:"629b91a8-d40a-549b-94bd-9dd571bf1d27",thumb:"https://assets.sudomock.com/workspace/695be265ea17/workspace-start/product-thumbnails/695be265ea17880bf946b8c4311d41c3fd3d203da4d4d51016f14350f1d32704.png"},{id:"4d255cf3-fa6d-5528-90b9-fa5d4b159eff",thumb:"https://assets.sudomock.com/workspace/78dc7247d257/workspace-start/product-thumbnails/78dc7247d2576818e07bb01d584b7a1a4d200f460770cef9f9847bc761d57ba9.png"},{id:"277ff52d-de70-5f61-a4d5-1fcfc6836bb5",thumb:"https://assets.sudomock.com/workspace/1b1b21a199e6/workspace-start/product-thumbnails/1b1b21a199e6763068962a66c7bd96a1a24f631644d7833ee318720e11047649.png"},{id:"89f4b67e-63c8-569a-9237-315fcb830d38",thumb:"https://assets.sudomock.com/workspace/26454ae533ff/workspace-start/product-thumbnails/26454ae533ff0d62a705bfc2284dba4481bb82cc4918d109f85bacc5c3d1d27a.png"},{id:"9ac1149f-9706-5171-9b11-307c287907d1",thumb:"https://assets.sudomock.com/workspace/39551ce23376/workspace-start/product-thumbnails/39551ce23376feb28b2409495dad7106f327023b9aedbe626371f768b6830961.png"},{id:"867d7103-a417-522c-bbee-551ab7f91973",thumb:"https://assets.sudomock.com/workspace/90c93e5a30a1/workspace-start/product-thumbnails/90c93e5a30a1e73cfe539dacd6136ac4310d11d23a0d97bd47fae6da8c9fc02a.png"}],el=[{id:"shirt",title:"T-shirt in natural light",image:"https://assets.sudomock.com/workspace/08d5a404f6fd/workspace-start/01-tshirt-lifestyle.png",prompt:"A blank t-shirt worn outdoors in soft natural light. Show the front clearly, with an uninterrupted print surface, subtle folds and no artwork or distracting accessories."},{id:"mug",title:"Mug by the window",image:"https://assets.sudomock.com/workspace/39dcf93be307/workspace-start/02-mug-lifestyle.png",prompt:"A plain ceramic mug on a wooden table beside a softly lit window. Show a clean, unobstructed printable face and the handle, with gentle reflections and no artwork."},{id:"poster",title:"Framed poster at home",image:"https://assets.sudomock.com/workspace/bea7ceecd613/workspace-start/03-framed-poster-lifestyle.png",prompt:"An empty poster frame on a warm, minimal interior wall. Face the print area toward the camera, keep the whole opening visible, and keep shadows outside the printable surface."}],ec=["Botanical line art","Vintage engraving","Retro typography","Minimal geometry","Watercolor florals","Bold flat illustration","Woodcut","Linocut","Hand-drawn doodles","Coastal","Folk art","Abstract collage","Monoline","Celestial","Playful lettering","Modern botanical"],ed={"Botanical line art":"https://assets.sudomock.com/workspace/b3ba0c24ae4e/workspace-start/styles/botanical-line-art.png","Vintage engraving":"https://assets.sudomock.com/workspace/3ac1bfac0047/workspace-start/styles/vintage-engraving.png","Retro typography":"https://assets.sudomock.com/workspace/c13071c06163/workspace-start/styles/retro-typography.png","Minimal geometry":"https://assets.sudomock.com/workspace/84e414902860/workspace-start/styles/minimal-geometry.png","Watercolor florals":"https://assets.sudomock.com/wor
1kspace/8f39d47ccfb7/workspace-start/styles/watercolor-florals.png","Bold flat illustration":"https://assets.sudomock.com/workspace/437e2d9e27b5/workspace-start/styles/bold-flat-illustration.png",Woodcut:"https://assets.sudomock.com/workspace/99d869203f93/workspace-start/styles/woodcut.png",Linocut:"https://assets.sudomock.com/workspace/f4e79e89c799/workspace-start/styles/linocut.png","Hand-drawn doodles":"https://assets.sudomock.com/workspace/f011f8f0a65d/workspace-start/styles/hand-drawn-doodles.png",Coastal:"https://assets.sudomock.com/workspace/9263d2f6e376/workspace-start/styles/coastal.png","Folk art":"https://assets.sudomock.com/workspace/1e2239bb7721/workspace-start/styles/folk-art.png","Abstract collage":"https://assets.sudomock.com/workspace/cf59566c8eac/workspace-start/styles/abstract-collage.png",Monoline:"https://assets.sudomock.com/workspace/182176b7a293/workspace-start/styles/monoline.png",Celestial:"https://assets.sudomock.com/workspace/21634c2d7c21/workspace-start/styles/celestial.png","Playful lettering":"https://assets.sudomock.com/workspace/d3fc710aa936/workspace-start/styles/playful-lettering.png","Modern botanical":"https://assets.sudomock.com/workspace/4dc243d4efe4/workspace-start/styles/modern-botanical.png"},eu={shirt:[["Botanical emblem","Create a centered botanical emblem for a t-shirt, with clean edges and a transparent background. No shirt photograph."],["Retro badge","Create a simple retro outdoor badge for apparel with a small number of strong colors. Leave room around the artwork."],["Minimal graphic","Create a minimal geometric chest graphic. Keep all elements separate from a product photograph."]],mug:[["Wrap pattern","Create a horizontal botanical pattern for a mug wrap. Keep the two ends visually compatible and use the selected template dimensions."],["Two-sided motif","Create a small illustration that can be placed on either side of a mug, with generous clear space."],["Personalized space","Create a simple floral frame with a blank area for a name added later as editable text."]],poster:[["Botanical print","Create a vertical botanical wall-art composition with balanced negative space, without a photographed frame."],["Abstract landscape","Create a quiet abstract landscape as flat printable artwork. Match the selected poster template ratio."],["Graphic study","Create a bold geometric composition for a portrait poster with a clear focal point."]]},ep=[{id:"claude",label:"Claude Code",logo:"https://assets.sudomock.com/workspace/5119ef950a0d/workspace-start/claude.svg"},{id:"codex",label:"Codex",logo:"https://assets.sudomock.com/workspace/b94ea61d860f/workspace-start/chatgpt.svg"},{id:"cursor",label:"Cursor",logo:"https://assets.sudomock.com/workspace/68c88e317a03/workspace-start/cursor.svg"},{id:"vscode",label:"VS Code",logo:"https://assets.sudomock.com/workspace/74ad401c6487/workspace-start/vscode.svg"},{id:"windsurf",label:"Windsurf",logo:"https://assets.sudomock.com/workspace/de4c144d9697/workspace-start/windsurf.svg"}],eh=["All","T-shirts","Canvas","Posters","Hoodies","Sweatshirts","Mugs","Tote bags","Other"],em=[{id:"clean-studio",label:"Clean studio",description:"Neutral backdrop, soft studio light.",prompt:"Use a clean seamless neutral studio backdrop, soft diffuse light and natural contact shadows. Present the selected product in its natural form with the whole print surface facing the camera. If the user explicitly asks for a person wearing or holding the product, follow that request. Otherwise show the product without a person. Keep props separate from the product.",image:"https://assets.sudomock.com/workspace/ee949dc77645/workspace-start/scene-styles/clean-studio-ee949dc776.png"},{id:"soft-daylight",label:"Soft daylight",description:"Soft window light, natural colors.",prompt:"Use a simple pale interior beside a window, soft diffused daylight and neutral white balance. If the user explicitly asks for a person wearing or holding the product, follow that request. Otherwise show the product without a person, naturally placed on a suitable visible support, such as a hanger for clothing or a tabletop for rigid objects, with a believable contact shadow. Keep the full print surface unobstructed and facing the camera. Do not let the product float.",image:"https://assets.sudomock.com/wor
1kspace/c8bcbac4dfaa/workspace-start/scene-styles/soft-daylight-c8bcbac4df.png"},{id:"warm-interior",label:"Warm interior",description:"Warm neutrals, a calm home setting.",prompt:"Use a calm home interior with warm neutral linen and light wood in the background. Use soft warm light while preserving the actual product color. If the user explicitly asks for a person wearing or holding the product, follow that request. Otherwise show the product without a person, naturally placed on an appropriate visible support with realistic contact shadows. Furniture and props stay outside the full print surface. No floating objects.",image:"https://assets.sudomock.com/workspace/c4163d2361bb/workspace-start/scene-styles/warm-interior-c4163d2361.png"},{id:"outdoors",label:"Outdoors",description:"Open shade, a quiet outdoor setting.",prompt:"Use a quiet outdoor setting with natural greenery or neutral stone, bright open shade and believable natural shadows. If the user explicitly asks for a person wearing or holding the product, follow that request. Otherwise show the product without a person, naturally supported on a surface or a visible hanger appropriate to its form. Keep the entire print surface visible; no dappled light, hard shadows or foreground props over it. Do not let the product float.",image:"https://assets.sudomock.com/workspace/287d7908afc0/workspace-start/scene-styles/outdoors-287d7908af.png"},{id:"flat-lay",label:"Flat lay",description:"From above, on a simple surface.",prompt:"Create a realistic overhead flat-lay composition with a plain neutral surface and soft diffuse light. Lay the product naturally without changing its physical shape. Position its printable face toward the camera, keep all print boundaries visible and keep props outside it. No person, hands or hanger.",image:"https://assets.sudomock.com/workspace/39102eb16c2c/workspace-start/scene-styles/flat-lay-39102eb16c.png"},{id:"on-model",label:"On model",description:"Worn or held, with the design area clear.",prompt:"Show one adult naturally wearing or holding the selected product as appropriate to that product. Use a quiet neutral setting and soft even light. Face the print surface toward the camera and keep it completely visible. Hands, hair, straps and drawcords stay outside the usable print area. Preserve the actual product shape, proportions and features.",image:"https://assets.sudomock.com/workspace/c99eb38891cb/workspace-start/scene-styles/on-model-c99eb38891.png"}],ef=a(61856),eg=a(59804),eb=a(65490),ew=a(86005),ek=a(31710),ev=a(70493),ey=a(37137);function e_(e,t,a){var s,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"1:1",o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],n=null==(s=o?e.minimum_credit_options:e.credit_options)?void 0:s.find(function(e){var s;return e.resolution===t&&(null!=(s=e.quality)?s:"")===a&&(!e.aspect_ratio||e.aspect_ratio===r)});return n&&Number.isInteger(n.credits)&&n.credits>=0?n.credits:null}function ex(e){var t=e.credits,a=e.minimum,s=e.id,r=null!=t?t:a;return null==r?null:(0,d.jsxs)("span",{id:s,className:"cw-picker-price",children:[null===t&&"From ",(0,d.jsx)("strong",{children:r.toLocaleString("en-US")})," credits"]})}var ej={"nano-banana-2":"Google","nano-banana-pro":"Google","gpt-image-2.5-sunburst":"OpenAI","gpt-image-2.5-flare":"OpenAI","grok-imagine-image-2":"xAI","reve-2.1":"Reve","meta-muse-image":"Meta","seedream-5-pro":"ByteDance","uni-1":"Luma","uni-1-max":"Luma","ideogram-4":"Ideogram","recraft-4.1":"Recraft","flux-2-max":"Black Forest Labs","flux-2-pro":"Black Forest Labs","krea-2-large":"Krea","krea-2-medium":"Krea","wan-2.7-pro":"Wan"},eC=["nano-banana-2","gpt-image-2.5-sunburst","gpt-image-2.5-flare","grok-imagine-image-2","reve-2.1","nano-banana-pro","flux-2-max","flux-2-pro","seedream-5-pro","ideogram-4","recraft-4.1","meta-muse-image","uni-1-max","uni-1","krea-2-large","krea-2-medium","wan-2.7-pro"],eN={Google:"https://assets.sudomock.com/workspace/d1ce9c2af0b1/images/logos/model-providers/google.png",OpenAI:"https://assets.sudomock.com/workspace/b94ea61d860f/workspace-start/chatgpt.svg",xAI:"https://assets.sudomock.com/wor
1kspace/768cbbf7a752/images/logos/model-providers/grok.png",Reve:"https://assets.sudomock.com/workspace/08564656f26c/images/logos/model-providers/reve-icon.png",Meta:"https://assets.sudomock.com/workspace/50e7e31d30ee/images/logos/model-providers/meta.png",ByteDance:"https://assets.sudomock.com/workspace/edfcd80db6ad/images/logos/model-providers/bytedance.png",Luma:"https://assets.sudomock.com/workspace/794422c8d166/images/logos/model-providers/luma-white.svg",Ideogram:"https://assets.sudomock.com/workspace/6d3f155a29f4/images/logos/model-providers/ideogram.svg",Recraft:"https://assets.sudomock.com/workspace/ab7b0086a4a0/images/logos/model-providers/recraft.png","Black Forest Labs":"https://assets.sudomock.com/workspace/ac69a70f6dfd/images/logos/model-providers/bfl-icon.png",Krea:"https://assets.sudomock.com/workspace/904bb1e74ed7/images/logos/model-providers/krea.png",Wan:"https://assets.sudomock.com/workspace/9dda78d28bed/images/logos/model-providers/wan.png"};function eq(e){var t=eN[ej[e.model.id]];return(0,d.jsx)("span",{className:"cw-model-logo","aria-hidden":"true",children:t?(0,d.jsx)(h.default,{src:t,alt:"",width:24,height:24,sizes:"24px"}):(0,d.jsx)(eb.A,{size:21})})}function eS(e){var t=e.label,a=e.className,s=e.children;return(0,d.jsx)(E.ZL,{children:(0,d.jsxs)(E.UC,{className:"cw-picker-panel ".concat(void 0===a?"":a),sideOffset:8,align:"start",collisionPadding:16,"aria-label":t,children:[(0,d.jsxs)("div",{className:"cw-picker-heading",children:[(0,d.jsx)("h3",{children:t}),(0,d.jsx)(E.bm,{className:"cw-picker-close","aria-label":"Close ".concat(t.toLowerCase()),children:(0,d.jsx)(C.A,{size:16})})]}),s]})})}function eA(e){var t=e.models,a=e.model,s=e.resolution,r=e.quality,o=e.aspectRatio,n=void 0===o?"1:1":o,c=e.disabled,p=e.onChange,h=(0,i._)((0,u.useState)(!1),2),m=h[0],f=h[1],g=(0,u.useId)(),b=(0,l._)(t).sort(function(e,t){var a=eC.indexOf(e.id),s=eC.indexOf(t.id);return(a<0?eC.length:a)-(s<0?eC.length:s)});return(0,d.jsxs)(E.bL,{open:m&&!c,onOpenChange:f,children:[(0,d.jsx)(E.l9,{asChild:!0,children:(0,d.jsxs)("button",{type:"button",className:"cw-picker-trigger cw-model-trigger",disabled:c,"aria-label":"Image model","aria-describedby":"".concat(g,"-model ").concat(g,"-price"),children:[(0,d.jsx)(eq,{model:a}),(0,d.jsx)("span",{id:"".concat(g,"-model"),children:a.label}),(0,d.jsx)(ex,{id:"".concat(g,"-price"),credits:e_(a,s,r,n),minimum:e_(a,s,r,n,!0)}),(0,d.jsx)(_.A,{size:14})]})}),(0,d.jsxs)(eS,{label:"Choose a model",className:"cw-model-panel",children:[(0,d.jsx)("div",{role:"group","aria-label":"Image models",children:b.map(function(e){var t,o,i,l,c=e.resolutions.includes(s)?s:null!=(i=e.resolutions[0])?i:"",u=(null==(t=e.qualities)?void 0:t.includes(r))?r:null!=(l=null==(o=e.qualities)?void 0:o[0])?l:"",h=e.aspect_ratios.includes(n)?n:e.aspect_ratios[0],m=[ej[e.id],"native"===c?"":c,u].filter(Boolean).join(" \xb7 ");return(0,d.jsxs)("button",{type:"button",className:"cw-model-row","aria-pressed":e.id===a.id,onClick:function(){p(e.id),f(!1)},children:[(0,d.jsx)(eq,{model:e}),(0,d.jsxs)("span",{className:"cw-model-copy",children:[(0,d.jsx)("strong",{children:e.label}),m&&(0,d.jsx)("small",{children:m})]}),(0,d.jsx)(ex,{credits:e_(e,c,u,h),minimum:e_(e,c,u,h,!0)}),(0,d.jsx)(x.A,{className:"cw-picker-check",size:16})]},e.id)})}),(0,d.jsx)("p",{className:"cw-picker-note",children:"One image. Final credits are confirmed before generation."}),t.some(function(e){var t;return null==(t=e.minimum_credit_options)?void 0:t.length})&&(0,d.jsx)("p",{className:"cw-picker-note",children:"From prices cover image output. Prompt usage is additional."})]})]})}function eP(e){var t=(0,i._)(e.split(":").map(Number),2),a=t[0],s=t[1];return a>0&&s>0&&Number.isFinite(a/s)?[a,s]:[1,1]}function eI(e){var t=e.value,a=(0,i._)(eP(t),2),s=a[0],r=a[1];return(0,d.jsx)("span",{className:"cw-ratio-shape","aria-hidden":"true",style:{width:"".concat(100*Math.min(1,s/r),"%"),height:"".concat(100*Math.min(1,r/s),"%")}})}function eU(e){var t=e.values,a=e.value,s=e.disabled,r=e.onChange,o=(0,i._)((0,u.useState)(!1),2),n=o[0],l=o[1],c=(0,i._)((0,u.useState)(null),2),p=c[0],h=c[1],m=(0,i._)((0,u.useState)(Math.max(0,t.indexOf(a))),2),f=m[0],g=m[1],b=(0,u.useId)(),w=n&&p&&t.includes(p)?p:a,k=(0,i._)(eP(w),2),v=k[0],y=k[1];return(0,d.jsxs)(E.bL,{open:n&&!s,onOpenChange:function(e){l(e),h(null),g(Math.max(0,t.indexOf(a)))},children:[(0,d.jsx)(E.l9,{asChild:!0,children:(0,d.jsxs)("button",{type:"button",className:"cw-picker-trigger",disabled:s,"aria-label":"Image aspect ratio","aria-describedby":b,children:[(0,d.jsx)("span",{className:"cw-ratio-mini",children:(0,d.jsx)(eI,{value:a})}),(0,d.jsx)("span",{id:b,children:a}),(0,d.jsx)(_.A,{size:14})]})}),(0,d.jsx)(eS,{label:"Aspect ratio",className:"cw-ratio-panel",children:(0,d.jsxs)("div",{className:"cw-ratio-layout",children:[(0,d.jsxs)("div",{className:"cw-ratio-preview",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)(eI,{value:w}),(0,d.jsx)("strong",{children:w})]}),(0,d.jsx)("span",{children:v===y?"Square":v>y?"Landscape":"Portrait"}),(0,d.jsxs)("small",{children:["Selected: ",a]})]}),(0,d.jsx)("div",{className:"cw-ratio-grid",role:"group","aria-label":"Image aspect ratios",onPointerLeave:function(){return h(null)},onBlur:function(e){e.currentTarget.contains(e.relatedTarget)||h(null)},children:t.map(function(e,s){return(0,d.jsxs)("button",{type:"button","aria-pressed":e===a,tabIndex:s===f?0:-1,onPointerEnter:function(t){"touch"!==t.pointerType&&h(e)},onFocus:function(){h(e),g(s)},onKeyDown:function(e){var a,r,o={ArrowRight:1,ArrowLeft:-1,ArrowDown:2,ArrowUp:-2}[e.key];if(void 0!==o||"Home"===e.key||"End"===e.key){e.preventDefault();var n="Home"===e.key?0:"End"===e.key?t.length-1:(s+(null!=o?o:0)+t.length)%t.length;null==(r=e.currentTarget.parentElement)||null==(a=r.querySelectorAll("button")[n])||a.focus()}},onClick:function(){r(e),h(null),l(!1)},children:[(0,d.jsx)("span",{className:"cw-ratio-tile",children:(0,d.jsx)(eI,{value:e})}),(0,d.jsx)("span",{children:e}),e===a&&(0,d.jsx)(x.A,{size:12})]},e)})})]})})]})}function eL(e){var t=e.disabled,a=e.onOpen,s=(0,i._)((0,u.useState)(!1),2),r=s[0],o=s[1],n=(0,i._)((0,u.useState)(!1),2),l=n[0],c=n[1],p=(0,u.useRef)(null);(0,u.useEffect)(function(){if("function"==typeof window.matchMedia){var e,t=window.matchMedia("(max-height: 600px)"),a=function(){return c(t.matches)};return a(),null==(e=t.addEventListener)||e.call(t,"change",a),function(){var e;return null==(e=t.removeEventListener)?void 0:e.call(t,"change",a)}}},[]);var m=function(e){var t;o(!1),a(e,null!=(t=p.current)?t:void 0)},f=(0,d.jsxs)("button",{ref:p,type:"button",disabled:t,className:"cw-file-action","aria-label":"PSD templates",children:[(0,d.jsx)(h.default,{src:"/samples/photoshop-logo.png",alt:"",width:22,height:22}),"PSD templates",(0,d.jsx)(_.A,{size:13})]}),g=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"cw-psd-picker-list",children:[(0,d.jsx)("p",{className:"cw-picker-note",children:"Start from an example"}),eg.t.map(function(e){return(0,d.jsxs)("div",{className:"cw-psd-picker-row",children:[(0,d.jsx)(h.default,{src:e.image,alt:"",width:72,height:72}),(0,d.jsxs)("div",{children:[(0,d.jsx)("strong",{children:e.name}),(0,d.jsxs)("small",{children:[(e.bytes/1024/1024).toFixed(1)," MB"]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("button",{type:"button",onClick:function(){return m(e.id)},children:"Open"}),(0,d.jsx)("a",{href:e.file,download:!0,children:"Download"})]})]})]},e.id)})]}),(0,d.jsx)("div",{className:"cw-psd-picker-footer",children:(0,d.jsxs)(O.$,{className:"cw-psd-own",onClick:function(){return m(null)},children:[(0,d.jsx)(ew.A,{size:16}),"Upload your PSD"]})})]});return l?(0,d.jsxs)(Y.lG,{open:r&&!t,onOpenChange:o,children:[(0,d.jsx)(Y.zM,{asChild:!0,children:f}),(0,d.jsxs)(Y.Cf,{className:"cw-dialog cw-psd-picker-dialog",hideClose:!0,children:[(0,d.jsxs)("div",{className:"cw-picker-heading",children:[(0,d.jsx)(Y.L3,{children:"PSD templates"}),(0,d.jsx)(Y.HM,{className:"cw-picker-close","aria-label":"Close psd templates",children:(0,d.jsx)(C.A,{size:16})})]}),(0,d.jsx)(Y.rr,{className:"sr-only",children:"Choose an example or upload your own Photoshop file."}),g]})]}):(0,d.jsxs)(E.bL,{open:r&&!t,onOpenChange:o,children:[(0,d.jsx)(E.l9,{asChild:!0,children:f}),(0,d.jsx)(eS,{label:"PSD templates",className:"cw-psd-picker",children:g})]})}function eR(e){var t=e.kind,a=e.values,s=e.value,r=e.disabled,o=e.model,n=e.resolution,l=e.quality,c=e.aspectRatio,p=void 0===c?"1:1":c,h=e.onChange,m=(0,i._)((0,u.useState)(!1),2),f=m[0],g=m[1],b=(0,u.useId)(),w="size"===t?"Image size":"Image quality",k=function(e){return"native"===e?"Default size":"quality"===t?e.slice(0,1).toUpperCase()+e.slice(1):e};return(0,d.jsxs)(E.bL,{open:f&&!r,onOpenChange:g,children:[(0,d.jsx)(E.l9,{asChild:!0,children:(0,d.jsxs)("button",{type:"button",className:"cw-picker-trigger",disabled:r,"aria-label":w,"aria-describedby":b,children:["size"===t?(0,d.jsx)(ek.A,{size:16}):(0,d.jsx)(ev.A,{size:16}),(0,d.jsx)("span",{id:b,children:k(s)}),(0,d.jsx)(_.A,{size:14})]})}),(0,d.jsx)(eS,{label:w,className:"cw-size-panel",children:(0,d.jsx)("div",{role:"group","aria-label":w,children:a.map(function(e){return(0,d.jsxs)("button",{type:"button",className:"cw-size-row","aria-pressed":e===s,onClick:function(){h(e),g(!1)},children:[(0,d.jsxs)("span",{children:[(0,d.jsx)("strong",{children:k(e)}),"size"===t&&(0,d.jsx)("small",{children:"native"===e?"Uses the modelâs output size":"".concat(e," output")})]}),(0,d.jsx)(ex,{credits:e_(o,"size"===t?e:n,"quality"===t?e:l,p),minimum:e_(o,"size"===t?e:n,"quality"===t?e:l,p,!0)}),(0,d.jsx)(x.A,{className:"cw-picker-check",size:16})]},e)})})})]})}function ez(e){var t=e.styles,a=e.previews,s=e.value,r=e.disabled,o=e.onChange,n=e.scene,l=void 0!==n&&n,c=e.descriptions,p=void 0===c?{}:c,m=(0,i._)((0,u.useState)(!1),2),f=m[0],g=m[1],b=(0,u.useRef)(null),w=(0,u.useId)(),k=t.filter(function(e){return a[e]}),v=t.filter(function(e){return!a[e]}),y=function(e){o(e),g(!1)};return(0,d.jsxs)("div",{className:"cw-style-control",children:[(0,d.jsxs)(Y.lG,{open:f&&!r,onOpenChange:g,children:[(0,d.jsx)(Y.zM,{asChild:!0,children:(0,d.jsxs)("button",{ref:b,type:"button",className:"cw-picker-trigger cw-style-trigger",disabled:r,"aria-label":l?"Photo style":"Artwork style","aria-describedby":w,children:[s&&a[s]?(0,d.jsx)(h.default,{src:a[s],alt:"",width:24,height:24}):(0,d.jsx)(ey.A,{size:17}),(0,d.jsx)("span",{id:w,children:s||"Style"}),(0,d.jsx)(_.A,{size:14})]})}),(0,d.jsxs)(Y.Cf,{className:"cw-dialog cw-style-dialog".concat(l?" cw-scene-style-dialog":""),children:[(0,d.jsx)(Y.L3,{children:l?"Choose a photo style":"Choose an artwork style"}),(0,d.jsx)(Y.rr,{children:l?"Choose the lighting, setting and presentation for your product.":"Choose a look for the design you will print on your product."}),(0,d.jsxs)("button",{type:"button",className:"cw-style-none","aria-pressed":!s,onClick:function(){return y("")},children:[(0,d.jsx)(ey.A,{size:20}),(0,d.jsxs)("span",{children:[(0,d.jsx)("strong",{children:"No added style"}),(0,d.jsx)("small",{children:"Follow your prompt as written."})]}),!s&&(0,d.jsx)(x.A,{size:17})]}),!!k.length&&(0,d.jsx)("div",{className:"cw-style-grid",role:"group","aria-label":l?"Photo style previews":"Artwork style previews",children:k.map(function(e){return(0,d.jsxs)("button",{type:"button","aria-pressed":e===s,onClick:function(){return y(e)},children:[(0,d.jsx)(h.default,{src:a[e],alt:"".concat(e," ").concat(l?"photo":"artwork"," example"),width:320,height:320,sizes:"(max-width: 640px) 42vw, 240px"}),(0,d.jsxs)("span",{children:[e,e===s&&(0,d.jsx)(x.A,{size:15})]}),p[e]&&(0,d.jsx)("small",{children:p[e]})]},e)})}),!!v.length&&(0,d.jsx)("div",{className:"cw-style-names",role:"group","aria-label":"More artwork styles",children:v.map(function(e){return(0,d.jsxs)("button",{type:"button","aria-pressed":e===s,onClick:function(){return y(e)},children:[e,e===s&&(0,d.jsx)(x.A,{size:15})]},e)})})]})]}),l&&s&&(0,d.jsx)("button",{type:"button",className:"cw-style-clear",disabled:r,"aria-label":"Clear photo style",onClick:function(){var e;y(""),null==(e=b.current)||e.focus()},children:(0,d.jsx)(C.A,{size:14})})]})}var eM=a(67909),eT=a(22005);a(59667);var eE=a(39607),eO=(0,eM.default)(function(){return Promise.all([a.e(8720),a.e(2052),a.e(7340),a.e(2239),a.e(5940)]).then(a.bind(a,62239)).then(function(e){return e.DetectionWaitScreen})},{loadableGenerated:{webpack:function(){return[62239]}},ssr:!1}),eD=(0,eM.default)(function(){return Promise.all([a.e(8720),a.e(1608),a.e(7599),a.e(2107),a.e(5776),a.e(4395)]).then(a.bind(a,34395)).then(function(e){return e.UnifiedMockupVault})},{loadableGenerated:{webpack:function(){return[34395]}},ssr:!1}),eF=(0,eM.default)(function(){return Promise.all([a.e(8720),a.e(5993),a.e(5741),a.e(6487),a.e(3020)]).then(a.bind(a,36487)).then(function(e){return e.CreatePsdUpload})},{loadableGenerated:{webpack:function(){return[36487]}},ssr:!1});function eK(e){var t=e.scene,a=e.disabled,s=e.eager,r=e.onSelect,o=(0,i._)((0,u.useState)("loading"),2),n=o[0],l=o[1],c=(0,i._)((0,u.useState)(0),2),p=c[0],m=c[1];return(0,d.jsxs)("button",{type:"button","aria-label":"error"===n?"Retry photo: ".concat(t.title):t.title,disabled:a||"loading"===n,onClick:function(){"error"===n?(l("loading"),m(function(e){return e+1})):r(t)},children:[(0,d.jsxs)("div",{className:"cw-scene-media",style:{aspectRatio:"".concat(t.width," / ").concat(t.height)},children:[(0,d.jsx)(h.default,{src:"".concat(t.image).concat(p?"?retry=".concat(p):""),alt:"",fill:!0,priority:s,loading:s?void 0:"lazy",sizes:"(max-width: 767px) 45vw, (max-width: 1023px) 35vw, 28vw",style:{opacity:+("loaded"===n)},onLoad:function(){return l("loaded")},onError:function(){return l("error")}},p),"loading"===n&&(0,d.jsx)(B.E,{className:"absolute inset-0 rounded-none motion-reduce:animate-none","aria-hidden":"true"}),"error"===n&&(0,d.jsx)("div",{className:"cw-scene-retry",children:(0,d.jsx)(v.A,{size:22,"aria-hidden":"true"})})]}),(0,d.jsxs)("span",{style:{visibility:"loaded"===n?"visible":"hidden"},children:[t.title,(0,d.jsx)(y.A,{size:16})]})]})}function eB(e){var t=e.disabled,a=e.onSelect,r=(0,i._)((0,u.useState)(24),2),p=r[0],h=r[1],m=(0,i._)((0,u.useState)(""),2),f=m[0],g=m[1],w=(0,i._)((0,u.useState)("All"),2),k=w[0],v=w[1],y=(0,i._)((0,u.useState)("All formats"),2),N=y[0],q=y[1],S=(0,i._)((0,u.useState)(!1),2),A=S[0],P=S[1],I=(0,i._)((0,u.useState)(3),2),U=I[0],L=I[1],R=(0,i._)((0,u.useState)(function(){return el.map(function(e){return(0,n._)((0,o._)({},e),{width:1254,height:1254})})}),2),z=R[0],M=R[1],T=(0,u.useRef)(null),D=(0,b.I)({queryKey:["scene-gallery"],staleTime:1/0,queryFn:function(){return(0,s._)(function(){var e,t;return(0,c.YH)(this,function(a){switch(a.label){case 0:return[4,fetch("/workspace-start/scene-gallery.json")];case 1:if(!(e=a.sent()).ok)throw Error("Could not load more photos");return[4,e.json()];case 2:if(!Array.isArray(t=a.sent()))throw Error("Invalid photo gallery");return[2,t.filter(function(e){return"string"==typeof e.id&&"string"==typeof e.title&&"string"==typeof e.image&&(e.image.startsWith("/workspace-start/catalogue/")||e.image.startsWith("/workspace-start/catalogue-bulk/")||/^https:\/\/assets\.sudomock\.com\/workspace\/[a-f0-9]{12}\/workspace-start\/catalogue(?:-bulk)?\/[a-zA-Z0-9_-]+\.(?:png|webp|jpe?g)$/.test(e.image))&&e.width>0&&e.height>0})]}})})()}}).data;(0,u.useEffect)(function(){if(void 0!==D){for(var e=(0,l._)(el.map(function(e){return(0,n._)((0,o._)({},e),{width:1254,height:1254})})).concat((0,l._)(null!=D?D:[])),t=e.length-1;t>0;t--){var a,s=Math.floor(Math.random()*(t+1));a=[e[s],e[t]],e[t]=a[0],e[s]=a[1]}M(e)}},[D]),(0,u.useEffect)(function(){if("function"==typeof window.matchMedia){var e,t=window.matchMedia("(min-width: 1024px)"),a=function(){return L(t.matches?3:2)};return a(),null==(e=t.addEventListener)||e.call(t,"change",a),function(){var e;return null==(e=t.removeEventListener)?void 0:e.call(t,"change",a)}}},[]);var F=(0,u.useMemo)(function(){var e=f.trim().toLowerCase().split(/\s+/).filter(
1Boolean);return z.filter(function(t){var a;return("All"===k||(a=t.title,(/\b(cards?|blanket|towel|polo|jacket|vest|leggings?|pants|sweatpants?|joggers?|shorts|dress|socks?|pillows?|pillowcases?|cushions?|sneakers?)\b/i.test(a)?"Other":/\b(mugs?)\b/i.test(a)?"Mugs":/\btotes?\b/i.test(a)?"Tote bags":/\b(tees?|t[\s-]?shirts?|tanks?)\b/i.test(a)?"T-shirts":/\b(hoodies?|hooded)\b/i.test(a)?"Hoodies":/\b(sweatshirts?|crewnecks?|pullovers?|fleece)\b/i.test(a)?"Sweatshirts":/\b(caps?|hats?|beanies?|bags?|backpacks?|aprons?|shoes?)\b/i.test(a)?"Other":/\bcanvas\b/i.test(a.replace(/Bella[+\s]+Canvas/gi,""))?"Canvas":/\b(posters?|prints?)\b/i.test(a)?"Posters":"Other")===k))&&("All formats"===N||(t.width===t.height?"Square":t.width<t.height?"Portrait":"Landscape")===N)&&e.every(function(e){var a;return t.title.toLowerCase().includes(e)||/^[a-f\d-]{8,}$/i.test(e)&&(t.id.toLowerCase().includes(e)||(null==(a=t.product_id)?void 0:a.toLowerCase().includes(e)))})})},[z,f,k,N]);(0,u.useEffect)(function(){return h(24)},[f,k,N]),(0,u.useEffect)(function(){if(T.current&&!(p>=F.length)&&"undefined"!=typeof IntersectionObserver){var e=new IntersectionObserver(function(e){e.some(function(e){return e.isIntersecting})&&h(function(e){return Math.min(F.length,e+24)})},{rootMargin:"500px"});return e.observe(T.current),function(){return e.disconnect()}}},[p,F.length]);var K=(0,u.useMemo)(function(){var e=Array.from({length:U},function(){return[]}),t=Array(U).fill(0),a=!0,s=!1,r=void 0;try{for(var o,n=F.slice(0,p)[Symbol.iterator]();!(a=(o=n.next()).done);a=!0){var i,c=o.value,d=t.indexOf((i=Math).min.apply(i,(0,l._)(t)));e[d].push(c),t[d]+=c.height/c.width+.18}}catch(e){s=!0,r=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw r}}return e},[F,p,U]);return(0,d.jsxs)("section",{className:"cw-scenes",children:[(0,d.jsx)("h2",{children:"Or explore the gallery"}),(0,d.jsxs)("div",{className:"cw-gallery-toolbar",children:[(0,d.jsx)("div",{className:"cw-gallery-categories",role:"group","aria-label":"Product category",children:eh.map(function(e){return(0,d.jsx)(O.$,{variant:"ghost",size:"sm","aria-pressed":k===e,onClick:function(){return v(e)},children:e},e)})}),(0,d.jsxs)("div",{className:"cw-gallery-search-tools",children:[(0,d.jsxs)(E.bL,{open:A,onOpenChange:P,children:[(0,d.jsx)(E.l9,{asChild:!0,children:(0,d.jsxs)(O.$,{variant:"ghost",size:"sm",className:"cw-gallery-format","aria-label":"Photo format",children:[N,(0,d.jsx)(_.A,{size:14})]})}),(0,d.jsx)(E.ZL,{children:(0,d.jsx)(E.UC,{className:"cw-picker-panel cw-gallery-format-panel",sideOffset:8,align:"end",collisionPadding:12,"aria-label":"Photo format",children:(0,d.jsx)("div",{role:"group","aria-label":"Choose photo format",children:["All formats","Square","Portrait","Landscape"].map(function(e){return(0,d.jsxs)(O.$,{variant:"ghost","aria-pressed":N===e,onClick:function(){q(e),P(!1)},children:[e,N===e&&(0,d.jsx)(x.A,{size:15})]},e)})})})})]}),(0,d.jsxs)("label",{className:"cw-gallery-search",children:[(0,d.jsx)(j.A,{size:16,"aria-hidden":"true"}),(0,d.jsx)(G.p,{"aria-label":"Search gallery",placeholder:"Search mockups",value:f,onChange:function(e){return g(e.target.value)}}),f&&(0,d.jsx)("button",{type:"button","aria-label":"Clear search",onClick:function(){return g("")},children:(0,d.jsx)(C.A,{size:14})})]})]})]}),(0,d.jsx)("div",{className:"cw-scene-grid",style:{gridTemplateColumns:"repeat(".concat(U,", minmax(0, 1fr))")},children:K.map(function(e,s){return(0,d.jsx)("div",{children:e.map(function(e,s){return(0,d.jsx)(eK,{scene:e,disabled:t,eager:s<2,onSelect:a},e.id)})},s)})}),!F.length&&(0,d.jsxs)("div",{className:"cw-gallery-empty",children:[(0,d.jsx)("p",{children:"No photos match."}),(0,d.jsx)(O.$,{variant:"ghost",onClick:function(){g(""),v("All"),q("All formats")},children:"Clear filters"})]}),p<F.length&&(0,d.jsx)(O.$,{ref:T,variant:"ghost",onClick:function(){return h(function(e){return Math.min(F.length,e+24)})},children:"Load more photos"})]})}function eG(e){var t,a,n,l,p,m=e.jobId,g=e.initial,b=e.receipt,k=e.modelLabel,v=e.artworkOnly,_=e.onArtworkReady,x=(0,J.Q)(m,{kind:"image_generate"}),j=(null==(t=x.job)?void 0:t.job_id)===m?(0,o._)({},g,x.job):g,C=null!=(a=null==j?void 0:j.input)?a:null==b?void 0:b.input,S=null!=(n=null==j?void 0:j.purpose)?n:null==C?void 0:C.purpose,A=(0,ef.Yx)(null==j?void 0:j.result_url),P=null!=(l=null==j?void 0:j.preview_url)?l:null,I=!!j&&(0,es.Os)(j),U=null==j?void 0:j.financial,L=(0,w.jE)(),R=(0,V.Ll)(),z=R.addJob,M=R.markTerminal,T=R.updateJobState,E=(0,i._)((0,u.useState)(!1),2),D=E[0],F=E[1],K=(0,i._)((0,u.useState)(""),2),G=K[0],Y=K[1],Q=(0,u.useRef)(!1),$=(0,u.useRef)(!0),H="".concat(null==j?void 0:j.state,":").concat(null==U?void 0:U.status,":").concat(null==U?void 0:U.transaction_id);(0,u.useEffect)(function(){return $.current=!0,function(){$.current=!1}},[]),(0,u.useEffect)(function(){j&&(z(m,"image_generate","artwork"===S?"Artwork":"Product scene"),"succeeded"===j.state||"failed"===j.state?M(m,{state:j.state,resultUrl:j.result_url,credits:j.credits,model:j.model,error:j.error}):T(m,j.state),L.invalidateQueries({queryKey:["billing"]}),L.invalidateQueries({queryKey:["sidebar"]}),L.invalidateQueries({queryKey:["payg","status"]}))},[m,H,z,M,T,L]);var W=null==j?void 0:j.phase,Z=(null==j?void 0:j.state)==="failed"||(null==j?void 0:j.state)==="c
1ancelled"?"Image generation stopped":(null==j?void 0:j.state)==="succeeded"?P?"Image ready":"We couldnât load your image":"saving"===W?"Saving your image":"generating"===W?"Generating your image":j?"Image accepted":"Checking your image";return(0,d.jsxs)("section",{className:"cw-result","aria-label":"Image generation result",children:[(0,d.jsx)("div",{className:"cw-result-media","aria-busy":!I,children:(null==j?void 0:j.state)==="succeeded"&&P?(0,d.jsx)(h.default,{src:P,alt:"artwork"===S?"Generated flat artwork":"Generated product scene",width:1024,height:1024,unoptimized:!0}):(0,d.jsxs)(d.Fragment,{children:[!I&&(0,d.jsx)(B.E,{className:"cw-job-skeleton motion-reduce:animate-none","aria-hidden":"true"}),(0,d.jsxs)("div",{role:"status",children:[(0,d.jsx)(N.A,{size:28}),(0,d.jsx)("strong",{children:Z}),(0,d.jsx)("p",{children:(null==j?void 0:j.state)==="failed"?j.error||"The image could not be completed.":(null==j?void 0:j.state)==="cancelled"?"This job was cancelled.":(null==j?void 0:j.state)==="succeeded"?"Check the saved image before starting another generation.":x.pollError?"The connection was interrupted. Your job may still be running.":"You can keep working. This image will stay here."})]})]})}),(0,d.jsxs)("div",{className:"cw-result-info",children:[(0,d.jsx)("h2",{children:"artwork"===S?"Artwork":"Product scene"}),(0,d.jsxs)("p",{children:[null!=(p=null!=k?k:null==b?void 0:b.modelLabel)?p:null==j?void 0:j.model,C?" \xb7 ".concat(C.aspect_ratio," \xb7 ").concat(C.resolution):""]}),(null==C?void 0:C.product)&&(0,d.jsx)("p",{children:C.product.name}),U?(0,d.jsx)("p",{className:"cw-job-payment",role:"status",children:"refunded"===U.status?"payg"===U.source&&null!==U.refunded_usd?"".concat((0,ef.MS)(U.refunded_usd)," refunded to your prepaid balance"):"".concat(U.refunded_credits," credits refunded to ").concat((0,ef.v8)(U.source).toLowerCase()):"payg"===U.source&&null!==U.charged_usd?"".concat((0,ef.MS)(U.charged_usd)," charged from your prepaid balance"):"".concat(U.credits," credits charged from ").concat((0,ef.v8)(U.source).toLowerCase())}):(0,d.jsx)(f(),{href:"/dashboard/billing",children:"Payment details"}),(x.pollError||(null==j?void 0:j.state)==="succeeded"&&!P)&&(0,d.jsx)(O.$,{variant:"outline",onClick:function(){return x.refetch()},children:"Check status"}),(null==j?void 0:j.can_cancel)===!0&&!I&&(0,d.jsx)(O.$,{variant:"outline",disabled:D,onClick:function(){(0,s._)(function(){var e,t;return(0,c.YH)(this,function(a){switch(a.label){case 0:if(Q.current||(null==j?void 0:j.can_cancel)!==!0)return[2];Q.current=!0,F(!0),Y(""),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,(0,ef.zc)("/api/images/".concat(m,"/cancel"),{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"})];case 2:if(e=a.sent(),!$.current)return[2];return L.setQueryData(["job",m],e),L.invalidateQueries({queryKey:["image-jobs"]}),[3,5];case 3:if(t=a.sent(),!$.current)return[2];return Y((0,r._)(t,ef.Nv)&&"IMAGE_CANCEL_NOT_ALLOWED"===t.code?"Generation has already started. This image could not be cancelled.":"Cancellation could not be confirmed. Check the image status before trying again."),x.refetch(),[3,5];case 4:return Q.current=!1,$.current&&F(!1),[7];case 5:return[2]}})})()},children:D?"Cancelling":"Cancel generation"}),G&&(0,d.jsx)("p",{role:"status",children:G}),(null==j?void 0:j.state)==="succeeded"&&A&&(0,d.jsxs)(d.Fragment,{children:[v&&"artwork"===S&&_&&"image_generate"===j.kind&&(0,d.jsxs)(O.$,{onClick:function(){return _(m)},children:["Use this design",(0,d.jsx)(y.A,{size:16})]}),(0,d.jsxs)("a",{className:v?"cw-download cw-download-secondary":"btn-primary cw-download",href:"/api/images/".concat(encodeURIComponent(m),"/download"),download:!0,children:[(0,d.jsx)(q.A,{size:16}),"Download ","artwork"===S?"artwork":"scene"]})]}),C&&(0,d.jsxs)("details",{children:[(0,d.jsx)("summary",{children:"Image prompt"}),(0,d.jsx)("p",{children:C.prompt})]})]})]})}function eY(){var e,t,a,m,v,q,D,F,B,G,Q,J,es,eh,eg,eb,ew,ek,ev,ey,ex,ej,eC,eN=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},eq=eN.artworkOnly,eS=void 0!==eq&&eq,eP=eN.onArtworkReady,eI=eN.headerActions,eM=(0,g.useRouter)(),eK=(0,eE.x)(),eY=(0,g.usePathname)(),eQ=(0,g.useSearchParams)(),e$=(0,w.jE)(),eH=(0,V.Ll)().addJob,eW=(0,X.As)(),eJ=eW.user,eV=eW.isLoading,eZ=(0,ee.k)().data,eX=(0,et.l)().data,e0=(0,ea.o)().data,e1=null!=(q=null==eX?void 0:eX.image_unit_price_usd)?q:null==e0?void 0:e0.imageUnitPriceUsd,e2=null!=(D=null==eX?void 0:eX.mockup_unit_price_usd)?D:null==e0?void 0:e0.mockupUnitPriceUsd,e4=(0,Z.mu)(),e3=eJ?(0,Z.IK)(eJ.id,e4):null,e9=(0,u.useRef)(e3);e9.current=e3;var e6=(0,i._)((0,u.useState)(void 0),2),e5=e6[0],e7=e6[1],e8=eQ.get("workspace"),te=(0,i._)((0,u.useState)("assistant"===e8?"assistant":"automation"===e8?"automation":"browser"),2),tt=te[0],ta=te[1],ts=(0,i._)((0,u.useState)(eS?"artwork":"scene"),2),tr=ts[0],to=ts[1],tn=(0,i._)((0,u.useState)(""),2),ti=tn[0],tl=tn[1],tc=(0,i._)((0,u.useState)(""),2),td=tc[0],tu=tc[1],tp=(0,i._)((0,u.useState)(null),2),th=tp[0],tm=tp[1],tf=(0,i._)((0,u.useState)(!1),2),tg=tf[0],tb=tf[1],tw=(0,i._)((0,u.useState)(!1),2),tk=tw[0],tv=tw[1],ty=(0,i._)((0,u.useState)(null),2),t_=ty[0],tx=ty[1],tj=(0,i._)((0,u.useState)(!1),2),tC=tj[0],tN=tj[1],tq=(0,i._)((0,u.useState)(null),2),tS=tq[0],tA=tq[1],tP=(0,i._)((0,u.useState)(""),2),tI=tP[0],tU=tP[1],tL=(0,i._)((0,u.useState)("shirt"),2),tR=tL[0],tz=tL[1],tM=(0,i._)((0,u.useState)(""),2),tT=tM[0],tE=tM[1],tO=(0,i._)((0,u.useState)(""),2),tD=tO[0],tF=tO[1],tK=(0,i._)((0,u.useState)(""),2),tB=tK[0],tG=tK[1],tY=(0,i._)((0,u.useState)(""),2),tQ=tY[0],t$=tY[1],tH=(0,i._)((0,u.useState)(""),2),tW=tH[0],tJ=tH[1],tV=(0,i._)((0,u.useState)("claude"),2),tZ=tV[0],tX=tV[1],t0=(0,i._)((0,u.useState)("make"),2),t1=t0[0],t2=t0[1],t4=(0,i._)((0,u.useState)(""),2),t3=t4[0],t9=t4[1],t6=(0,i._)((0,u.useState)(!1),2),t5=t6[0],t7=t6[1],t8=(0,u.useRef)(!1),ae=(0,i._)((0,u.useState)(null),2),at=ae[0],aa=ae[1],as=(0,i._)((0,u.useState)(""),2),ar=as[0],ao=as[1],an=(0,i._)((0,u.useState)(""),2),ai=an[0],al=an[1],ac=(0,i._)((0,u.useState)(""),2),ad=ac[0],au=ac[1],ap=(0,i._)((0,u.useState)(null),2),ah=ap[0],am=ap[1],af=(0,i._)((0,u.useState)(!1),2),ag=af[0],ab=af[1],aw=(0,i._)((0,u.useState)(null),2),ak=aw[0],av=aw[1],ay=(null==ak?void 0:ak.ownerId)===e3?ak:null,a_=(0,i._)((0,u.useState)(null),2),ax=a_[0],aj=a_[1],aC=(0,i._)((0,u.useState)(null),2),aN=aC[0],aq=aC[1],aS=(0,i._)((0,u.useState)(!1),2),aA=aS[0],aP=aS[1],aI=(0,i._)((0,u.useState)(!1),2),aU=aI[0],aL=aI[1],aR=(0,i._)((0,u.useState)(Date.now()),2),az=aR[0],aM=aR[1],aT=(0,i._)((0,u.useState)(null),2),aE=aT[0],aO=aT[1],aD=(0,i._)((0,u.useState)(""),2),aF=aD[0],aK=aD[1],aB=(0,i._)((0,u.useState)(!1),2),aG=aB[0],aY=aB[
11],aQ=(0,i._)((0,u.useState)(!1),2),a$=aQ[0],aH=aQ[1],aW=(0,i._)((0,u.useState)(""),2),aJ=aW[0],aV=aW[1],aZ=(0,u.useRef)(!1),aX=(0,u.useRef)(!1),a0=(0,u.useRef)(null),a1=(0,u.useRef)(null),a2=(0,u.useRef)(null),a4=(0,u.useRef)(null),a3=(0,u.useRef)(null),a9=(0,u.useRef)(null),a6=(0,u.useRef)(null),a5="artwork"===tr?"artwork":"scene",a7=em.find(function(e){return e.id===tT}),a8="artwork"===a5?tT:null!=(F=null==a7?void 0:a7.prompt)?F:"",se="artwork"===a5?tT.toLowerCase().replace(/[^a-z0-9]+/g,"-"):null!=(B=null==a7?void 0:a7.id)?B:"",st="artwork"===tr?td:ti;(0,u.useEffect)(function(){ta("assistant"===e8?"assistant":"automation"===e8?"automation":"browser")},[e8]),(0,u.useEffect)(function(){if(!eS&&"psd"===eQ.get("upload")){tx({open:!0,starterId:eQ.get("starter_psd")});var e=new URL(window.location.href);e.searchParams.delete("upload"),e.searchParams.delete("starter_psd"),window.history.replaceState(null,"",e)}},[eS,eQ]),(0,u.useEffect)(function(){var e=eQ.get("source");if(!eS&&e){aO({kind:"sample",url:e,title:"Product photo"}),aY(!0);var t=new URL(window.location.href);t.searchParams.delete("source"),window.history.replaceState(null,"",t)}},[eS,eQ]),(0,u.useEffect)(function(){if(!eV&&(void 0!==e5&&e5!==e3&&(av(null),tl(""),tu(""),tm(null),tE(""),to(eS?"artwork":"scene"),aO(null),aa(null),tv(!1),tx(null),tA(null),aj(null),aq(null),aY(!1),aL(!1),au(""),ao("")),e5!==e3)&&(e7(e3),e3)){var e,t,a,s,r,o,n=(0,ef.HO)(e3);if(n&&(av(n),"scene"!==n.input.purpose||!n.jobId)){if(n.input.purpose!==(eS?"artwork":"scene"))return void aL(!n.jobId);tF(n.input.model_id),tG(n.input.aspect_ratio),t$(n.input.resolution),tJ(null!=(a=n.input.quality)?a:""),tE("scene"===n.input.purpose?null!=(s=null==(e=n.input.style)?void 0:e.id)?s:"":null!=(r=null==(t=n.input.style)?void 0:t.prompt)?r:""),"artwork"===n.input.purpose?tu(n.input.prompt):tl(n.input.prompt),n.input.product&&tm({id:n.input.product.id,display_name:n.input.product.name,description:null!=(o=n.input.product.description)?o:"",brand:null,model:null}),aL(!n.jobId),n.jobId?eH(n.jobId,"image_generate","scene"===n.input.purpose?"Product scene":"Artwork"):ao("Check your last image request before starting another image.")}}},[e3,eV,e5,eH,eS]);var sa=(0,u.useMemo)(function(){return eT.x.filter(function(e){return e.purposes.includes(a5)})},[a5]),ss=null!=(Q=null!=(G=sa.find(function(e){return e.id===tD}))?G:sa.find(function(e){return e.is_default}))?Q:sa[0],sr=(null==ss?void 0:ss.aspect_ratios.includes(tB))?tB:null!=(J=null==ss?void 0:ss.aspect_ratios[0])?J:"",so=(null==ss?void 0:ss.resolutions.includes(tQ))?tQ:null!=(es=null==ss?void 0:ss.resolutions[0])?es:"",sn=(null==ss||null==(e=ss.qualities)?void 0:e.includes(tW))?tW:null!=(eh=null==ss||null==(t=ss.qualities)?void 0:t[0])?eh:"",si=ss?e_(ss,so,sn,sr):null,sl=ss?e_(ss,so,sn,sr,!0):null,sc=(null!=si?si:sl)==null?null:(null!=si?si:sl)+("scene"===a5?W.Q:0),sd=null!==sc&&(null==eZ?void 0:eZ.credits)?eZ.credits.credits_available>=sc?"subscription":eZ.credits.extra_credits>=sc?"extra":"payg":null,su=(0,ef.zx)(null!=(eg=null!=si?si:sl)?eg:0,"scene"===a5?W.Q:0,e1,e2),sp=(0,b.I)({queryKey:["dashboard-product-catalog"],queryFn:function(e){var t=e.signal;return(0,s._)(function(){var e;return(0,c.YH)(this,function(a){switch(a.label){case 0:return[4,fetch("/workspace-start/products.json",{signal:t})];case 1:if(!(e=a.sent()).ok)throw Error("The product catalog could not load. Try again.");return[2,e.json()]}})})()},enabled:tg,staleTime:1/0,retry:!1}),sh=(0,u.useMemo)(function(){var e,t=tI.toLocaleLowerCase().trim().split(/\s+/).filter(Boolean);return(null!=(e=sp.data)?e:[]).filter(function(e){return t.every(function(t){return e.display_name.toLocaleLowerCase().includes(t)})})},[sp.data,tI]),sm=(0,u.useMemo)(function(){return ei.flatMap(function(e){var t,a,s=e.id,r=e.thumb,o=null==(t=sp.data)?void 0:t.find(function(e){return e.id===s});return o?[{item:o,thumb:null!=(a=o.thumbnail)?a:r}]:[]})},[sp.data]),sf=tI.trim()?sh.slice(0,40).map(function(e){var t;return{item:e,thumb:null!=(t=e.thumbnail)?t:null}}):sm,sg=a$||t5||"viewer"===eK,sb=(0,u.useMemo)(function(){return ss&&st.trim()&&sr&&so?(0,o._)({model_id:ss.id,purpose:a5,prompt:st.trim(),aspect_ratio:sr,resolution:so},"scene"===a5?{workflow:"scene_to_mockup_v1"}:{},sn?{quality:sn}:{},th?{product:{id:th.id,name:th.display_name,description:th.description}}:{},a8?{style:{id:se,prompt:a8}}:{}):null},[ss,a5,st,sr,so,sn,th,a8,se]),sw=JSON.stringify(sb),sk=(0,u.useRef)(sw);sk.current=sw;var sv=(null==ax?void 0:ax.ownerId)===e3&&JSON.stringify(ax.input)===sw?ax:null,sy=!!sv&&1e3*sv.quote.expires_at<=az,s_=sv&&!sy?sv.quote.line_items:void 0,sx=null!=(ew=null!=(eb=null==s_||null==(a=s_.find(function(e){return"image_generation"===e.kind}))?void 0:a.credits)?eb:si)?ew:sl,sj=null!=(ek=null==s_||null==(m
1=s_.find(function(e){return"mockup_preparation"===e.kind}))?void 0:m.credits)?ek:W.Q,sC=(!sv||sy)&&null===si,sN=(0,k.q)({queryKey:["image-jobs",e3],queryFn:function(e){var t=e.pageParam,a=e.signal;return(0,ef.zc)("/api/images?limit=20".concat(t?"&cursor=".concat(encodeURIComponent(t)):""),{signal:a})},initialPageParam:null,getNextPageParam:function(e){var t;return null!=(t=e.nextCursor)?t:void 0},enabled:eS&&!!e3&&!eV,staleTime:0,retry:!1}),sq=(0,u.useMemo)(function(){var e=new Map,t=!0,a=!1,s=void 0;try{for(var r,o,n=((null==aN?void 0:aN.ownerId)===e3?aN.jobs:[])[Symbol.iterator]();!(t=(o=n.next()).done);t=!0){var i=o.value;e.set(i.job_id,i)}}catch(e){a=!0,s=e}finally{try{t||null==n.return||n.return()}finally{if(a)throw s}}var c=!0,d=!1,u=void 0,p=!0,h=!1,m=void 0;try{for(var f,g,b=(null!=(f=null==(r=sN.data)?void 0:r.pages)?f:[])[Symbol.iterator]();!(p=(g=b.next()).done);p=!0){var w=g.value;try{for(var k,v=w.jobs[Symbol.iterator]();!(c=(k=v.next()).done);c=!0){var y=k.value;e.set(y.job_id,y)}}catch(e){d=!0,u=e}finally{try{c||null==v.return||v.return()}finally{if(d)throw u}}}}catch(e){h=!0,m=e}finally{try{p||null==b.return||b.return()}finally{if(h)throw m}}return(0,l._)(e.values()).filter(function(e){return!eS||"artwork"===e.purpose}).sort(function(e,t){var a,s;return(null!=(a=t.created_at)?a:"").localeCompare(null!=(s=e.created_at)?s:"")||t.job_id.localeCompare(e.job_id)})},[aN,e3,sN.data,eS]),sS=Array.from(new Set((0,l._)(sq.map(function(e){return e.job_id})).concat((0,l._)((null==ay?void 0:ay.jobId)&&(!eS||"artwork"===ay.input.purpose)?[ay.jobId]:[])))),sA=(null==aE?void 0:aE.kind)==="upload"?aF:null==aE?void 0:aE.url,sP=(null==aE?void 0:aE.kind)==="upload"?aE.file.name:null==aE?void 0:aE.title,sI=(0,er.LY)(ah);(0,u.useEffect)(function(){if((null==aE?void 0:aE.kind)!=="upload")return void aK("");var e=URL.createObjectURL(aE.file);return aK(e),function(){return URL.revokeObjectURL(e)}},[aE]),(0,u.useEffect)(function(){aj(null),al("")},[sw,e3]),(0,u.useEffect)(function(){if(sv){var e=window.setTimeout(function(){return aM(Date.now())},Math.max(0,1e3*sv.quote.expires_at-Date.now()));return function(){return window.clearTimeout(e)}}},[sv]);var sU=function(){au(""),ao(""),al(""),t9(""),ab(!1),am(null)},sL=function(e){sU(),ta(e);var t=new URLSearchParams(eQ.toString());"browser"===e?t.delete("workspace"):t.set("workspace",e),eM.replace("".concat(eY).concat(t.size?"?".concat(t):""),{scroll:!1})},sR=function(e){au((0,r._)(e,Error)?e.message:"Something went wrong. Please try again."),ab((0,r._)(e,ef.Nv)&&402===e.status),am((0,r._)(e,ef.Nv)?e.code:null)},sz=function(e){st.trim()||th||aE?(tA(e),tv(!0)):eM.push(e)},sM=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sv;return(0,s._)(function(){var t,a,s,i,d,u,p,h,m,f,g,b,w,k,v,y;return(0,c.YH)(this,function(c){switch(c.label){case 0:if(aZ.current||(null==e?void 0:e.jobId)||!e3||!aU&&(!sb||e&&JSON.stringify(e.input)!==sk.current)||e&&e.ownerId!==e3)return[2];t=e3,a=sk.current,aZ.current=!0,aP(!0),sU(),s=!1,c.label=1;case 1:if(c.trys.push([1,5,6,7]),!(!e||!aU&&!(0,ef.eo)(e.quote,e.input)))return[3,3];if(!sb)return[2];return[4,(0,ef.zc)("/api/images/quote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(sb)})];case 2:if(f=c.sent(),e9.current!==t||sk.current!==a)return[2];if(!(0,ef.eo)(f,sb))throw Error("The price could not be confirmed. Please try again.");if(g=sv&&!sy?sv.quote:null,aj(e={ownerId:t,input:sb,quote:f,key:crypto.randomUUID(),modelLabel:null!=(b=null==ss?void 0:ss.label)?b:sb.model_id}),aM(Date.now()),!(g?f.credits===g.credits&&(null==(i=f.funding)?void 0:i.source)===(null==(d=g.funding)?void 0:d.source)&&(null==(u=f.funding)?void 0:u.amount_usd)===(null==(p=g.funding)?void 0:p.amount_usd):null!==si&&f.credits===sc&&(null==(h=f.funding)?void 0:h.source)===sd&&("payg"!==sd||null!==su&&(null==(m=f.funding)?void 0:m.amount_usd)===su)))return al("Review the total and payment source, then generate."),[2];c.label=3;case 3:return(0,ef.A4)(e),av(e),s=!0,[4,(0,ef.zc)("/api/images",{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":e.key},body:JSON.stringify((0,n._)((0,o._)({},e.input),{quote_token:e.quote.quote_token,idempotency_key:e.key}))})];case 4:if(w=c.sent(),e9.current!==e.ownerId)return[2];if("string"!=typeof w.job_id||!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(w.job_id))throw new ef.Nv("The server did not return a job number.",502);k=(0,n._)((0,o._)({},e),{jobId:w.job_id});try{(0,ef.A4)(k)}catch(e){}return av(k),aL(!1),aq(function(e){return{ownerId:k.ownerId,jobs:[w].concat((0,l._)((null==e?void 0:e.ownerId)===k.ownerId?e.jobs.filter(function(e){return e.job_id!==w.job_id}):[]))}}),eH(w.job_id,"image_generate","scene"===e.input.purpose?"Product scene":"Artwork"),"scene_to_mockup_v1"===e.input.workflow?(e$.setQueryData(["j
1ob",w.job_id],w),(null==th?void 0:th.thumbnail)&&e$.setQueryData(["scene-reference",w.job_id],th.thumbnail),eM.push("/dashboard/photo-to-mockup/".concat(w.job_id,"?generation=1"))):ao("Image started. You can keep working while it generates."),e$.invalidateQueries({queryKey:["image-jobs",e.ownerId]}),e$.invalidateQueries({queryKey:["billing"]}),e$.invalidateQueries({queryKey:["sidebar"]}),e$.invalidateQueries({queryKey:["payg","status"]}),[3,7];case 5:if(v=c.sent(),e9.current!==t)return[2];return aL(y=aU||s&&(!(0,r._)(v,ef.Nv)||v.status>=500)),y||((0,ef.QZ)(t),av(null)),!y&&(0,r._)(v,ef.Nv)&&"IMAGE_QUOTE_CHANGED"===v.code?(aj(null),al("The price or payment source changed. Review the updated price, then generate again.")):sR(v),[3,7];case 6:return aZ.current=!1,aP(!1),[7];case 7:return[2]}})})()},sT=function(e){var t,a=null==(t=e.target.files)?void 0:t[0];a&&((sU(),H.Zw.includes(a.type))?a.size>H.BD?au("Choose an image smaller than ".concat(H.Ho," MB.")):(aO({kind:"upload",file:a}),aY(!0)):au("Choose a PNG, JPG or WebP product photo.")),e.target.value=""},sE=ad?(0,d.jsxs)("div",{className:"cw-error",role:"alert",children:[(0,d.jsx)(S.A,{size:17}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{children:ad}),ag&&"owner"===eK&&(0,d.jsxs)(f(),{href:sI.href,children:[sI.label,(0,d.jsx)(y.A,{size:14})]})]})]}):null,sO=(0,d.jsxs)(d.Fragment,{children:[!aG&&sE,ar&&!aU&&(0,d.jsx)("p",{className:"cw-message",role:"status",children:ar})]}),sD=(0,d.jsxs)("div",{className:"cw-product-control",children:[(0,d.jsxs)(Y.lG,{open:tg,onOpenChange:tb,children:[(0,d.jsx)(Y.zM,{asChild:!0,children:(0,d.jsxs)(O.$,{variant:"ghost",className:"cw-product-button",disabled:sg||aG,"aria-label":null!=(ev=null==th?void 0:th.display_name)?ev:"Product",title:null!=(ey=null==th?void 0:th.display_name)?ey:"Product",children:[(0,d.jsx)(j.A,{size:16}),(0,d.jsx)("span",{children:null!=(ex=null==th?void 0:th.display_name)?ex:"Product"}),(0,d.jsx)(_.A,{size:14})]})}),(0,d.jsxs)(Y.Cf,{className:"cw-dialog",children:[(0,d.jsx)(Y.L3,{children:"Choose your product"}),(0,d.jsx)(Y.rr,{children:"Search by the full brand and model name."}),(0,d.jsxs)("label",{className:"cw-search",children:[(0,d.jsx)(j.A,{size:17}),(0,d.jsx)("input",{autoComplete:"off","aria-label":"Search products",placeholder:"Brand, model or productâ¦",value:tI,onChange:function(e){return tU(e.target.value)}})]}),sp.isPending?(0,d.jsx)("p",{className:"cw-muted",role:"status",children:"Loading productsâ¦"}):sp.isError?(0,d.jsxs)("div",{role:"alert",children:[(0,d.jsx)("p",{children:sp.error.message}),(0,d.jsx)(O.$,{variant:"outline",onClick:function(){sp.refetch()},children:"Try again"})]}):(0,d.jsxs)(d.Fragment,{children:[!tI.trim()&&!!sm.length&&(0,d.jsx)("p",{className:"cw-muted",children:"Popular products"}),(0,d.jsxs)("div",{className:"cw-product-results",children:[sf.map(function(e){var t=e.item,a=e.thumb;return(0,d.jsxs)("button",{type:"button",onClick:function(){tm(t),tb(!1)},children:[a&&(0,d.jsx)("span",{className:"cw-product-thumbnail","aria-hidden":"true",children:(0,d.jsx)(h.default,{src:a,width:48,height:48,sizes:"48px",alt:"",style:{objectFit:"contain"},onError:function(e){e.currentTarget.style.opacity="0"},onLoad:function(e){e.currentTarget.style.opacity="1"}})}),(0,d.jsxs)("span",{children:[(0,d.jsx)("strong",{children:t.display_name}),t.brand&&(0,d.jsxs)("small",{children:[t.brand,t.model?" \xb7 ".concat(t.model):""]})]}),t.id===(null==th?void 0:th.id)&&(0,d.jsx)(x.A,{size:17})]},t.id)}),!sf.length&&(0,d.jsx)("p",{children:"No matching products. Try a brand or a shorter name."})]}),!!tI.trim()&&sh.length>40&&(0,d.jsx)("p",{className:"cw-muted",children:"Refine your search to see more products."})]})]})]}),th&&(0,d.jsx)("button",{type:"button",className:"cw-clear-product",disabled:sg,"aria-label":"Clear selected product",onClick:function(){return tm(null)},children:(0,d.jsx)(C.A,{size:14})})]}),sF=null!=(ej=ep.find(function(e){return e.id===tZ}))?ej:ep[0],sK="claude"===sF.id?"claude mcp add --transport http sudomock https://mcp.sudomock.com":"codex"===sF.id?"codex mcp add sudomock --url https://mcp.sudomock.com":"https://mcp.sudomock.com",sB="".concat($,"\n\nHelp me ").concat("artwork"===tr?"create artwork for a product, then place it on a mockup":"create a product mockup",".").concat(th?"\nProduct: ".concat(th.display_name,".\nProduct description: ").concat(th.description):"\nHelp me cho
1ose a product.").concat(st.trim()?"\nCreative direction: ".concat(st.trim()):"").concat(a8?"\n".concat("artwork"===a5?"Artwork":"Photo"," style: ").concat(a8):"","\nKeep the product photograph and the flat artwork as separate files. Ask for any missing photo, PSD or artwork. Inspect the available tools, show the credits before spending, and follow the job to its final result. Do not assume an image generation tool or a universal print size."),sG=function(e,t){return(0,d.jsxs)("div",{className:"cw-code-block",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{children:e}),(0,d.jsxs)(O.$,{size:"sm",variant:"ghost",onClick:function(){(0,s._)(function(){return(0,c.YH)(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,navigator.clipboard.writeText(t)];case 1:return e.sent(),t9(t),ao("Copied. Paste it into your tool."),[3,3];case 2:return e.sent(),ao("Clipboard is unavailable. Select the text and copy it manually."),[3,3];case 3:return[2]}})})()},children:[(0,d.jsx)(A.A,{size:14}),t3===t?"Copied":"Copy"]})]}),(0,d.jsx)("pre",{tabIndex:0,children:t})]})};return void 0!==e5&&e5!==e3?(0,d.jsx)("section",{className:"create-workspace","aria-label":"Create a mockup",children:(0,d.jsx)("p",{role:"status",children:"Loading your workspaceâ¦"})}):a$?(0,d.jsx)(en.bQ,{children:(0,d.jsx)(eO,{stageIndex:0,referenceUrl:sA,notice:aJ})}):(0,d.jsxs)("section",{className:"create-workspace".concat(eS?" cw-artwork-embedded":""),"aria-label":eS?"Create a print design":"Create a mockup",children:[!eS&&eI&&(0,p.createPortal)((0,d.jsxs)("div",{className:"cw-mobile-ways",children:["browser"!==tt&&(0,d.jsx)(O.$,{variant:"ghost","aria-label":"Back to Create",title:"Back to Create",className:"h-9 w-9 p-0",onClick:function(){return sL("browser")},children:(0,d.jsx)(P.A,{size:17})}),(0,d.jsxs)(E.bL,{open:tC,onOpenChange:tN,children:[(0,d.jsx)(E.l9,{asChild:!0,children:(0,d.jsx)("button",{type:"button","aria-label":"More ways to work",title:"More ways to work",className:"h-9 w-9 justify-center rounded-lg border border-white/10",children:(0,d.jsx)(I.A,{size:18})})}),(0,d.jsx)(E.ZL,{children:(0,d.jsxs)(E.UC,{className:"cw-picker-panel cw-mobile-ways-panel",sideOffset:8,align:"end",collisionPadding:12,"aria-label":"More ways to work",children:[(0,d.jsxs)("button",{type:"button",onClick:function(){sL("assistant"),tN(!1)},children:[(0,d.jsx)(U.A,{size:16}),"Claude / Codex"]}),(0,d.jsxs)("button",{type:"button",onClick:function(){sL("automation"),tN(!1)},children:[(0,d.jsx)(L.A,{size:16}),"Make / n8n / API"]})]})})]})]}),eI),!eS&&(0,d.jsx)("div",{className:"cw-work-modes",role:"group","aria-label":"Where to work",children:[["browser","In SudoMock",N.A],["assistant","Claude / Codex",U.A],["automation","Make / n8n / API",L.A]].map(function(e){var t=(0,i._)(e,3),a=t[0],s=t[1],r=t[2];return(0,d.jsxs)("button",{type:"button","aria-pressed":tt===a,onClick:function(){return sL(a)},children:[(0,d.jsx)(r,{size:17}),s]},a)})}),(eS||"browser"===tt)&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"cw-composer",ref:a6,tabIndex:-1,children:[!eS&&(0,d.jsx)("input",{ref:a1,type:"file",accept:"image/png,image/jpeg,image/webp","aria-label":"Choose product photo",className:"hidden",disabled:sg,onChange:sT}),!eS&&(0,d.jsx)("input",{ref:a2,type:"file",accept:"image/png,image/jpeg,image/webp",capture:"environment","aria-label":"Take product photo",className:"hidden",disabled:sg,onChange:sT}),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"cw-prompt",children:[(0,d.jsx)("label",{className:"sr-only",htmlFor:"image-prompt",children:"artwork"===tr?"Create a design to print on your product":"Describe your product scene"}),(0,d.jsxs)("div",{className:"cw-prompt-editor",children:[(0,d.jsx)(K,{ref:a0,className:"cw-prompt-textarea",id:"image-prompt",maxLength:4e3,disabled:sg,value:st,onChange:function(e){aa(null),"artwork"===tr?tu(e.target.value):tl(e.target.value)},placeholder:"artwork"===tr?"A botanical emblem with clean lines and an open backgroundâ¦":"A blank white T-shirt in soft window light, with a clear front print areaâ¦"}),"scene"===tr&&!st.trim()&&(0,d.jsxs)(O.$,{type:"button",variant:"ghost",className:"cw-surprise",disabled:sg||t5||aG,onClick:function(){(0,s._)(function(){var e,t,a,r,o,n,i,l,d;return(0,c.YH)(this,function(u){switch(u.label){case 0:if(t8.current||sg)return[2];t={prompt:ti,product:th,owner:e=e9.current},t8.current=!0,t7(!0),sU(),u.label=1;case 1:return u.trys.push([1,6,7,8]),[4,e$.fetchQuery({queryKey:["dashboard-product-prompts"],staleTime:1/0,queryFn:function(){return(0,s._)(function(){var e,t;return(0,c.YH)(this,function(a){switch(a.label){case 0:return[4,fetch("/workspace-start/product-prompts.json")];case 1:if(!(e=a.sent()).ok)throw Error("Prompt ideas could not load. Try again.");return[4,e.json()];case 2:if(!Array.isArray(t=a.sent())||!t.length||t.some(function(e){return!e||"string"!=typeof e.product_id||"string"!=typeof e.prompt||!e.prompt.trim()||e.prompt.length>4e3}))throw Error("Prompt ideas are unavailable. Try again.");return[2,t]}})})()}})];case 2:if(a=u.sent(),null==(r=sp.data))return[3,3];return n=r,[3,5];case 3:return[4,sp.refetch()];case 4:n=u.sent().data,u.label=5;case 5:if(o=n,e9.current!==e||!a0.current||a0.current.value.trim())return[2];if(i=a[Math.floor(Math.random()*a.length)],!(l=null==o?void 0:o.find(function(e){return e.id===i.product_id})))throw Error("The suggested product could not load. Try again.");return aa(t),tm(l),tl(i.prompt),requestAnimationFrame(function(){var e;return null==(e=a0.current)?void 0:e.focus({preventScroll:!0})}),[3,8];case 6:return d=u.sent(),e9.current===e&&sR(d),[3,8];case 7:return t8.current=!1,t7(!1),[7];case 8:return[2]}})})()},children:[t5?(0,d.jsx)(R.A,{className:"cw-busy-icon",size:17}):(0,d.jsx)(z.A,{size:17}),(0,d.jsx)("span",{children:t5?"Loading idea":"Surprise me"})]})]}),at&&(0,d.jsxs)("div",{className:"cw-random-undo",role:"status",children:["Prompt added.",(0,d.jsx)("button",{type:"button",disabled:sg,onClick:function(){at.owner===e9.current&&(tl(
1at.prompt),tm(at.product)),aa(null)},children:"Undo"})]})]}),!eS&&(0,d.jsxs)("div",{className:"cw-mobile-photo-actions",children:[(0,d.jsxs)(O.$,{variant:"outline",disabled:sg||aG,onClick:function(){var e;return null==(e=a2.current)?void 0:e.click()},children:[(0,d.jsx)(M.A,{size:17}),"Take photo"]}),(0,d.jsxs)(O.$,{variant:"outline",disabled:sg||aG,onClick:function(){var e;return null==(e=a1.current)?void 0:e.click()},children:[(0,d.jsx)(N.A,{size:17}),"Upload photo"]})]}),(0,d.jsxs)("div",{className:"cw-composer-toolbar",children:[(0,d.jsxs)("fieldset",{disabled:sg,className:"cw-options",children:[(0,d.jsx)("legend",{className:"sr-only",children:"Image options"}),sD,"scene"===tr&&(0,d.jsx)(ez,{scene:!0,styles:em.map(function(e){return e.label}),previews:Object.fromEntries(em.map(function(e){return[e.label,e.image]})),descriptions:Object.fromEntries(em.map(function(e){return[e.label,e.description]})),value:null!=(eC=null==a7?void 0:a7.label)?eC:"",disabled:sg,onChange:function(e){var t,a;return tE(null!=(a=null==(t=em.find(function(t){return t.label===e}))?void 0:t.id)?a:"")}}),"artwork"===tr&&(0,d.jsx)(ez,{styles:ec,previews:ed,value:tT,disabled:sg,onChange:tE}),ss&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(eA,{models:sa,model:ss,resolution:so,quality:sn,aspectRatio:sr,disabled:sg,onChange:function(e){var t,a,s,r,o,n=sa.find(function(t){return t.id===e});n&&(tF(e),t$(n.resolutions.includes(so)?so:null!=(s=n.resolutions[0])?s:""),tJ((null==(t=n.qualities)?void 0:t.includes(sn))?sn:null!=(r=null==(a=n.qualities)?void 0:a[0])?r:""),tG(n.aspect_ratios.includes(sr)?sr:null!=(o=n.aspect_ratios[0])?o:""))}}),(0,d.jsx)(eU,{values:ss.aspect_ratios,value:sr,disabled:sg,onChange:tG}),(0,d.jsx)(eR,{kind:"size",values:ss.resolutions,value:so,model:ss,resolution:so,quality:sn,aspectRatio:sr,disabled:sg,onChange:t$}),!!(null==(v=ss.qualities)?void 0:v.length)&&(0,d.jsx)(eR,{kind:"quality",values:ss.qualities,value:sn,model:ss,resolution:so,quality:sn,aspectRatio:sr,disabled:sg,onChange:tJ})]})]}),(0,d.jsxs)("div",{className:"cw-generation-submit",children:[(0,d.jsxs)("div",{id:"image-price",className:"cw-generation-price","aria-live":"polite","aria-atomic":"true",children:[sv&&!sy&&sv.quote.funding?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("strong",{children:[sv.quote.credits," credits"]}),(0,d.jsx)("small",{children:(0,ef.v8)(sv.quote.funding.source)})]}):null!==sc?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("strong",{children:[null===si?"From ":"",sc," credits"]}),sd&&(0,d.jsx)("small",{children:(0,ef.v8)(sd)})]}):null,"scene"===a5&&null!==sx&&(0,d.jsxs)("small",{className:"cw-price-breakdown",children:[sC?"From ":"",sx," image + ",sj," mockup credits"]}),ai&&!aU&&(0,d.jsx)("p",{className:"cw-price-notice",role:"status",children:ai})]}),(0,d.jsx)(O.$,{className:"cw-submit-icon","aria-label":"Generate image","aria-describedby":"image-price","aria-busy":aA,disabled:!sb||sg||aA||aU,onClick:function(){sM()},children:aA?(0,d.jsx)(R.A,{className:"cw-busy-icon",size:19}):(0,d.jsx)(T.A,{size:21})})]})]})]}),!eS&&(0,d.jsxs)("div",{className:"cw-source-actions",children:[(0,d.jsxs)(O.$,{variant:"outline",className:"cw-desktop-upload",disabled:sg||aG,onClick:function(){var e;return null==(e=a1.current)?void 0:e.click()},children:[(0,d.jsx)(N.A,{size:17}),"Upload photo"]}),(0,d.jsx)(eL,{disabled:sg||aG,onOpen:function(e,t){a9.current=null!=t?t:null,tx({open:!0,starterId:e})}}),(0,d.jsxs)("span",{className:"cw-file-hint",children:["Photo: PNG, JPG or WebP \xb7 ",H.Ho," MB"]}),(0,d.jsx)("button",{ref:a4,type:"button",className:"cw-saved-link",disabled:sg||aG,onClick:function(){a3.current=a4.current,tA(null),tv(!0)},children:"Use a saved mockup"})]}),sO]}),(0,d.jsxs)("div",{className:"cw-prompt-ideas",children:["artwork"===tr?(0,d.jsx)("div",{className:"cw-idea-products",role:"group","aria-label":"Artwork prompt examples for",children:[["shirt","T-shirt"],["mug","Mug"],["poster","Poster"]].map(function(e){var t=(0,i._)(e,2),a=t[0],s=t[1];return(0,d.jsx)("button",{type:"button",disabled:sg,"aria-pressed":tR===a,onClick:function(){return tz(a)},children:s},a)})}):(0,d.jsx)("span",{children:"Try a starting point"}),("artwork"===tr?eu[tR]:el.map(function(e){return[e.title,e.prompt]})).map(function(e){var t=(0,i._)(e,2),a=t[0],s=t[1];return(0,d.jsxs)("button",{type:"button",disabled:sg,onClick:function(){return"artwork"===tr?tu(s):tl(s)},children:[a,(0,d.jsx)(y.A,{size:13})]},a)})]}),aU&&(0,d.jsxs)("div",{className:"cw-unresolved",role:"status",children:[(0,d.jsx)("p",{children:"The last request may have started. Check the same request before generating another image."}),(0,d.jsx)(O.$,{variant:"outline",disabled:aA,onClick:function(){sM(ay)},children:aA?"Checking request":"Check the same request"})]}),eS&&sS.length>0&&(0,d.jsxs)("div",{className:"cw-image-history","aria-label":"Your generated images",children:[(0,d.jsx)("h2",{children:"Your images"}),sS.map(function(e){var t,a=sq.find(function(t){return t.job_id===e});return(0,d.jsx)(eG,{jobId:e,initial:a,receipt:(null==ay?void 0:ay.jobId)===e?ay:null,modelLabel:null==(t=sa.find(function(e){return e.id===(null==a?void 0:a.model)}))?void 0:t.label,artworkOnly:eS,onArtworkReady:eP},"".concat(e3,":").concat(e))}),sN.hasNextPage&&(0,d.jsx)(O.$,{variant:"ghost",disabled:sN.isFetchingNextPage,onClick:function(){sN.fetchNextPage()},children:"Load earlier images"})]}),eS&&sN.isError&&(0,d.jsxs)("div",{className:"cw-history-error",role:"alert",children:[(0,d.jsx)("p",{children:"Your saved image jobs could not load."}),(0,d.jsx)(O.$,{variant:"ghost",onClick:function(){sN.refetch()},children:"Try again"})]}),!eS&&"artwork"!==tr&&(0,d.jsx)(eB,{disabled:sg||aG,onSelect:function(e){aO({kind:"sample",url:e.image,title:e.title}),sU(),aY(!0)}})]}),!eS&&"assistant"===tt&&(0,d.jsxs)("section",{className:"cw-automation",children:[(0,d.jsx)("div",{className:"cw-tool-list",role:"group","aria-label":"Choose your MCP client",children:ep.map(function(e){return(0,d.jsxs)("button",{type:"button","aria-pressed":tZ===e.id,onClick:function(){tX(e.id),sU()},children:[(0,d.jsx)(h.default,{className:"cursor"===e.id||"windsurf"===e.id?"cw-monochrome-logo":void 0,src:e.logo,alt:"",width:24,height:24}),e.label]},e.id)})}),(0,d.jsxs)("div",{className:"cw-automation-layout",children:[(0,d.jsxs)("div",{children:[sG("claude"===sF.id||"codex"===sF.id?"Connect ".concat(sF.label):"Add an HTTP MCP server",sK),(0,d.jsxs)("p",{className:"cw-muted",children:["Approve the connection in your browser, then return to ",sF.label,"."]}),sG("Continue your task",sB)]}),(0,d.jsxs)("aside",{children:[(0,d.jsx)("h2",{children:"Your task"}),sD,(0,d.jsx)("p",{children:"artwork"===tr?"Create artwork and place it on a mockup.":"Create a product mockup."}),(0,d.jsxs)("ol",{children:[(0,d.jsx)("li",{children:"Connect your tool."}),(0,d.jsx)("li",{children:"Paste the task prompt."}),(0,d.jsx)("li",{children:"Provide the photo, PSD and artwork it asks for."}),(0,d.jsx)("li",{children:"Review credits and follow the result."})]}),(0,d.jsx)("p",{children:"Image generation tools and their billing depend on your client."}),(0,d.jsxs)(f(),{href:"/docs/mcp",children:["Connection help",(0,d.jsx)(y.A,{size:14})]})]})]})]}),!eS&&"automation"===tt&&(0,d.jsxs)("section",{className:"cw-automation",children:[(0,d.jsx)("div",{className:"cw-tool-list",role:"group","aria-label":"Choose your automation tool",children:["make","n8n","api"].map(function(e){return(0,d.jsxs)("button",{type:"button","aria-pressed":t1===e,onClick:function(){t2(e),sU()},children:["api"===e?(0,d.jsx)(L.A,{size:24}):(0,d.jsx)(h.default,{src:"make"===e?"https://assets.sudomock.com/wor
1kspace/5c9c255e9eaf/workspace-start/make.svg":"https://assets.sudomock.com/workspace/e249c7d6c78a/workspace-start/n8n.svg",alt:"",width:24,height:24}),"api"===e?"My code / API":"make"===e?"Make":"n8n"]},e)})}),(0,d.jsxs)("div",{className:"cw-automation-layout",children:[(0,d.jsxs)("div",{children:["api"===t1?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("h2",{children:"Render your first mockup"}),(0,d.jsx)("p",{children:"The Python example chooses a sample template, uses its real IDs, and follows the render until the image is ready. Python 3 is required."}),sG("Run the working example",'curl -fsS https://sudomock.com/samples/first-mockup.py -o first-mockup.py\nexport SUDOMOCK_API_KEY="YOUR_API_KEY"\npython3 first-mockup.py'),(0,d.jsx)("p",{className:"cw-muted",children:"Replace YOUR_API_KEY with your own SudoMock API key. Rendering uses your account credits."}),(0,d.jsxs)(f(),{href:"/dashboard/api-keys",children:["Create or choose an API key",(0,d.jsx)(y.A,{size:14})]})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("h2",{children:"make"===t1?"Connect SudoMock in Make":"Connect SudoMock in n8n"}),(0,d.jsx)("p",{children:"make"===t1?"Add SudoMock to your Make organization, then add a SudoMock module to your scenario.":"Open SudoMockâs integration page, then add the SudoMock node to your workspace."}),(0,d.jsxs)("a",{className:"btn-primary",href:"make"===t1?"https://www.make.com/en/hq/app-invitation/b53acc83bb7db9d99561432f62dac51f":"https://n8n.io/integrations/sudomock/",target:"_blank",rel:"noopener noreferrer",children:["make"===t1?"Open Make invitation":"Open SudoMock in n8n",(0,d.jsx)(y.A,{size:16})]}),(0,d.jsx)("h3",{className:"cw-next-step",children:"Add your SudoMock connection"}),(0,d.jsxs)("p",{children:["Create or choose an API key, save it in ","make"===t1?"the SudoMock connection in Make":"SudoMock credentials in n8n",", then test the connection in your tool."]}),(0,d.jsxs)(f(),{href:"/dashboard/api-keys",children:["Create or choose an API key",(0,d.jsx)(y.A,{size:14})]})]}),(0,d.jsxs)("div",{className:"cw-existing-template",children:[(0,d.jsx)("h3",{children:"Use your own mockup"}),(0,d.jsx)("p",{children:"Open a saved mockup and switch to its Code tab to get a request with that templateâs IDs."}),(0,d.jsx)("div",{className:"cw-editor-links",children:(0,d.jsxs)(f(),{href:"/dashboard/mockups",children:["My mockups",(0,d.jsx)(y.A,{size:14})]})})]})]}),(0,d.jsxs)("aside",{children:[(0,d.jsx)("h2",{children:"From connection to result"}),(0,d.jsxs)("ol",{children:[(0,d.jsx)("li",{children:"Connect your SudoMock account."}),(0,d.jsx)("li",{children:"Choose a saved mockup."}),(0,d.jsx)("li",{children:"Provide the artwork."}),(0,d.jsx)("li",{children:"Run the render and use the returned image."})]}),(0,d.jsxs)(f(),{href:"api"===t1?"/docs/quickstart":"/docs/integrations/".concat(t1),children:["View the ","api"===t1?"API":"make"===t1?"Make":"n8n"," guide",(0,d.jsx)(y.A,{size:14})]})]})]})]}),!eS&&"browser"!==tt&&sO,!eS&&t_&&(0,d.jsx)(eF,{open:t_.open,starterId:t_.starterId,triggerRef:a9,onOpenChange:function(e){return tx(function(t){return t?(0,n._)((0,o._)({},t),{open:e}):null})},onOpenMockup:function(e){a3.current=a9.current,sz("/dashboard/psd-mockup-editor?mockup=".concat(encodeURIComponent(e)))}}),(0,d.jsx)(Y.lG,{open:tk,onOpenChange:function(e){tv(e),e||tA(null)},children:(0,d.jsxs)(Y.Cf,{className:"cw-dialog cw-vault-dialog",onCloseAutoFocus:function(e){var t,a;e.preventDefault(),null==(t=null!=(a=a3.current)?a:a4.current)||t.focus()},children:[(0,d.jsx)(Y.L3,{children:"My mockups"}),(0,d.jsx)(Y.rr,{children:"Choose a saved mockup to continue in its editor."}),tS?(0,d.jsxs)("div",{className:"cw-vault-handoff",children:[(0,d.jsx)("p",{children:"Leave this draft and continue in the mockup editor?"}),(0,d.jsxs)("div",{className:"cw-actions",children:[(0,d.jsxs)(O.$,{onClick:function(){return eM.push(tS)},children:["Open editor",(0,d.jsx)(y.A,{size:15})]}),(0,d.jsx)(O.$,{variant:"ghost",onClick:function(){tv(!1),tA(null)},children:"Keep editing"})]})]}):(0,d.jsx)(eD,{mode:"select",onManage:function(){return sz("/dashboard/mockups")},onSelect:function(e){return sz(e.href)}})]})}),(0,d.jsx)(Y.lG,{open:aG,onOpenChange:function(e){a$||(aY(e),e||aO(null),sU())},children:(0,d.jsxs)(Y.Cf,{className:"cw-dialog",children:[(0,d.jsx)(Y.L3,{children:"Create a reusable mockup"}),(0,d.jsx)(Y.rr,{children:"Use this product photo as the template. You will add your artwork in the editor."}),sA&&(0,d.jsx)(h.default,{className:"cw-confirm-photo",src:sA,alt:null!=sP?sP:"Selected product photo",width:480,height:300,unoptimized:!0}),(0,d.jsxs)("div",{className:"cw-confirm-cost",children:[(0,d.jsx)("span",{children:"Mockup creation"}),(0,d.jsxs)("strong",{children:[W.Q," credits"]})]}),sE,(0,d.jsxs)(O.$,{onClick:function(){(0,s._)(function(){var e,t,a,s,r,o,n,i;return(0,c.YH)(this,function(l){switch(l.label){case 0:if(!aE||aX.current)return[2];if(!e3||eV)return au("Sign in to your account before creating a mockup."),[2];e=e3,aX.current=!0,aH(!0),aY(!1),aV(""),sU(),t=!1,l.label=1;case 1:if(l.trys.push([1,7,8,9]),"upload"!==aE.kind)return[3,2];return a=aE.file,[3,5];case 2:return[4,fetch(aE.url,{cache:"no-store"})];case 3:if(!(s=l.sent()).ok)throw Error("The photo could not be loaded. Your mockup has not been created.");return[4,s.blob()];case 4:if(r=l.sent(),!H.Zw.includes(r.type)||r.size>H.BD)throw Error("Use a PNG, JPG or WebP image smaller than ".concat(H.Ho," MB."));a=new File([r],"".concat(aE.title,".").concat(r.type.split("/")[1]),{type:r.type}),l.label=5;case 5:if(e9.current!==e)return[2];return aV("Uploading your photo"),[4,(0,eo.c)(a,{onProgress:function(e){return aV("Uploading your photo: ".concat(Math.round(100*e),"%"))},onUploaded:function(){return aV("Creating your mockup")}})];case 6:if(o=l.sent(),e9.current!==e)return[2];if(!o.success||!o.data)return ab(!!o.insufficientCredits),am(null!=(n=o.billingErrorCode)?n:null),au(o.error||"Your mockup could not be created."),[2];return e$.invalidateQueries({queryKey:["billing"]}),e$.invalidateQueries({queryKey:["sidebar"]}),e$.invalidateQueries({queryKey:["payg","status"]}),eM.push("/dashboard/photo-to-mockup/".concat(o.data.mockup_id)),t=!0,[3,9];case 7:return i=l.sent(),e9.current===e&&sR(i),[3,9];case 8:return aX.current=!1,t||(aH(!1),aV(""),e9.current===e&&aY(!0)),[7];case 9:return[2]}})})()},children:["Create for ",W.Q," credits",(0,d.jsx)(y.A,{size:16})]})]})})]})}},59804:(e,t,a)=>{a.d(t,{t:()=>s});var s=[{id:"shirt",name:"Bella+Canvas 3001 \xb7 T-shirt",file:"https://assets.sudomock.com/wor
1kspace/6008358e8e01/workspace-start/psd/t-shirt.psd",image:"https://assets.sudomock.com/workspace/08d5a404f6fd/workspace-start/01-tshirt-lifestyle.png",bytes:0x10588bf},{id:"mug",name:"White Glossy Mug \xb7 11 oz",file:"https://assets.sudomock.com/workspace/0219a0bb9583/workspace-start/psd/mug.psd",image:"https://assets.sudomock.com/workspace/39dcf93be307/workspace-start/02-mug-lifestyle.png",bytes:0xc53034},{id:"poster",name:"Enhanced Matte Framed Poster \xb7 12 \xd7 18 \xb7 Red Oak",file:"https://assets.sudomock.com/workspace/fc1d68a9ab70/workspace-start/psd/framed-poster.psd",image:"https://assets.sudomock.com/workspace/bea7ceecd613/workspace-start/03-framed-poster-lifestyle.png",bytes:0xf5cada}]},68122:(e,t,a)=>{a.d(t,{E:()=>l});var s=a(82732),r=a(17389),o=a(95155),n=a(12115),i=a(43564),l=n.forwardRef(function(e,t){var a=e.className,n=e.variant,l=(0,r._)(e,["className","variant"]);return(0,o.jsx)("div",(0,s._)({ref:t,className:(0,i.cn)("rounded bg-zinc-800/50","shimmer"===(void 0===n?"default":n)?"shimmer":"animate-pulse",a)},l))});l.displayName="Skeleton"},86105:(e,t,a)=>{a.d(t,{c:()=>s});function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=t.onProgress,s=t.onUploaded;return new Promise(function(t){var r=new FormData;r.append("file",e);var o=new XMLHttpRequest;o.open("POST","/api/dashboard/2d-mockup"),o.responseType="json",a&&o.upload.addEventListener("progress",function(e){e.lengthComputable&&!(e.total<=0)&&a(Math.min(1,e.loaded/e.total))}),s&&o.upload.addEventListener("load",function(){return s()}),o.addEventListener("load",function(){var e=o.response;if(e&&"boolean"==typeof e.success)return void t(e);t({success:!1,error:"Upload failed. Please try again.",failureReason:"error"})}),o.addEventListener("error",function(){t({success:!1,error:"Network error. Please check your connection.",failureReason:"error"})}),o.addEventListener("abort",function(){t({success:!1,error:"Upload cancelled.",failureReason:"error"})}),o.send(r)})}}}]);
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.