#!/usr/bin/env node var u=Object.defineProperty;var c=(t,n)=>u(t,"name",{value:n,configurable:!0});var p={admin:"graphql","storefront-graphql":"graphql",partner:"graphql",customer:"graphql","payments-apps":"graphql",functions_cart_checkout_validation:"functions",functions_cart_transform:"functions",functions_delivery_customization:"functions",functions_discount:"functions",functions_fulfillment_constraints:"functions",functions_local_pickup_delivery_option_generator:"functions",functions_order_discounts:"functions",functions_order_routing_location_rule:"functions",functions_payment_customization:"functions",functions_pickup_point_delivery_option_generator:"functions",functions_product_discounts:"functions",functions_shipping_discounts:"functions","polaris-app-home":"components","polaris-admin-extensions":"components","polaris-checkout-extensions":"components","polaris-customer-account-extensions":"components","pos-ui":"components",hydrogen:"components",liquid:"theme"};import{basename as f}from"path";var a=p,_=new Set(["theme"]),g={graphql:"./_validate_graphql.mjs",functions:"./_validate_functions.mjs",components:"./_validate_components.mjs",theme:"./_validate_theme.mjs"};function l(t){for(let n=0;n [validator options]","","Validates generated code against the Shopify topic you name.","`--api` selects the validator; every other flag is passed straight through","to it. Run `scripts/validate.mjs --api --help` for that topic's own","options (they differ: GraphQL topics take --code/--file/--version, UI topics","add --target/--language, and liquid takes --theme-path/--filetype/--context).","",`Valid --api values: ${t.join(", ")}`,""].join(` `)),process.exit(0)}var i=l(s);i||(console.error(`Error: --api is required. Pass the Shopify topic this code targets \u2014 one of: ${Object.keys(a).sort().join(", ")}.`),process.exit(1));var r=a[i];if(!r){let t=Object.keys(a).sort(),n=t.filter(o=>o.startsWith(`${i}_`));console.error(n.length?`Error: "${i}" is a topic, not a validator \u2014 it dispatches on the specific ${i} API. Valid values: ${n.join(", ")}.`:`Error: unknown --api "${i}". Valid values: ${t.join(", ")}.`),process.exit(1)}var m=_.has(r)?h(s):s;process.argv=[process.argv[0],process.argv[1],...m];try{await import(g[r])}catch(t){let n=t instanceof Error?t.message:String(t);console.error(`Error: could not run the ${r} validator for --api ${i}: ${n} Expected it alongside ${f(process.argv[1]||"validate.mjs")}.`),process.exit(1)}