@vcp-dev/contracts 0.10.2 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{z as t}from"zod";import{z as xl}from"zod";var W=xl.uuidv7(),wi=W,iE=W,sE=W,aE=W,oE=W,rE=W,cE=W,R=W,At=W,Pa=W,Ce=W,vi=W,T=W,wa=W,H=W,va=W,Ge=W,Rn=W,Ye=W,mE=W,lE=W,Ca=W,ze=W,Da=W,pE=W,dE=W,uE=W,ht=W,gE=W,_E=W,hE=W;import{z as Tn}from"zod";var ja=Tn.object({primary_products:Tn.string().trim().min(1).max(1e3).optional(),current_markets:Tn.string().trim().min(1).max(1e3).optional(),qualifications:Tn.string().trim().min(1).max(1e3).optional()}).strict();function bE(e){return Object.values(e).some(n=>typeof n=="string"&&n.trim().length>0)}import{z as Wt}from"zod";import{z as Ci}from"zod";var M=e=>Ci.object({code:Ci.number().int(),data:e,message:Ci.string()});var Pt=2e3,El=Wt.object({note:Wt.string().trim().max(Pt),updated_at:Wt.string().min(1)}).strict(),TE=Wt.object({note:Wt.string().trim().max(Pt)}).strict(),kE=M(El.nullable());import{z as Vt}from"zod";var Il=40,St=Vt.object({protocol:Vt.enum(["phone","form","download","route","external"]),ctaLabel:Vt.string().min(1).max(Il),ctaTarget:Vt.string().min(1).max(200).optional(),requiresOwnerDetail:Vt.boolean().optional()});var wt=["queued","preparing_source","building","artifact_ready","deploying","released","lock_failed","source_prepare_failed","build_failed","artifact_fetch_failed","artifact_validation_failed","deploy_failed","cleanup_failed"];function vE(e){let n=e.VCP_REDIS_URL??e.REDIS_URL;if(n){let i=new URL(n);return{url:n,host:i.hostname,port:i.port?Number(i.port):6379,password:i.password?decodeURIComponent(i.password):void 0}}return{host:e.VCP_REDIS_HOST??"127.0.0.1",port:Rl(e.VCP_REDIS_PORT,56379)}}function Rl(e,n){if(!e)return n;let i=Number(e);return Number.isInteger(i)&&i>0?i:n}import{z as X}from"zod";var Na=W,Oa=200,Tl=4e3,La=X.enum(["succeeded","degraded","no_changes","failed"]),Ht=X.enum(["typecheck_unresolved","step_cap_reached","partial_apply_gave_up","patch_protected_dropped","preview_build_failed","preview_runtime_degraded","build_not_verified","external_blocked","cms_reconcile_failed","run_expired","sandbox_unavailable"]),kl=["sandbox_unavailable"];function OE(e){return e!=null&&kl.includes(e)}var Al=X.enum(["pending","delivered","failed"]),Pl=X.enum(["running","succeeded","degraded","no_changes","failed"]),NE=X.object({site_id:R,external_run_id:X.string().min(1).max(Oa),external_thread_id:X.string().min(1).max(Oa),prompt:X.string().min(1).max(Tl),thread_title:X.string().trim().min(1).max(200).optional()}).strict(),Ma=X.object({id:Na,site_id:R,external_run_id:X.string().min(1),external_thread_id:X.string().min(1),status:Pl,outcome:La.nullable(),degraded_reason:Ht.nullable(),vcp_run_id:H.nullable(),vcp_thread_id:Ge.nullable(),base_snapshot_id:T,snapshot_id:T.nullable(),preview_url:X.string().url().nullable(),summary:X.string().nullable(),error_code:X.string().nullable(),build_verified:X.boolean().nullable(),callback_status:Al,created_at:X.string().min(1),started_at:X.string().min(1).nullable(),finished_at:X.string().min(1).nullable()}).strict(),LE=X.object({task:Ma}).strict(),ME=X.object({task:Ma}).strict(),UE=X.object({task_id:Na,external_run_id:X.string().min(1),external_thread_id:X.string().min(1),site_id:R,vcp_run_id:H.nullable(),outcome:La,degraded_reason:Ht.nullable(),snapshot_id:T.nullable(),preview_url:X.string().url().nullable(),summary:X.string().nullable(),error_code:X.string().nullable(),build_verified:X.boolean().nullable(),retryable:X.boolean(),finished_at:X.string().min(1)}).strict(),qE=X.object({received:X.literal(!0)}).strict();import{z as O}from"zod";var Di=O.enum(["text","url","document","image"]),ji=O.enum(["pending","ready","failed"]),wl=O.enum(["pending","ready","failed"]),vl=O.enum(["product","price","contact","copy","audience","other"]),kn=O.object({fact:O.string().min(1).max(300),kind:vl,source_id:ht,quote:O.string().min(1).max(500),trust:O.enum(["verbatim","ocr"]).default("verbatim")}),Cl=O.object({page_type:O.string().min(1).max(40),sections:O.array(O.string().min(1).max(40)).max(12)}),An=O.object({source_id:ht,nav_structure:O.array(O.string().min(1).max(30)).max(12),page_patterns:O.array(Cl).max(10),tone:O.array(O.string().min(1).max(20)).max(8),screenshot_ref:O.string().optional()}),Dl=O.object({source_id:ht,type:Di,status:ji,title:O.string().max(120).optional(),original_ref:O.string().min(1),source_metadata:O.record(O.string(),O.unknown()),error_code:O.string().optional(),submitted:O.boolean().optional()}),Pn=O.object({topic:O.string().min(1).max(80),variants:O.array(O.object({value:O.string().min(1).max(300),source_id:ht})).min(2)}),jl=O.object({type:O.literal("text"),content:O.string().min(20).max(1e4),title:O.string().min(1).max(120).optional()}).strict(),Ol=O.object({type:O.literal("url"),url:O.string().url().max(2048),rights_ack:O.boolean().optional(),title:O.string().min(1).max(120).optional()}).strict(),KE=O.discriminatedUnion("type",[jl,Ol]),BE=[".docx",".html",".md",".txt"],WE=["application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/html","text/markdown","text/x-markdown","text/plain","application/octet-stream"],VE=10*1024*1024,HE=2,$E=O.object({consent_cross_border:O.union([O.literal(!0),O.literal("true")]),consent_text_version:O.string().min(1).max(120),title:O.string().min(1).max(120).optional()}).strict();function YE(e){return e===!0||e==="true"}var XE=[".png",".jpg",".jpeg",".webp"],QE=["image/png","image/jpeg","image/webp","application/octet-stream"],ZE=8*1024*1024,JE=10,Nl=O.enum(["asset","reference"]),eI=O.object({image_role:Nl,title:O.string().min(1).max(120).optional()}).strict(),tI=O.object({version:O.literal(1),site_id:R,tenant_id:O.string().min(1),user_prompt:O.string(),status:wl,sources:O.array(Dl).max(16),facts:O.array(kn).max(120),reference:An.optional(),conflicts:O.array(Pn).max(20)}).superRefine((e,n)=>{let i=new Map(e.sources.map(a=>[a.source_id,a]));for(let[a,s]of e.facts.entries()){let r=i.get(s.source_id);(!r||r.type==="url")&&n.addIssue({code:"custom",path:["facts",a,"source_id"],message:"facts must reference a text/document/image source (never url)"})}if(e.reference){let a=i.get(e.reference.source_id),s=a?.type==="image"&&a.source_metadata.image_role==="reference";(!a||a.type!=="url"&&!s)&&n.addIssue({code:"custom",path:["reference","source_id"],message:"reference must point at a url source or reference image source"})}});function nI(e){for(let n of e.sources)if(n.type==="image"&&n.status==="ready"&&n.source_metadata?.image_role==="reference")return{source_id:n.source_id};return e.reference?.screenshot_ref?{source_id:e.reference.source_id}:null}import{z as D}from"zod";import{z as vn}from"zod";import{z as Z}from"zod";var Pe=Z.string().min(1),wn=Z.string().min(1).refine(e=>e.startsWith("/")&&!e.includes("?")&&!e.includes("#"),{message:"page_path must start with / and must not contain ? or #"}),Ll=Z.object({template_id:Pe,safe_name:Z.string().min(1),entry_file:Z.string().min(1),kind:Z.enum(["default","additional"])}).strict(),oI=Z.object({schema_version:Z.literal(1),route_id:Z.string().min(1),canonical_entry_file:Z.string().min(1),route_key:Z.string().min(1),default_template_id:Pe,templates:Z.array(Ll).min(1)}).strict().superRefine((e,n)=>{let i=new Set,a,s=0;for(let[r,d]of e.templates.entries())i.has(d.template_id)&&n.addIssue({code:"custom",path:["templates",r,"template_id"],message:`Duplicate template_id: ${d.template_id}`}),i.add(d.template_id),d.kind==="default"&&(s+=1,a=d.template_id);s!==1?n.addIssue({code:"custom",path:["templates"],message:"templates must contain exactly one default item"}):a!==e.default_template_id&&n.addIssue({code:"custom",path:["default_template_id"],message:"default_template_id must match the default template"})}),rI=Z.object({page_path:wn,template_id:Pe,instruction:Z.string().min(1)}).strict(),Ua=e=>[...new Set(e)],cI=Z.object({page_path:wn,template_id:Pe,exit_template_ids:Z.array(Pe).default([]).transform(Ua)}).strict(),mI=Z.object({page_path:wn,template_ids:Z.array(Pe).min(1).transform(Ua)}).strict(),Oi={ok:Z.literal(!0),site_id:R,page_path:wn,route_id:Z.string().min(1),default_template_id:Pe,snapshot_id:T,route_mode:Z.literal("delegated")},lI=Z.object({...Oi,template_id:Pe,status:Z.literal("created")}).strict(),pI=Z.object({...Oi,promoted_template_id:Pe,deleted_template_ids:Z.array(Pe),status:Z.literal("promoted")}).strict(),dI=Z.object({...Oi,deleted_template_ids:Z.array(Pe),status:Z.literal("cleaned")}).strict(),uI=Z.enum(["PAGE_TEMPLATE_REQUEST_INVALID","PAGE_TEMPLATE_PAGE_NOT_FOUND","PAGE_TEMPLATE_NOT_FOUND","PAGE_TEMPLATE_ALREADY_EXISTS","PAGE_TEMPLATE_ID_COLLISION","PAGE_TEMPLATE_MANAGED_SOURCE_INVALID","PAGE_TEMPLATE_DEFAULT_PROTECTED","PAGE_TEMPLATE_DEFAULT_ALREADY_ACTIVE","PAGE_TEMPLATE_ASSET_IN_USE","PAGE_TEMPLATE_SNAPSHOT_CONFLICT","PAGE_TEMPLATE_DYNAMIC_ROUTE_UNSUPPORTED","PAGE_TEMPLATE_SOURCE_UNSUPPORTED","PAGE_TEMPLATE_GENERATION_FAILED","PAGE_TEMPLATE_PATCH_FAILED"]);var ae=vn.object({routeId:vn.string().min(1),templateId:Pe.optional()}).strict(),U=vn.object({routeId:vn.string().min(1),effectiveTemplateId:Pe.optional()}).strict();function Ni(e){return JSON.stringify([e.routeId,e.effectiveTemplateId??null])}function SI(e){let n;try{n=JSON.parse(e)}catch{return null}if(!Array.isArray(n)||n.length!==2)return null;let[i,a]=n,s=U.safeParse(a===null?{routeId:i}:{routeId:i,effectiveTemplateId:a});return s.success?s.data:null}var Ml=["design.md","DESIGN.md"],qa=["components/site","src/components/site","lib/generated","src/lib/generated","public"],Ul=["app/globals.css","src/app/globals.css"],ql=[".cjs",".css",".cts",".html",".js",".json",".jsx",".md",".mdx",".mjs",".mts",".ts",".tsx",".txt",".yaml",".yml"],Fl=new Set(ql),Li="source-delete",Fa=D.literal(Li),ge=D.string().min(1).refine(za,"Invalid site edit source path"),Gl=D.string().min(1).refine(Yl,"Invalid site edit source directory path"),xI=D.enum(["text","binary"]),Cn=D.object({composition:U,path:ge,language:D.string().min(1).nullable(),sizeBytes:D.number().int().nonnegative(),contentHash:D.string().min(1).optional()}).strict(),zl=D.discriminatedUnion("kind",[Cn.extend({kind:D.literal("text"),language:D.string().min(1),readonly:D.boolean().default(!1)}),Cn.extend({kind:D.literal("binary"),language:D.null(),mimeType:D.string().min(1).optional(),readonly:D.literal(!0)})]),Ga=D.lazy(()=>D.discriminatedUnion("kind",[D.object({kind:D.literal("directory"),name:D.string().min(1),path:Gl,children:D.array(Ga)}),D.object({kind:D.literal("file"),name:D.string().min(1),path:ge,file:zl}).superRefine((e,n)=>{e.path!==e.file.path&&n.addIssue({code:"custom",path:["file","path"],message:"file.path must match node path"})})])),Kl=D.enum(["max-files","max-depth","max-total-bytes"]),Bl=D.object({reasons:D.array(Kl).min(1),maxFiles:D.number().int().positive(),maxDepth:D.number().int().positive(),maxTotalBytes:D.number().int().positive()}),EI=D.object({composition:U,nodes:D.array(Ga),defaultPath:ge.optional(),totalFiles:D.number().int().nonnegative(),truncated:Bl.optional()}).strict(),II=D.object({composition:ae}).strict(),RI=D.object({path:ge,composition:ae}).strict(),Wl=Cn.extend({kind:D.literal("text"),language:D.string().min(1),readonly:D.boolean().default(!1),content:D.string()}),Vl=D.enum(["too-large","unsupported-mime","bytes-unavailable"]),Hl=Cn.extend({kind:D.literal("binary"),language:D.null(),readonly:D.literal(!0),mimeType:D.string().min(1),contentBase64:D.string().min(1).optional(),previewUnavailableReason:Vl.optional()}),TI=D.discriminatedUnion("kind",[Wl,Hl]),kI=D.object({key:D.string().min(1),composition:ae}).strict(),$l=D.object({startLine:D.number().int().positive(),startColumn:D.number().int().nonnegative(),endLine:D.number().int().positive(),endColumn:D.number().int().nonnegative()}),AI=D.object({key:D.string().min(1),composition:U,sourceFile:ge,componentName:D.string().min(1),openingElementRange:$l,structuralPath:D.string().min(1),textPreview:D.string().min(1).optional()}).strict();function za(e){return!Va(e)||Wa(e)?!1:qi(e)||Ba(e)||Ka(e)||qa.some(n=>e===n||e.startsWith(`${n}/`))}function Mi(e){return qi(e)||Fl.has(Ql(e))}function Yl(e){return!Va(e)||Wa(e)?!1:e==="app"||e.startsWith("app/")||e==="src"||e==="src/app"||e.startsWith("src/app/")||qa.some(n=>e===n||e.startsWith(`${n}/`)||n.startsWith(`${e}/`))}function Xl(e){return qi(e)}function Ui(e){return za(e)?Xl(e)?"design-document":Ka(e)?"route-entry":Ba(e)?"app-global-style":e.toLowerCase()==="lib/generated/media-assets.ts"||e.toLowerCase()==="src/lib/generated/media-assets.ts"?"generated-media-manifest":null:null}function PI(e){return Ui(e)!==null}function Ka(e){return/^(?:src\/)?app\/(?:.*\/)?page\.[cm]?[jt]sx?$/.test(e.toLowerCase())}function Ba(e){return Ul.some(n=>n.toLowerCase()===e.toLowerCase())}function Ql(e){let n=e.split("/").at(-1)??e,i=n.lastIndexOf(".");return i>0?n.slice(i).toLowerCase():""}function qi(e){return!e.includes("/")&&Ml.some(n=>n.toLowerCase()===e.toLowerCase())}function Wa(e){let n=e.toLowerCase(),i=n.split("/"),s=(i.at(-1)??n).replace(/\.[^.]+$/,"");return/^(?:src\/)?app\/api(?:\/|$)/.test(n)||/^(?:src\/)?app\/(?:.*\/)?route\.[cm]?[jt]sx?$/.test(n)||/^(?:src\/)?app\/(?:.*\/)?(?:action|actions)\.[cm]?[jt]sx?$/.test(n)||/(^|\/)[^/]+\.server\.[cm]?[jt]sx?$/.test(n)||n==="lib/server"||n.startsWith("lib/server")||n==="src/lib/server"||n.startsWith("src/lib/server")||n==="lib/db"||n.startsWith("lib/db")||n==="src/lib/db"||n.startsWith("src/lib/db")||n==="lib/cms"||n.startsWith("lib/cms/")||n==="src/lib/cms"||n.startsWith("src/lib/cms/")?!0:s==="server"||s==="db"||s==="database"||s==="auth"||s==="secret"||s==="secrets"||s==="token"||s==="tokens"||s==="credential"||s==="credentials"||i.includes("server")||i.includes("secrets")}function Va(e){return!e||e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(n=>!(n.length===0||n==="."||n===".."||n.startsWith(".")||n==="package.json"||n==="node_modules"||n==="recipes"||n.startsWith(".env")))}import{z as Zl}from"zod";var $t=["zh-CN","zh-HK","zh-TW","en-US","en-GB","ja-JP","ko-KR","es-ES","fr-FR","de-DE","pt-PT","ru-RU","ar-SA","id-ID","vi-VN","th-TH","it-IT","nl-NL","tr-TR","pl-PL","uk-UA","cs-CZ","sk-SK","hu-HU","ro-RO","el-GR","sv-SE","da-DK","fi-FI","hr-HR","lt-LT","lv-LV","et-EE","ga-IE","mt-MT","ka-GE","fa-IR","bn-BD","ta-IN","si-LK","ms-MY","fil-PH","my-MM","km-KH","lo-LA","mn-MN","kk-KZ"],Jl=["en","ja","es","fr","de","ko","pt","pt-BR","it","ru","ar","hi","id","vi","th","tr","nl","pl","uk","sv","da","fi","no","cs","el","hu","ro","he","ms","fil","bn","ta","ca","sk","hr","bg","lt","lv","et","fa","sw","sr","is"],ep=[...$t,...Jl],tp=new Set(["ar","fa","he"]),CI=[{code:"zh-CN",label:"\u7B80\u4F53\u4E2D\u6587",englishName:"Chinese (Simplified)"},{code:"zh-HK",label:"\u7E41\u9AD4\u4E2D\u6587\uFF08\u9999\u6E2F\uFF09",englishName:"Chinese (Traditional, Hong Kong)"},{code:"zh-TW",label:"\u7E41\u9AD4\u4E2D\u6587\uFF08\u53F0\u7063\uFF09",englishName:"Chinese (Traditional, Taiwan)"},{code:"en-US",label:"English (US)",englishName:"English (United States)",common:!0},{code:"en-GB",label:"English (UK)",englishName:"English (United Kingdom)",common:!0},{code:"ja-JP",label:"\u65E5\u672C\u8A9E",englishName:"Japanese"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4",englishName:"Korean"},{code:"es-ES",label:"Espa\xF1ol",englishName:"Spanish"},{code:"fr-FR",label:"Fran\xE7ais",englishName:"French"},{code:"de-DE",label:"Deutsch",englishName:"German"},{code:"pt-PT",label:"Portugu\xEAs",englishName:"Portuguese"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",englishName:"Russian"},{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",englishName:"Arabic"},{code:"id-ID",label:"Bahasa Indonesia",englishName:"Indonesian"},{code:"vi-VN",label:"Ti\u1EBFng Vi\u1EC7t",englishName:"Vietnamese"},{code:"th-TH",label:"\u0E44\u0E17\u0E22",englishName:"Thai"},{code:"it-IT",label:"Italiano",englishName:"Italian"},{code:"nl-NL",label:"Nederlands",englishName:"Dutch"},{code:"tr-TR",label:"T\xFCrk\xE7e",englishName:"Turkish"},{code:"pl-PL",label:"Polski",englishName:"Polish"},{code:"uk-UA",label:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",englishName:"Ukrainian"},{code:"cs-CZ",label:"\u010Ce\u0161tina",englishName:"Czech"},{code:"sk-SK",label:"Sloven\u010Dina",englishName:"Slovak"},{code:"hu-HU",label:"Magyar",englishName:"Hungarian"},{code:"ro-RO",label:"Rom\xE2n\u0103",englishName:"Romanian"},{code:"el-GR",label:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC",englishName:"Greek"},{code:"sv-SE",label:"Svenska",englishName:"Swedish"},{code:"da-DK",label:"Dansk",englishName:"Danish"},{code:"fi-FI",label:"Suomi",englishName:"Finnish"},{code:"hr-HR",label:"Hrvatski",englishName:"Croatian"},{code:"lt-LT",label:"Lietuvi\u0173",englishName:"Lithuanian"},{code:"lv-LV",label:"Latvie\u0161u",englishName:"Latvian"},{code:"et-EE",label:"Eesti",englishName:"Estonian"},{code:"ga-IE",label:"Gaeilge",englishName:"Irish"},{code:"mt-MT",label:"Malti",englishName:"Maltese"},{code:"ka-GE",label:"\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8",englishName:"Georgian"},{code:"fa-IR",label:"\u0641\u0627\u0631\u0633\u06CC",englishName:"Persian"},{code:"bn-BD",label:"\u09AC\u09BE\u0982\u09B2\u09BE",englishName:"Bengali"},{code:"ta-IN",label:"\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD",englishName:"Tamil"},{code:"si-LK",label:"\u0DC3\u0DD2\u0D82\u0DC4\u0DBD",englishName:"Sinhala"},{code:"ms-MY",label:"Bahasa Melayu",englishName:"Malay"},{code:"fil-PH",label:"Filipino",englishName:"Filipino"},{code:"my-MM",label:"\u1019\u103C\u1014\u103A\u1019\u102C",englishName:"Burmese"},{code:"km-KH",label:"\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A",englishName:"Khmer"},{code:"lo-LA",label:"\u0EA5\u0EB2\u0EA7",englishName:"Lao"},{code:"mn-MN",label:"\u041C\u043E\u043D\u0433\u043E\u043B",englishName:"Mongolian"},{code:"kk-KZ",label:"\u049A\u0430\u0437\u0430\u049B",englishName:"Kazakh"}],np={en:"en-US",ja:"ja-JP",es:"es-ES",fr:"fr-FR",de:"de-DE",ko:"ko-KR",pt:"pt-PT",it:"it-IT",ru:"ru-RU",ar:"ar-SA",id:"id-ID",vi:"vi-VN",th:"th-TH",tr:"tr-TR",nl:"nl-NL",pl:"pl-PL",uk:"uk-UA",sv:"sv-SE",da:"da-DK",fi:"fi-FI",cs:"cs-CZ",el:"el-GR",hu:"hu-HU",ro:"ro-RO",ms:"ms-MY",fil:"fil-PH",bn:"bn-BD",ta:"ta-IN",sk:"sk-SK",hr:"hr-HR",lt:"lt-LT",lv:"lv-LV",et:"et-EE",fa:"fa-IR"},ip=new Set($t);function Ha(e){return ip.has(e)?e:np[e]}var sp="en";function DI(e){let n=e.toLowerCase().split("-",1)[0]??"";return tp.has(n)?"rtl":"ltr"}var ap={cmn:"zh-CN",eng:"en",jpn:"ja",spa:"es",fra:"fr",deu:"de",kor:"ko",por:"pt",ita:"it",rus:"ru",arb:"ar",ara:"ar",hin:"hi",ind:"id",vie:"vi",tha:"th",tur:"tr",nld:"nl",pol:"pl",ukr:"uk",swe:"sv",dan:"da",fin:"fi",nob:"no",nor:"no",ces:"cs",ell:"el",hun:"hu",ron:"ro",heb:"he",msa:"ms",zsm:"ms",tgl:"fil",ben:"bn",tam:"ta",cat:"ca",slk:"sk",hrv:"hr",bul:"bg",lit:"lt",lav:"lv",est:"et",pes:"fa",fas:"fa",swh:"sw",swa:"sw",srp:"sr",isl:"is"};function jI(e){return ap[e]??sp}var op=["zh-CN","zh-HK","zh-TW","ja-JP","ja","ko-KR","ko","ru-RU","ru","uk-UA","uk","bg","sr","mn-MN","kk-KZ","ar-SA","ar","fa-IR","fa","he","hi","th-TH","th","el-GR","el","ka-GE","bn-BD","bn","ta-IN","ta","si-LK","my-MM","km-KH","lo-LA"],rp=new Set(op);function OI(e){return rp.has(e)}var _e=Zl.enum(ep);import{z as cp}from"zod";var $a=cp.string().uuid();import{z as o}from"zod";var le=o.string().trim().min(1).max(128),at=o.string().trim().min(1).max(200),Ue=o.string().trim().min(1).max(2e3),Gi=o.string().trim().max(200),Yt=o.string().regex(/^[a-f0-9]{64}$/),zi=o.enum(["en-US","zh-CN","zh-TW","fr-FR","de-DE","es-ES","ja-JP","ko-KR"]),ft=["market","persona","product","brand","competition","structure","language","seogeo","content","conversion","risk"],xe=ft.length,Nn=o.enum(ft),Ln=Nn,Za=["recommended","conservative","focused"],vt=o.enum(Za),Mn=o.enum(["single_country","regional_combination","multi_market"]),Un=o.object({code:o.string().trim().regex(/^[A-Z]{2}$/),name_zh:at,name_en:at,region:at}).strict(),Fi=o.object({id:vt,label:at,note:Ue,impact:o.string().trim().max(500).nullish(),set_value:o.string().trim().max(500).nullish(),site_locale:_e.nullish(),market_type:Mn.nullish(),markets:o.array(Un).max(32).optional()}).loose(),mp=o.object({lead:o.string().trim().min(1).max(500),title:at,columns:o.array(o.string().trim().min(1).max(80)).min(1).max(8),rows:o.array(o.array(o.string().trim().max(500)).min(1).max(8)).max(100)}).strict().superRefine((e,n)=>{e.rows.forEach((i,a)=>{i.length!==e.columns.length&&n.addIssue({code:"custom",path:["rows",a],message:"Each Step5 plan row must match the column count."})})}),lp=o.object({goal:Ue,issue:Ue,criteria:o.array(Ue).min(1).max(12),resources:o.array(Ue).min(1).max(12),risks:o.array(Ue).min(1).max(12),execution:o.object({standard:o.array(Ue).min(1).max(12),acceptance:o.array(Ue).min(1).max(12),downstream:o.array(Ue).min(1).max(12)}).strict()}).strict(),pp=o.object({source_type:o.enum(["step2","step3"]),source_id:le,field_path:o.string().trim().max(300).nullish()}).strict(),dp=o.enum(["ready","disabled","empty","timeout","rate_limited","quota_exhausted","failed"]),up=["INFORMATIONAL","NAVIGATIONAL","COMMERCIAL","TRANSACTIONAL"],Ja=o.enum(up),Dn=50,jn=60,Ya=7,FI=["COMMERCIAL","TRANSACTIONAL"],gp=["C","T"];function eo(e){return gp.includes(e)}var _p=o.object({id:le,term:o.string().trim().min(1).max(255),source_type:o.enum(["step2","step3","step5"]),source_id:le,field_path:o.string().trim().min(1).max(300),source_field:o.string().trim().min(1).max(300).optional(),source_evidence:o.string().trim().min(1).max(2e3).optional(),business_subject:o.string().trim().min(1).max(255).optional(),reason:o.string().trim().min(1).max(1e3).optional()}).strict(),hp=o.object({keyword:o.string().trim().min(1).max(255),normalized_keyword:o.string().trim().min(1).max(255),intents:o.array(Ja).min(1).max(4),search_volume:o.number().int().min(Dn),keyword_difficulty:o.number().min(0).max(jn),cpc:o.number().nonnegative().nullish(),trend:o.array(o.number().int().min(0).max(100)).length(12),serp_features:o.array(o.string().trim().min(1).max(80)).max(64),fit:o.object({seo:o.number().int().min(0).max(100),geo:o.number().int().min(0).max(100),buyer:o.number().int().min(0).max(100)}).strict(),recommended_channel:o.enum(["SEO","GEO","DUAL"]),priority:o.enum(["P0","P1","P2","P3"]),already_in_plan:o.boolean(),page_level:o.union([o.literal(1),o.literal(2)]).default(1)}).strict(),Sp=o.object({id:le,intent:Ja,title:at,landing_page_type:o.enum(["blog","product","category","landing"]),keywords:o.array(hp).min(1).max(100)}).strict(),fp=o.enum(["NO_SEEDS","NO_PROVIDER_CANDIDATES","NO_METRIC_ELIGIBLE_CANDIDATES","NO_COMMERCIAL_INTENT_CANDIDATES","NO_FIT_ELIGIBLE_CANDIDATES"]),bp=o.object({fetched_count:o.number().int().nonnegative(),unique_count:o.number().int().nonnegative(),metric_gate_pass_count:o.number().int().nonnegative(),commercial_intent_pass_count:o.number().int().nonnegative(),fit_pass_count:o.number().int().nonnegative(),selected_count:o.number().int().nonnegative()}).strict().superRefine((e,n)=>{let i=[e.fetched_count,e.unique_count,e.metric_gate_pass_count,e.commercial_intent_pass_count,e.fit_pass_count,e.selected_count];i.some((a,s)=>s>0&&a>i[s-1])&&n.addIssue({code:"custom",message:"Semrush selection counts must be monotonically non-increasing."})}),Xa={provider:o.literal("semrush"),api_version:o.literal("v4"),fetched_at:o.string().datetime({offset:!0}),context_hash:Yt,status:dp,seeds:o.array(_p).max(20),intent_groups:o.array(Sp).max(16),selection_summary:bp.optional(),empty_reason_code:fp.nullish(),error_code:o.string().trim().regex(/^[A-Z0-9_]+$/).max(64).nullish()},yp=o.discriminatedUnion("schema_version",[o.object({schema_version:o.literal(1),...Xa,database:o.string().trim().regex(/^[A-Z]{2}$/),country:o.string().trim().regex(/^[A-Z]{2}$/)}).strict(),o.object({schema_version:o.literal(2),...Xa,database:o.string().trim().regex(/^[a-z]{2}$/),country:o.string().trim().regex(/^[A-Z]{2}$/)}).strict()]).superRefine((e,n)=>{if(e.schema_version===1&&e.database!==e.country&&n.addIssue({code:"custom",path:["database"],message:"Semrush database must match the ISO country code."}),e.status==="ready"&&e.intent_groups.length===0&&n.addIssue({code:"custom",path:["intent_groups"],message:"Ready Semrush recommendations require an intent group."}),e.status==="ready"&&e.error_code&&n.addIssue({code:"custom",path:["error_code"],message:"Ready Semrush recommendations cannot contain an error code."}),e.empty_reason_code&&e.status!=="empty"&&n.addIssue({code:"custom",path:["empty_reason_code"],message:"Semrush empty reason is only valid for an empty snapshot."}),e.selection_summary){let i=e.intent_groups.reduce((a,s)=>a+s.keywords.length,0);e.selection_summary.selected_count!==i&&n.addIssue({code:"custom",path:["selection_summary","selected_count"],message:"Semrush selected count must match the persisted keywords."})}}),to=0,xp=o.union([o.literal(to),o.literal(1)]),GI=o.object({seed_keyword:o.string().trim().min(1).max(255),database:o.string().trim().toLowerCase().regex(/^[a-z]{2}$/).default("us"),limit:o.number().int().min(1).max(100).default(20),offset:o.number().int().nonnegative().default(0),min_search_volume:o.number().int().nonnegative().default(Dn),max_keyword_difficulty:o.number().finite().min(0).max(100).default(jn),min_relevance_score:xp.default(to)}).strict(),Ep=o.object({keyword:o.string().trim().min(1).max(255),search_volume:o.number().int().nonnegative().nullable(),keyword_difficulty:o.number().nonnegative().nullable(),cpc:o.number().nonnegative().nullable(),competition:o.number().nonnegative().nullable(),result_count:o.number().int().nonnegative().nullable(),intent:o.string().trim().max(64).nullable(),trend:o.array(o.string()).nullable(),serp_features:o.array(o.string()).nullable(),fit:o.number().finite().min(0).max(10),currency:o.string().trim().regex(/^[A-Z]{3}$/).nullable()}).strict(),Ip=o.object({request_id:o.string().trim().min(1).max(128),snapshot_id:o.string().uuid(),seed_keyword:o.string().trim().min(1).max(255),database:o.string().trim().min(1).max(16),limit:o.number().int().min(1).max(100),offset:o.number().int().nonnegative(),freshness:o.enum(["live","cached","historical"]),collected_at:o.string().datetime({offset:!0}),items:o.array(Ep).max(100),result_count:o.number().int().nonnegative()}).strict(),zI=o.object({code:o.literal(0),message:o.string(),data:Ip}).strict(),KI=o.object({snapshot_id:o.string().uuid(),selected_keywords:o.array(o.string().trim().min(2).max(160)).min(1).max(50)}).strict(),Rp=o.object({candidate_id:le,keyword:o.string().trim().min(2).max(160),classification_status:o.string().trim().min(1).max(64),selection_status:o.string().trim().min(1).max(64),selected_at:o.string().datetime({offset:!0})}).strict(),Tp=o.object({selection_batch_id:le,snapshot_id:o.string().uuid(),selected_count:o.number().int().nonnegative(),created_count:o.number().int().nonnegative(),updated_count:o.number().int().nonnegative(),deselected_count:o.number().int().nonnegative(),items:o.array(Rp).max(50)}).strict().superRefine((e,n)=>{e.selected_count!==e.items.length&&n.addIssue({code:"custom",path:["selected_count"],message:"selected_count must equal items.length."})}),BI=o.object({code:o.literal(0),message:o.string(),data:Tp}).strict(),kp=o.enum(["ok","degraded"]),Ap=["category","selection","application","parameter","cost","trust","compliance","delivery"],no=o.object({id:le,question:o.string().trim().min(8).max(300).refine(e=>/^[\x20-\x7E]+$/.test(e)),question_type:o.enum(Ap),intent_strength:o.enum(["high","medium","low"]),source:o.enum(["ai_generation","user_input"])}).strict(),Pp=no.extend({source:o.literal("ai_generation")}).strict(),Ki=o.object({key:Ln,position:o.number().int().min(1).max(xe),category:at,title:at,summary:Ue,rationale:Ue,parameter:o.string().trim().max(500).nullish(),options:o.tuple([Fi,Fi,Fi]),plan:mp.nullish(),structure_detail:lp.nullish(),note_tips:o.array(o.string().trim().min(1).max(200)).max(6),note_placeholder:o.string().trim().min(1).max(300),evidence_refs:o.array(pp).min(1).max(8),semrush_recommendations:yp.nullish(),seo_payload:o.lazy(()=>Bi).nullish(),geo_questions:o.array(Pp).max(20).optional(),generation_status:kp.optional()}).loose().superRefine((e,n)=>{let i=ft.indexOf(e.key)+1;e.position!==i&&n.addIssue({code:"custom",path:["position"],message:`Step5 strategy ${e.key} uses an invalid position.`}),e.options.forEach((a,s)=>{a.id!==Za[s]&&n.addIssue({code:"custom",path:["options",s,"id"],message:"Step5 strategy options must use the canonical order."})}),e.semrush_recommendations&&e.key!=="seogeo"&&n.addIssue({code:"custom",path:["semrush_recommendations"],message:"Semrush recommendations are only valid for the seogeo item."}),e.seo_payload&&e.key!=="seogeo"&&n.addIssue({code:"custom",path:["seo_payload"],message:"SEO payloads are only valid for the seogeo item."}),(e.geo_questions?.length??0)>0&&e.key!=="seogeo"&&n.addIssue({code:"custom",path:["geo_questions"],message:"GEO questions are only valid for the seogeo item."}),e.structure_detail&&e.key!=="structure"&&n.addIssue({code:"custom",path:["structure_detail"],message:"Structure detail is only valid for the structure item."}),e.geo_questions&&new Set(e.geo_questions.map(a=>a.question.trim().toLocaleLowerCase())).size!==e.geo_questions.length&&n.addIssue({code:"custom",path:["geo_questions"],message:"GEO citation questions must be unique."})}),On=9,io=o.object({id:le,type:o.union([o.literal(1),o.literal(2)]).default(1),cells:o.tuple([o.string().trim().max(500),o.string().trim().max(500),o.string().trim().max(500),o.string().trim().max(500),o.string().trim().max(500),o.string().trim().max(500)])}).strict(),wp=2,vp=0,WI=20,Cp=50,so=o.object({id:le,keyword:o.string().trim().min(1).max(500),intent_code:o.string().trim().min(1).max(16),intent_type:o.string().trim().min(1).max(200),strength:o.enum(["high","medium"]),search_volume:o.number().int().nonnegative().nullable(),cpc:o.number().finite().nonnegative().nullable()}).strict(),Dp=so.superRefine((e,n)=>{eo(e.intent_code)||n.addIssue({code:"custom",path:["intent_code"],message:"New legacy SEO keyword selections must use commercial or transactional intent."})}),qn=o.object({id:le,keyword:o.string().trim().min(2).max(160),normalized_keyword:o.string().trim().min(2).max(160),intc:o.enum(["I","N","C","T"]),keyword_type:o.string().trim().min(1).max(80),intent_strength:o.enum(["high","medium","low"]),monthly_volume:o.number().int().nonnegative().nullable(),keyword_difficulty:o.number().finite().min(0).max(100).nullable(),fit:o.number().finite().min(0).max(10).nullable(),sem_cpc:o.number().finite().nonnegative().nullable(),currency:o.string().trim().regex(/^[A-Z]{3}$/).nullable(),landing_page:o.string().trim().regex(/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*(?:\/[a-z0-9]+(?:-[a-z0-9]+)*)*)?$/),content_format:o.string().trim().min(1).max(80),priority:o.enum(["P0","P1","P2","P3"]),source:o.enum(["step5_generation","semrush"]),source_market:o.string().trim().toLowerCase().regex(/^[a-z]{2,8}$/),metric_timestamp:o.string().datetime({offset:!0}).nullable()}).strict().superRefine((e,n)=>{let i=ro(e.keyword);e.normalized_keyword!==i&&n.addIssue({code:"custom",path:["normalized_keyword"],message:"normalized_keyword must match the canonical keyword form."})}),jp=o.object({request_id:o.string().trim().min(1).max(128),snapshot_id:le,selected_keywords:o.array(o.string().trim().min(2).max(160)).min(1).max(50)}).strict(),Bi=o.object({schema_version:o.literal(wp),seo_keywords:o.array(qn).min(vp).max(Cp),semrush_snapshot_refs:o.array(jp).max(20).optional(),geo_questions:o.array(no).max(20).optional()}).strict().superRefine(Wp),Op=Bi.superRefine((e,n)=>{e.seo_keywords.forEach((i,a)=>{eo(i.intc)||n.addIssue({code:"custom",path:["seo_keywords",a,"intc"],message:"New SEO keyword selections must use commercial or transactional intent."})})}),Np=o.object({rows:o.array(io).max(100).optional(),seo_keywords:o.array(so).max(100).optional()}).strict(),Lp=o.object({rows:o.array(io).max(100).optional(),seo_keywords:o.array(Dp).max(100).optional()}).strict(),Mp=o.union([Bi,Np]),ao=o.union([Op,Lp]),Up=o.object({item_key:Nn,selected_option_id:vt,note:Gi,custom_payload:ao.optional()}).strict().superRefine((e,n)=>{e.item_key==="seogeo"&&e.custom_payload&&!("schema_version"in e.custom_payload)&&Bp(e.custom_payload,n)}),Wi=o.object({item_key:Nn,selected_option_id:vt,note:Gi,custom_payload:Mp.optional(),market_type:Mn.nullish(),markets:o.array(Un).max(32).optional(),selected_value:o.unknown().nullable(),accepted_at:o.string().datetime({offset:!0})}).loose(),qp=o.enum(["running","succeeded","failed"]),Fp=o.object({schema_version:o.literal(1),source_job_id:le,site_id:le,output_locale:zi.optional(),items:o.array(Ki).length(xe),decisions:o.array(Wi).length(xe)}).loose(),Gp=o.object({strategy_version_id:le,site_id:le,source_job_id:le,output_locale:zi.optional(),version:o.number().int().positive(),checksum:Yt,snapshot:Fp,committed_at:o.string().datetime({offset:!0})}).loose(),oo=o.object({job_id:le,site_id:le,output_locale:zi.optional(),status:qp,revision:o.number().int().nonnegative(),items:o.array(Ki).max(xe),decisions:o.array(Wi).max(xe),output_checksum:Yt.nullish(),error_code:o.string().trim().max(64).nullish(),error_message:o.string().trim().max(500).nullish(),committed_version:Gp.nullish()}).loose().superRefine((e,n)=>{let i=e.items.map(s=>s.key);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["items"],message:"Step5 job items must have unique keys."});let a=e.decisions.map(s=>s.item_key);new Set(a).size!==a.length&&n.addIssue({code:"custom",path:["decisions"],message:"Step5 job decisions must have unique item keys."})}),VI=o.object({force_refresh:o.boolean().optional().default(!1)}).strict(),HI=oo.extend({cached:o.boolean()}).strict(),$I=o.object({expected_revision:o.number().int().nonnegative()}).strict(),YI=o.object({expected_revision:o.number().int().nonnegative(),selected_option_id:vt,note:Gi,custom_payload:ao.optional()}).strict(),XI=o.object({revision:o.number().int().positive(),decision:Wi}).strict(),QI=o.object({idempotency_key:o.string().trim().min(8).max(128),expected_revision:o.number().int().nonnegative(),decisions:o.array(Up).length(xe)}).strict().superRefine((e,n)=>{let i=e.decisions.map(a=>a.item_key);new Set(i).size!==ft.length&&n.addIssue({code:"custom",path:["decisions"],message:`Step5 commit must contain ${xe} unique decisions.`}),ft.forEach(a=>{i.includes(a)||n.addIssue({code:"custom",path:["decisions"],message:`Step5 commit is missing ${a}.`})})}),ZI=o.object({strategy_version_id:le,version:o.number().int().positive(),checksum:Yt,next_path:o.string().trim().min(1).max(500)}).strict(),zp=oo.extend({completed:o.number().int().min(0).max(xe),total:o.literal(xe)}).loose(),Kp=["snapshot","strategy_item_start","strategy_item_done","strategy_items_invalidated","strategy_generation_done","failed"];function JI(e){return typeof e=="string"&&Kp.includes(e)}var eR=o.discriminatedUnion("event",[o.object({id:o.number().int().nonnegative(),event:o.literal("snapshot"),data:zp}).strict(),o.object({id:o.number().int().positive(),event:o.literal("strategy_item_start"),data:o.object({key:Nn,position:o.number().int().min(1).max(xe)}).strict()}).strict(),o.object({id:o.number().int().positive(),event:o.literal("strategy_item_done"),data:o.object({item:Ki}).strict()}).strict(),o.object({id:o.number().int().positive(),event:o.literal("strategy_items_invalidated"),data:o.object({after_position:o.number().int().min(0).max(xe)}).strict()}).strict(),o.object({id:o.number().int().positive(),event:o.literal("strategy_generation_done"),data:o.object({item_count:o.literal(xe),schema_version:o.literal(1),checksum:Yt}).strict()}).strict(),o.object({id:o.number().int().positive(),event:o.literal("failed"),data:o.object({code:o.string().trim().min(1).max(64),message:o.string().trim().min(1).max(500),retryable:o.boolean(),item_key:Ln.optional()}).loose()}).loose()]);function Qa(e){let n=e.trim().toLocaleLowerCase();return n===""||n==="/"?"/":`/${n.replace(/^\/+|\/+$/g,"")}`}function Bp(e,n){let i=(e.rows??[]).filter(s=>s.type===1);e.rows&&i.length===0&&n.addIssue({code:"custom",path:["custom_payload","rows"],message:"SEO plans must keep at least one primary page."});let a=i.some(s=>Qa(s.cells[3])==="/");i.length+(a?0:1)>On&&n.addIssue({code:"custom",path:["custom_payload","rows"],message:`Initial generation supports at most ${On} primary pages including home.`}),i.forEach((s,r)=>{/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*)?$/.test(Qa(s.cells[3]))||n.addIssue({code:"custom",path:["custom_payload","rows",r,"cells",3],message:"Primary intent pages must use root or one-segment kebab-case paths."})})}function ro(e){return e.normalize("NFKC").trim().replace(/\s+/g," ").toLowerCase()}function Wp(e,n){let i=new Set;e.seo_keywords.forEach((r,d)=>{i.has(r.normalized_keyword)&&n.addIssue({code:"custom",path:["seo_keywords",d,"normalized_keyword"],message:"SEO keywords must be unique after Unicode normalization."}),i.add(r.normalized_keyword),(r.monthly_volume===null||r.monthly_volume<Dn)&&n.addIssue({code:"custom",path:["seo_keywords",d,"monthly_volume"],message:`Selected SEO keywords require monthly_volume >= ${Dn}.`}),(r.keyword_difficulty===null||r.keyword_difficulty>jn)&&n.addIssue({code:"custom",path:["seo_keywords",d,"keyword_difficulty"],message:`Selected SEO keywords require keyword_difficulty <= ${jn}.`}),(r.fit===null||r.fit<Ya)&&n.addIssue({code:"custom",path:["seo_keywords",d,"fit"],message:`Selected SEO keywords require fit >= ${Ya.toFixed(1)}.`})});let a=new Set((e.semrush_snapshot_refs??[]).flatMap(r=>r.selected_keywords.map(ro)));e.seo_keywords.forEach((r,d)=>{r.source==="semrush"&&!a.has(r.normalized_keyword)&&n.addIssue({code:"custom",path:["seo_keywords",d,"source"],message:"Semrush keywords must reference a persisted Semrush snapshot selection."})});let s=(e.geo_questions??[]).map(r=>r.question.trim().toLocaleLowerCase());new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["geo_questions"],message:"GEO citation questions must be unique."})}import{z as Vp}from"zod";var qe=Vp.string().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/);function iR(e,n){let i=qe.safeParse(e),a=qe.safeParse(n);if(!i.success||!a.success)return null;let s=co(i.data),r=co(a.data);for(let c=0;c<3;c+=1){let g=mo(s.release[c],r.release[c]);if(g!==0)return g}if(!s.prerelease&&!r.prerelease)return 0;if(!s.prerelease)return 1;if(!r.prerelease)return-1;let d=Math.max(s.prerelease.length,r.prerelease.length);for(let c=0;c<d;c+=1){let g=s.prerelease[c],k=r.prerelease[c];if(g===void 0)return-1;if(k===void 0)return 1;if(g===k)continue;let I=/^\d+$/u.test(g),C=/^\d+$/u.test(k);return I&&C?mo(BigInt(g),BigInt(k)):I?-1:C?1:Hp(g,k)}return 0}function co(e){let n=e.indexOf("+"),i=n===-1?e:e.slice(0,n),a=i.indexOf("-"),s=a===-1?i:i.slice(0,a),r=a===-1?void 0:i.slice(a+1),[d,c,g]=s.split(".");return{release:[BigInt(d),BigInt(c),BigInt(g)],...r?{prerelease:r.split(".")}:{}}}function mo(e,n){return e<n?-1:e>n?1:0}function Hp(e,n){return e<n?-1:e>n?1:0}import{z as V}from"zod";import{z as Ee}from"zod";var Vi=64,$p=512*1024,Hi=4*1024*1024,Yp=/^(?!\/)(?!.*\\)(?!.*(?:^|\/)\.\.(?:\/|$))(?!.*\/\/).+/;function Xp(e){return Yp.test(e)}var lo=Ee.string().min(1).refine(Xp,{message:"Materialization pathTemplate must be a safe relative path."}),Qp=Ee.object({pathTemplate:lo,content:Ee.string(),role:Ee.string().min(1).optional()}).strict(),Zp=Ee.union([Ee.object({kind:Ee.literal("default")}).strict(),Ee.object({kind:Ee.literal("named"),name:Ee.string().min(1)}).strict()]),Jp=Ee.object({pathTemplate:lo,export:Zp}).strict(),ed=Ee.array(Ee.never()).optional(),bt=Ee.object({instanceBaseName:Ee.string().min(1),files:Ee.array(Qp).min(1).max(Vi),entry:Jp,dataRequirements:ed}).strict().superRefine((e,n)=>{let i=new Set,a=e.entry.pathTemplate,s=0;for(let[r,d]of e.files.entries()){i.has(d.pathTemplate)&&n.addIssue({code:"custom",path:["files",r,"pathTemplate"],message:`Duplicate materialization pathTemplate: ${d.pathTemplate}`}),i.add(d.pathTemplate);let c=new TextEncoder().encode(d.content).length;c>$p&&n.addIssue({code:"custom",path:["files",r,"content"],message:"Materialization file content exceeds the per-file byte limit."}),s+=c}i.has(a)||n.addIssue({code:"custom",path:["entry","pathTemplate"],message:"Materialization entry pathTemplate must match a file."}),s>Hi&&n.addIssue({code:"custom",path:["files"],message:"Materialization exceeds the total content byte limit."})});var po="insertNewComponent",mR={categoryGroupMissing:"DESIGNER_COMPONENT_CATEGORY_GROUP_MISSING",unavailable:"DESIGNER_COMPONENT_LIBRARY_UNAVAILABLE",timeout:"DESIGNER_COMPONENT_LIBRARY_TIMEOUT",invalidResponse:"DESIGNER_COMPONENT_LIBRARY_INVALID_RESPONSE",incompatibleResource:"DESIGNER_COMPONENT_RESOURCE_INCOMPATIBLE"},$i=V.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),uo=V.lazy(()=>V.object({id:V.string().uuid(),key:V.string().min(1),name:V.string(),children:V.array(uo)}).strict()),go=V.object({category_group_key:V.literal(po),categories:V.array(uo)}).strict(),td=V.object({resource_id:V.string().min(1),name:V.string(),description:V.string().nullable(),thumbnail_url:V.string().nullable(),resolved_version:$i,category_id:V.string().uuid().nullable()}).strict(),_o=V.object({category_group_key:V.literal(po),items:V.array(td),next_cursor:V.string().min(1).nullable()}).strict(),lR=V.object({resource_id:V.string().min(1),resolved_version:$i,anchor_block_id:V.string().min(1),placement:V.enum(["before","after"])}).strict(),pR=V.object({status:V.literal("mock_acknowledged")}).strict(),dR=V.object({category_id:V.string().uuid().optional(),include_descendants:V.enum(["true","false"]).optional().transform(e=>e==="true"),limit:V.coerce.number().int().min(1).max(100).optional().default(20),cursor:V.string().min(1).optional()}).strict().superRefine((e,n)=>{e.include_descendants&&!e.category_id&&n.addIssue({code:"custom",message:"include_descendants requires category_id"})}),yt=$i,uR=V.object({version:yt}).strict(),ho=V.object({resource_id:V.string().min(1),resolved_version:yt,revision_id:V.string().uuid().optional(),digest_sha256:V.string().regex(/^[a-f0-9]{64}$/),materialization:bt}).strict();import{z as y}from"zod";import{z as h}from"zod";var yo="/",xo=255,nd=5e3,id=64;function sd(e){if(!e.startsWith("/")||e.includes("//")||/[?#\\\s\u0000-\u001f\u007f]/u.test(e))return!1;try{let n=decodeURIComponent(e);return n.includes("//")||/[?#\\\s\u0000-\u001f\u007f]/u.test(n)||n.split("/").length!==e.split("/").length||/%25/iu.test(e)?!1:n.split("/").every(i=>![".",".."].includes(i))}catch{return!1}}var Xe=h.string().min(1).max(xo).refine(sd,"url_path must be a safe site-relative path"),Qi=h.string().max(xo),Fn=h.preprocess(e=>e===0?!1:e===1?!0:e,h.boolean()),Xt=h.union([h.url(),Xe]),Zi=h.enum(["landing_page","general_page","detail_page"]),Ji=h.enum([...Zi.options,"list_page","category_page","tag_page","author_page","search_page","date_page"]);function SR(e){return e.vcp_managed&&e.url!==null&&Zi.safeParse(e.page_type).success&&Xe.safeParse(e.url_path).success}function So(e){return e.includes("{")||e.includes("}")}function fR(e){if(!So(e.url_path))return fo(e.url_path);if(e.url===null)return null;let n=/^[a-z][a-z0-9+.-]*:\/\//iu.test(e.url)?ad(e.url):e.url;return n===null||So(n)?null:fo(n)}function fo(e){let n=Xe.safeParse(e);return n.success?n.data:null}function ad(e){try{return new URL(e).pathname}catch{return null}}var Eo=h.lazy(()=>h.object({cms_page_id:h.number().int().positive(),title:h.string().trim().min(1).max(255),url_path:Qi,url:Xt.nullable(),page_type:Ji,vcp_managed:Fn,children:h.array(Eo)}).strict()),od=h.object({group_id:h.string().min(1),title:h.string().trim().min(1).max(255),collection_slug:h.string(),pages:h.array(Eo)}).strict(),bo=h.object({groups:h.array(od)}).strict(),Io=h.lazy(()=>h.object({id:h.number().int().positive(),title:h.string().trim().min(1).max(120),url_path:Qi,parent_id:h.number().int().nonnegative(),group_type:h.string().min(1),page_type:Ji,plugin_id:h.number().int().nonnegative(),is_default:Fn,is_published:Fn,url:Xt.nullable(),vcp_managed:Fn,children:h.array(Io)})),rd=h.object({plugin_id:h.number().int().nonnegative(),slug:h.string(),group_name:h.string().trim().min(1).max(255),pages:h.array(Io)}).passthrough(),cd=h.array(rd);function Ro(e){return{cms_page_id:e.id,title:e.title,url_path:e.url_path,url:e.url,page_type:e.page_type,vcp_managed:e.vcp_managed,children:e.children.map(n=>Ro(n))}}function bR(e){if(!md(e))return null;let n=bo.safeParse(e);if(n.success)return n.data;let i=cd.safeParse(e);if(!i.success)return null;let a=bo.safeParse({groups:i.data.map(s=>({group_id:String(s.plugin_id),title:s.group_name,collection_slug:s.slug,pages:s.pages.map(Ro)}))});return a.success?a.data:null}function md(e){let n=Array.isArray(e)?e:Yi(e)&&Array.isArray(e.groups)?e.groups:[],i=[];for(let s of n)if(!(!Yi(s)||!Array.isArray(s.pages)))for(let r of s.pages)i.push({node:r,depth:1});let a=0;for(;i.length>0;){let s=i.pop();if(a+=1,a>nd||s.depth>id)return!1;if(!(!Yi(s.node)||!Array.isArray(s.node.children)))for(let r of s.node.children)i.push({node:r,depth:s.depth+1})}return!0}function Yi(e){return typeof e=="object"&&e!==null}var ld=h.enum(["invalid_url_path","missing_url","not_vcp_managed","unsupported_page_type"]),pd=h.enum(["home_page","invalid_url_path","not_selectable","not_vcp_managed","page_has_children","last_selectable_page","cms_unbound","unsupported_page_type"]),To=h.lazy(()=>h.object({cms_page_id:h.number().int().positive().nullable(),title:h.string().trim().min(1).max(255),url_path:Qi,preview_url_path:Xe.nullable(),url:Xt.nullable(),page_type:Ji,vcp_managed:h.boolean(),selectable:h.boolean(),disabled_reason:ld.nullable(),can_delete:h.boolean(),delete_block_reason:pd.nullable(),has_cms_children:h.boolean(),children:h.array(To)}).strict()),ko=h.object({group_id:h.string().min(1),title:h.string().trim().min(1).max(255),pages:h.array(To)}).strict(),yR=h.object({base_snapshot_id:T,expected_url_path:Xe}).strict(),dd=h.enum(["succeeded","failed"]),ud=h.object({url_path:Xe,phase:h.enum(["ensure","binding","delete"]),code:h.string().min(1),message:h.string().min(1)}).strict(),es=h.object({status:dd,checked_count:h.number().int().nonnegative(),ensured_count:h.number().int().nonnegative(),deleted_count:h.number().int().nonnegative(),already_absent_count:h.number().int().nonnegative(),failed_pages:h.array(ud),warnings:h.array(h.string().min(1))}).strict(),gd=h.object({result_snapshot_id:T,deleted_files:h.array(h.string().min(1)),updated_files:h.array(h.string().min(1)),preserved_shared_files:h.array(h.string().min(1)),warnings:h.array(h.string().min(1)),next_url:Xt.nullable(),previous_url:Xt.nullable(),cms_reconcile_result:es}).strict(),xR=h.object({code:h.literal(0),message:h.string(),data:gd}).strict(),ER=h.object({snapshot_id:T}).strict(),_d=h.object({snapshot_id:T,warnings:h.array(h.string().min(1)),cms_reconcile_result:es}).strict(),IR=h.object({code:h.literal(0),message:h.string(),data:_d}).strict(),RR=h.object({source_committed:h.boolean(),result_snapshot_id:T.optional(),cms_reconcile_result:es.optional()}).strict().superRefine((e,n)=>{e.source_committed&&!e.result_snapshot_id&&n.addIssue({code:"custom",path:["result_snapshot_id"],message:"committed source requires result_snapshot_id"})}),hd=Zi,Sd=h.object({title:h.string().min(1).max(255).optional(),description:h.string().min(1).max(1e3).optional(),keywords:h.string().min(1).max(255).optional(),meta_tags_json:h.record(h.string(),h.unknown()).optional(),schema_json:h.union([h.record(h.string(),h.unknown()),h.array(h.unknown())]).optional(),breadcrumbs_json:h.array(h.unknown()).optional()}).strict(),Ao=h.object({url_path:Xe,title:h.string().trim().min(1).max(255),kind:hd,route_file:h.string().min(1),collection_id:h.string().trim().min(1).optional(),seo:Sd.optional()}).strict().superRefine((e,n)=>{e.kind==="detail_page"&&e.seo&&n.addIssue({code:"custom",path:["seo"],message:"detail_page target cannot carry seo (owned by the collection binding flow)"}),e.kind==="detail_page"&&!e.collection_id&&n.addIssue({code:"custom",path:["collection_id"],message:"detail_page target requires collection_id"}),e.kind!=="detail_page"&&e.collection_id&&n.addIssue({code:"custom",path:["collection_id"],message:`${e.kind} target cannot have collection_id`}),e.kind==="landing_page"!=(e.url_path===yo)&&n.addIssue({code:"custom",path:["kind"],message:"The home target must be the only landing_page target."})}),fd=h.object({complete:h.literal(!0),targets:h.array(Ao)}).strict().superRefine((e,n)=>{e.targets.length<1&&n.addIssue({code:"too_small",minimum:1,inclusive:!0,origin:"array",path:["targets"],message:"A complete page target set must contain at least one page."}),e.targets.filter(a=>a.url_path===yo).length!==1&&n.addIssue({code:"custom",path:["targets"],message:"A complete page target set must contain exactly one home page."})}),TR=h.discriminatedUnion("complete",[fd,h.object({complete:h.literal(!1),targets:h.array(Ao),errors:h.array(h.string().min(1)).min(1)}).strict()]),Xi=h.string().regex(/^sha256:[0-9a-f]{64}$/),kR=h.object({projection_hash:Xi.nullable()}).strict(),AR=h.object({expected_projection_hash:Xi.nullable(),projection_hash:Xi}).strict();var Po="insertNewPage",jR={categoryGroupMissing:"DESIGNER_PAGE_CATEGORY_GROUP_MISSING",unavailable:"DESIGNER_PAGE_LIBRARY_UNAVAILABLE",timeout:"DESIGNER_PAGE_LIBRARY_TIMEOUT",invalidResponse:"DESIGNER_PAGE_LIBRARY_INVALID_RESPONSE",incompatibleResource:"DESIGNER_PAGE_RESOURCE_INCOMPATIBLE"},xt=y.enum(["page","pages"]),bd=y.object({resource_id:y.string().min(1),resource_type:xt,resolved_version:yt,template_page_id:y.string().min(1)}).strict(),wo=y.lazy(()=>y.object({id:y.string().uuid(),key:y.string().min(1),name:y.string(),children:y.array(wo)}).strict()),vo=y.object({category_group_key:y.literal(Po),categories:y.array(wo)}).strict(),yd=y.object({resource_id:y.string().min(1),resource_type:xt,name:y.string(),description:y.string().nullable(),thumbnail_url:y.string().nullable(),preview_images:y.array(y.object({url:y.string().min(1),page_id:y.string().min(1).nullable(),is_primary:y.boolean()}).strict()).optional(),resolved_version:yt,category_id:y.string().uuid().nullable()}).strict(),Co=y.object({category_group_key:y.literal(Po),items:y.array(yd),next_cursor:y.string().min(1).nullable()}).strict(),OR=y.object({category_id:y.string().uuid().optional(),include_descendants:y.enum(["true","false"]).optional().transform(e=>e==="true"),limit:y.coerce.number().int().min(1).max(100).optional().default(20),cursor:y.string().min(1).optional()}).strict().superRefine((e,n)=>{e.include_descendants&&!e.category_id&&n.addIssue({code:"custom",message:"include_descendants requires category_id"})}),Qt=yt,Gn=y.string().regex(/^\/[a-z0-9]+(?:-[a-z0-9]+)*$/),NR=y.string().regex(/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*)?$/),xd=y.object({template_page_id:y.string().min(1),title:y.string().trim().min(1).max(120),final_route:Gn}).strict(),Ed=y.object({template_page_id:y.string().min(1),title:y.string().trim().min(1).max(120),source:bd.optional(),blocks:y.array(y.discriminatedUnion("kind",[y.object({kind:y.literal("package-component"),instance_id:y.string().min(1),component_id:y.string().min(1),label:y.string().trim().min(1).max(120)}).strict(),y.object({kind:y.literal("component-resource"),instance_id:y.string().min(1),resource_id:y.string().min(1),resolved_version:yt,label:y.string().trim().min(1).max(120)}).strict()])).optional(),route:y.object({input:y.string(),append_random_suffix:y.boolean().optional(),random_suffix_length:y.number().int().min(4).max(16).optional(),final:Gn}).strict()}).strict(),Id=y.object({resource_id:y.string().min(1),resource_type:xt,resolved_version:Qt,pages:y.array(Ed).min(1)}).strict().superRefine((e,n)=>{ot(e.pages.map(i=>i.template_page_id),"pages",n),ot(e.pages.map(i=>i.route.final),"routes",n);for(let[i,a]of e.pages.entries()){if(!a.blocks)continue;let s=new Set;for(let[r,d]of a.blocks.entries())s.has(d.instance_id)&&n.addIssue({code:"custom",path:["pages",i,"blocks",r,"instance_id"],message:`Duplicate block instance identifier within page: ${d.instance_id}`}),s.add(d.instance_id)}});function ts(e,n){e.resource_type==="page"&&e.pages.length!==1&&n.addIssue({code:"custom",path:["pages"],message:"page resources must contain exactly one page"}),e.resource_type==="pages"&&e.pages.length<2&&n.addIssue({code:"custom",path:["pages"],message:"pages resources must contain at least two pages"})}function ot(e,n,i){let a=new Set;for(let[s,r]of e.entries())a.has(r)&&i.addIssue({code:"custom",path:[n,s],message:`Duplicate ${n} identifier: ${r}`}),a.add(r)}var LR=y.object({resource_type:xt,version:Qt,pages:y.array(xd).min(1)}).strict().superRefine((e,n)=>{ts(e,n),ot(e.pages.map(i=>i.template_page_id),"pages",n),ot(e.pages.map(i=>i.final_route),"routes",n)}),Rd=y.object({instance_id:y.string().min(1),component_id:y.string().min(1)}).strict(),Td=y.object({component_id:y.string().min(1),materialization:bt}).strict(),kd=y.object({template_page_id:y.string().min(1),title:y.string().trim().min(1).max(120),final_route:Gn,materialization:bt,components:y.array(Rd)}).strict(),ns=y.object({resource_id:y.string().min(1),resource_type:xt,resolved_version:Qt,revision_id:y.string().uuid().optional(),digest_sha256:y.string().regex(/^[a-f0-9]{64}$/),components:y.array(Td),pages:y.array(kd).min(1),project_dependencies:y.record(y.string(),y.never()).optional()}).strict().superRefine((e,n)=>{ts(e,n);let i=e.components.map(s=>s.component_id),a=new Set(i);ot(i,"components",n),ot(e.pages.map(s=>s.template_page_id),"pages",n),ot(e.pages.map(s=>s.final_route),"routes",n);for(let[s,r]of e.pages.entries()){let d=new Set;for(let[c,g]of r.components.entries())a.has(g.component_id)||n.addIssue({code:"custom",path:["pages",s,"components",c,"component_id"],message:`Unknown component reference: ${g.component_id}`}),d.has(g.instance_id)&&n.addIssue({code:"custom",path:["pages",s,"components",c,"instance_id"],message:`Duplicate component instance identifier within page: ${g.instance_id}`}),d.add(g.instance_id)}}),Do=ns,jo=y.object({template_page_id:y.string().min(1),title:y.string().trim().min(1).max(120),final_route:Gn,route_file_path:y.string().regex(/^app\/[a-z0-9]+(?:-[a-z0-9]+)*\/page\.tsx$/)}).strict(),Ad=y.object({template_page_id:y.string().min(1),title:y.string().trim().min(1).max(120),composition_supported:y.boolean(),blocks:y.array(y.object({instance_id:y.string().min(1),component_id:y.string().min(1),label:y.string().trim().min(1).max(120)}).strict())}).strict(),Oo=y.object({resource_id:y.string().min(1),resource_type:xt,resolved_version:Qt,pages:y.array(Ad).min(1)}).strict().superRefine((e,n)=>{ts(e,n),ot(e.pages.map(i=>i.template_page_id),"pages",n)}),MR=y.object({resource_type:xt,version:Qt}).strict(),UR=y.object({draft:Id}).strict(),No=y.object({groups:y.array(ko)}).strict(),Lo=y.object({candidate:y.record(y.string(),y.unknown())}).strict();var Ct="[a-z0-9]+(?:-[a-z0-9]+)*",Zt=new RegExp(`^/(?:${Ct}(?:/${Ct})*)?$`),Mo=["/privacy","/cookie-policy","/system/not-found"],Pd=Mo.map(e=>`app/${e.slice(1)}/page.tsx`);function wd(e){return e.replace(/[^A-Za-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()}function Uo(e){return typeof e=="string"&&Zt.test(e)}function qo(e){if(typeof e!="string")return null;let n=e.trim();if(/[^\x00-\x7F]/.test(n))return null;let i=n.replace(/^\/+|\/+$/g,"");if(i==="")return"/";let a=i.split("/");if(a.some(c=>c==="."||c===".."))return null;let s=i.toLowerCase();if(s==="index"||s==="home")return"/";let r=a.map(wd).filter(c=>c.length>0);if(r.length===0)return null;let d=`/${r.join("/")}`;return Uo(d)?d:null}function Fo(e){let n=qo(e);if(n===null)throw new Error("Page slug must be an ASCII route without traversal segments.");return n}function vd(e){let n=Fo(e);return n==="/"?"app/page.tsx":`app/${n.slice(1)}/page.tsx`}import{z as J}from"zod";import{z as u}from"zod";import{z as je}from"zod";var Cd=je.object({code:je.string().min(1),message:je.string().min(1)}),KR=je.object({code:je.string().min(1),message:je.string().min(1)});function is(e){return je.object({ok:je.literal(!0),composition:U,data:e}).strict()}function Dd(e){let n={ok:je.literal(!1),composition:U,error:Cd.extend({code:e.codeSchema})};return e.currentSchema&&(n.current=e.currentSchema.optional()),e.diagnosticsSchema&&(n.diagnostics=je.array(e.diagnosticsSchema).optional()),e.dataSchema&&(n.data=e.dataSchema.optional()),je.object(n).strict()}function Go(e){return je.discriminatedUnion("ok",[is(e.dataSchema),Dd({codeSchema:e.codeSchema,currentSchema:e.currentSchema,diagnosticsSchema:e.diagnosticsSchema,dataSchema:e.failureDataSchema})])}import{z as $}from"zod";var Qe=$.object({start:$.number().int().nonnegative(),end:$.number().int().nonnegative()}).superRefine((e,n)=>{e.end<e.start&&n.addIssue({code:"custom",path:["end"],message:"end must be greater than or equal to start"})}),jd=$.object({code:$.enum(["missing-class-name","unsupported-attribute-name","source-locator-warning","invalid-new-attr","version-conflict","write-failed"]),message:$.string().min(1)}),zo=$.object({path:$.string().min(1),content:$.string(),hash:$.string().min(1).optional()}),$R=$.object({composition:U,revision:$.string().min(1),entryCss:zo,stylesheets:$.array(zo).default([])}).strict(),YR=$.object({composition:ae}).strict(),XR=$.object({key:$.string().min(1),composition:ae}).strict(),Ko=$.object({key:$.string().min(1),composition:U,filePath:$.string().min(1),componentName:$.string().min(1),sourceKind:$.enum(["missing","stringLiteral","expression"]),attrRaw:$.string().min(1).nullable(),valueRaw:$.string().min(1).nullable(),attrRange:Qe.nullable(),openingElementRange:Qe,version:$.object({documentVersion:$.number().int().nonnegative(),contentHash:$.string().min(1)}),diagnostics:$.array(jd),computedStyle:$.record($.string(),$.string()).optional()}).strict().superRefine((e,n)=>{if(e.sourceKind==="missing"){(e.attrRaw!==null||e.valueRaw!==null||e.attrRange!==null)&&n.addIssue({code:"custom",message:"missing className source must not include attr raw or range"});return}(e.attrRaw===null||e.valueRaw===null||e.attrRange===null)&&n.addIssue({code:"custom",message:"present className source must include attr raw and ranges"})}),QR=Ko,ZR=is(Ko),ss=$.object({source:$.enum(["style-panel","class-source-editor"]),operation:$.enum(["replace-static-classname","replace-expression","create-attribute","remove-attribute"])});import{z as Ke}from"zod";var Od=new Set(["children","key","ref","dangerouslysetinnerhtml"]),Nd=new Set(["data-designer-hover-outline","data-designer-select-outline"]),Ld=/^[A-Za-z_$][A-Za-z0-9_$:-]*$/u;function Md(e){return{code:"protected-attribute",message:`Property is protected from generic site editing: ${e}`}}function Ud(){return{code:"invalid-attribute-name",message:"Property name must be a valid single JSX attribute name"}}function qd(e){let n=e.toLowerCase();return Od.has(n)||n.startsWith("data-vcp-")||Nd.has(n)||/^on[a-z]/iu.test(e)}function as(e){if(!Ld.test(e))return{owner:"blocked",name:e,diagnostic:Ud()};if(qd(e))return{owner:"blocked",name:e,diagnostic:Md(e)};let n=e.toLowerCase();return n==="classname"||n==="class"?{owner:"class-name-source",name:e}:n==="style"?{owner:"style",name:e}:{owner:"generic",name:e}}import{z as Ze}from"zod";var Et=Ze.lazy(()=>Ze.union([Ze.string(),Ze.number().finite(),Ze.boolean(),Ze.null(),Ze.array(Et),Ze.record(Ze.string(),Et)]));var Bo=Ke.string().min(1),Fd=Ke.discriminatedUnion("operation",[Ke.object({operation:Ke.literal("set"),name:Bo,value:Et}).strict(),Ke.object({operation:Ke.literal("remove"),name:Bo}).strict()]).superRefine((e,n)=>{let i=as(e.name);i.owner==="blocked"&&n.addIssue({code:"custom",path:["name"],message:i.diagnostic?.message??"Property is not available for site editing"})}),Wo=Ke.object({kind:Ke.literal("set-props"),scope:Ke.enum(["selection","template"]),changes:Ke.array(Fd).min(1)}).strict().superRefine((e,n)=>{let i=new Map;for(let[a,s]of e.changes.entries()){let r=as(s.name),d=Gd(r),c=i.get(d);c!==void 0?n.addIssue({code:"custom",path:["changes",a,"name"],message:`Duplicate property change; first declared at index ${c}`}):i.set(d,a)}});function Gd(e){return e.owner==="class-name-source"||e.owner==="style"?`owner:${e.owner}`:`name:${e.name}`}import{z as zd}from"zod";var Vo=zd.enum(["src","alt","poster","href","width","height"]);import{z as Dt}from"zod";var Jt=Dt.object({editingSessionId:Dt.string().min(1),lockId:Dt.string().min(1),ownerId:Dt.string().min(1),leaseAssertion:Dt.string().min(1)}).strict(),lT="signed-designer-mutations-v1",pT=Dt.object({mutationContext:Jt}).strict();import{z as p}from"zod";import{z as en}from"zod";var zn="::",os=en.object({file:en.string().min(1),component:en.string().min(1),structuralPath:en.string().min(1),key:en.string().min(1)}).superRefine((e,n)=>{let i=Kd(e.file,e.component,e.structuralPath);e.key!==i&&n.addIssue({code:"custom",path:["key"],message:"key must match file::component::structuralPath"})});function Kd(e,n,i){return`${e}${zn}${n}${zn}${i}`}function gT(e){let[n,i,...a]=e.split(zn);return!n||!i||a.length===0?null:{file:n,component:i,structuralPath:a.join(zn)}}var Kn=p.enum(["VERSION_STALE","RECOVERY_REQUIRED","MULTIPLE_PAGE_RETURNS","INDIRECT_RETURN_ONLY","PAGE_CONTAINER_AMBIGUOUS","NO_SAFE_PAGE_PLACEMENT","MEMBER_NOT_INDEPENDENT","UNSUPPORTED_ROUTE_STRUCTURE","RUNTIME_ANCHOR_UNRESOLVED","ROUTE_RETURN_NOT_FOUND"]),tn=p.object({code:p.string().min(1),message:p.string().min(1)}).strict(),Bd=p.union([p.object({kind:p.literal("virtual-route-root"),key:p.string().min(1)}).strict(),p.object({kind:p.literal("jsx-container"),key:p.string().min(1),sourceMemberKey:p.string().min(1),sourceFile:p.string().min(1),componentName:p.string().min(1).optional()}).strict(),p.object({kind:p.literal("starter-placeholder"),key:p.string().min(1),sourceFile:p.string().min(1).optional()}).strict()]),Wd=p.object({key:p.string().min(1),kind:p.enum(["jsx-element","jsx-fragment","jsx-expression","null-return","starter-placeholder"]),containerKey:p.string().min(1),label:p.string().min(1),sourceFile:p.string().min(1).optional(),isAtomic:p.boolean()}).strict(),Vd=p.object({key:p.string().min(1),sourceMemberKey:p.string().min(1),containerKey:p.string().min(1),label:p.string().min(1),isIndependent:p.boolean()}).strict(),Hd=p.object({key:p.string().min(1),containerKey:p.string().min(1),businessMemberKeys:p.array(p.string().min(1)),isMultiMember:p.boolean()}).strict(),$o=p.object({kind:p.literal("page-composition"),placementKey:p.string().min(1),documentVersion:p.number().int().nonnegative(),composition:ae}).strict(),$d=p.object({kind:p.literal("page-composition"),placementKey:p.string().min(1),documentVersion:p.number().int().nonnegative(),composition:U,placementUnitKey:p.string().min(1),relation:p.enum(["before","after","prepend","append"])}).strict(),Yo=p.object({kind:p.literal("page-composition"),placementKey:p.string().min(1),documentVersion:p.number().int().nonnegative(),composition:ae,placementUnitKey:p.string().min(1),relation:p.enum(["before","after","prepend","append"])}).strict(),Xo=p.object({kind:p.literal("page-unit"),composition:ae,placementUnitKey:p.string().min(1)}).strict(),Qo=p.object({kind:p.literal("page-unit"),composition:U,placementUnitKey:p.string().min(1)}).strict();function Je(e,n,i,a,s){let r=new Set;for(let[d,c]of e.entries()){let g=a(c);r.has(g)&&n.addIssue({code:"custom",path:[i,d,s],message:`Duplicate ${i} key: ${g}`}),r.add(g)}}var Yd=p.object({status:p.literal("supported"),version:p.number().int().nonnegative(),composition:U,container:Bd,sourceMembers:p.array(Wd),businessMembers:p.array(Vd),placementUnits:p.array(Hd),placements:p.array($d)}).strict().superRefine((e,n)=>{Je(e.sourceMembers,n,"sourceMembers",c=>c.key,"key"),Je(e.businessMembers,n,"businessMembers",c=>c.key,"key"),Je(e.placementUnits,n,"placementUnits",c=>c.key,"key"),Je(e.placements,n,"placements",c=>c.placementKey,"placementKey");let i=new Set(e.sourceMembers.map(c=>c.key)),a=new Set(e.placementUnits.map(c=>c.key)),s=new Map(e.sourceMembers.map(c=>[c.key,c])),r=new Map(e.businessMembers.map(c=>[c.key,c]));for(let[c,g]of e.sourceMembers.entries()){g.containerKey!==e.container.key&&!i.has(g.containerKey)&&n.addIssue({code:"custom",path:["sourceMembers",c,"containerKey"],message:"Source member parent must reference the page container or another source member."}),g.containerKey===g.key&&n.addIssue({code:"custom",path:["sourceMembers",c,"containerKey"],message:"Source member cannot contain itself."});let k=new Set([g.key]),I=g.containerKey;for(;I!==e.container.key;){if(k.has(I)){n.addIssue({code:"custom",path:["sourceMembers",c,"containerKey"],message:"Source member hierarchy must be acyclic."});break}k.add(I);let C=s.get(I);if(!C)break;I=C.containerKey}}e.container.kind==="jsx-container"&&!i.has(e.container.sourceMemberKey)&&n.addIssue({code:"custom",path:["container","sourceMemberKey"],message:"Container sourceMemberKey must reference a source member."});for(let[c,g]of e.businessMembers.entries())i.has(g.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",c,"sourceMemberKey"],message:"Business member must reference a source member."}),a.has(g.containerKey)||n.addIssue({code:"custom",path:["businessMembers",c,"containerKey"],message:"Business member must reference a placement unit container."});for(let[c,g]of e.placementUnits.entries()){let k=s.get(g.containerKey);k?k.containerKey!==e.container.key&&n.addIssue({code:"custom",path:["placementUnits",c,"containerKey"],message:"Placement unit must reference a direct child of the page container."}):n.addIssue({code:"custom",path:["placementUnits",c,"containerKey"],message:"Placement unit containerKey must reference a source member."});let I=new Set;for(let[C,F]of g.businessMemberKeys.entries()){let B=r.get(F);if(!B){n.addIssue({code:"custom",path:["placementUnits",c,"businessMemberKeys",C],message:"Placement unit must reference existing business members."});continue}I.has(F)&&n.addIssue({code:"custom",path:["placementUnits",c,"businessMemberKeys",C],message:"Placement unit cannot reference the same business member twice."}),I.add(F),B.containerKey!==g.key&&n.addIssue({code:"custom",path:["placementUnits",c,"businessMemberKeys",C],message:"Business member containerKey must match its placement unit."});let ne=B.sourceMemberKey,ce=new Set;for(;ne&&ne!==g.containerKey&&!ce.has(ne);)ce.add(ne),ne=s.get(ne)?.containerKey;ne!==g.containerKey&&n.addIssue({code:"custom",path:["placementUnits",c,"businessMemberKeys",C],message:"Placement unit business members must belong to its source subtree."})}}for(let[c,g]of e.businessMembers.entries())e.placementUnits.find(I=>I.key===g.containerKey)?.businessMemberKeys.includes(g.key)||n.addIssue({code:"custom",path:["businessMembers",c,"containerKey"],message:"Business member must be listed by its placement unit container."});let d=new Map;for(let c of e.placementUnits)d.set(c.containerKey,(d.get(c.containerKey)??0)+1);for(let[c,g]of e.sourceMembers.entries())g.containerKey===e.container.key&&d.get(g.key)!==1&&n.addIssue({code:"custom",path:["sourceMembers",c,"key"],message:"Every direct source member must be owned by exactly one placement unit."});for(let[c,g]of e.placements.entries())er(g.composition,e.composition)||n.addIssue({code:"custom",path:["placements",c,"composition"],message:"Page placement composition must match page composition."}),g.documentVersion!==e.version&&n.addIssue({code:"custom",path:["placements",c,"documentVersion"],message:"Page placement version must match page composition version."}),a.has(g.placementUnitKey)||n.addIssue({code:"custom",path:["placements",c,"placementUnitKey"],message:"Placement option must reference an existing placement unit."})}),Xd=p.object({status:p.literal("unsupported"),version:p.number().int().nonnegative(),composition:U,reason:Kn,diagnostics:p.array(tn)}).strict(),Qd=p.discriminatedUnion("status",[Yd,Xd]),Zo=2,bT="page-composition-v2",Jo=p.object({start:p.number().int().nonnegative(),end:p.number().int().nonnegative(),startLine:p.number().int().positive().optional(),startColumn:p.number().int().nonnegative().optional(),endLine:p.number().int().positive().optional(),endColumn:p.number().int().nonnegative().optional()}).strict().superRefine((e,n)=>{e.end<e.start&&n.addIssue({code:"custom",path:["end"],message:"Source range end must be greater than or equal to start."});let i=[e.startLine,e.startColumn,e.endLine,e.endColumn],a=i.some(r=>r!==void 0),s=i.every(r=>r!==void 0);a&&!s&&n.addIssue({code:"custom",path:["startLine"],message:"Source line and column locations must be provided together."}),e.startLine!==void 0&&e.endLine!==void 0&&e.endLine<e.startLine&&n.addIssue({code:"custom",path:["endLine"],message:"Source range endLine must not precede startLine."}),e.startLine!==void 0&&e.endLine===e.startLine&&e.startColumn!==void 0&&e.endColumn!==void 0&&e.endColumn<e.startColumn&&n.addIssue({code:"custom",path:["endColumn"],message:"Source range endColumn must not precede startColumn."})}),Zd=p.object({key:p.string().min(1),instanceIndex:p.number().int().nonnegative().optional(),instanceCount:p.number().int().positive().optional(),textSegmentIndex:p.number().int().nonnegative().optional()}).strict().superRefine((e,n)=>{e.instanceIndex!==void 0&&e.instanceCount!==void 0&&e.instanceIndex>=e.instanceCount&&n.addIssue({code:"custom",path:["instanceIndex"],message:"instanceIndex must be lower than instanceCount."})}),Jd=p.enum(["component-call","native-jsx","dynamic-expression","indirect-expression","text","starter-placeholder"]),eu=p.enum(["none","dynamic-expression","indirect-expression","text","starter-placeholder"]),tu=p.discriminatedUnion("kind",[p.object({kind:p.literal("virtual-route-root"),key:p.null(),routeReturn:p.object({sourceIdentity:os,sourceRange:Jo}).strict()}).strict(),p.object({kind:p.literal("jsx-container"),key:p.string().min(1),sourceMemberKey:p.string().min(1)}).strict(),p.object({kind:p.literal("starter-placeholder"),key:p.string().min(1),sourceMemberKey:p.string().min(1),replacementMode:p.literal("replace")}).strict()]),nu=p.object({key:p.string().min(1),kind:Jd,parentKey:p.string().min(1).nullable(),childKeys:p.array(p.string().min(1)),order:p.number().int().nonnegative(),label:p.string().min(1),sourceIdentity:os,sourceRange:Jo.nullable(),atomicKind:eu}).strict().superRefine((e,n)=>{let i=e.kind==="component-call"||e.kind==="native-jsx"?"none":e.kind;e.atomicKind!==i&&n.addIssue({code:"custom",path:["atomicKind"],message:`atomicKind must be ${i} for ${e.kind}.`});let a=new Set;for(let[s,r]of e.childKeys.entries())a.has(r)&&n.addIssue({code:"custom",path:["childKeys",s],message:`Duplicate child source member key: ${r}`}),a.add(r)}),iu=p.object({key:p.string().min(1),sourceMemberKey:p.string().min(1),placementUnitKey:p.string().min(1),label:p.string().min(1),isIndependent:p.boolean()}).strict(),su=p.enum(["independent","atomic","container"]),au=p.object({key:p.string().min(1),containerKey:p.string().min(1).nullable(),sourceMemberKeys:p.array(p.string().min(1)).min(1),businessMemberKeys:p.array(p.string().min(1)),order:p.number().int().nonnegative(),boundaryMode:su,isIndependent:p.boolean(),isMultiMember:p.boolean()}).strict().superRefine((e,n)=>{Ho(e.sourceMemberKeys,n,"sourceMemberKeys","source member"),Ho(e.businessMemberKeys,n,"businessMemberKeys","business member");let i=e.sourceMemberKeys.length>1||e.businessMemberKeys.length>1;e.isMultiMember!==i&&n.addIssue({code:"custom",path:["isMultiMember"],message:"isMultiMember must reflect the source and business member cardinality."});let a=e.boundaryMode==="independent";e.isIndependent!==a&&n.addIssue({code:"custom",path:["isIndependent"],message:"isIndependent must match boundaryMode."})}),ou=p.enum(["before","after","prepend","append","replace"]),ru=p.enum(["insert-sibling","insert-child","replace-placeholder"]),cu=p.object({kind:p.literal("page-composition"),placementKey:p.string().min(1),documentVersion:p.number().int().nonnegative(),composition:U,placementUnitKey:p.string().min(1),containerKey:p.string().min(1).nullable(),relation:ou,writeMode:ru}).strict().superRefine((e,n)=>{let i=e.relation==="before"||e.relation==="after"?"insert-sibling":e.relation==="prepend"||e.relation==="append"?"insert-child":"replace-placeholder";e.writeMode!==i&&n.addIssue({code:"custom",path:["writeMode"],message:`writeMode must be ${i} for ${e.relation}.`})}),mu=p.object({key:p.string().min(1),placementUnitKey:p.string().min(1),runtimeRefs:p.array(Zd).min(1)}).strict(),lu=p.object({schemaVersion:p.literal(Zo),status:p.literal("supported"),version:p.number().int().nonnegative(),composition:U,container:tu,sourceMembers:p.array(nu),businessMembers:p.array(iu),placementUnits:p.array(au),placements:p.array(cu),visualAnchors:p.array(mu).optional(),diagnostics:p.array(tn)}).strict().superRefine((e,n)=>{uu(e,n)}),pu=p.object({schemaVersion:p.literal(Zo),status:p.literal("unsupported"),version:p.number().int().nonnegative(),composition:U,reason:Kn,diagnostics:p.array(tn)}).strict(),du=p.discriminatedUnion("status",[lu,pu]),yT=p.union([du,Qd]);function Ho(e,n,i,a){let s=new Set;for(let[r,d]of e.entries())s.has(d)&&n.addIssue({code:"custom",path:[i,r],message:`Duplicate ${a} key: ${d}`}),s.add(d)}function er(e,n){return Ni(e)===Ni(n)}function uu(e,n){Je(e.sourceMembers,n,"sourceMembers",I=>I.key,"key"),Je(e.businessMembers,n,"businessMembers",I=>I.key,"key"),Je(e.placementUnits,n,"placementUnits",I=>I.key,"key"),Je(e.placements,n,"placements",I=>I.placementKey,"placementKey"),Je(e.visualAnchors??[],n,"visualAnchors",I=>I.key,"key"),gu(e,n);let i=new Map(e.sourceMembers.map(I=>[I.key,I])),a=new Map(e.businessMembers.map(I=>[I.key,I])),s=new Map(e.placementUnits.map(I=>[I.key,I]));_u(e,i,n),e.container.kind!=="virtual-route-root"&&(i.has(e.container.sourceMemberKey)||n.addIssue({code:"custom",path:["container","sourceMemberKey"],message:"Container sourceMemberKey must reference a source member."}));let r=new Map,d=new Map,c=new Set;for(let[I,C]of e.placementUnits.entries()){C.containerKey!==e.container.key&&n.addIssue({code:"custom",path:["placementUnits",I,"containerKey"],message:"Placement unit containerKey must match the page container."});let F=`${C.containerKey??"<virtual>"}:${C.order}`;c.has(F)&&n.addIssue({code:"custom",path:["placementUnits",I,"order"],message:"Placement unit order must be unique within its container."}),c.add(F);for(let[B,ne]of C.sourceMemberKeys.entries()){i.has(ne)||n.addIssue({code:"custom",path:["placementUnits",I,"sourceMemberKeys",B],message:"Placement unit must reference existing source members."});let ce=r.get(ne);ce&&ce!==C.key&&n.addIssue({code:"custom",path:["placementUnits",I,"sourceMemberKeys",B],message:`Source member is already assigned to ${ce}.`}),r.set(ne,C.key)}for(let[B,ne]of C.businessMemberKeys.entries()){let ce=a.get(ne);if(!ce){n.addIssue({code:"custom",path:["placementUnits",I,"businessMemberKeys",B],message:"Placement unit must reference existing business members."});continue}ce.placementUnitKey!==C.key&&n.addIssue({code:"custom",path:["placementUnits",I,"businessMemberKeys",B],message:"Placement unit and business member must reference each other."}),C.sourceMemberKeys.includes(ce.sourceMemberKey)||n.addIssue({code:"custom",path:["placementUnits",I,"businessMemberKeys",B],message:"Business member sourceMemberKey must belong to the placement unit."});let Bt=d.get(ne);Bt&&Bt!==C.key&&n.addIssue({code:"custom",path:["placementUnits",I,"businessMemberKeys",B],message:`Business member is already assigned to ${Bt}.`}),d.set(ne,C.key)}}for(let[I,C]of e.businessMembers.entries()){i.has(C.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",I,"sourceMemberKey"],message:"Business member must reference a source member."});let F=s.get(C.placementUnitKey);if(!F){n.addIssue({code:"custom",path:["businessMembers",I,"placementUnitKey"],message:"Business member must reference a placement unit."});continue}F.businessMemberKeys.includes(C.key)||n.addIssue({code:"custom",path:["businessMembers",I,"placementUnitKey"],message:"Business member and placement unit must reference each other."}),F.sourceMemberKeys.includes(C.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",I,"sourceMemberKey"],message:"Business member sourceMemberKey must belong to its placement unit."});let B=F.isIndependent&&F.businessMemberKeys.length===1;C.isIndependent!==B&&n.addIssue({code:"custom",path:["businessMembers",I,"isIndependent"],message:"Business member independence must match its placement unit boundary."})}let g=new Set;for(let[I,C]of e.placements.entries()){C.documentVersion!==e.version&&n.addIssue({code:"custom",path:["placements",I,"documentVersion"],message:"Page placement version must match page composition version."}),er(C.composition,e.composition)||n.addIssue({code:"custom",path:["placements",I,"composition"],message:"Page placement composition must match page composition."});let F=s.get(C.placementUnitKey);F?C.containerKey!==F.containerKey&&n.addIssue({code:"custom",path:["placements",I,"containerKey"],message:"Placement containerKey must match its placement unit."}):n.addIssue({code:"custom",path:["placements",I,"placementUnitKey"],message:"Placement option must reference a placement unit."});let B=`${C.placementUnitKey}:${C.relation}`;g.has(B)&&n.addIssue({code:"custom",path:["placements",I,"relation"],message:"A placement unit cannot expose the same relation more than once."}),g.add(B),C.relation==="replace"&&e.container.kind!=="starter-placeholder"&&n.addIssue({code:"custom",path:["placements",I,"relation"],message:"replace is only valid for a starter placeholder container."}),e.container.kind==="starter-placeholder"&&C.relation!=="replace"&&n.addIssue({code:"custom",path:["placements",I,"relation"],message:"Starter placeholder placements must use replace."})}let k=new Set;for(let[I,C]of(e.visualAnchors??[]).entries())s.has(C.placementUnitKey)||n.addIssue({code:"custom",path:["visualAnchors",I,"placementUnitKey"],message:"Visual anchor must reference a placement unit."}),k.has(C.placementUnitKey)&&n.addIssue({code:"custom",path:["visualAnchors",I,"placementUnitKey"],message:"A placement unit may expose only one visual anchor."}),k.add(C.placementUnitKey)}function gu(e,n){let i=[];e.container.key!==null&&i.push({key:e.container.key,path:["container","key"],namespace:"container"});for(let[s,r]of e.sourceMembers.entries())i.push({key:r.key,path:["sourceMembers",s,"key"],namespace:"source member"});for(let[s,r]of e.businessMembers.entries())i.push({key:r.key,path:["businessMembers",s,"key"],namespace:"business member"});for(let[s,r]of e.placementUnits.entries())i.push({key:r.key,path:["placementUnits",s,"key"],namespace:"placement unit"});for(let[s,r]of(e.visualAnchors??[]).entries())i.push({key:r.key,path:["visualAnchors",s,"key"],namespace:"visual anchor"});let a=new Map;for(let s of i){let r=a.get(s.key);r?n.addIssue({code:"custom",path:s.path,message:`${s.namespace} key collides with ${r}: ${s.key}`}):a.set(s.key,s.namespace)}}function _u(e,n,i){let a=new Set;for(let[s,r]of e.sourceMembers.entries()){let d=`${r.parentKey??"<root>"}:${r.order}`;if(a.has(d)&&i.addIssue({code:"custom",path:["sourceMembers",s,"order"],message:"Source member order must be unique among siblings."}),a.add(d),r.parentKey===r.key&&i.addIssue({code:"custom",path:["sourceMembers",s,"parentKey"],message:"Source member cannot be its own parent."}),r.parentKey!==null){let k=n.get(r.parentKey);k?k.childKeys.includes(r.key)||i.addIssue({code:"custom",path:["sourceMembers",s,"parentKey"],message:"Source parent and child references must be bidirectional."}):i.addIssue({code:"custom",path:["sourceMembers",s,"parentKey"],message:"Source member parentKey must reference a source member."})}for(let[k,I]of r.childKeys.entries()){if(I===r.key){i.addIssue({code:"custom",path:["sourceMembers",s,"childKeys",k],message:"Source member cannot be its own child."});continue}let C=n.get(I);C?C.parentKey!==r.key&&i.addIssue({code:"custom",path:["sourceMembers",s,"childKeys",k],message:"Source parent and child references must be bidirectional."}):i.addIssue({code:"custom",path:["sourceMembers",s,"childKeys",k],message:"Source child key must reference a source member."})}let c=new Set,g=r;for(;g;){if(c.has(g.key)){i.addIssue({code:"custom",path:["sourceMembers",s,"parentKey"],message:"Source member graph must be acyclic."});break}c.add(g.key),g=g.parentKey===null?void 0:n.get(g.parentKey)}}}var nn=u.enum(["update-text","update-array-item","remove-node","insert-child","replace-node","move-node","set-class-name-source","set-props","apply-style-draft","source-edit","insert-page-resource","delete-page-source"]),hu=u.discriminatedUnion("kind",[u.object({kind:u.literal("node"),key:u.string().min(1)}).strict(),Xo,u.object({kind:u.literal("route"),composition:ae}).strict(),u.object({kind:u.literal("source-file"),path:ge}).strict(),u.object({kind:u.literal("source-batch"),paths:u.array(ge).min(1)}).superRefine((e,n)=>{let i=new Set;for(let[a,s]of e.paths.entries())i.has(s)&&n.addIssue({code:"custom",path:["paths",a],message:`Duplicate source target path: ${s}`}),i.add(s)}).strict(),u.object({kind:u.literal("project")}).strict()]),Su=u.discriminatedUnion("kind",[u.object({kind:u.literal("node"),key:u.string().min(1)}).strict(),Qo,u.object({kind:u.literal("route"),composition:U}).strict(),u.object({kind:u.literal("source-file"),path:ge}).strict(),u.object({kind:u.literal("source-batch"),paths:u.array(ge).min(1)}).strict(),u.object({kind:u.literal("project")}).strict()]),nr=u.enum(["display","position","top","right","bottom","left","zIndex","flexDirection","flexWrap","flexGrow","flexShrink","flexBasis","order","gridTemplateColumns","gridTemplateRows","columns","gridColumn","gridRow","gap","gapX","gapY","spaceX","spaceY","alignItems","justifyContent","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","width","height","minWidth","minHeight","maxWidth","maxHeight","overflow","fontFamily","fontSize","fontWeight","lineHeight","letterSpacing","textAlign","textTransform","textDecoration","textOverflow","textIndent","writingMode","whiteSpace","wordBreak","lineClamp","fontVariantNumeric","screenReaderOnly","color","backgroundColor","backgroundImage","backgroundRepeat","backgroundSize","backgroundPosition","backgroundAttachment","backgroundClip","backgroundOrigin","borderStyle","borderWidth","borderRadius","borderColor","objectFit","objectPosition","aspectRatio","opacity","boxShadow","transform","transformOrigin","transitionProperty","transitionDuration","transitionTimingFunction","animation","pointerEvents","cursor","userSelect","fontStyle","textUnderlineOffset","scrollMarginTop","alignSelf","flex","outlineStyle","resize","ringWidth","ringColor","backdropFilter","overscrollBehavior","divideWidth","divideColor"]),ir=u.enum(["hover","active","focus","disabled"]),sr=u.enum(["sm","md","lg","xl","2xl"]),tr=u.union([u.object({relation:u.enum(["before","after"]),anchorKey:u.string().min(1)}),u.object({relation:u.enum(["prepend","append"]),parentKey:u.string().min(1)}),Yo]),ar=u.object({kind:u.literal("component-call"),component:u.never().optional(),materialization:bt,props:u.record(u.string(),u.never()).optional()}).strict(),fu=u.union([u.object({kind:u.literal("native-tag"),tag:u.string().min(1),text:u.string().optional()}),u.object({kind:u.literal("component-call"),component:u.object({source:u.string().min(1),exportName:u.string().min(1)}),materialization:u.never().optional(),props:u.record(u.string(),u.unknown()).optional()}).strict(),ar]),bu=u.discriminatedUnion("kind",[u.object({kind:u.literal("update-text"),segmentIndex:u.number().int().min(0),value:u.string()}),u.object({kind:u.literal("update-array-item"),segmentIndex:u.number().int().min(0),index:u.number().int().min(0),value:u.string()}),u.object({kind:u.literal("remove-node")}),u.object({kind:u.literal("insert-child"),node:fu,position:u.union([tr,$o])}),u.object({kind:u.literal("replace-node"),node:ar}),u.object({kind:u.literal("move-node"),target:tr,preserveBindings:u.boolean().optional()}),u.object({kind:u.literal("set-class-name-source"),filePath:u.string().min(1),expectedVersion:u.object({documentVersion:u.number().int().nonnegative(),contentHash:u.string().min(1)}),oldAttrRaw:u.string().min(1).nullable(),oldAttrRange:Qe.nullable(),openingElementRange:Qe,newAttrRaw:u.string().min(1).nullable(),intent:ss}),Wo,u.object({kind:u.literal("apply-style-draft"),className:u.object({filePath:u.string().min(1),expectedVersion:u.object({documentVersion:u.number().int().nonnegative(),contentHash:u.string().min(1)}),oldAttrRaw:u.string().min(1).nullable(),oldAttrRange:Qe.nullable(),openingElementRange:Qe,newAttrRaw:u.string().min(1).nullable(),intent:ss}).optional(),props:u.partialRecord(Vo,u.string()).optional()}).superRefine((e,n)=>{!e.className&&!e.props&&n.addIssue({code:"custom",message:"apply-style-draft requires className or props"})}),u.object({kind:u.literal("source-edit"),conflictPolicy:u.enum(["compare-and-swap","overwrite"]),edits:u.array(u.discriminatedUnion("operation",[u.object({operation:u.literal("upsert"),path:ge,content:u.string(),baseContentHash:u.string().min(1).nullable().optional()}).strict().superRefine((e,n)=>{Mi(e.path)||n.addIssue({code:"custom",path:["path"],message:"source-edit upsert only accepts allowlisted text source files"}),e.content.includes("\0")&&n.addIssue({code:"custom",path:["content"],message:"source-edit content must be valid text"})}),u.object({operation:u.literal("delete"),path:ge,capability:Fa,confirmDelete:u.literal(!0),confirmPath:ge,baseContentHash:u.string().min(1).nullable().optional()}).strict().superRefine((e,n)=>{e.capability!==Li&&n.addIssue({code:"custom",path:["capability"],message:"delete requires source-delete capability"}),e.confirmPath!==e.path&&n.addIssue({code:"custom",path:["confirmPath"],message:"delete confirmation path must match edit path"}),Mi(e.path)||n.addIssue({code:"custom",path:["path"],message:"source-edit delete only accepts allowlisted text source files"});let i=Ui(e.path);i&&n.addIssue({code:"custom",path:["path"],message:`Protected source file cannot be deleted: ${e.path} (${i})`})})])).min(1),reason:u.string().min(1).optional()}).strict().superRefine((e,n)=>{let i=new Set;for(let[a,s]of e.edits.entries())i.has(s.path)&&n.addIssue({code:"custom",path:["edits",a,"path"],message:`Duplicate source edit path: ${s.path}`}),i.add(s.path),e.conflictPolicy==="compare-and-swap"&&s.baseContentHash===void 0&&n.addIssue({code:"custom",path:["edits",a,"baseContentHash"],message:"source-edit compare-and-swap requires baseContentHash for every edit"})}),u.object({kind:u.literal("insert-page-resource"),artifact:ns}).strict(),u.object({kind:u.literal("delete-page-source"),expectedUrlPath:u.string().startsWith("/")}).strict()]),or=u.enum(["NODE_NOT_FOUND","HOME_PAGE_LOCKED","ROUTE_NOT_FOUND","CAPABILITY_REJECTED","CONSTRAINT_VIOLATED","INVALID_PARAMS","PLAN_FAILED","TRANSACTION_PREFLIGHT_FAILED","ROUTE_REBUILD_FAILED","HISTORY_COMMIT_FAILED","MATERIALIZATION_CONFLICT","MATERIALIZATION_REJECTED","MUTATION_ASSERTION_REQUIRED","MUTATION_ASSERTION_INVALID","VERSION_STALE","AST_PARSE_ERROR","UNSUPPORTED_OPERATION","LOCATOR_FAILED","INVALID_TARGET","WRITE_IO_ERROR","CONCURRENT_MODIFIED","ROLLBACK_FAILED","RECOVERY_REQUIRED","RECOVERY_PERSIST_FAILED","MUTATION_SESSION_REQUIRED","LEASE_ASSERTION_INVALID","LEASE_ASSERTION_EXPIRED","LEASE_ASSERTION_SCOPE_MISMATCH","CROSS_PAGE_MOVE_UNSUPPORTED","INTERNAL_ERROR"]),rr=u.object({code:or,message:u.string().min(1),details:u.record(u.string(),u.unknown()).optional()}),jt=u.object({key:u.string().min(1),instanceIndex:u.number().int().nonnegative().optional(),instanceCount:u.number().int().positive().optional()}),rs=u.object({id:u.string().min(1),siteId:R,baseSnapshotId:T,composition:ae,kind:nn,target:hu,documentVersion:u.number().int().nonnegative(),selectionRef:jt.optional(),mutationContext:Jt.optional(),params:bu}).strict().superRefine((e,n)=>{if(e.kind!==e.params.kind&&n.addIssue({code:"custom",path:["params","kind"],message:"params.kind must match operation kind"}),e.kind==="source-edit"){if(e.target.kind!=="source-file"&&e.target.kind!=="source-batch")n.addIssue({code:"custom",path:["target","kind"],message:"source-edit requires a source-file or source-batch target"});else if(e.params.kind==="source-edit"){let i=e.params.edits.map(s=>s.path),a=e.target.kind==="source-file"?[e.target.path]:e.target.paths;Iu(i,a)||n.addIssue({code:"custom",path:["target"],message:"source-edit target paths must match edit paths"})}}else(e.target.kind==="source-file"||e.target.kind==="source-batch")&&n.addIssue({code:"custom",path:["target","kind"],message:"source targets are only valid for source-edit"});e.target.kind==="page-unit"&&(e.kind!=="insert-child"&&e.kind!=="replace-node"&&e.kind!=="move-node"&&e.kind!=="remove-node"&&n.addIssue({code:"custom",path:["target","kind"],message:"page-unit target is only valid for page-level operations"}),e.kind==="move-node"&&e.params.kind==="move-node"&&(!("kind"in e.params.target)||e.params.target.kind!=="page-composition")&&n.addIssue({code:"custom",path:["params","target","kind"],message:"page-unit move-node target requires page-composition placement"})),e.params.kind==="insert-child"&&"kind"in e.params.position&&e.params.position.kind==="page-composition"&&e.target.kind!=="page-unit"&&n.addIssue({code:"custom",path:["params","position","kind"],message:"page-composition position requires page-unit target"}),e.kind==="replace-node"&&e.target.kind!=="page-unit"&&n.addIssue({code:"custom",path:["target","kind"],message:"replace-node requires a page-unit target"}),e.kind==="insert-page-resource"||e.kind==="delete-page-source"?e.target.kind!=="project"&&n.addIssue({code:"custom",path:["target","kind"],message:`${e.kind} requires a project target`}):e.target.kind==="project"&&n.addIssue({code:"custom",path:["target","kind"],message:"project target is only valid for insert-page-resource or delete-page-source"}),e.kind==="insert-child"&&e.target.kind==="page-unit"&&e.params.kind==="insert-child"&&(!("kind"in e.params.position)||e.params.position.kind!=="page-composition")&&n.addIssue({code:"custom",path:["params","position","kind"],message:"page-unit target requires page-composition position"})}),OT=rs,yu=u.object({kind:u.literal("insert-page-resource"),package_instance_id:u.string().min(1),pages:u.array(jo).min(1)}).strict().superRefine((e,n)=>{let i=new Set,a=new Set;for(let[s,r]of e.pages.entries())i.has(r.template_page_id)&&n.addIssue({code:"custom",path:["pages",s,"template_page_id"],message:`Duplicate template page route mapping: ${r.template_page_id}`}),a.has(r.final_route)&&n.addIssue({code:"custom",path:["pages",s,"final_route"],message:`Duplicate final route mapping: ${r.final_route}`}),i.add(r.template_page_id),a.add(r.final_route)}),xu=u.object({kind:u.literal("delete-page-source"),deleted_files:u.array(u.string().min(1)),updated_files:u.array(u.string().min(1)),preserved_shared_files:u.array(u.string().min(1)),warnings:u.array(u.string().min(1))}).strict(),Eu=u.discriminatedUnion("kind",[yu,xu]),cr=u.object({requestId:u.string().min(1),kind:nn,composition:U,target:Su,resultVersion:u.number().int().nonnegative(),affectedFiles:u.array(u.string().min(1)).optional(),selectionRef:jt.optional(),output:Eu.optional()}).strict(),cs=cr.superRefine((e,n)=>{let i=e.kind==="insert-page-resource"||e.kind==="delete-page-source";i&&e.target.kind!=="project"?n.addIssue({code:"custom",path:["target","kind"],message:`${e.kind} result requires a project target`}):!i&&e.target.kind==="project"&&n.addIssue({code:"custom",path:["target","kind"],message:"project result target requires a project operation"}),i&&!e.output&&n.addIssue({code:"custom",path:["output"],message:`${e.kind} result requires typed output`}),e.output&&e.output.kind!==e.kind&&n.addIssue({code:"custom",path:["output","kind"],message:"output.kind must match operation kind"})}),NT=Go({dataSchema:cs,codeSchema:or,failureDataSchema:cr.partial()});function Iu(e,n){return e.length===n.length&&e.every((i,a)=>i===n[a])}var Ru=J.enum(["component","page","pages"]),Tu=J.object({resource_kind:Ru,resource_name:J.string().trim().min(1).max(200),file_count:J.number().int().min(1).max(64),total_bytes:J.number().int().min(0).max(4*1024*1024),content_digest:J.string().regex(/^sha256:[a-f0-9]{64}$/),custom_prompt:J.string().trim().min(1).max(4e3).optional(),final_routes:J.array(J.string().min(1)).max(64)}).strict(),ku=J.discriminatedUnion("kind",[J.object({kind:J.literal("none")}).strict(),J.object({kind:J.literal("primary"),items:J.array(J.object({label:J.string().trim().min(1).max(120),href:J.string().startsWith("/").max(200)}).strict()).min(1).max(64)}).strict().superRefine((e,n)=>{let i=new Set;for(let[a,s]of e.items.entries())i.has(s.href)&&n.addIssue({code:"custom",path:["items",a,"href"],message:`Duplicate navigation href: ${s.href}`}),i.add(s.href)})]),Au=J.object({base_snapshot_id:J.string().min(1),operation:rs,navigation_selection:ku.optional()}).strict().superRefine((e,n)=>{e.base_snapshot_id!==e.operation.baseSnapshotId&&n.addIssue({code:"custom",path:["operation","baseSnapshotId"],message:"Resource operation baseSnapshotId must match base_snapshot_id."})});function Pu(e){return(e.kind==="insert-child"||e.kind==="replace-node")&&(e.params.kind==="insert-child"||e.params.kind==="replace-node")&&e.params.node.kind==="component-call"&&"materialization"in e.params.node&&e.params.node.materialization?[e.params.node.materialization]:e.kind==="insert-page-resource"&&e.params.kind==="insert-page-resource"?[...e.params.artifact.components.map(n=>n.materialization),...e.params.artifact.pages.map(n=>n.materialization)]:[]}var mr=J.object({id:J.string().min(1),tenant_id:J.string().min(1),site_id:J.string().min(1),run_id:J.string().min(1).optional(),correlation_id:J.string().min(1).optional(),sent_at:J.string().min(1),type:J.literal("client.resource.operation.create"),payload:J.object({client_message_id:J.string().min(1),display:Tu,transient_resource_input:Au}).strict()}).strict().superRefine((e,n)=>{let{display:i,transient_resource_input:a}=e.payload;e.site_id!==a.operation.siteId&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation","siteId"],message:"Resource operation siteId must match envelope site_id."}),(i.resource_kind==="component"?a.operation.kind==="insert-child"||a.operation.kind==="replace-node":a.operation.kind==="insert-page-resource")||n.addIssue({code:"custom",path:["payload","transient_resource_input","operation","kind"],message:i.resource_kind==="component"?"component resources require insert-child or replace-node.":`${i.resource_kind} resources require insert-page-resource.`});let d=Pu(a.operation).flatMap(g=>g.files),c=d.reduce((g,k)=>g+new TextEncoder().encode(k.content).byteLength,0);if(d.length>Vi&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation"],message:"Resource operation exceeds the aggregate file count limit."}),c>Hi&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation"],message:"Resource operation exceeds the aggregate content byte limit."}),i.file_count!==d.length&&n.addIssue({code:"custom",path:["payload","display","file_count"],message:"Resource summary file_count must match the transient operation."}),i.total_bytes!==c&&n.addIssue({code:"custom",path:["payload","display","total_bytes"],message:"Resource summary total_bytes must match the transient operation."}),a.operation.kind==="insert-page-resource"&&a.operation.params.kind==="insert-page-resource"){let g=a.operation.params.artifact;g.resource_type!==i.resource_kind&&n.addIssue({code:"custom",path:["payload","display","resource_kind"],message:"Resource summary kind must match the page artifact resource_type."});let k=g.pages.map(I=>I.final_route);(k.length!==i.final_routes.length||k.some((I,C)=>I!==i.final_routes[C]))&&n.addIssue({code:"custom",path:["payload","display","final_routes"],message:"Resource summary final_routes must match the page artifact routes."})}if(a.navigation_selection?.kind==="primary"){let g=new Set(i.final_routes);for(let[k,I]of a.navigation_selection.items.entries())g.has(I.href)||n.addIssue({code:"custom",path:["payload","transient_resource_input","navigation_selection","items",k,"href"],message:"Navigation selection href must reference a final resource route."})}});import{z as A}from"zod";var wu=["with_website","without_website"],Bn=A.enum(wu),ms=A.string().trim().url().refine(e=>{let n=new URL(e).protocol;return n==="http:"||n==="https:"},{message:"Website must use the http or https protocol."}),vu=["welcome","website_scan","customer_materials","analysis","diagnosis","strategy","structure_planning","preview_personalization","publishing"],sn=A.enum(vu),Cu=["company_info","website_crawl","website_basic_info_extract","website_metrics_evaluate","intelligent_analysis","strategy_recommendation"],pr=A.enum(Cu),Du=["started","running","succeeded","failed","invalidated"],dr=A.enum(Du),ju=["draft","structure_saved","generating","workspace_ready"],ls=A.enum(ju),Ou=["not_deployed","deploying","deployed"],ps=A.enum(Ou),Nu=["active","completed"],Lu=A.enum(Nu),Mu=["completed","current","locked"],Uu=A.enum(Mu),ur={draft:10,structure_saved:20,generating:30,workspace_ready:40},gr={not_deployed:10,deploying:20,deployed:30},_r={active:10,completed:20},hr={started:10,running:20,succeeded:30,failed:40,invalidated:50};function Wn(e){return new Map(Object.entries(e).map(([n,i])=>[i,n]))}var qu=Wn(ur),Fu=Wn(gr),Gu=Wn(_r),zu=Wn(hr);function VT(e){let n=qu.get(e);if(!n)throw new Error(`Unknown site build status code: ${e}`);return n}function HT(e){let n=Fu.get(e);if(!n)throw new Error(`Unknown site deployment status code: ${e}`);return n}function $T(e){let n=Gu.get(e);if(!n)throw new Error(`Unknown site workflow status code: ${e}`);return n}function YT(e){let n=zu.get(e);if(!n)throw new Error(`Unknown task execution status code: ${e}`);return n}function XT(e){return ur[e]}function QT(e){return gr[e]}function ZT(e){return _r[e]}function JT(e){return hr[e]}var ds=[{definition_version:1,published:!0,required_client_capability:null,definitions:{with_website:[{id:"01900000-0000-7000-8000-000000000001",node_code:"welcome",label:"\u6B22\u8FCE\u542F\u52A8",sort_order:1,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000002",node_code:"website_scan",label:"\u521D\u59CB\u5316\u9700\u6C42\u4E0E\u5B98\u7F51\u626B\u63CF",sort_order:2,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000003",node_code:"analysis",label:"\u667A\u80FD\u5206\u6790",sort_order:3,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000004",node_code:"diagnosis",label:"\u8BCA\u65AD\u62A5\u544A",sort_order:4,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000005",node_code:"strategy",label:"\u7B56\u7565\u4E0E\u5EFA\u8BAE",sort_order:5,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000014",node_code:"structure_planning",label:"\u7ED3\u6784\u89C4\u5212",sort_order:6,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000015",node_code:"preview_personalization",label:"\u9884\u89C8\u4E0E\u4E2A\u6027\u5316",sort_order:7,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000016",node_code:"publishing",label:"\u7F51\u7AD9\u53D1\u5E03",sort_order:8,is_enabled:!0}],without_website:[{id:"01900000-0000-7000-8000-00000000000b",node_code:"welcome",label:"\u6B22\u8FCE\u542F\u52A8",sort_order:1,is_enabled:!0},{id:"01900000-0000-7000-8000-00000000000c",node_code:"customer_materials",label:"\u5BA2\u6237\u8D44\u6599\u63D0\u4F9B",sort_order:2,is_enabled:!0},{id:"01900000-0000-7000-8000-00000000000d",node_code:"analysis",label:"\u667A\u80FD\u5206\u6790",sort_order:3,is_enabled:!0},{id:"01900000-0000-7000-8000-00000000000e",node_code:"strategy",label:"\u7B56\u7565\u4E0E\u5EFA\u8BAE",sort_order:4,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000017",node_code:"structure_planning",label:"\u7ED3\u6784\u89C4\u5212",sort_order:5,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000018",node_code:"preview_personalization",label:"\u9884\u89C8\u4E0E\u4E2A\u6027\u5316",sort_order:6,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000019",node_code:"publishing",label:"\u7F51\u7AD9\u53D1\u5E03",sort_order:7,is_enabled:!0}]}}],ek=ds[0].definitions,Sr=A.number().int().min(1),Ku=A.object({id:W,flow_type:Bn,definition_version:Sr,node_code:sn,label:A.string().min(1),sort_order:A.number().int().min(1),is_enabled:A.boolean(),state:Uu}),fr=A.object({id:Da,tenant_id:A.string().min(1),site_id:R,workflow_id:ze,node_code:sn,task_type:pr,external_task_id:A.string().min(1),execution_status:dr,idempotency_key:A.string().min(1),attempt_no:A.number().int().min(1),source_crawl_task_ref_id:A.string().uuid().nullable(),succeeded_at:A.string().min(1).nullable(),superseded_at:A.string().min(1).nullable(),site_url:A.string().url().nullable(),created_at:A.string().min(1),updated_at:A.string().min(1)}),Bu=A.object({id:ze,tenant_id:A.string().min(1),site_id:R,flow_type:Bn,website:ms.nullable(),definition_version:Sr,current_node_code:sn,status:Lu,started_at:A.string().min(1),completed_at:A.string().min(1).nullable(),created_at:A.string().min(1),updated_at:A.string().min(1)}),us=A.object({workflow:Bu,menu:A.array(Ku),task_refs:A.array(fr),site:A.object({default_locale:_e.optional(),status:ls,deployment_status:ps,archived_at:A.string().min(1).nullable(),current_sitemap_id:A.string().nullable().optional(),current_sitemap_version:A.number().int().positive().nullable().optional(),confirmed_sitemap_id:A.string().nullable().optional(),confirmed_sitemap_version:A.number().int().positive().nullable().optional(),structure_confirmed_at:A.string().min(1).nullable().optional(),current_snapshot_id:A.string().nullable(),deployed_url:A.string().url().nullable(),cms_site_id:A.string().min(1).nullish()})}),tk=M(us),nk=M(fr),lr=A.array(A.string().min(1).max(64)).max(16).optional(),ik=A.discriminatedUnion("flow_type",[A.object({flow_type:A.literal("with_website"),website:ms,client_capabilities:lr}).strict(),A.object({flow_type:A.literal("without_website"),website:A.null().optional(),client_capabilities:lr}).strict()]),sk=A.object({expected_current_node:A.literal("website_scan"),website:ms}).strict(),ak=A.object({expected_current_node:sn}).strict(),ok=A.object({expected_current_node:A.literal("publishing")}).strict(),Wu=A.object({node_code:sn,task_type:pr,external_task_id:A.string().min(1).max(255),idempotency_key:A.string().min(1).max(255),site_url:A.string().url().optional()}),rk=Wu.extend({workflow_id:ze}).strict(),ck=A.object({external_task_id:A.string().min(1).max(255),execution_status:dr}),Vu=A.object({previous_external_task_id:A.string().min(1).max(255),external_task_id:A.string().min(1).max(255),idempotency_key:A.string().min(1).max(255),site_url:A.string().url().optional()}),mk=Vu.extend({workflow_id:ze}).strict(),Hu=A.object({previous_external_task_id:A.string().min(1).max(255),external_task_id:A.string().min(1).max(255),idempotency_key:A.string().min(1).max(255),site_url:A.string().url()}),lk=Hu.extend({workflow_id:ze}).strict(),pk=A.object({}).strict();function $u(e,n,i){return e.find(a=>a.definition_version===i)?.definitions[n]}function Yu(e,n){return $u(ds,e,n)}function Xu(e,n=1){let i=Yu(e,n);if(!i)throw new Error(`Unknown workflow definition: ${e} v${n}.`);return i}function Qu(e,n,i){let a=new Set(i);return e.filter(s=>s.published&&(s.required_client_capability===null||a.has(s.required_client_capability))).sort((s,r)=>r.definition_version-s.definition_version).map(s=>({definition_version:s.definition_version,items:s.definitions[n]}))[0]}function dk(e,n){return Qu(ds,e,n)}function uk(e,n){return Xu(e).findIndex(i=>i.node_code===n)}function gk(e,n){return e==="website_scan"?n==="website_crawl"||n==="website_basic_info_extract"||n==="website_metrics_evaluate":e==="customer_materials"?n==="company_info":e==="analysis"?n==="intelligent_analysis":e==="strategy"?n==="strategy_recommendation":!1}function _k(e,n){if(e===n)return n;if(!{started:["running","succeeded","failed","invalidated"],running:["succeeded","failed","invalidated"],succeeded:["invalidated"],failed:["invalidated"],invalidated:[]}[e].includes(n))throw new Error(`Invalid task execution status transition: ${e} -> ${n}`);return n}function hk(e,n){if(e===n)return n;if(!{draft:["structure_saved"],structure_saved:["generating","draft"],generating:["workspace_ready","structure_saved"],workspace_ready:[]}[e].includes(n))throw new Error(`Invalid site build status transition: ${e} -> ${n}`);return n}import{z as x}from"zod";var gs=x.string().min(1).max(120).regex(/^[a-z][a-z0-9_-]*$/),we=x.string().min(1).max(120).regex(/^[A-Za-z_][A-Za-z0-9_]*$/),Zu=x.enum(["text","select","multi_select","tags","category_list","boolean","number"]),an=x.string().min(1).max(512).regex(/^\/(?:[^?#]*)$/),Ju=x.object({minimum:x.number().finite(),maximum:x.number().finite(),step:x.number().finite().positive()}).strict().refine(e=>e.minimum<e.maximum,{message:"minimum must be less than maximum"}),eg=x.string().trim().min(1).max(100),yr=x.array(eg).max(5).refine(e=>new Set(e.map(n=>n.toLowerCase())).size===e.length,{message:"popular_terms must be unique ignoring case"}),yk=x.array(x.string()).max(20).transform(e=>{let n=new Set;return e.map(i=>i.trim()).filter(i=>{if(i.length===0||i.length>100)return!1;let a=i.toLowerCase();return n.has(a)?!1:(n.add(a),!0)}).slice(0,5)}),xr=x.object({filter_enabled:x.boolean(),selected_fields:x.array(we).max(64),selected_card_fields:x.array(we).max(64).default([]),popular_terms_enabled:x.boolean().default(!1),popular_terms:yr.optional()}).strict(),tg=x.object({app_slug:gs}).extend(xr.shape).strict(),_s=x.object({kind:x.literal("product_search_confirmation"),baseline_snapshot_id:T,target_route_id:an,applications:x.array(x.object({app_slug:gs,label:x.string().min(1).max(200),popular_terms:yr.default([]),current_config:xr.nullable().default(null),affected_routes:x.array(an).max(64).default([]),fields:x.array(x.object({field_name:we,label:x.string().min(1).max(200),value_shape:Zu,option_count:x.number().int().nonnegative().optional(),filter_meta:Ju.optional()}).strict()).max(64)}).strict()).min(1).max(12),current_config:tg.nullable().optional(),affected_routes:x.array(an).min(1).max(64).optional()}).strict(),ng=x.object({kind:x.literal("product_search_confirmation"),action:x.enum(["confirm","modify"]),app_slug:gs,filter_enabled:x.boolean(),popular_terms_enabled:x.boolean().default(!1),selected_fields:x.array(we).max(64),selected_card_fields:x.array(we).max(64).default([])}).strict().superRefine((e,n)=>{e.filter_enabled&&e.selected_fields.length===0&&n.addIssue({code:"custom",path:["selected_fields"],message:"selected_fields must not be empty while filters are enabled"}),new Set(e.selected_fields).size!==e.selected_fields.length&&n.addIssue({code:"custom",path:["selected_fields"],message:"selected_fields must be unique"}),new Set(e.selected_card_fields).size!==e.selected_card_fields.length&&n.addIssue({code:"custom",path:["selected_card_fields"],message:"selected_card_fields must be unique"})}),Vn=x.union([ng,x.object({kind:x.literal("product_search_confirmation"),action:x.literal("cancel")}).strict()]),on=x.union([x.string().max(255),x.number().finite(),x.boolean()]),ig=x.object({values:x.array(on).min(1).max(20).refine(e=>new Set(e.map(n=>`${typeof n}:${String(n)}`)).size===e.length,{message:"values must be unique"})}).strict(),sg=x.object({min:x.number().finite().optional(),max:x.number().finite().optional(),include_unlabeled:x.boolean().optional()}).strict().refine(e=>e.min!==void 0||e.max!==void 0||e.include_unlabeled===!0,{message:"a numeric boundary or include_unlabeled is required"}).refine(e=>e.min===void 0||e.max===void 0||e.min<=e.max,{message:"min must not be greater than max"}),ag=x.object({q:x.string().max(200),page:x.number().int().min(1).max(500),page_size:x.union([x.literal(9),x.literal(20)]),sort:x.enum(["published_at_desc","published_at_asc","product_name_asc","product_name_desc"]),filters:x.record(we,x.union([ig,sg])).superRefine((e,n)=>{Object.keys(e).length>12&&n.addIssue({code:"custom",message:"filters must contain at most 12 fields"})}),display_fields:x.array(we).max(64).default([]),missing_count_fields:x.array(we).max(12).default([]),relaxation_count_fields:x.array(we).max(12).default([]),facets:x.array(x.object({field:we,query:x.string().max(100),page:x.number().int().min(1).max(100),page_size:x.literal(10),include_values:x.array(on).max(20)}).strict()).max(8)}).strict(),br=x.object({value:on,label:x.string().max(200),count:x.number().int().nonnegative()}).strict(),og=x.union([on,x.array(on).max(50)]),rg=x.object({items:x.array(x.object({id:x.number().int().positive(),thumbnail:x.string().max(2048).nullable(),title:x.string().max(300),summary:x.string().max(2e3),category:x.string().max(300).nullable(),field_values:x.record(we,og).default({}),url:x.string().min(1).max(2048)}).strict()).max(20),page:x.object({total:x.number().int().nonnegative(),page:x.number().int().positive(),page_size:x.union([x.literal(9),x.literal(20)])}).strict(),facets:x.array(x.object({field:we,total:x.number().int().nonnegative(),page:x.number().int().positive(),page_size:x.literal(10),values:x.array(br).max(10),selected_values:x.array(br).max(20)}).strict()).max(8),missing_counts:x.record(we,x.number().int().nonnegative()).default({}),relaxation_counts:x.record(we,x.number().int().nonnegative()).default({})}).strict(),xk=x.object({contract_version:x.literal(1),request:ag,response:rg}).strict();import{z as rn}from"zod";var cg=["deployment_queued","prepare_source","build_artifact","publish_site","site_released","cleanup_release"],mg=rn.enum(cg),lg=rn.enum(["running","succeeded","failed"]),pg=rn.object({code:mg,status:lg,message:rn.string().trim().min(1)}).strict(),Er=rn.array(pg);import{z as P}from"zod";var dg=P.enum(["pending","running","succeeded","failed"]),ug=P.enum(["TASK_FAILED","WEBSITE_UNREACHABLE"]),gg=P.object({task_id:P.string().uuid(),site_url:P.string().url(),crawler_task_id:P.string().min(1).max(255).nullable(),crawler_error_code:ug.nullable().optional(),crawler_failure_stage:P.enum(["URL_DISCOVERY","PAGE_CRAWL","TASK_SCHEDULING","RESULT_PERSISTENCE"]).nullable().optional(),page_count:P.number().int().min(0).max(20),status:dg,error:P.string().nullable(),created_at:P.string().min(1),updated_at:P.string().min(1)}),Ak=M(gg),hs=P.enum(["existing_site","new_site"]),Ir=P.enum(["google_indexing","ai_recommendation","qualification_verifiability","content_freshness","inquiry_form","inquiry_response","privacy_compliance","prohibited_content"]),Ss=P.object({label:P.string().trim(),value:P.union([P.string(),P.number(),P.boolean(),P.null()]),summary:P.string().trim(),tone:P.enum(["good","warn","bad","unknown"]),status:P.enum(["ok","unknown"])}),Hn=P.object({key:P.string().trim().min(1).max(100),label:P.string().trim().min(1).max(100),value:P.union([P.string().max(1e3),P.number(),P.boolean(),P.null()]),tone:P.enum(["good","warn","bad","unknown"]),status:P.enum(["ok","unknown"]),evidence:P.string().trim().max(2e3).optional()}).strict(),_g=P.object({url:P.string().url().max(2048),title:P.string().trim().max(300),words:P.number().int().nonnegative().max(1e7)}).strict(),hg=P.object({site_url:P.string().url().max(2048),scanned_at:P.string().datetime({offset:!0}),reach:P.array(Hn).max(64),trust:P.array(Hn).max(64),convert:P.array(Hn).max(64),safe:P.array(Hn).max(64),pages:P.array(_g).max(100)}).strict(),$n=P.object({company_task_id:P.string().min(1).max(128),scan_task_id:P.string().min(1).max(128),type:hs,result:P.object({company_name:P.string(),website:P.string().url().optional(),primary_product:P.string(),current_market:P.string(),qualifications:P.string(),scan_cards:P.record(P.string(),Ss),scan_result:hg.optional()})}),Sg=P.object({saved:P.literal(!0),company_task_id:P.string().min(1).max(128),scan_task_id:P.string().min(1).max(128)}),Pk=M(Sg),fg=P.enum(["snapshot","task"]),bg=$n.shape.result.extend({type:hs,structured_facts:P.unknown().optional()}).extend({company_name:P.string(),primary_product:P.string(),current_market:P.string(),qualifications:P.string()}),yg=P.object({site_id:P.string().min(1).max(128),company_task_id:P.string().min(1).max(128),scan_task_id:P.string().min(1).max(128),type:hs,data_source:fg,result:bg}),wk=M(yg.nullable());import{z as he}from"zod";var rt=he.enum(["company","product_service","case_qualification","market","contact_inquiry","privacy_compliance","news_freshness"]),xg=he.object({ordinal:he.number().int().min(1).max(1e4),path:he.string().min(1).max(2048).refine(e=>!Rg(e),{message:"path must be a site-relative path, not an absolute URL"}),last_modified:he.string().max(64).nullable()}).strict(),Dk=he.object({candidates:he.array(xg).min(1).max(1e4),selection_limit:he.number().int().min(1).max(19)}).strict().superRefine((e,n)=>{let i=e.candidates.map(a=>a.ordinal).sort((a,s)=>a-s);for(let[a,s]of i.entries())if(s!==a+1){n.addIssue({code:"custom",path:["candidates"],message:"candidates ordinals must be unique and consecutive from 1"});return}}),Eg=he.object({ordinal:he.number().int().positive().max(1e4),roles:he.array(rt).min(1).max(7)}).strict(),Ig=he.object({role:rt,status:he.enum(["selected","not_found"]),selected_ordinals:he.array(he.number().int().positive().max(1e4)).max(19)}).strict(),jk=he.object({selections:he.array(Eg).max(19),coverage:he.array(Ig).length(7)}).strict().superRefine((e,n)=>{let i=new Set;for(let[s,r]of e.coverage.entries())i.has(r.role)&&n.addIssue({code:"custom",path:["coverage",s,"role"],message:"coverage roles must be unique"}),i.add(r.role);for(let s of rt.options)i.has(s)||n.addIssue({code:"custom",path:["coverage"],message:`coverage must include every page role (missing ${s})`});let a=new Map;for(let s of e.selections)for(let r of s.roles){let d=a.get(r)??new Set;d.add(s.ordinal),a.set(r,d)}for(let[s,r]of e.coverage.entries()){let d=a.get(r.role);r.selected_ordinals.some(g=>!d?.has(g))&&n.addIssue({code:"custom",path:["coverage",s,"selected_ordinals"],message:"selected_ordinals must reference selections carrying the same role"})}});function Rg(e){let n=e.toLowerCase();return n.startsWith("http://")||n.startsWith("https://")||e.startsWith("//")}import{z as S}from"zod";var Mk=S.object({force_refresh:S.boolean().optional()}),Tr=S.enum(["running","succeeded","failed"]),Tg=S.object({agent_id:S.string().min(1),name:S.string().min(1),icon:S.string().min(1),capability:S.string().min(1),data_source:S.string().min(1),output_topics:S.string().min(1)}),kg=S.object({site_mode:S.enum(["existing_site","new_site"]),scan_required:S.boolean(),scheduled_agent_ids:S.array(S.string().min(1)),omitted_agent_ids:S.array(S.string().min(1)),next_stage:S.enum(["diagnostic_report","strategy"])}),Ag=S.object({t:S.string(),d:S.string(),evidence:S.object({from:S.string(),url:S.string().nullable().optional(),value:S.string().nullable().optional()})}),Pg=S.enum(["complete","partial","insufficient_data","failed"]),wg=S.enum(["ok","failed","insufficient_data"]),fs=S.object({agent_id:S.string().min(1),name:S.string().min(1),icon:S.string().min(1),status:wg,topics:S.array(S.object({topic_id:S.string().min(1),status:Pg,evidence_refs:S.array(S.string())})).length(3),findings:S.array(Ag).max(3),elapsed_ms:S.number().nonnegative(),note:S.string().optional(),error:S.string().optional()}),kr=S.object({total:S.number().int().nonnegative(),ok:S.number().int().nonnegative(),degraded:S.number().int().nonnegative(),total_findings:S.number().int().nonnegative(),elapsed_ms:S.number().nonnegative(),site_mode:S.enum(["existing_site","new_site"]).optional(),scheduled_agent_ids:S.array(S.string()).optional(),omitted_agent_ids:S.array(S.string()).optional(),scheduled:S.number().int().nonnegative().optional(),complete:S.number().int().nonnegative().optional(),partial:S.number().int().nonnegative().optional(),insufficient:S.number().int().nonnegative().optional(),failed:S.number().int().nonnegative().optional(),next_stage:S.enum(["diagnostic_report","strategy"]).optional()}),vg=S.object({agents_done:S.boolean(),analysis:S.record(S.string(),fs),step4_scoring_input:S.unknown().optional(),summary:kr}),Ar=S.object({job_id:S.string().min(1),site_id:S.string().min(1),model_version:S.string().min(1),output_locale:S.string().min(2),cached:S.boolean().optional(),status:Tr,result:vg.nullable().optional(),error:S.string().nullable().optional()}),Uk=M(S.array(Tg)),qk=M(kg),Fk=M(Ar),Gk=M(Ar.nullable()),et=S.object({id:S.union([S.number().int().nonnegative(),S.string().regex(/^(0|[1-9]\d*)$/u).transform(Number)]).pipe(S.number().int().nonnegative())}),Rr=S.object({percent:S.number().int().min(0).max(100),phase:S.enum(["preparing","analyzing","finalizing","completed","failed"]),stage:S.enum(["queued","baseline_ready","source_pages_ready","external_evidence_ready","knowledge_evidence_ready","page_evidence_ready","analysis_context_ready","preparation_saved","workflow_ready","agent_started","agent_completed","workflow_completed","scoring_input_ready","red_texts_ready","result_ready","result_persisted","completed","failed"]),agents_done:S.number().int().nonnegative(),agents_total:S.number().int().nonnegative(),agent_id:S.string().min(1).optional()}),zk=S.discriminatedUnion("event",[et.extend({event:S.literal("snapshot"),data:S.object({job_id:S.string().min(1),status:Tr,done:S.number().int().nonnegative(),total:S.number().int().nonnegative(),results:S.array(fs),progress:Rr.optional()})}),et.extend({event:S.literal("progress"),data:Rr}),et.extend({event:S.literal("preparing_started"),data:S.object({stage:S.literal("baseline")})}),et.extend({event:S.literal("preparing_progress"),data:S.object({stage:S.enum(["context","external_evidence"])})}),et.extend({event:S.literal("preparing_done"),data:S.object({evidence_count:S.number().int().nonnegative(),rule_count:S.number().int().nonnegative(),degraded_capabilities:S.array(S.string())})}),et.extend({event:S.literal("agent_start"),data:S.object({agent_id:S.string().min(1),name:S.string().min(1),icon:S.string().min(1)})}),et.extend({event:S.literal("agent_done"),data:fs}),et.extend({event:S.literal("done"),data:S.object({agents_done:S.literal(!0),summary:kr})}),et.extend({event:S.literal("failed"),data:S.object({message:S.string().min(1)})})]);import{z as j}from"zod";var ys=j.enum(["reach","trust","convert","safe"]),Ie=j.number().finite(),Cg=j.number().finite().positive(),bs=["reach","trust","convert","safe"],Dg=17,jg=j.enum(["passed","partial","failed"]),Og=j.object({landing_page_mode:j.enum(["intent_dynamic","static","none"]),ab_test_enabled:j.boolean()}).strict(),Ng=j.union([j.boolean(),j.number().finite(),jg,Og]).nullable(),Lg=j.union([j.boolean(),j.number().finite()]).nullable(),Mg=j.object({competitor_avg:j.number().finite(),score_items:j.record(j.string(),Ng),penalty_items:j.record(j.string(),Lg),red_texts:j.array(j.string())}).strict(),Ug=j.record(ys,Mg),qg=j.object({key:ys,score:Ie,pass_score:Ie,gap:Ie}),Fg=j.object({key:j.string(),title:j.string(),is_redline_option:j.boolean().optional(),score:Ie,max_score:Cg,pass_score:Ie,passed:j.boolean(),description:j.string()}),Gg=j.object({key:ys,title:j.string(),alias:j.string(),slogan:j.string(),score:Ie,max_score:j.literal(100),pass_score:Ie,competitor_average:Ie,status:j.enum(["reached","near","not_reached"]),status_name:j.enum(["\u8FBE\u6807","\u63A5\u8FD1","\u672A\u8FBE\u6807"]),summary:j.string(),sub_dimensions:j.array(Fg),red_texts:j.array(j.string()),redline_hit:j.boolean().optional()}),zg=j.object({id:j.number().int().positive(),task_code:j.string().min(1).max(128),is_sync:j.literal(0),status:j.literal("succeeded"),rules:Ug,scores_list:j.object({overview:j.object({pass_scores:j.object({reach:Ie,trust:Ie,convert:Ie,safe:Ie}),total_score:Ie,total_pass_score:Ie,score_gap:Ie,competitor_average_score:Ie,scoring_criteria_text:j.string().min(1),gap_dimensions:j.array(qg).max(4),overall_passed:j.boolean(),all_scores_passed:j.boolean(),diagnosis_passed:j.boolean(),commitment_eligible:j.boolean(),safe_redline_hit:j.boolean()}),dimensions:j.array(Gg).length(4)}),created_at:j.string().datetime({offset:!0}),updated_at:j.string().datetime({offset:!0})}).superRefine((e,n)=>{Kg(e.scores_list.dimensions)||n.addIssue({code:"custom",path:["scores_list","dimensions"],message:"dimensions must include each canonical score dimension."}),e.scores_list.dimensions.reduce((a,s)=>a+s.sub_dimensions.length,0)!==Dg&&n.addIssue({code:"custom",path:["scores_list","dimensions"],message:"dimensions must include 17 subdimensions in total."});for(let[a,s]of e.scores_list.dimensions.entries()){if(s.redline_hit===void 0)continue;let r=s.sub_dimensions.findIndex(d=>d.is_redline_option===void 0);r!==-1&&n.addIssue({code:"custom",path:["scores_list","dimensions",a,"sub_dimensions",r,"is_redline_option"],message:"subdimensions must define is_redline_option when redline_hit is defined."})}}),Vk=M(zg);function Kg(e){let n=e.map(i=>i.key);return n.length===bs.length&&new Set(n).size===bs.length&&bs.every(i=>n.includes(i))}var ct={queued:["preparing_source","lock_failed","deploy_failed"],preparing_source:["building","source_prepare_failed","deploy_failed"],building:["artifact_ready","build_failed","artifact_fetch_failed","artifact_validation_failed","deploy_failed"],artifact_ready:["deploying","deploy_failed"],deploying:["released","deploy_failed"],released:[],lock_failed:[],source_prepare_failed:[],build_failed:[],artifact_fetch_failed:[],artifact_validation_failed:[],deploy_failed:[],cleanup_failed:[]};for(let e of Object.values(ct))Object.freeze(e);Object.freeze(ct);var Yk=Object.freeze(wt.filter(e=>ct[e].length>0)),Xk=Object.freeze(wt.filter(e=>ct[e].length===0)),Bg=Object.freeze(["preparing_source","building","artifact_ready","deploying","released"]),Wg="DEPLOYMENT_TRANSITION_INVALID",xs=class extends Error{constructor(n,i){super(`Invalid deployment transition: ${n} -> ${i}`),this.currentStatus=n,this.nextStatus=i,this.code=Wg,this.name="DeploymentTransitionError"}};function Qk(e){return ct[e]}function Zk(e){return wt.filter(n=>ct[n].some(i=>i===e))}function Vg(e){return ct[e].length>0}function Jk(e){return!Vg(e)}function e1(e,n){if(!ct[e].some(i=>i===n))throw new xs(e,n);return n}function t1(){return Bg}import{z as Hg}from"zod";var s1=".i18n.json",Yn="translation",Pr=new Set(["__proto__","constructor","prototype"]);function vr(e){if(!Xn(e)||Object.keys(e).length===0)return mt("I18N_ROOT_INVALID","Component i18n resources must be a non-empty object.",[]);for(let[n,i]of Object.entries(e)){if(Pr.has(n))return wr([n]);if(!$g(n))return mt("I18N_LOCALE_INVALID",`Component i18n locale must be canonical BCP-47: ${n}`,[n]);if(!Xn(i))return mt("I18N_NAMESPACE_INVALID",`Component i18n locale ${n} must contain only the translation namespace.`,[n]);let a=Object.keys(i);if(a.length!==1||a[0]!==Yn)return mt("I18N_NAMESPACE_INVALID",`Component i18n locale ${n} must contain only the translation namespace.`,[n]);let s=i[Yn];if(!Xn(s))return mt("I18N_RESOURCE_TREE_INVALID",`Component i18n translation namespace for ${n} must be an object.`,[n,Yn]);let r=[{value:s,path:[n,Yn]}];for(;r.length>0;){let d=r.pop();for(let[c,g]of Object.entries(d.value)){let k=[...d.path,c];if(Pr.has(c))return wr(k);if(typeof g!="string"){if(!Xn(g))return mt("I18N_RESOURCE_TREE_INVALID","Component i18n resource leaves must be strings.",k);r.push({value:g,path:k})}}}}return{success:!0,data:e}}function a1(e){let n;try{n=JSON.parse(e)}catch{return mt("I18N_JSON_INVALID","Component i18n resource file must contain valid JSON.",[])}return vr(n)}var o1=Hg.custom(e=>vr(e).success,"Invalid component i18n resources.");function $g(e){try{let n=Intl.getCanonicalLocales(e);return n.length===1&&n[0]===e}catch{return!1}}function Xn(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let n=Object.getPrototypeOf(e);return n===Object.prototype||n===null}function wr(e){return mt("I18N_RESOURCE_KEY_FORBIDDEN",`Component i18n resource key is forbidden: ${e.at(-1)??""}`,e)}function mt(e,n,i){return{success:!1,error:{code:e,message:n,path:i}}}var tt="products",Yg=`/${tt}`,c1=Yg,m1=`${tt} detail`,l1="cms_collection_view",p1="list",d1="detail",Be={zhHans:{pageTitle:"\u4EA7\u54C1\u4E2D\u5FC3",blockLabel:"\u4EA7\u54C1\u6982\u89C8",detailBlockLabel:"\u4EA7\u54C1\u8BE6\u60C5",heroBlockLabel:"\u4EA7\u54C1\u7B80\u4ECB",homeLabel:"\u9996\u9875"},zhHant:{pageTitle:"\u7522\u54C1\u4E2D\u5FC3",blockLabel:"\u7522\u54C1\u6982\u89BD",detailBlockLabel:"\u7522\u54C1\u8A73\u60C5",heroBlockLabel:"\u7522\u54C1\u7C21\u4ECB",homeLabel:"\u9996\u9801"},en:{pageTitle:"Products",blockLabel:"Products overview",detailBlockLabel:"Product details",heroBlockLabel:"Products Introduction",homeLabel:"Home"},de:{pageTitle:"Produkte",blockLabel:"Produkt\xFCbersicht",detailBlockLabel:"Produktdetails",heroBlockLabel:"Produkteinf\xFChrung",homeLabel:"Startseite"},fr:{pageTitle:"Produits",blockLabel:"Aper\xE7u des produits",detailBlockLabel:"D\xE9tails du produit",heroBlockLabel:"Pr\xE9sentation des produits",homeLabel:"Accueil"},es:{pageTitle:"Productos",blockLabel:"Resumen de productos",detailBlockLabel:"Detalles del producto",heroBlockLabel:"Introducci\xF3n de productos",homeLabel:"Inicio"},ja:{pageTitle:"\u88FD\u54C1",blockLabel:"\u88FD\u54C1\u6982\u8981",detailBlockLabel:"\u88FD\u54C1\u8A73\u7D30",heroBlockLabel:"\u88FD\u54C1\u7D39\u4ECB",homeLabel:"\u30DB\u30FC\u30E0"},ko:{pageTitle:"\uC81C\uD488",blockLabel:"\uC81C\uD488 \uAC1C\uC694",detailBlockLabel:"\uC81C\uD488 \uC0C1\uC138",heroBlockLabel:"\uC81C\uD488 \uC18C\uAC1C",homeLabel:"\uD648"}},Xg=new Set(Object.values(Be).map(e=>e.pageTitle)),Qg=new Set(Object.values(Be).flatMap(e=>[e.blockLabel,e.detailBlockLabel,e.heroBlockLabel]));function u1(e){let n=e?.trim().toLowerCase()??"";if(n==="zh-tw"||n==="zh-hk"||n==="zh-mo")return Be.zhHant;if(n.startsWith("zh"))return Be.zhHans;switch(n.split("-")[0]){case"de":return Be.de;case"fr":return Be.fr;case"es":return Be.es;case"ja":return Be.ja;case"ko":return Be.ko;case"en":default:return Be.en}}function g1(e){return Xg.has(e.trim())}function _1(e){return Qg.has(e.trim())}import{z as Ot}from"zod";var b1="SITE_HAS_ACTIVE_SUBSITES",y1="SITE_HAS_SUBSITES",Zg=Ot.object({site_id:R,name:Ot.string().min(1),mount_path:Ot.string().min(1),archived_at:Ot.string().nullable()}),x1=Ot.object({subsites:Ot.array(Zg)});import{z as Se}from"zod";var T1=Se.object({key:Se.string().min(1),composition:ae}).strict(),Zn=Se.enum(["component-boundary","repeat-region","conditional-region","fragment-region","opaque-region"]),Jg=Se.enum(["direct","proxy","upstream","readonly","unsupported"]),e_=Se.enum(["component-boundary","repeat-region","conditional-region","opaque-region","void-element","read-only","cross-file-required","import-required"]),Qn=Se.object({mode:Jg,reasonCode:Se.string().min(1).optional()}),t_=Se.object({kind:e_,message:Se.string().min(1)}),Jn=Se.object({composition:U,key:Se.string().min(1),canUpdateText:Se.boolean(),canInsertChild:Se.boolean(),canMove:Se.boolean(),canRemove:Se.boolean(),editModes:Se.object({updateText:Qn.optional(),insertChild:Qn.optional(),move:Qn.optional(),remove:Qn.optional()}).optional(),constraints:Se.array(t_)}).strict();import{z as K}from"zod";var D1=K.discriminatedUnion("type",[K.object({type:K.literal("site-edit.document.changed"),siteId:R,snapshotId:T,composition:U,version:K.number().int().nonnegative(),at:K.string().min(1)}).strict(),K.object({type:K.literal("site-edit.operation.planned"),siteId:R,operationId:K.string().min(1),baseSnapshotId:T,composition:U,changedFiles:K.array(K.string().min(1)),at:K.string().min(1)}).strict(),K.object({type:K.literal("site-edit.operation.completed"),siteId:R,composition:U,result:cs,at:K.string().min(1)}).strict(),K.object({type:K.literal("site-edit.operation.failed"),siteId:R,composition:U,requestId:K.string().min(1),error:rr,at:K.string().min(1)}).strict(),K.object({type:K.literal("site-edit.capability.changed"),siteId:R,composition:U,keys:K.array(K.string().min(1)),at:K.string().min(1)}).strict(),K.object({type:K.literal("site-edit.graph.invalidated"),siteId:R,composition:U,at:K.string().min(1)}).strict(),K.object({type:K.literal("site-edit.graph.ready"),siteId:R,composition:U,version:K.number().int().nonnegative(),at:K.string().min(1)}).strict(),K.object({type:K.literal("site-edit.graph.error"),siteId:R,composition:U,message:K.string().min(1),at:K.string().min(1)}).strict(),K.object({type:K.literal("site-edit.snapshot.changed"),siteId:R,composition:U,snapshotId:T,previousSnapshotId:K.string().min(1).nullable(),at:K.string().min(1)}).strict()]);import{z as ee}from"zod";var L1="durable-history-v1",ei=ee.object({initiatingComposition:U.optional(),affectedCompositions:ee.array(U)}).strict(),M1=ee.enum(["writable","read-only-recovery","unavailable"]),n_=ee.enum(["INDEX_CORRUPT","ENTRY_MISSING","BLOB_MISSING","FILESYSTEM_UNAVAILABLE","ROLLBACK_INCOMPLETE","UNKNOWN"]),i_=ee.object({code:n_,message:ee.string().min(1),occurredAt:ee.iso.datetime().optional()}).strict(),s_=ee.enum(["NOT_INITIALIZED","FILESYSTEM_UNAVAILABLE","UNSUPPORTED_RUNTIME"]),Cr={revision:ee.number().int().nonnegative(),undoDepth:ee.number().int().nonnegative(),redoDepth:ee.number().int().nonnegative()},a_=ee.object({mode:ee.literal("writable"),composition:U,...Cr,canUndo:ee.boolean(),canRedo:ee.boolean(),provenance:ei.optional()}).strict().superRefine((e,n)=>{e.canUndo!==e.undoDepth>0&&n.addIssue({code:"custom",path:["canUndo"],message:"canUndo must reflect undoDepth."}),e.canRedo!==e.redoDepth>0&&n.addIssue({code:"custom",path:["canRedo"],message:"canRedo must reflect redoDepth."})}),o_=ee.object({mode:ee.literal("read-only-recovery"),composition:U,...Cr,canUndo:ee.literal(!1),canRedo:ee.literal(!1),recoveryDiagnostic:i_,provenance:ei.optional()}).strict(),r_=ee.object({mode:ee.literal("unavailable"),composition:U,revision:ee.literal(0),undoDepth:ee.literal(0),redoDepth:ee.literal(0),canUndo:ee.literal(!1),canRedo:ee.literal(!1),reason:s_,provenance:ei.optional()}).strict(),c_=ee.discriminatedUnion("mode",[a_,o_,r_]),U1=ee.object({composition:U,status:c_,provenance:ei}).strict();import{z as G}from"zod";var ti=G.enum(["api-field","cms-field","i18n-message","config-entry"]),Es=G.object({kind:G.enum(["jsx-node","value-path","route-export","external-entry"]),file:G.string().min(1).optional(),isProxy:G.boolean(),displayPath:G.string().min(1).optional(),sourceType:ti.optional(),sourceId:G.string().min(1).optional()}),m_=G.discriminatedUnion("status",[G.object({status:G.literal("resolved"),value:Et}).strict(),G.object({status:G.literal("undefined")}).strict(),G.object({status:G.literal("unresolved")}).strict()]),l_=G.object({kind:G.enum(["literal","boolean-shorthand","expression","binding","repeat-template"]),raw:G.string().optional()}).strict(),p_=G.object({name:G.string().min(1),source:l_,resolution:m_,editMode:G.enum(["direct","proxy","upstream","readonly","unsupported"]),sourceScope:G.enum(["node","repeat-item","repeat-template"]),allowedWriteScopes:G.array(G.enum(["selection","template"])),effectiveWriteTarget:Es.optional(),diagnostics:G.array(G.object({code:G.string().min(1),message:G.string().min(1)}).strict())}).strict(),d_=G.object({raw:G.string().min(1),sourceRange:Qe,order:G.number().int().nonnegative(),diagnostics:G.array(G.object({code:G.string().min(1),message:G.string().min(1)}).strict())}).strict(),u_=G.object({selection:G.enum(["direct","materialize","unsupported"]),template:G.enum(["direct","unsupported"])}).strict(),Is=G.object({documentVersion:G.number().int().nonnegative(),selectionRef:jt.optional(),items:G.array(p_),spreads:G.array(d_),creation:u_}).strict().superRefine((e,n)=>{let i=e.selectionRef;i&&i.instanceIndex!==void 0&&i.instanceCount!==void 0&&i.instanceIndex>=i.instanceCount&&n.addIssue({code:"custom",path:["selectionRef","instanceIndex"],message:"instanceIndex must be smaller than instanceCount"})});import{z as fe}from"zod";var g_=fe.string().min(1).refine(e=>!e.startsWith("/")&&!e.includes(".."),{message:"Patch paths must be safe relative POSIX paths."}),__=fe.string().regex(/^sha256:[a-f0-9]{64}$/),h_=fe.object({path:g_,operation:fe.enum(["create","update","delete"]),expectedHash:__.optional(),fullContent:fe.string().optional()}).superRefine((e,n)=>{e.operation==="delete"&&e.fullContent!==void 0&&n.addIssue({code:"custom",path:["fullContent"],message:"delete patches must not include fullContent"}),e.operation!=="delete"&&e.fullContent===void 0&&n.addIssue({code:"custom",path:["fullContent"],message:"create/update patches must include fullContent"})}),S_=fe.object({siteId:R,baseSnapshotId:T,operationId:fe.string().min(1),reason:fe.string().min(1),patches:fe.array(h_).min(1),changedCompositions:fe.array(U),changedRouteIds:fe.array(fe.string().min(1)).optional(),diagnostics:fe.array(fe.object({code:fe.string().min(1),message:fe.string().min(1),path:fe.string().min(1).optional()})).default([])}).strict().superRefine((e,n)=>{let i=new Set;for(let[s,r]of e.patches.entries())i.has(r.path)&&n.addIssue({code:"custom",path:["patches",s,"path"],message:`Duplicate patch path: ${r.path}`}),i.add(r.path);let a=[...new Set(e.changedCompositions.map(s=>s.routeId))];e.changedRouteIds!==void 0&&(e.changedRouteIds.length!==a.length||e.changedRouteIds.some((s,r)=>s!==a[r]))&&n.addIssue({code:"custom",path:["changedRouteIds"],message:"changedRouteIds must be the stable deduplicated route projection of changedCompositions."})}),$1=S_.transform(e=>({...e,changedRouteIds:[...new Set(e.changedCompositions.map(n=>n.routeId))]}));var Rs="::repeat-item#";function f_(e,n){return`${e}${Rs}${n}`}function X1(e,n){return n.reduce((i,a)=>f_(i,a),e)}function b_(e){if(typeof e!="string"||e.length===0)return null;let n=[],i=e;for(;;){let a=i.lastIndexOf(Rs);if(a<0)break;let s=Number(i.slice(a+Rs.length));if(!Number.isInteger(s)||s<0)return null;n.unshift({repeatIndex:s}),i=i.slice(0,a)}return!i||n.length===0?null:{baseKey:i,parts:n}}function Q1(e){return b_(e)?.baseKey??e??null}import{z as m}from"zod";import{z as Te}from"zod";var y_=Te.object({placementKey:Te.string().min(1),placementUnitKey:Te.string().min(1),relation:Te.enum(["before","after","prepend","append"])}).strict(),x_=Te.object({status:Te.literal("supported"),containerKey:Te.string().min(1),hasBusinessMembers:Te.boolean(),placementUnitKeys:Te.array(Te.string().min(1)),placements:Te.array(y_)}).strict().superRefine((e,n)=>{let i=new Set(e.placementUnitKeys);i.size!==e.placementUnitKeys.length&&n.addIssue({code:"custom",path:["placementUnitKeys"],message:"Render page composition placement unit keys must be unique."});let a=new Set;e.placements.forEach((s,r)=>{a.has(s.placementKey)&&n.addIssue({code:"custom",path:["placements",r,"placementKey"],message:"Render page composition placement keys must be unique."}),a.add(s.placementKey),i.has(s.placementUnitKey)||n.addIssue({code:"custom",path:["placements",r,"placementUnitKey"],message:"Render page composition placement must reference a projected unit."})})}),E_=Te.object({status:Te.literal("unsupported"),reason:Kn,diagnostics:Te.array(tn)}).strict(),Dr=Te.discriminatedUnion("status",[x_,E_]);var I_=m.object({canUpdateText:m.boolean(),canInsertChild:m.boolean(),canMove:m.boolean(),canRemove:m.boolean()}),jr=m.enum(["vcp-cms-collection","vcp-cms-form","vcp-cms-settings","vcp-cms-navigation","site-api-route","external-api","unknown-api"]),R_=m.enum(["cms-field","api-field"]),T_=m.enum(["text","attribute","richtext","repeat-region","conditional-region","component-prop"]),k_=m.enum(["exact","safe-derived","partial","unknown"]),A_=m.object({file:m.string().min(1),symbol:m.string().min(1).optional(),reason:m.string().min(1)}),P_=m.object({sourceKind:jr,sourceType:R_,endpointPattern:m.string().min(1).optional(),operation:m.string().min(1).optional(),collection:m.string().min(1).optional(),fieldPath:m.string().min(1).optional(),valuePath:m.string().min(1).optional(),targetKind:T_,targetName:m.string().min(1),confidence:k_,readonly:m.literal(!0),evidence:m.array(A_)}),Or=m.object({hasDynamicData:m.boolean(),bindings:m.array(P_)}),Nr=m.object({hasDynamicData:m.boolean(),sourceKinds:m.array(jr),primaryEndpoint:m.string().min(1).optional(),primaryCollection:m.string().min(1).optional(),primaryFieldPath:m.string().min(1).optional()}),w_=m.object({key:m.string().min(1),pageCompositionUnitKey:m.string().min(1).optional(),operationSummary:I_,dynamicDataSummary:Nr.optional()}).strict(),g0=m.object({composition:ae}).strict(),_0=m.object({key:m.string().min(1),composition:ae,selectionRef:jt.optional()}).strict(),h0=m.object({siteId:R,snapshotId:T,composition:U,version:m.number().int().nonnegative(),entries:m.array(w_),pageComposition:Dr}).strict(),Lr=m.object({kind:m.enum(["literal","binding","imported-binding","repeat-template"]),file:m.string().min(1),expression:m.string().min(1),bindingName:m.string().min(1).optional(),path:m.array(m.union([m.string(),m.number()])).optional()}),Ts=m.object({index:m.number().int().min(0),value:m.string(),editable:m.boolean(),source:Lr.nullable()}),cn=m.object({key:m.string().min(1),label:m.string().min(1),tag:m.string().min(1)}),S0=m.object({composition:U,key:m.string().min(1),canUpdateText:m.boolean(),canInsertChild:m.boolean(),canMove:m.boolean(),canRemove:m.boolean(),boundaryKind:Zn.nullable(),isOpaque:m.boolean()}).strict(),v_=m.object({kind:m.enum(["jsx-node","component-proxy","value-binding","route-export"]),file:m.string().min(1),componentName:m.string().min(1),isProxy:m.boolean()}),Mr=m.object({kind:m.union([m.enum(["jsx-literal","component-prop","binding","imported-binding","object-field","array-item","repeat-template","conditional-branch"]),ti]),file:m.string().min(1),displayPath:m.string().min(1),externalSource:m.object({sourceType:ti,sourceId:m.string().min(1),adapterId:m.string().min(1).optional()}).optional()}),C_=m.object({kind:Mr.shape.kind,file:m.string().min(1),displayName:m.string().min(1),canEditHere:m.boolean()}),mn=m.object({finalSource:Mr.nullable(),chain:m.array(C_),confidence:m.enum(["exact","safe-derived","partial","unknown"]),editMode:m.enum(["direct","proxy","upstream","readonly","unsupported"]),diagnostics:m.array(m.object({code:m.string().min(1),message:m.string().min(1)}))}),D_=m.object({kind:m.literal("css-style-model"),properties:m.array(m.object({property:nr,value:m.union([m.string(),m.number(),m.boolean(),m.null()]),resolvedValue:m.union([m.string(),m.number(),m.boolean(),m.null()]).optional(),breakpoint:sr.optional(),state:ir.optional(),variants:m.array(m.string().min(1)).optional(),options:m.array(m.union([m.string(),m.number()])).optional(),editable:m.boolean(),diagnostics:m.array(m.object({code:m.string().min(1),message:m.string().min(1)})).optional(),operationBoundary:m.array(nn).optional()}))}),f0=m.union([m.record(m.string(),m.unknown()),D_]),Ur=m.object({kind:m.literal("class-name-source"),className:m.string(),sourceKind:m.enum(["missing","static-attribute","static-expression","dynamic-expression"]),editable:m.boolean(),operationBoundary:m.array(nn),sourcePath:m.string().min(1).optional(),diagnostics:m.array(m.object({code:m.enum(["missing-class-name","dynamic-binding","non-string-binding"]),message:m.string().min(1)})).optional()}),j_=m.object({startLine:m.number().int().positive(),startColumn:m.number().int().nonnegative(),endLine:m.number().int().positive(),endColumn:m.number().int().nonnegative()}),ks=m.object({sourceFile:m.string().min(1),componentName:m.string().min(1),openingElementRange:j_,structuralPath:m.string().min(1),textPreview:m.string().min(1).optional()}),b0=m.object({composition:U,key:m.string().min(1),tag:m.string().min(1),componentName:m.string().min(1),sourceFile:m.string().min(1),sourceLocator:ks.optional(),label:m.string().min(1),capabilities:Jn,writeTarget:v_,effectiveWriteTarget:Es.optional(),provenanceChain:mn.optional(),componentSemantic:m.record(m.string(),m.unknown()).optional(),contentModel:m.record(m.string(),m.unknown()).optional(),mediaModel:m.record(m.string(),m.unknown()).optional(),styleSource:Ur.optional(),conditional:m.record(m.string(),m.unknown()).optional(),dynamicData:Or.optional(),properties:Is.optional(),textSegments:m.array(Ts),boundaryKind:Zn.nullable(),isOpaque:m.boolean(),ancestors:m.array(cn),children:m.array(cn),siblings:m.array(cn)}).strict(),y0=m.object({composition:U,key:m.string().min(1),tag:m.string().min(1),label:m.string().min(1),sourceLocator:ks.optional(),capabilities:m.object({constraints:Jn.shape.constraints}),isOpaque:m.boolean(),provenanceChain:m.object({editMode:mn.shape.editMode,diagnostics:mn.shape.diagnostics}).optional(),dynamicDataSummary:Nr.optional(),ancestors:m.array(cn)}).strict(),x0=m.object({composition:U,key:m.string().min(1),tag:m.string().min(1),label:m.string().min(1),sourceLocator:ks.optional(),isOpaque:m.boolean(),ancestors:m.array(cn),componentName:m.string().min(1),sourceFile:m.string().min(1),capabilities:Jn,provenanceChain:m.object({editMode:mn.shape.editMode,diagnostics:mn.shape.diagnostics}).optional(),textSegments:m.array(m.object({index:Ts.shape.index,editable:Ts.shape.editable,sourceKind:Lr.shape.kind.nullable()})),dynamicData:Or.optional(),properties:Is.optional(),boundaryKind:Zn.nullable()}).strict(),E0=m.object({composition:U,key:m.string().min(1),mediaModel:m.record(m.string(),m.unknown()).optional(),styleSource:Ur.optional()}).strict();var O_=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],N_=["article","aside","div","footer","form","header","li","main","nav","ol","section","select","table","tbody","tfoot","thead","tr","ul"],L_=["a","button","em","h1","h2","h3","h4","h5","h6","label","p","small","span","strong"],M_=new Set(O_),U_=new Set(N_),q_=new Set(L_),F_={canUpdateText:!1,canInsertChild:!1,canMove:!1,canRemove:!1};function R0(e){return M_.has(As(e))}function G_(e){return U_.has(As(e))}function z_(e){return q_.has(As(e))}function T0(e){let{operationSummary:n}=e;return n?{canUpdateText:n.canUpdateText,canInsertChild:n.canInsertChild,canMove:n.canMove,canRemove:n.canRemove}:e.fallbackMode!=="preview"?{...F_}:{canUpdateText:z_(e.tagName),canInsertChild:G_(e.tagName),canMove:!1,canRemove:!1}}function As(e){return e?.trim().toLowerCase()??""}import{z as K_}from"zod";var v0=K_.object({composition:ae,mutationContext:Jt.optional()}).strict();var D0={PATCH_VALIDATION_FAILED:"The code didn't pass validation. Try describing the change more specifically.",PATCH_BATCH_FAILED:"The site code couldn't be generated. Please regenerate the site.",PATCH_BATCH_INVALID:"The change couldn't be applied. Try simpler instructions.",VALIDATION_FAILED:"Your message couldn't be sent as written. Please edit it and try again.",WORKSPACE_MESSAGE_CONTAINS_SECRET:"Your message looks like it contains a secret or token, so it wasn't sent. Remove it and try again.",WORKSPACE_RUN_INPUT_REQUIRED:"Nothing to work on: the request had no instruction, so no edit was started. Describe the change you want and send it.",WORKSPACE_TOOL_RESULT_INVALID:"This change couldn't be completed and was rolled back. Please try again.",WORKSPACE_TOOL_FAILED:"A tool step failed. Please try again.",WORKSPACE_TOOL_RESULT_MISSING:"The tool didn't return a usable result. Please try again.",WORKSPACE_MODEL_STREAM_FAILED:"The model stream ended unexpectedly. Please try again.",WORKSPACE_MODEL_STREAM_ABORTED:"Generation was interrupted before finishing. Please try again.",MODEL_OUTPUT_TRUNCATED:"The response was too long and was cut off before any change was applied. Try again, or split the request into smaller changes.",WORKSPACE_EDIT_NOT_APPLIED:"No change was applied. Try describing the change differently.",PRODUCT_SEARCH_APPLY_NOT_AVAILABLE:"Product search changes aren't available yet. Please try again later.",WORKSPACE_INITIAL_EXECUTION_FAILED:"Initial generation failed. Please retry from the brief.",WORKSPACE_INITIAL_GENERATION_CHECK_FAILED:"Initial generation could not be verified. Please retry.",WORKSPACE_INITIAL_GENERATION_FINALIZE_FAILED:"Initial generation could not finalize. Please retry.",WORKSPACE_INITIAL_GENERATION_QUALITY_GATE_FAILED:"Initial generation failed quality checks. Please regenerate the site.",WORKSPACE_ITERATION_QUALITY_GATE_FAILED:"Quality check failed. The change was rolled back; try a smaller or more specific request.",WORKSPACE_SOCKET_DEAD:"The workspace connection was lost. Please retry.",WORKSPACE_RUN_CANCELLED:"The run was cancelled.",WORKSPACE_RUN_ABANDONED:"This run was interrupted and did not finish. Please try again.",WORKSPACE_RUN_REQUEST_FAILED:"Couldn't start the workspace. Please try again.",WORKSPACE_RUN_BAD_RESPONSE:"The server response was malformed. Please try again.",WORKSPACE_SOCKET_UNAVAILABLE:"Workspace connection unavailable. Please try again.",WORKSPACE_SOCKET_ERROR:"The workspace connection had an error. Please try again.",WORKSPACE_SOCKET_CLOSED:"The workspace connection closed. Please try again.",WORKSPACE_SOCKET_OPEN_TIMEOUT:"Couldn't reach the workspace in time. Please try again.",WORKSPACE_CLIENT_MESSAGE_ID_MISSING:"Something went wrong sending your message. Please try again.",SITE_SNAPSHOT_REQUIRED:"This site has no usable snapshot yet. Complete Step 3 first.",AGENT_TIMEOUT:"That took longer than expected. Try breaking the change into smaller pieces.",SANDBOX_NOT_AVAILABLE:"The preview environment isn't ready. Your edits have still been saved.",PREVIEW_BUILD_FAILED:"Preview is available, but the production build failed. Fix the reported build error before deploying.",PREVIEW_BUILD_NOT_CONFIGURED:"Preview is available, but the production build check is not configured.",PREVIEW_BUILD_SANDBOX_NOT_FOUND:"Preview is available, but the build check could not find the active preview sandbox.",WS_CONNECTION_ERROR:"Connection lost. Reconnecting\u2026",USER_MESSAGE_PERSIST_FAILED:"Your message wasn't saved. Please send it again.",CLARIFICATION_REPLY_STALE:"That question has expired. Please tell me what you'd like to do now.",CLARIFY_MODEL_FAILED:"Clarify couldn't finish generating questions. Please try again.",WORKSPACE_RUN_IN_FLIGHT:"Another session is already running. Please try again in a moment.",SITE_OPERATION_LOCKED:"Another change is already running for this site. Wait for it to finish, then try again.",WORKSPACE_THREAD_NOT_FOUND:"That conversation no longer exists. Switching back to the default conversation.",WORKSPACE_THREAD_ARCHIVED:"This conversation is archived. Start a new one to continue.",WORKSPACE_THREAD_BUSY:"This conversation is still running. Wait for it to finish before archiving.",WORKSPACE_THREAD_READ_ONLY:"Background conversations are read-only here.",WORKSPACE_THREAD_INVALID:"This conversation can't accept new requests right now. Refresh and try again.",EDIT_ENGINE_VERSION_INVALID:"Invalid editor version. Refresh the page and try again.",SANDBOX_DEPENDENCY_SYNC_FAILED:"The preview runtime could not be prepared. Please try again.",SANDBOX_PREVIEW_FAILED:"The site preview failed to start. Please try again.",SANDBOX_DEPENDENCY_VERSION_MISMATCH:"The preview runtime could not be verified. Please try again.",SANDBOX_RUNTIME_NOT_READY:"The preview needs to be refreshed before this change can be applied. Refresh the preview and try again.",GENERIC:"Something went wrong. Please try again."},j0={UNDO_OR_ROLLBACK:"I can't roll back from chat. Use the version history at the top right to pick a restore point.",HISTORY_RECALL:"Tell me what you'd like to change now\u2014I'll work from the current page state.",OUT_OF_SCOPE:"That's outside what I can do from chat. Try the corresponding panel on the right."},O0={CARD_HEADER:"Needs your confirmation",FREE_TEXT_PLACEHOLDER:"Or describe what you'd like instead",SUBMIT_LABEL:"Submit"},N0={SEND_FAILED_RETRY:"Send failed \u2014 tap to retry"};var qr="0.10.2",M0="x-vcp-edit-engine-version",U0="x-vcp-edit-engine-version-source",Ps=class extends Error{constructor(n="Invalid edit-engine version."){super(n),this.code="EDIT_ENGINE_VERSION_INVALID",this.name="EditEngineVersionParseError"}},B_=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z]+(?:\.[0-9A-Za-z]+)*)?$/;function W_(e){return B_.test(e)}function V_(e){if(typeof e!="string"||!W_(e))throw new Ps;return e}function q0(e){return e==null?{version:qr,source:"fallback_current"}:{version:V_(e),source:"explicit"}}function F0(){return{version:qr,source:"system_current"}}import{z as Fe}from"zod";var H_=200,$_=200;function Y_(e){let n=e.indexOf(":");if(n<=0)return null;let i=e.slice(0,n).trim(),a=e.slice(n+1).trim();return i.length===0||a.length===0?null:{source:i,target:a}}var X_=Fe.string().min(3).max(H_).refine(e=>Y_(e)!==null,{message:'glossary entries must be "source:target" pairs split on a half-width colon, e.g. "\u7C73:Rice"'}),K0=Fe.array(X_).max($_),B0=Fe.object({website_name:Fe.string().min(1).max(200),website_industry:Fe.string().min(1).max(200).optional(),website_description:Fe.string().min(1).max(1e3).optional()}),Q_=Fe.enum(["regional","fonts_only"]),ni=Fe.string().regex(/^#[0-9a-fA-F]{6}$/,'color must be a "#rrggbb" value'),Z_=Fe.object({primary:ni.optional(),accent:ni.optional(),foreground:ni.optional(),neutral:ni.optional()}),J_=600,W0=Fe.object({mode:Q_.default("regional"),seeds:Z_.optional(),note:Fe.string().min(1).max(J_).optional()}),V0={mode:"regional"};function H0(e){return e===void 0?!1:Object.values(e).some(n=>typeof n=="string"&&n.length>0)}import{z as ve}from"zod";var eh=ve.string().trim().min(1),Nt=ve.string().uuid(),th=ve.string().min(1).max(2048).refine(e=>e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(n=>n.length>0&&n!=="."&&n!==".."),"object_key must be a relative snapshot store path without empty, '.' or '..' segments"),Fr=ve.object({snapshot_id:Nt,object_key:th}),X0=ve.object({tenant_id:eh,parent_site_id:Nt,subsite_site_id:Nt,base:Fr,target:Fr}),Q0=ve.object({subsite_site_id:Nt,pending_pages:ve.array(ve.string().min(1)),hash_diverged_count:ve.number().int().nonnegative(),child_only_count:ve.number().int().nonnegative(),base_snapshot_id:Nt,target_snapshot_id:Nt}),nh=ve.enum(["SUBSITE_DIFF_REQUEST_INVALID","SUBSITE_DIFF_STORE_NOT_CONFIGURED","SUBSITE_DIFF_MANIFEST_MISSING","SUBSITE_DIFF_MANIFEST_INVALID"]),Z0=ve.object({error_code:nh,message:ve.string().min(1),side:ve.enum(["base","target"]).optional()});import{z as pe}from"zod";var nA=pe.object({tenant_id:pe.string().min(1),site_id:R,snapshot_id:T,manifest_hash:pe.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:pe.string().min(1).max(2048),page_slug:pe.string().max(512).optional()}),iA=pe.object({site_id:R,snapshot_id:T,unit_count:pe.number().int().nonnegative(),file_count:pe.number().int().nonnegative(),markdown:pe.string().min(1),page_slug:pe.string().optional(),page_file:pe.string().optional(),entries:pe.array(pe.object({id:pe.string().min(1),file_path:pe.string().min(1),line:pe.number().int().nullable(),kind:pe.string().min(1),text:pe.string(),media_key:pe.string().optional()})).optional()});import{z as ih}from"zod";var sh=/^\/[a-z0-9][a-z0-9-]{0,30}$/,ah=Object.freeze(["api","_next","assets","static","robots.txt","sitemap.xml",".well-known"]),oh=new Set(ah);function rh(e){return oh.has(e)}var oA=ih.string().regex(sh).refine(e=>!rh(e.slice(1)),{message:"mount_path must not use a reserved segment (api, _next, assets, static, robots.txt, sitemap.xml, .well-known)"});import{z as oe}from"zod";var ch=oe.enum(["active","paused","blocked"]),Gr=oe.enum(["typecheck_failed","health_failed","validation_failed"]),mh={status:ch,attempts:oe.number().int().nonnegative(),attempted_template_version:qe.nullable(),last_error_code:Gr.nullable()},Lt=oe.object(mh).strict(),ii=oe.object({template_id:oe.string().trim().min(1),target_template_version:qe}).strict(),lA=ii,lh=oe.discriminatedUnion("action",[oe.object({action:oe.literal("proceed"),state:Lt.extend({status:oe.literal("active")})}).strict(),oe.object({action:oe.literal("skip_not_newer"),state:Lt.extend({status:oe.literal("active")})}).strict(),oe.object({action:oe.literal("skip_paused"),state:Lt.extend({status:oe.literal("paused")})}).strict(),oe.object({action:oe.literal("skip_blocked"),state:Lt.extend({status:oe.literal("blocked")})}).strict()]),pA=ii,dA=lh,uA=ii.extend({error_code:Gr}),gA=oe.object({state:Lt}).strict(),_A=ii,hA=oe.object({state:Lt}).strict();import{z}from"zod";var ph=744*60*60*1e3,dh=z.enum(["eligible","fast_path","upgraded","skipped","lock_skipped","cas_aborted","validation_failed","blocked","paused"]),uh=z.enum(["typecheck","build","health","validation"]),gh=z.enum(["not_attempted","promoted","aborted"]),xA=z.object({template_id:z.string().trim().min(1).max(128),from_version:qe.nullable(),to_version:qe,outcome:dh,attempt:z.number().int().nonnegative().max(2147483647),duration_ms:z.number().int().nonnegative().max(2147483647),replaced_group_count:z.number().int().nonnegative().max(2147483647),skipped_group_count:z.number().int().nonnegative().max(2147483647),validation_stage:uh.nullable(),cas_outcome:gh.nullable()}).strict(),EA=z.object({recorded:z.literal(!0)}).strict(),zr=z.object({from:z.iso.datetime(),to:z.iso.datetime()}).strict().refine(({from:e,to:n})=>Date.parse(e)<Date.parse(n),{message:"from must be earlier than to",path:["to"]}).refine(({from:e,to:n})=>Date.parse(n)-Date.parse(e)<=ph,{message:"report window must not exceed 31 days",path:["to"]}),IA=zr,_h=z.object({eligible:z.number().int().nonnegative(),fast_path:z.number().int().nonnegative(),upgraded:z.number().int().nonnegative(),skipped:z.number().int().nonnegative(),lock_skipped:z.number().int().nonnegative(),cas_aborted:z.number().int().nonnegative(),validation_failed:z.number().int().nonnegative(),blocked:z.number().int().nonnegative(),paused:z.number().int().nonnegative()}).strict(),RA=z.object({window:zr,outcome_counts:_h,current_state_counts:z.object({blocked:z.number().int().nonnegative(),paused:z.number().int().nonnegative()}).strict(),duration_ms:z.object({p50:z.number().int().nonnegative().nullable(),p95:z.number().int().nonnegative().nullable(),sample_count:z.number().int().nonnegative()}).strict()}).strict(),TA=z.object({older_than:z.iso.datetime(),limit:z.coerce.number().int().min(1).max(200).default(50),include_candidates:z.enum(["true","false"]).default("false").transform(e=>e==="true")}).strict(),hh=z.object({site_id:R,snapshot_id:T,status:z.enum(["candidate","deleting"]),created_at:z.iso.datetime()}).strict(),kA=z.object({snapshots:z.array(hh)}).strict();import{z as nt}from"zod";var Sh=nt.enum(["PREVIEW_SESSION_NOT_FOUND","PREVIEW_SESSION_INVALID","PREVIEW_SESSION_STALE","PREVIEW_SESSION_LOOKUP_FAILED","PREVIEW_SANDBOX_NOT_FOUND","PREVIEW_SANDBOX_CONNECT_FAILED","PREVIEW_SANDBOX_OWNERSHIP_MISMATCH","PREVIEW_ACTIVATION_TIMEOUT","PREVIEW_PREFLIGHT_FAILED","PREVIEW_ENV_LOOKUP_FAILED","PREVIEW_SERVER_START_FAILED","PREVIEW_HEALTH_CHECK_FAILED","SANDBOX_NOT_CONFIGURED"]),fh=nt.object({status:nt.literal("ready"),preview_url:nt.string().url()}).strict(),bh=nt.object({status:nt.literal("failed"),code:Sh,message:nt.string().min(1),retryable:nt.boolean()}).strict(),wA=nt.discriminatedUnion("status",[fh,bh]);import{z as me}from"zod";var NA="build-context.json",LA=2e5,Kr=me.string().regex(/^sha256:[a-f0-9]{64}$/u),Br=1e3;function yh(e){return Array.from(e).length<=Br}var xh=me.object({kind:me.enum(["customer_materials","website_scan_diagnosis","committed_strategy"]),digest:Kr}).strict(),Eh=me.object({schema_version:me.literal(1),flow_type:Bn,sources:me.array(xh).min(2).max(2)}).strict().superRefine((e,n)=>{let i=new Set(e.sources.map(s=>s.kind)),a=e.flow_type==="with_website"?["website_scan_diagnosis","committed_strategy"]:["customer_materials","committed_strategy"];(i.size!==a.length||a.some(s=>!i.has(s)))&&n.addIssue({code:"custom",path:["sources"],message:"Site-build provenance sources must match the persisted workflow flow."})}),Ih=me.object({schema_version:me.literal(1),seed:Kr.optional(),cms_settings:me.object({main_products:me.string().trim().min(1).refine(yh,{message:`main_products must contain at most ${Br} characters`}).optional()}).strict().optional(),provenance:Eh.optional()}).strict(),Rh=me.object({schema_version:me.literal(1),site_id:R,workflow_id:ze,brief:me.string().min(1),source:me.enum(["business_provider","mock"]),payload:Ih}).strict().superRefine((e,n)=>{e.source==="business_provider"&&!e.payload.provenance&&n.addIssue({code:"custom",path:["payload","provenance"],message:"Business site-build context requires persisted provenance."})}),MA=me.object({source_snapshot_id:T,source_run_id:H,build_context:Rh,page_slugs:me.array(me.string().min(1)).optional()}).strict(),UA=me.object({disposition:me.enum(["reused","rebased"]),snapshot_id:T}).strict(),Th=me.object({snapshot:us,workspace_run_id:H.nullable()}).strict(),qA=M(Th);import{z as We}from"zod";import{z as Oe}from"zod";import{z as re}from"zod";import{z as kh}from"zod";var Ah=["company_profile","product_manual","product_list","customer_case","product_help","qualification","industry_material"],Wr=kh.enum(Ah);var Vr=re.enum(["pending","running","ready","failed","missing"]),Ph=re.object({task_id:re.string().min(1).max(500),status:Vr}).strict(),WA=re.object({items:re.array(Ph).max(100)}).strict(),ln=re.string().trim().min(1).max(255),VA=re.object({knowledge_site_id:ln,source_ids:re.array(ln).min(1).max(200)}).strict().superRefine((e,n)=>{new Set(e.source_ids).size!==e.source_ids.length&&n.addIssue({code:"custom",message:"Knowledge source IDs must be unique.",path:["source_ids"]})}),wh=re.object({source_file_id:ln,category_code:Wr.nullable(),category_confirmed:re.boolean(),status:Vr}).strict(),HA=re.object({ready:re.boolean(),files:re.array(wh),counts:re.object({total:re.number().int().nonnegative(),pending:re.number().int().nonnegative(),running:re.number().int().nonnegative(),ready:re.number().int().nonnegative(),failed:re.number().int().nonnegative(),missing:re.number().int().nonnegative(),unclassified:re.number().int().nonnegative()}).strict()}).strict();var de=e=>Oe.string().trim().max(e),Hr=Oe.array(Oe.string().trim().min(1).max(120)).max(20),ws=Oe.object({company_name:Oe.string().trim().min(1).max(200),brand_name:de(200),primary_products:Oe.string().trim().min(1).max(1e3),industry:de(200),applications:de(1e3),business_summary:de(2e3),registered_capital:de(200).default(""),legal_representative:de(200).default(""),target_markets:Hr,customer_industries:de(1e3),customer_roles:de(1e3),buying_scenarios:de(2e3),differentiators:de(2e3),competitors:de(1e3),trust_proof:de(2e3),customer_cases:de(3e3),channels:Hr,expected_domain:de(255),brand_tone:de(500),contact_name:de(200),contact_info:de(500),timezone:de(100),launch_timing:de(200),input_source_ids:Oe.array(ln).max(50)}).strict(),vh=Oe.enum(["draft","submitted"]),vs=ws.extend({id:W,tenant_id:Oe.string().min(1),site_id:R,workflow_id:ze,status:vh,submitted_at:Oe.string().min(1).nullable(),created_at:Oe.string().min(1),updated_at:Oe.string().min(1)}).strict(),JA=M(vs),eP=M(vs),tP=M(vs.nullable());var oP=$n.extend({expected_current_node:We.literal("website_scan"),type:We.literal("existing_site"),result:$n.shape.result.extend({website:We.string().url(),scan_cards:We.partialRecord(Ir,Ss).refine(e=>Object.keys(e).length>0,{message:"At least one recognized scan card is required."})}).strict()}).strict(),rP=We.object({expected_current_node:We.literal("customer_materials"),materials:ws}).strict(),cP=We.object({expected_current_node:We.literal("diagnosis")}).strict(),mP=We.object({expected_current_node:We.literal("strategy")}).strict();import{z as w}from"zod";var pn={Inter:{import:"Inter"},"Inter Tight":{import:"Inter_Tight"},"DM Sans":{import:"DM_Sans"},"Source Sans 3":{import:"Source_Sans_3"},"Libre Franklin":{import:"Libre_Franklin"},Montserrat:{import:"Montserrat"},Archivo:{import:"Archivo"},"Space Grotesk":{import:"Space_Grotesk"},Manrope:{import:"Manrope"},"IBM Plex Sans":{import:"IBM_Plex_Sans"},Oswald:{import:"Oswald"},"Roboto Condensed":{import:"Roboto_Condensed"},"Bebas Neue":{import:"Bebas_Neue",weights:["400"]},"Playfair Display":{import:"Playfair_Display"},Lora:{import:"Lora"},Fraunces:{import:"Fraunces"},"Cormorant Garamond":{import:"Cormorant_Garamond"},"JetBrains Mono":{import:"JetBrains_Mono"},"IBM Plex Mono":{import:"IBM_Plex_Mono"},"Noto Sans SC":{import:"Noto_Sans_SC",download:!1},"Noto Serif SC":{import:"Noto_Serif_SC",download:!1}},Ch={heading:"Inter",body:"Inter"},$r=pn.Inter;function si(e){return e.trim().replace(/\s+/g,"_").toLowerCase()}var Zr=(()=>{let e=new Map;for(let[n,i]of Object.entries(pn))e.set(si(n),i),e.set(si(i.import),i);return e})();function Dh(e){return typeof e!="string"||e.trim().length===0?$r:Zr.get(si(e))??$r}var jh=(()=>{let e=new Map;for(let[n,i]of Object.entries(pn))e.set(i.import,n);return e})();function Oh(e){if(typeof e!="string"||e.trim().length===0)return"Inter";let n=Zr.get(si(e));return n?jh.get(n.import)??"Inter":"Inter"}var Nh=Object.keys(pn),Yr='ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',Xr='Georgia, "Times New Roman", serif',Qr='"SFMono-Regular", Consolas, monospace',Lh=new Set(["serif","sans-serif","sans serif","monospace","mono","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace"]),Mh=new Set(["Playfair Display","Lora","Fraunces","Cormorant Garamond","Noto Serif SC"].map(e=>e.toLowerCase())),Uh=new Set(["JetBrains Mono","IBM Plex Mono"].map(e=>e.toLowerCase()));function qh(e){let n=e.toLowerCase();return Uh.has(n)||n.includes("mono")?"mono":Mh.has(n)||n.includes("serif")?"serif":"sans"}function Cs(e,n){let i=g=>(g??"").trim().replace(/^['"]|['"]$/g,"").replace(/[^A-Za-z0-9 _-]+/g,"").trim().slice(0,60),a=i(e),s=i(n),r=g=>Lh.has(g.toLowerCase());if(a&&r(a)){let g=a.toLowerCase();return g.includes("mono")?Qr:g.includes("serif")?Xr:Yr}let d=a;d||(d=r(s)?"":s),d||(d="Inter");let c=qh(d);return c==="mono"?`"${d}", ${Qr}`:c==="serif"?`"${d}", ${Xr}`:`"${d}", ${Yr}`}function Fh(e){return{"--site-font-sans":Cs(e?.body,"Inter"),"--site-font-heading":Cs(e?.heading,e?.body??"Inter")}}var Ds=["archivo-inter","playfair-source-sans","space-grotesk-manrope","fraunces-libre-franklin","noto-serif-sc-noto-sans-sc","noto-sans-sc"],Jr=[{id:"archivo-inter",heading:"Archivo",body:"Inter"},{id:"playfair-source-sans",heading:"Playfair Display",body:"Source Sans 3"},{id:"space-grotesk-manrope",heading:"Space Grotesk",body:"Manrope"},{id:"fraunces-libre-franklin",heading:"Fraunces",body:"Libre Franklin"},{id:"noto-serif-sc-noto-sans-sc",heading:"Noto Serif SC",body:"Noto Sans SC"},{id:"noto-sans-sc",heading:"Noto Sans SC",body:"Noto Sans SC"}];function ec(e){let n=Jr.find(i=>i.id===e);if(!n)throw new Error(`Unknown font pairing: ${e}`);return n}var js=["compact","comfortable","airy"],tc=["none","sm","md","lg","xl"],nc="lg",Os=["subtle","moderate","expressive"],Gh=[{id:"subtle",motionLevel:"subtle"},{id:"moderate",motionLevel:"moderate"},{id:"expressive",motionLevel:"expressive"}];function ic(e){let n=Gh.find(i=>i.id===e);if(!n)throw new Error(`Unknown motion preset: ${e}`);return n}var sc=["ocean","forest","clay","violet","graphite","crimson"],ac=["ai-forest","ai-navy","ai-steel"],oc=/^gen-[0-9a-f]{8}$/,Ns=[{id:"ai-forest",name:"\u5DE5\u4E1A\u58A8\u7EFF \xB7 Industrial Teal",description:"\u6C89\u7A33\u4E13\u4E1A\uFF0C\u7A81\u51FA\u7CBE\u5BC6\u4E0E\u53EF\u4FE1\u3002",fallbackReason:"\u7A33\u5B9A\u4E13\u4E1A\u7684\u9ED8\u8BA4\u9009\u62E9\u3002",colorSeeds:{primary:"#0E7C6F",accent:"#2F6FED",foreground:"#0F1B2D"},surfaceMode:"light",radius:"sm"},{id:"ai-navy",name:"\u79D1\u6280\u6DF1\u84DD \xB7 Deep Tech Blue",description:"\u7406\u6027\u79D1\u6280\u611F\uFF0C\u5F3A\u8C03\u6280\u672F\u5B9E\u529B\u4E0E\u6570\u636E\u53EF\u4FE1\u3002",fallbackReason:"\u6280\u672F\u8868\u8FBE\u7684\u5907\u9009\u3002",colorSeeds:{primary:"#1E3A8A",accent:"#2F6FED",foreground:"#0F1B2D"},surfaceMode:"light",radius:"md"},{id:"ai-steel",name:"\u7CBE\u5BC6\u94F6\u7070 \xB7 Precision Steel",description:"\u514B\u5236\u6E05\u6670\uFF0C\u9002\u5408\u53C2\u6570\u4E0E\u5DE5\u7A0B\u7EC6\u8282\u8868\u8FBE\u3002",fallbackReason:"\u53C2\u6570\u4FE1\u606F\u8F83\u591A\u65F6\u7684\u5907\u9009\u3002",colorSeeds:{primary:"#475569",accent:"#94A3B8",foreground:"#111827"},surfaceMode:"light",radius:"none"}],Ls=[{id:"ocean",colorSeeds:{primary:"#1e3a5f",accent:"#2563eb",foreground:"#0f172a"},surfaceMode:"light",radius:"md"},{id:"forest",colorSeeds:{primary:"#14532d",accent:"#16a34a",foreground:"#0f172a"},surfaceMode:"light",radius:"lg"},{id:"clay",colorSeeds:{primary:"#7c2d12",accent:"#ea580c",foreground:"#1c1917"},surfaceMode:"light",radius:"xl"},{id:"violet",colorSeeds:{primary:"#3b0764",accent:"#7c3aed",foreground:"#18181b"},surfaceMode:"light",radius:"lg"},{id:"graphite",colorSeeds:{primary:"#1f2937",accent:"#0d9488",foreground:"#111827"},surfaceMode:"light",radius:"none"},{id:"crimson",colorSeeds:{primary:"#7f1d1d",accent:"#dc2626",foreground:"#1f1012"},surfaceMode:"light",radius:"sm"}];function uP(e){let n=Ls.find(i=>i.id===e);if(!n)throw new Error(`Unknown theme preset: ${e}`);return n}function rc(e){return Ls.find(n=>n.id===e)?.radius??Ns.find(n=>n.id===e)?.radius}var Ms=w.string().regex(/^#[0-9A-F]{6}$/i),dn=w.string().trim().min(1).max(500),cc=w.string().datetime({offset:!0}),zh=w.enum(sc),Kh=w.enum(ac),Bh=w.string().regex(oc),un=w.union([zh,Kh,Bh]),gn=w.enum(Ds),_n=w.enum(Os),hn=w.enum(js),ai=w.enum(tc),mc=300,Wh=w.string().trim().min(1).max(mc),oi=w.object({primary:Ms,accent:Ms,foreground:Ms}).strict(),Vh=w.object({id:un,rank:w.number().int().min(1).max(3),name:w.string().trim().min(1).max(120),description:w.string().trim().min(1).max(240),color_seeds:oi,surface_mode:w.enum(["light","dark"]),radius:ai,font_pairing_id:gn,motion_preset_id:_n,density:hn,reason:dn}).strict(),lc=w.object({name:w.string().trim().min(1).max(120),description:w.string().trim().min(1).max(240),reason:dn,color_seeds:oi,surface_mode:w.enum(["light","dark"]),radius:ai,font_pairing_id:gn,motion_preset_id:_n,density:hn}).strict(),pc=w.object({version:w.number().int().min(1),recommendation_id:w.string().uuid(),theme_preset_id:un,color_seeds:oi,surface_mode:w.enum(["light","dark"]),font_pairing_id:gn,motion_preset_id:_n,density:hn,radius:ai.optional(),aesthetic_note:Wh.optional(),updated_at:cc}).strict(),Hh=w.object({id:w.string().uuid(),version:w.number().int().min(1),catalog_version:w.string().trim().min(1).max(80),source:w.object({mode:w.enum(["ai","fallback"]),fallback_reason:w.string().trim().min(1).max(80).nullable()}).strict(),inputs:w.object({industry:w.string().trim().min(1).max(160).optional(),site_language:w.string().trim().min(2).max(35),owner_locale:_e.optional(),strategy_version:w.number().int().min(1),input_digest:w.string().regex(/^sha256:[a-f0-9]{64}$/)}).strict(),theme:w.object({recommended_id:un,candidate_ids:w.array(un).length(3),candidates:w.array(Vh).length(3)}).strict().superRefine((e,n)=>{e.recommended_id!==e.candidate_ids[0]&&n.addIssue({code:"custom",path:["recommended_id"],message:"recommended_id must be the first candidate"}),e.candidates.some((i,a)=>i.id!==e.candidate_ids[a]||i.rank!==a+1)&&n.addIssue({code:"custom",path:["candidates"],message:"Candidates must follow candidate_ids order."})}),font:w.object({recommended_id:gn,reason:dn}).strict(),motion:w.object({recommended_id:_n,reason:dn}).strict(),density:w.object({recommended_id:hn,reason:dn}).strict(),conversion:St.optional(),generated_at:cc}).strict(),RP=w.object({force_refresh:w.boolean().optional()}).strict(),TP=w.object({request_id:w.string().trim().min(1).max(160),site_id:R,cached:w.boolean(),recommendation:Hh,selection:pc}).strict(),kP=w.object({recommendation_id:w.string().uuid(),expected_version:w.number().int().min(1),theme_preset_id:un,color_seeds:oi,surface_mode:w.enum(["light","dark"]),font_pairing_id:gn,motion_preset_id:_n,density:hn,radius:ai.optional(),aesthetic_note:w.string().trim().max(mc).optional()}).strict(),AP=w.object({selection:pc}).strict(),PP=w.object({tenant_id:w.string().trim().min(1).max(160),site_id:R,site_language:w.string().trim().min(2).max(35),owner_locale:_e,industry:w.string().trim().min(1).max(160).optional(),strategy_version_id:w.string().uuid(),strategy_version:w.number().int().min(1),strategy_checksum:w.string().regex(/^[a-f0-9]{64}$/),strategy_summary:w.array(w.string().trim().min(1).max(500)).min(1).max(xe),reference_image_source_id:ht.optional(),owner_whole_site_request:w.string().trim().min(1).max(Pt).optional()}).strict(),Us=w.object({theme_candidates:w.array(lc).length(3),conversion:St.optional()}).strict().superRefine((e,n)=>{let i=new Set;e.theme_candidates.forEach((a,s)=>{let r=JSON.stringify(a.color_seeds).toUpperCase();i.has(r)&&n.addIssue({code:"custom",path:["theme_candidates",s,"color_seeds"],message:"Theme candidates must have pairwise distinct color_seeds"}),i.add(r)})});function wP(){return Ns.map(e=>lc.parse({name:e.name,description:e.description,reason:e.fallbackReason,color_seeds:e.colorSeeds,surface_mode:e.surfaceMode,radius:e.radius,font_pairing_id:Ds[0],motion_preset_id:Os[0],density:js[1]}))}function $h(e){return e.radius??rc(e.theme_preset_id)??"lg"}function vP(e){let n=ec(e.font_pairing_id),i=ic(e.motion_preset_id);return{colorSeeds:e.color_seeds,surfaceMode:e.surface_mode,fonts:{heading:n.heading,body:n.body},density:e.density,motionLevel:i.motionLevel,motionPreset:i.id,radius:$h(e)}}function CP(e,n){let i=e.theme.candidates[0];return{version:1,recommendation_id:e.id,theme_preset_id:i.id,color_seeds:i.color_seeds,surface_mode:i.surface_mode,font_pairing_id:e.font.recommended_id,motion_preset_id:e.motion.recommended_id,density:e.density.recommended_id,radius:i.radius,updated_at:n.toISOString()}}import{z as qs}from"zod";function Yh(e){return JSON.stringify([e.color_seeds.primary.toUpperCase(),e.color_seeds.accent.toUpperCase(),e.color_seeds.foreground.toUpperCase(),e.surface_mode,e.font_pairing_id,e.radius,e.motion_preset_id,e.density])}var Xh=qs.object(Us.shape).strict().superRefine((e,n)=>{let i=new Set;e.theme_candidates.forEach((a,s)=>{let r=Yh(a);i.has(r)&&n.addIssue({code:"custom",path:["theme_candidates",s],message:"Theme candidates must have pairwise distinct visual identities"}),i.add(r)})}),NP=qs.union([Us,Xh.safeExtend({model_profile:qs.literal("azure-gpt")})]);import{z as lt}from"zod";var qP=lt.object({site_id:R,site_language:lt.string().trim().min(2).max(35),business_facts:lt.array(lt.string().trim().min(1).max(1e3)).min(1).max(8)}).strict(),Qh=lt.enum(["high","medium","low"]),FP=lt.object({skill_name:lt.string().trim().min(1).max(80).nullable(),confidence:Qh,reason:lt.string().trim().min(1).max(240)}).strict();import{z as Y}from"zod";var Fs=["title","text","richtext","number","boolean","date","datetime","url","email","color","select","multiselect","tag"],ri=Y.object({name:Y.string().min(1).max(100),type:Y.enum(Fs),label:Y.string().min(1).max(255),required:Y.boolean().optional(),options:Y.array(Y.string()).optional()}),KP=Y.object({name:Y.string(),cms_type:Y.string(),label:Y.string().optional(),required:Y.boolean().optional(),value_shape:Y.string().optional(),front_display:Y.enum(["visible","internal","forbidden"]).optional(),choices:Y.array(Y.object({value:Y.union([Y.string(),Y.number()]),label:Y.string()})).optional()}),BP=Y.object({route_file_path:Y.string().min(1),target_component_path:Y.string().min(1),content_type_hint:Y.string().min(1),collection_purpose:Y.enum(["generic","product"]).optional(),required_fields:Y.array(ri).optional(),mode:Y.enum(["bind_existing","provision"]),list_mode:Y.enum(["page","embedded"]).optional(),fields:Y.array(ri).optional(),seed_records:Y.array(Y.record(Y.string(),Y.unknown())).optional()});import{z as N}from"zod";var Sn=N.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),ci=N.string().regex(/^[a-f0-9]{64}$/),mi=N.string().regex(/^[a-z][a-z0-9-]{0,99}$/),li=N.string().regex(/^[a-z0-9]{1,30}$/),Le=e=>N.string().max(e).refine(n=>n.trim().length>0,"Value must not be blank"),dc=N.object({id:N.string().uuid(),key:Le(100),name:Le(255)}).strict(),gc=new Set(["title","summary","description","category","thumbnail","url","admin_id"]),Zh=new Set(["title","summary","description","image_query"]),Jh=new Set(["category","thumbnail","url","admin_id","page","pages","route","path","component","components","snapshot","run","site_id","cms_site_id","tenant_id","token","secret","password","authorization","headers","__proto__","prototype","constructor"]),uc=new Set(["select","multiselect"]),eS=new Set(["title","text","richtext","date","datetime","url","email","color"]),tS=N.object({name:Le(100),label:Le(255),type:N.enum(Fs),required:N.boolean().optional(),options:N.array(Le(100)).max(100).optional()}).strict().superRefine((e,n)=>{let i=e.options??[];uc.has(e.type)&&i.length===0&&n.addIssue({code:"custom",path:["options"],message:"Choice fields require at least one option"}),!uc.has(e.type)&&i.length>0&&n.addIssue({code:"custom",path:["options"],message:"Only choice fields may declare options"}),new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["options"],message:"Field options must be unique"}),gc.has(e.name)&&n.addIssue({code:"custom",path:["name"],message:"Reserved CMS field names cannot be declared"})}),nS=N.array(tS).min(1).max(200),iS=N.array(N.record(N.string(),N.unknown())).max(1e3);function Ne(e,n,i){e.addIssue({code:"custom",path:n,message:i})}var sS=N.object({name:Le(30),slug:li,collection_purpose:N.enum(["generic","product"]).optional(),fields:nS,seed_records:iS}).strict().superRefine((e,n)=>{let i=e.fields.map(s=>s.name);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["fields"],message:"Field names must be unique"}),i.some(s=>!gc.has(s))||n.addIssue({code:"custom",path:["fields"],message:"At least one custom field is required"});let a=new Map(e.fields.map(s=>[s.name,s]));e.seed_records.forEach((s,r)=>{for(let[d,c]of Object.entries(s)){let g=["seed_records",r,d];if(Jh.has(d)){Ne(n,g,"Seed cannot write reserved or runtime-owned fields");continue}if(d==="image_query"){(typeof c!="string"||c.trim()==="")&&Ne(n,g,"image_query must be a non-empty string");continue}if(Zh.has(d)){typeof c!="string"&&Ne(n,g,"Seed skeleton text fields must be strings");continue}let k=a.get(d);if(!k){Ne(n,g,"Seed contains an undeclared field");continue}if(c==null){Ne(n,g,"Seed field values must not be null");continue}if(k.type==="select")(typeof c!="string"||!(k.options??[]).includes(c))&&Ne(n,g,"Seed select value must be one of the declared options");else if(k.type==="multiselect")(!Array.isArray(c)||c.length===0||c.some(I=>typeof I!="string"||!(k.options??[]).includes(I)))&&Ne(n,g,"Seed multiselect value must contain only declared options");else if(k.type==="number")(typeof c!="number"||!Number.isFinite(c))&&Ne(n,g,"Seed number values must be finite numbers");else if(k.type==="boolean")typeof c!="boolean"&&Ne(n,g,"Seed boolean values must be booleans");else if(k.type==="tag"){let I=Array.isArray(c)?c:[c];(I.length===0||I.some(C=>typeof C!="string"||C.trim()===""))&&Ne(n,g,"Seed tag values must be non-empty strings")}else eS.has(k.type)&&typeof c!="string"&&Ne(n,g,"Seed text-like values must be strings")}for(let d of e.fields)d.required&&!(d.name in s)&&Ne(n,["seed_records",r,d.name],"Required fields must be present in every seed record")}),new TextEncoder().encode(JSON.stringify(e)).byteLength>1024*1024&&n.addIssue({code:"custom",path:[],message:"Application template must not exceed 1048576 UTF-8 bytes"})}),Gs=N.object({schema_version:N.literal(1),application:sS}).strict(),aS=N.object({templateId:N.string().uuid(),stableKey:mi,resolvedVersion:Sn,digest:ci,template:Gs}).strict(),oS=aS,rS={alreadyCreated:"APPLICATION_ALREADY_CREATED",slugConflict:"APPLICATION_SLUG_CONFLICT",createInProgress:"APPLICATION_CREATE_IN_PROGRESS",cmsUnbound:"APPLICATION_CMS_UNBOUND",templateVersionUnavailable:"APPLICATION_TEMPLATE_VERSION_UNAVAILABLE",createFailed:"APPLICATION_CREATE_FAILED",createResultUnknown:"APPLICATION_CREATE_RESULT_UNKNOWN"},_c=N.enum(Object.values(rS)),hc=N.object({category_status:N.enum(["succeeded","failed","not_attempted"]),seed_status:N.enum(["skipped","succeeded","partial","failed"]),requested_count:N.number().int().nonnegative(),written_count:N.number().int().nonnegative().nullable(),published_count:N.number().int().nonnegative().nullable(),errors:N.array(N.object({stage:N.enum(["category","seed","receipt"]),code:Le(100)}).strict()).max(20)}).strict(),cS=N.object({templateId:N.string().uuid(),stableKey:mi,title:Le(200),description:N.string().max(1e3),thumbnailUrl:N.string().url().nullable(),resolvedVersion:Sn,digest:ci,application:N.object({name:Le(30),slug:li}).strict(),categories:N.array(dc),tags:N.array(dc),status:N.enum(["available","creating","created","conflict","failed"]),errorCode:_c.nullable().optional(),template:Gs.optional()}).strict(),Sc=N.object({items:N.array(cS)}).strict(),$P=N.object({version:Sn}).strict(),mS=N.object({app_slug:li,name:Le(30),template:N.object({stable_key:mi,version:Sn,digest:ci}).strict()}).strict(),lS=N.object({status:N.literal("created"),application:mS,initialization:hc}).strict(),YP=lS,pS=N.object({stable_key:mi,version:Sn,digest:ci,created_at:N.string().datetime().nullable(),initialization:hc.nullable()}).strict(),dS=N.object({app_slug:li,name:Le(30),collection_slug:N.string().min(1),detail_prefix:N.string().min(1).optional(),source:pS.nullable()}).strict(),XP=N.object({applications:N.array(dS)}).strict(),QP=Sc,ZP=N.object({code:_c,message:Le(500)}).strict(),JP=Gs,ew=oS,tw=Sc;import{z as se}from"zod";var fc=e=>se.string().max(e).refine(n=>n.trim().length>0,"Value must not be blank"),uS=ri.strict(),yc=se.array(uS).min(1).max(200),gS=se.array(se.record(se.string(),se.unknown())).max(1e3),_S=se.string().regex(/^[a-z0-9]{1,30}$/),zs=se.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),aw=se.object({name:fc(30),slug:fc(50),collection_purpose:se.enum(["generic","product"]).optional(),fields:yc}).strict(),bc=se.object({collection_slug:_S,detail_prefix:se.string().min(1).max(255),plugin_id:zs.optional()}).strict(),ow=se.discriminatedUnion("kind",[bc.extend({kind:se.literal("created")}),bc.extend({kind:se.literal("exists")})]),rw=se.object({fields:yc,seed_records:gS,category_id:zs}).strict(),hS=se.record(se.string().min(1),se.string().min(1).nullable()),cw=se.object({ids:se.array(zs).max(1e3),urls:hS,failed:se.array(se.unknown()).max(1e3)}).strict();function mw(e){return e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase().slice(0,30)}import{z as ue}from"zod";var pi=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number","file"],SS=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number"],fS=ue.object({name:ue.string().min(1).max(100),type:ue.enum(SS),label:ue.string().min(1).max(255),required:ue.boolean().optional(),options:ue.array(ue.string()).optional()}),bS=ue.string().regex(/^[a-z][a-z0-9-]{0,48}$/).optional(),dw=ue.object({mode:ue.enum(["bind_existing","provision"],{error:'mode is required. Use "bind_existing" or "provision". Never call connect_form with {}.'}),form_hint:ue.string().min(1).optional(),name:ue.string().min(1).max(255).optional(),component_slug:bS,description:ue.string().min(1).max(1e3).optional(),fields:ue.array(fS).optional()}).superRefine((e,n)=>{e.mode==="bind_existing"&&!e.form_hint?.trim()&&n.addIssue({code:"custom",path:["form_hint"],message:"form_hint is required for bind_existing"}),e.mode==="provision"&&!e.name?.trim()&&n.addIssue({code:"custom",path:["name"],message:"name is required for provision"})}),uw=ue.object({name:ue.string(),label:ue.string(),cms_type:ue.string(),required:ue.boolean()});import{z as l}from"zod";var fn=/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/,Ut=/^[A-Za-z][A-Za-z0-9_-]{0,127}$/,di=/^[A-Za-z][A-Za-z0-9_]{0,99}$/,Rc=/^[A-Za-z0-9][A-Za-z0-9_-]{0,99}$/,Bs=/^[a-z][a-z0-9-]{0,99}$/,Tc=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/,xc=2,Ec=3,ui=l.string().regex(fn),yS=l.string().regex(fn),Ws=l.string().regex(fn),bn=l.string().regex(di),Vs=l.string().regex(Rc),xS=l.discriminatedUnion("status",[l.object({status:l.literal("unbound"),form_code:l.null()}).strict(),l.object({status:l.literal("bound"),form_code:l.string().regex(Ut)}).strict(),l.object({status:l.literal("missing"),form_code:l.string().regex(Ut)}).strict()]),ES=l.object({value:Vs,label:l.string().trim().min(1).max(255)}).strict(),IS=l.object({kind:l.literal("field"),field_name:bn,type:l.enum(pi),label:l.string().trim().min(1).max(255),required:l.boolean(),span:l.enum(["full","half"]),options:l.array(ES).max(100),max_files:l.number().int().min(1).max(5).optional()}).strict(),RS=l.object({kind:l.literal("step-break"),step_id:l.string().regex(fn)}).strict(),TS=l.discriminatedUnion("kind",[IS,RS]),kS=l.object({field_name:bn,type:l.enum(pi),last_label:l.string().max(255)}).strict(),AS=l.object({field_name:bn,value:Vs,last_label:l.string().max(255)}).strict(),PS=l.discriminatedUnion("kind",[l.object({kind:l.literal("custom")}).strict(),l.object({kind:l.literal("template"),slug:l.string().regex(Bs),version:l.string().regex(Tc)}).strict()]),wS={select:2,radio:2,multiselect:1,DropdownSelection:2,RadioButton:2,Checkbox:1};function Ve(e){return e.toLowerCase()}function kc(e,n){return e.trim().toLocaleLowerCase(n)}function Mt(e,n){return`${Ve(e)}\0${n}`}function be(e,n,i,a){let s=new Set;for(let r of e){if(s.has(r)){a.addIssue({code:"custom",path:n,message:i});return}s.add(r)}}function Hs(e,n,i,a){let s=wS[e]??0;s>0&&n<s?a.addIssue({code:"custom",path:i,message:`choice field requires at least ${s} option${s===1?"":"s"}`}):s===0&&n>0&&a.addIssue({code:"custom",path:i,message:"non-choice fields must use an empty options array"})}var $s=l.object({schema_version:l.literal(1),min_runtime_version:l.number().int().positive(),form_definition_id:ui,binding:xS,content_locale:_e,features:l.object({multistep:l.boolean()}).strict(),copy:l.object({title:l.string().max(255),description:l.string().max(1e3),submit_button:l.string().trim().min(1).max(100),success_message:l.string().trim().min(1).max(500),error_message:l.string().max(500)}).strict(),layout:l.object({columns:l.enum(["one","two"])}).strict(),nodes:l.array(TS).min(1).max(200),source:PS,retired:l.object({fields:l.array(kS).max(1e3),options:l.array(AS).max(5e3)}).strict(),compatibility:l.object({standardization_version:l.number().int().positive(),diagnostics:l.array(l.string().trim().min(1).max(500)).max(100)}).strict()}).strict().superRefine((e,n)=>{let i=e.nodes.flatMap((c,g)=>c.kind==="field"?[[g,c]]:[]),a=i.map(([,c])=>c);a.length===0&&n.addIssue({code:"custom",path:["nodes"],message:"at least one field node is required"});let s=e.nodes.filter(c=>c.kind==="step-break");!e.features.multistep&&s.length>0&&n.addIssue({code:"custom",path:["nodes"],message:"step-break requires the multistep feature"}),e.features.multistep&&(e.min_runtime_version<xc&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`multistep requires runtime version ${xc}`}),s.length===0&&n.addIssue({code:"custom",path:["nodes"],message:"multistep requires at least one step-break"}));for(let[c,g]of e.nodes.entries())g.kind==="step-break"&&(c===0||c===e.nodes.length-1||e.nodes[c-1]?.kind==="step-break"||e.nodes[c+1]?.kind==="step-break")&&n.addIssue({code:"custom",path:["nodes",c],message:"step-break must separate two non-empty steps"});be(s.map(c=>c.step_id),["nodes"],"step_id must be unique",n),be(a.map(c=>Ve(c.field_name)),["nodes"],"field_name must be unique",n),be(e.retired.fields.map(c=>Ve(c.field_name)),["retired","fields"],"retired field_name must be unique",n);let r=new Set(e.retired.fields.map(c=>Ve(c.field_name)));for(let[c,g]of i)r.has(Ve(g.field_name))&&n.addIssue({code:"custom",path:["nodes",c,"field_name"],message:"retired field_name cannot be reused"}),Hs(g.type,g.options.length,["nodes",c,"options"],n),g.type==="file"?e.min_runtime_version<Ec&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`file fields require runtime version ${Ec}`}):g.max_files!==void 0&&n.addIssue({code:"custom",path:["nodes",c,"max_files"],message:"max_files is only valid for file fields"}),be(g.options.map(k=>k.value),["nodes",c,"options"],"option value must be unique within a field",n),be(g.options.map(k=>kc(k.label,e.content_locale)),["nodes",c,"options"],"option label must be unique within a field",n);be(e.retired.options.map(c=>Mt(c.field_name,c.value)),["retired","options"],"retired option identity must be unique",n);let d=new Set(e.retired.options.map(c=>Mt(c.field_name,c.value)));for(let[c,g]of i)for(let[k,I]of g.options.entries())d.has(Mt(g.field_name,I.value))&&n.addIssue({code:"custom",path:["nodes",c,"options",k,"value"],message:"retired option value cannot be reused"})}),vS=["copy.title","copy.description","copy.submit_button","copy.success_message","copy.error_message","nodes.*.label","nodes.*.options.*.label"],CS=new Set(vS);function yw(e){let n=e.map(i=>typeof i=="number"||/^\d+$/.test(i)?"*":i).join(".");return CS.has(n)}function xw(e,n){let i=[],a=e.nodes.filter(c=>c.kind==="field"),s=new Map(n.nodes.filter(c=>c.kind==="field").map(c=>[Ve(c.field_name),c])),r=new Map(n.retired.fields.map(c=>[Ve(c.field_name),c])),d=new Map(n.retired.options.map(c=>[Mt(c.field_name,c.value),c]));for(let c of a){let g=Ve(c.field_name),k=s.get(g),I=r.get(g);k&&k.field_name!==c.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:c.field_name}),k&&k.type!==c.type&&i.push({code:"FIELD_TYPE_CHANGED",field_name:c.field_name}),!k&&I&&I.field_name!==c.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:c.field_name}),!k&&I&&I.type!==c.type&&i.push({code:"FIELD_TYPE_CHANGED",field_name:c.field_name}),!k&&!r.has(g)&&i.push({code:"FIELD_RETIREMENT_MISSING",field_name:c.field_name});let C=new Set(k?.options.map(F=>F.value)??[]);for(let F of c.options){let B=d.get(Mt(c.field_name,F.value));!C.has(F.value)&&B&&B.field_name!==c.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:c.field_name}),!C.has(F.value)&&!B&&i.push({code:"OPTION_RETIREMENT_MISSING",field_name:c.field_name,value:F.value})}}for(let c of e.retired.fields){let g=r.get(Ve(c.field_name));g&&g.field_name!==c.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:c.field_name}),g&&g.type!==c.type&&i.push({code:"FIELD_TYPE_CHANGED",field_name:c.field_name}),g||i.push({code:"FIELD_RETIREMENT_MISSING",field_name:c.field_name})}for(let c of e.retired.options){let g=d.get(Mt(c.field_name,c.value));g&&g.field_name!==c.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:c.field_name}),g||i.push({code:"OPTION_RETIREMENT_MISSING",field_name:c.field_name,value:c.value})}return i}var DS=l.enum($t),pt=l.object({english:l.string().max(1e3),translations:l.partialRecord(DS,l.string().max(1e3)).optional()}).strict(),jS=l.object({template_option_key:l.string().regex(Rc),label:pt}).strict(),OS=l.object({template_field_key:l.string().regex(di),type:l.enum(pi),label:pt,required:l.boolean(),span:l.enum(["full","half"]),options:l.array(jS).max(100)}).strict(),NS=l.object({template_step_key:l.string().regex(di),after_field_key:l.string().regex(di)}).strict(),Ew=["lead-generation","trial-and-samples","quote-and-commerce","appointments-and-visits","resources-and-subscriptions","service-and-channel"],Iw=[1,1,1,1,1,1],Ac=l.string().regex(Bs),LS=l.object({schema_version:l.literal(1),slug:Ac,name:pt,template_count:l.number().int().min(0).max(500)}).strict().superRefine((e,n)=>{e.name.english.trim()===""&&n.addIssue({code:"custom",path:["name","english"],message:"English category name is required"})}),MS=l.object({schema_version:l.literal(1),slug:l.string().regex(Bs),version:l.string().regex(Tc),category:Ac,copy:l.object({title:pt,description:pt,submit_button:pt,success_message:pt,error_message:pt}).strict(),layout:l.object({columns:l.enum(["one","two"])}).strict(),fields:l.array(OS).min(1).max(200),step_breaks:l.array(NS).max(20).optional()}).strict().superRefine((e,n)=>{for(let r of["title","description","submit_button","success_message","error_message"])e.copy[r].english.trim()===""&&n.addIssue({code:"custom",path:["copy",r,"english"],message:"English baseline text is required"});be(e.fields.map(r=>r.template_field_key),["fields"],"template_field_key must be unique",n);let i=new Map(e.fields.map((r,d)=>[r.template_field_key,d])),a=e.step_breaks??[];be(a.map(r=>r.template_step_key),["step_breaks"],"template_step_key must be unique",n),be(a.map(r=>r.after_field_key),["step_breaks"],"step breaks must not share an anchor field",n);let s=-1;for(let[r,d]of a.entries()){let c=i.get(d.after_field_key);c===void 0||c>=e.fields.length-1?n.addIssue({code:"custom",path:["step_breaks",r,"after_field_key"],message:"step break must follow an existing non-final field"}):c<=s&&n.addIssue({code:"custom",path:["step_breaks",r,"after_field_key"],message:"step breaks must follow field order"}),s=c??s}e.fields.length+a.length>200&&n.addIssue({code:"custom",path:["step_breaks"],message:"template fields and step breaks must not exceed 200 nodes"});for(let[r,d]of e.fields.entries()){d.label.english.trim()===""&&n.addIssue({code:"custom",path:["fields",r,"label","english"],message:"English field label is required"}),Hs(d.type,d.options.length,["fields",r,"options"],n),be(d.options.map(c=>c.template_option_key),["fields",r,"options"],"template_option_key must be unique within a field",n),be(d.options.map(c=>c.label.english.trim().toLowerCase()),["fields",r,"options"],"English option labels must be unique within a field",n);for(let[c,g]of d.options.entries())g.label.english.trim()===""&&n.addIssue({code:"custom",path:["fields",r,"options",c,"label","english"],message:"English option label is required"})}}),Rw=l.object({schema_version:l.literal(1),visibility:l.enum(["internal","public"]),categories:l.array(LS).max(500),templates:l.array(MS).max(500)}).strict().superRefine((e,n)=>{let i=(s,r)=>{let d=$t.filter(c=>!s.translations?.[c]?.trim());d.length>0&&n.addIssue({code:"custom",path:[...r,"translations"],message:`public template copy is missing locales: ${d.join(", ")}`})};be(e.categories.map(s=>s.slug),["categories"],"template category slug must be unique",n);let a=new Set(e.categories.map(s=>s.slug));for(let[s,r]of e.categories.entries()){let d=e.templates.filter(c=>c.category===r.slug).length;r.template_count!==d&&n.addIssue({code:"custom",path:["categories",s,"template_count"],message:"template_count must match catalog templates"})}be(e.templates.map(s=>s.slug),["templates"],"template slug must be unique",n);for(let[s,r]of e.templates.entries())a.has(r.category)||n.addIssue({code:"custom",path:["templates",s,"category"],message:"template category must exist in catalog categories"});if(e.visibility==="public"){for(let[s,r]of e.categories.entries())i(r.name,["categories",s,"name"]);for(let[s,r]of e.templates.entries()){for(let[d,c]of Object.entries(r.copy))i(c,["templates",s,"copy",d]);for(let[d,c]of r.fields.entries()){i(c.label,["templates",s,"fields",d,"label"]);for(let[g,k]of c.options.entries())i(k.label,["templates",s,"fields",d,"options",g,"label"])}}}});function Tw(e,n){let i=Ha(n),a=i?e.translations?.[i]:void 0;return a!==void 0&&a.trim()!==""?a:e.english}var US=["Text","Summary","Email","Phone","DropdownSelection","RadioButton","Checkbox","Boolean","Date","Num","MultipleFile","SpecificFile"],qS={text:"Text",textarea:"Summary",email:"Email",phone:"Phone",select:"DropdownSelection",radio:"RadioButton",multiselect:"Checkbox",boolean:"Boolean",date:"Date",number:"Num",file:"MultipleFile"},FS=l.object({value:Vs,label:l.string().trim().min(1).max(255)}).strict(),GS=l.object({field_name:bn,field_type:l.enum(US),field_label:l.string().trim().min(1).max(255),is_required:l.boolean(),sort_order:l.number().int().nonnegative(),options:l.array(FS).max(100)}).strict(),Pc=l.object({version:l.literal(1),locale:_e,fields:l.array(GS).min(1).max(200)}).strict().superRefine((e,n)=>{be(e.fields.map(i=>Ve(i.field_name)),["fields"],"field_name must be unique",n);for(let[i,a]of e.fields.entries())Hs(a.field_type,a.options.length,["fields",i,"options"],n),be(a.options.map(s=>s.value),["fields",i,"options"],"option value must be unique within a field",n),be(a.options.map(s=>kc(s.label,e.locale)),["fields",i,"options"],"option label must be unique within a field",n)});function kw(e){let n=e.nodes.filter(i=>i.kind==="field").map((i,a)=>({field_name:i.field_name,field_type:i.type==="file"&&i.max_files===1?"SpecificFile":qS[i.type],field_label:i.label,is_required:i.required,sort_order:a,options:i.options.map(s=>({...s}))}));return Pc.parse({version:1,locale:e.content_locale,fields:n})}var ie=l.string().regex(/^sha256:[0-9a-f]{64}$/),zS=l.union([ge,l.enum(["app/api/forms/[code]/route.ts","hooks/use-cms-form-submit.ts","lib/cms/forms.ts","lib/cms/client.ts"])]),KS=l.object({path:zS,content_hash:ie.nullable()}).strict(),BS=l.array(KS).min(1).max(500).superRefine((e,n)=>{be(e.map(i=>i.path),[],"affected file paths must be unique",n)}),Ys=l.object({grade:l.enum(["standard","A","B","C"]),required:l.boolean(),pending_confirmations:l.array(l.object({item_id:l.string().regex(fn),field_name:bn.optional(),kind:l.enum(["form_copy","layout","field_label","field_type","field_required","field_options"]),message:l.string().trim().min(1).max(500)}).strict().superRefine((e,n)=>{e.kind.startsWith("field_")&&!e.field_name&&n.addIssue({code:"custom",path:["field_name"],message:"field confirmation items require field_name"})})).max(200)}).strict().superRefine((e,n)=>{let i=e.grade==="standard";i===e.required&&n.addIssue({code:"custom",path:["required"],message:i?"standard forms do not require standardization confirmation":"legacy forms require standardization confirmation"}),e.grade==="C"&&e.pending_confirmations.length===0&&n.addIssue({code:"custom",path:["pending_confirmations"],message:"grade C requires at least one pending confirmation"}),e.grade!=="C"&&e.pending_confirmations.length>0&&n.addIssue({code:"custom",path:["pending_confirmations"],message:"only grade C can contain pending confirmations"})}),WS=l.object({site_id:R,form_definition_id:ui,base_snapshot_id:T,expected_form_spec_hash:ie,expected_cms_schema_hash:ie.nullable(),draft_form_spec_hash:ie,desired_cms_schema_hash:ie,affected_files_hash:ie,shared_reference_hash:ie,shared_reference_count:l.number().int().positive(),confirm_shared_update:l.boolean(),recreate_missing_binding:l.boolean(),standardization:Ys,confirm_standardization:l.boolean()}).strict(),wc=l.object({reference_hash:ie,page_count:l.number().int().positive(),block_count:l.number().int().positive()}).strict().refine(e=>e.page_count<=e.block_count,{message:"page_count cannot exceed block_count"}),Aw=l.object({site_id:R,form_block_id:yS,base_snapshot_id:T,form_spec:$s,runtime_upgrade_required:l.boolean(),expected_form_spec_hash:ie,expected_cms_schema_hash:ie.nullable(),affected_files_hash:ie,shared_impact:wc,standardization:Ys}).strict(),VS=l.object({operation_id:Ws,operation_fingerprint:ie,site_id:R,form_definition_id:ui,base_snapshot_id:T,expected_form_spec_hash:ie,expected_cms_schema_hash:ie.nullable(),draft_form_spec:$s,draft_form_spec_hash:ie,desired_cms_schema_hash:ie,affected_files_hash:ie,shared_impact:wc,confirm_shared_update:l.boolean(),recreate_missing_binding:l.boolean(),standardization:Ys,confirm_standardization:l.boolean()}).strict().superRefine((e,n)=>{e.form_definition_id!==e.draft_form_spec.form_definition_id&&n.addIssue({code:"custom",path:["form_definition_id"],message:"form_definition_id must match draft_form_spec"}),e.shared_impact.block_count>1&&!e.confirm_shared_update&&n.addIssue({code:"custom",path:["confirm_shared_update"],message:"shared definition updates require explicit confirmation"});let i=e.draft_form_spec.binding.status==="missing";i!==e.recreate_missing_binding&&n.addIssue({code:"custom",path:["recreate_missing_binding"],message:i?"missing bindings require explicit recreation confirmation":"only missing bindings can be recreated"});let a=e.draft_form_spec.binding.status==="bound",s=a&&e.standardization.required&&(e.standardization.grade==="B"||e.standardization.grade==="C");(a&&!s&&e.expected_cms_schema_hash===null||!a&&e.expected_cms_schema_hash!==null)&&n.addIssue({code:"custom",path:["expected_cms_schema_hash"],message:a?"bound standard forms require the current CMS schema hash":"unbound or missing forms cannot claim a current CMS schema hash"}),e.confirm_standardization!==e.standardization.required&&n.addIssue({code:"custom",path:["confirm_standardization"],message:e.standardization.required?"legacy standardization requires explicit confirmation":"standard forms cannot claim legacy standardization confirmation"})}),HS=["created","validated","binding_reserved","candidate_ready","cms_applied","snapshot_promoted","committed","compensating","recovery_required","failed"],Xs=l.enum(HS),$S=["pending","running","succeeded","failed","recovery_required"],vc=l.enum($S),YS=["candidate_abandon","snapshot_reconcile","cms_restore"],Cc=l.enum(YS),XS=["FORM_DESIGN_INVALID","FORM_DESIGN_UNSUPPORTED","FORM_DESIGN_STANDARDIZATION_AGENT_REQUIRED","FORM_DESIGN_STANDARDIZATION_UNSUPPORTED","FORM_DESIGN_FEATURE_NOT_ENABLED","FORM_DESIGN_PERMISSION_DENIED","FORM_DESIGN_LOCKED","FORM_DESIGN_CODE_CONFLICT","FORM_DESIGN_CMS_CONFLICT","FORM_DESIGN_CMS_SCHEMA_MISMATCH","FORM_DESIGN_CMS_NOT_FOUND","FORM_DESIGN_BINDING_MISSING","FORM_DESIGN_OPERATION_CONFLICT","FORM_DESIGN_CMS_UNAVAILABLE","FORM_DESIGN_PATCH_FAILED","FORM_DESIGN_COMPENSATION_FAILED","FORM_DESIGN_RECOVERY_REQUIRED"],Qs=l.enum(XS),Dc=l.enum(["wait","resume","retry_new_operation","manual_recovery","none"]),jc=l.enum(["not_started","pending","succeeded","failed"]),Oc=l.object({operation_id:Ws,operation_fingerprint:ie,site_id:R,form_definition_id:ui,stage:Xs,status:vc,base_snapshot_id:T,candidate_snapshot_id:T.nullable(),before_form_code:l.string().regex(Ut).nullable(),materialized_form_code:l.string().regex(Ut).nullable(),expected_form_spec_hash:ie,draft_form_spec_hash:ie,materialized_form_spec_hash:ie.nullable(),expected_cms_schema_hash:ie.nullable(),desired_cms_schema_hash:ie,retry_count:l.number().int().nonnegative(),failure_stage:Cc.nullable(),last_error_code:Qs.nullable(),retryable:l.boolean(),next_action:Dc,preview_refresh_status:jc,created_at:l.string().datetime({offset:!0}),updated_at:l.string().datetime({offset:!0})}).strict().superRefine((e,n)=>{if(!(e.stage!=="committed"&&e.status!=="succeeded")){(e.stage!=="committed"||e.status!=="succeeded")&&n.addIssue({code:"custom",path:["status"],message:"committed stage and succeeded status must be reported together"});for(let i of["candidate_snapshot_id","materialized_form_code","materialized_form_spec_hash"])e[i]===null&&n.addIssue({code:"custom",path:[i],message:`${i} is required for a committed success`});(e.failure_stage!==null||e.last_error_code!==null||e.retryable||e.next_action!=="none")&&n.addIssue({code:"custom",path:["next_action"],message:"a committed success cannot retain an error or retry action"})}}),Zs=l.object({operation:Oc}).strict(),Pw=Zs,ww=Zs,vw=l.object({operation_fingerprint:ie}).strict(),Cw=Zs,QS=l.preprocess(e=>!e||typeof e!="object"||Array.isArray(e)||"standardization"in e||"confirm_standardization"in e?e:{...e,standardization:{grade:"standard",required:!1,pending_confirmations:[]},confirm_standardization:!1},VS),Dw=l.object({operation:Oc,request:QS,cms_replace_result:l.unknown().nullable()}).strict(),ZS=l.object({stage:Xs.optional(),status:vc.optional(),candidate_snapshot_id:T.nullable().optional(),before_form_code:l.string().regex(Ut).nullable().optional(),materialized_form_code:l.string().regex(Ut).nullable().optional(),materialized_form_spec_hash:ie.nullable().optional(),retry_count:l.number().int().nonnegative().optional(),failure_stage:Cc.nullable().optional(),last_error_code:Qs.nullable().optional(),retryable:l.boolean().optional(),next_action:Dc.optional(),preview_refresh_status:jc.optional()}).strict(),jw=l.object({expected_updated_at:l.string().datetime({offset:!0}),operation:ZS,cms_replace_result:l.unknown().nullable().optional()}).strict().refine(e=>Object.keys(e.operation).length>0||Object.hasOwn(e,"cms_replace_result"),{message:"transition must change operation state or CMS result"}),Ow=l.object({code:Qs,message:l.string().trim().min(1).max(500),retryable:l.boolean(),operation_id:Ws.optional(),stage:Xs.optional()}).strict();function JS(e){return WS.parse({site_id:e.site_id,form_definition_id:e.form_definition_id,base_snapshot_id:e.base_snapshot_id,expected_form_spec_hash:e.expected_form_spec_hash,expected_cms_schema_hash:e.expected_cms_schema_hash,draft_form_spec_hash:e.draft_form_spec_hash,desired_cms_schema_hash:e.desired_cms_schema_hash,affected_files_hash:e.affected_files_hash,shared_reference_hash:e.shared_impact.reference_hash,shared_reference_count:e.shared_impact.block_count,confirm_shared_update:e.confirm_shared_update,recreate_missing_binding:e.recreate_missing_binding,standardization:e.standardization,confirm_standardization:e.confirm_standardization})}function Ic(e){for(let n=0;n<e.length;n+=1){let i=e.charCodeAt(n);if(i>=55296&&i<=56319){let a=e.charCodeAt(n+1);if(n+1>=e.length||a<56320||a>57343)throw new TypeError("canonical JSON cannot contain a lone surrogate");n+=1}else if(i>=56320&&i<=57343)throw new TypeError("canonical JSON cannot contain a lone surrogate")}}function Ks(e,n){if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"){if(!Number.isFinite(e))throw new TypeError("canonical JSON numbers must be finite");return JSON.stringify(e)}if(typeof e=="string")return Ic(e),JSON.stringify(e);if(typeof e!="object")throw new TypeError("value is not valid JSON");if(n.has(e))throw new TypeError("canonical JSON cannot contain cycles");n.add(e);try{if(Array.isArray(e)){let r=[];for(let d=0;d<e.length;d+=1){if(!(d in e))throw new TypeError("canonical JSON cannot contain sparse arrays");r.push(Ks(e[d],n))}return`[${r.join(",")}]`}let i=Object.getPrototypeOf(e);if(i!==Object.prototype&&i!==null)throw new TypeError("canonical JSON objects must be plain records");let a=e;return`{${Object.keys(a).sort().map(r=>(Ic(r),`${JSON.stringify(r)}:${Ks(a[r],n)}`)).join(",")}}`}finally{n.delete(e)}}function Js(e){return Ks(e,new Set)}async function gi(e){let n=Js(e),i=new TextEncoder().encode(n),a=globalThis.crypto?.subtle?new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256",i)):(await import("@noble/hashes/sha256")).sha256(i);return`sha256:${Array.from(a,r=>r.toString(16).padStart(2,"0")).join("")}`}async function Nw(e){return gi($s.parse(e))}async function Lw(e){return gi(Pc.parse(e))}async function Mw(e){let n=BS.parse(e).map(i=>({...i})).sort((i,a)=>i.path<a.path?-1:i.path>a.path?1:0);return gi({version:1,files:n})}async function Uw(e){return gi(JS(e))}import{z as v}from"zod";var Gw=["page-seo","root-layout-metadata","nav-items"],zw=v.object({path:v.string(),title:v.string(),description:v.string().optional(),keywords:v.string().optional(),meta_tags_json:v.record(v.string(),v.record(v.string(),v.string())).nullish(),schema_json:v.union([v.record(v.string(),v.unknown()),v.array(v.record(v.string(),v.unknown())),v.string()]).nullish(),breadcrumbs_json:v.array(v.object({name:v.string().optional(),text:v.string().optional(),url:v.string().nullish()})).nullish()}),Kw=v.object({metadataBase:v.string().optional(),title:v.union([v.string(),v.object({default:v.string().optional(),template:v.string().optional(),absolute:v.string().optional()})]).optional(),description:v.string().optional(),keywords:v.string().optional(),openGraph:v.object({title:v.string().optional(),description:v.string().optional(),type:v.string().optional(),siteName:v.string().optional(),url:v.string().optional(),locale:v.string().optional(),images:v.array(v.union([v.string(),v.object({url:v.string(),alt:v.string().optional()})])).optional()}).optional(),twitter:v.object({card:v.string().optional(),title:v.string().optional(),description:v.string().optional(),images:v.array(v.string()).optional()}).optional(),alternates:v.object({canonical:v.string().optional()}).optional()}),Nc=()=>v.object({label:v.string(),href:v.string().optional(),targetType:v.enum(["page","anchor","external","email","phone","file","group"]).optional(),role:v.enum(["link","cta"]).optional(),openInNewTab:v.boolean().optional(),nofollow:v.boolean().optional(),description:v.string().optional(),badge:v.string().optional(),iconKey:v.string().optional()}),Bw=Nc().extend({children:v.array(Nc()).optional()}),ef=["title","description","keywords","breadcrumbs_json.*.name","breadcrumbs_json.*.text"],tf=["path","meta_tags_json.**","schema_json.**","breadcrumbs_json.*.url"],nf=["title","title.default","title.template","title.absolute","description","keywords","openGraph.title","openGraph.description","openGraph.siteName","openGraph.images.*.alt","twitter.title","twitter.description"],sf=["metadataBase","openGraph.type","openGraph.url","openGraph.locale","openGraph.images.*","openGraph.images.*.url","twitter.card","twitter.images.*","alternates.canonical"],af=["label","description","badge"],of=["href","targetType","role","iconKey"],Lc={"page-seo":{localizable:ef,machine:tf},"root-layout-metadata":{localizable:nf,machine:sf},"nav-items":{localizable:af,machine:of}},Mc="*",Uc="**",rf="children";function cf(e){return typeof e=="number"||/^\d+$/.test(e)?Mc:e}function qc(e,n){let i=n.map(cf);return e!=="nav-items"?i:i.filter(a=>a!==Mc&&a!==rf)}function Fc(e,n){let i=e.split(".");for(let a=0;a<i.length;a+=1){if(i[a]===Uc)return!0;if(a>=n.length||i[a]!==n[a])return!1}return i.length===n.length}function mf(e,n){let i=e.split(".");if(n.length>=i.length)return!1;for(let a=0;a<n.length;a+=1){if(i[a]===Uc)return!0;if(i[a]!==n[a])return!1}return!0}function Ww(e,n){let i=qc(e,n);return i.length===0?!1:Lc[e].localizable.some(a=>Fc(a,i))}function Vw(e,n){let i=qc(e,n);if(i.length===0)return!0;let{localizable:a,machine:s}=Lc[e];return[...a,...s].some(r=>Fc(r,i)||mf(r,i))}var Yw=["product-search","migration-products","standard-form","form-submission-infrastructure"],lf=[{path:"app/search/page.tsx",materializer:"product-search"},{path:"components/site/generated/product-search/entry.tsx",materializer:"product-search"},{path:"components/site/generated/product-search/results.tsx",materializer:"product-search"},{path:"app/api/product-search/facets/route.ts",materializer:"product-search"},{path:"lib/cms/product-search.ts",materializer:"product-search"},{path:"lib/generated/product-search-value-codec.ts",materializer:"product-search"},{path:"lib/generated/product-search-config.json",materializer:"product-search"},{path:`lib/cms/generated/${tt}.ts`,materializer:"migration-products"},{path:`components/site/generated/${tt}-list.tsx`,materializer:"migration-products"},{path:`components/site/generated/${tt}-list-view.tsx`,materializer:"migration-products"},{path:`components/site/generated/${tt}-detail-view.tsx`,materializer:"migration-products"},{path:`app/${tt}/[slug]/page.tsx`,materializer:"migration-products"},{path:`components/site/generated/${tt}-breadcrumb.tsx`,materializer:"migration-products"},{path:"components/site/generated/forms/vcp-form-runtime.tsx",materializer:"standard-form"},{path:"app/api/forms/[code]/route.ts",materializer:"form-submission-infrastructure"},{path:"hooks/use-cms-form-submit.ts",materializer:"form-submission-infrastructure"},{path:"lib/cms/forms.ts",materializer:"form-submission-infrastructure"}],pf=[{prefix:"components/site/generated/forms/form-",suffix:".tsx",materializer:"standard-form"}],Xw=[{path:"lib/cms/client.ts",reason:"\u4E0D\u662F\u7269\u5316\u4EA7\u7269\uFF1A\u6A21\u677F\u81EA\u5E26\u7684 CMS \u4F20\u8F93\u5C42\uFF0C\u7269\u5316\u5668\u53EA\u5BF9\u5B83\u505A\u5B9A\u70B9\u5B57\u7B26\u4E32\u5347\u7EA7\uFF08\u591A\u90E8\u5206\u8868\u5355\u63D0\u4EA4\u3001no-store \u8BFB\uFF09\uFF0C\u6574\u4EFD\u8986\u5199\u53CD\u800C\u4F1A\u62B9\u6389\u7AD9\u70B9\u4FA7\u7684\u5176\u4ED6\u5347\u7EA7\u3002"},{path:"components/site/generated/forms/form-<id>.spec.ts",reason:"\u8DEF\u5F84\u5F52\u5E73\u53F0\u3001\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u8868\u5355\u8BBE\u8BA1\u5668\u5199\u7684\u5B57\u6BB5\u6587\u6848\uFF0C\u5F52 FORM_SPEC_LOCALIZABLE_FIELD_PATHS \u7684\u5B57\u6BB5\u7EA7\u6E05\u5355\u7BA1\u8F96\u3002"}];function df(e){return e.length>0&&!e.includes("/")&&!e.includes(".")}function Qw(e){return lf.some(n=>n.path===e)?!0:pf.some(n=>!e.startsWith(n.prefix)||!e.endsWith(n.suffix)?!1:df(e.slice(n.prefix.length,e.length-n.suffix.length)))}import{z as it}from"zod";var uf=["provisioning","cms_app_created","seeded","ready","failed"],tv=it.object({tenant_id:it.string().min(1),site_id:R,collection_slug:it.string().min(1),cms_collection_id:it.string().min(1).nullable(),status:it.enum(uf),owned_by_vcp:it.boolean(),run_id:H.nullable(),last_error:it.string().nullable(),created_at:it.string().datetime(),updated_at:it.string().datetime()});var Gc="/vibe/v1";function iv(e){let n=e?.trim().replace(/\/+$/,"");if(!n)return null;try{let i=new URL(n),a=i.pathname.replace(/\/+$/,"");return i.search="",i.hash="",i.pathname=a.endsWith(Gc)?a:Gc,i.href.replace(/\/+$/,"")}catch{return n}}import{z as _}from"zod";var _i=_.string().url().refine(jf,{message:"URL must use http or https"}),zc=_.string().trim().pipe(_i),gf=_.object({task_type:_.literal("home_url"),task_url:zc,planned_num:_.number().int().min(1).max(20).optional()}).strict(),_f=_.object({task_type:_.literal("url_list"),urls:_.array(_i).min(1).max(1e4)}).strict(),rv=_.discriminatedUnion("task_type",[gf,_f]),cv=_.object({page:_.coerce.number().int().positive().default(1),page_size:_.coerce.number().int().min(1).max(20).default(20)}).strict(),mv=_.object({home_url:zc}).strict(),It=_.string().uuid(),qt=_.string().uuid(),lv=_.object({task_uuid:It}).strict(),Kc=_.enum(["URL_DISCOVERY","PAGE_CRAWL","TASK_SCHEDULING","RESULT_PERSISTENCE"]),hf=_.object({task_uuid:It,status:_.literal("NOT_STARTED"),total:_.literal(0)}).strict(),Sf=_.object({task_uuid:It,status:_.literal("PROCESSING"),total:_.literal(0)}).strict(),pv=_.enum(["no_suitable_page_candidate","page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"]),ff=_.discriminatedUnion("status",[_.object({role:rt,status:_.literal("selected"),reason_code:_.null()}).strict(),_.object({role:rt,status:_.literal("not_found"),reason_code:_.literal("no_suitable_page_candidate")}).strict(),_.object({role:rt,status:_.literal("unknown"),reason_code:_.enum(["page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"])}).strict()]),Bc=_.array(ff).length(7).superRefine((e,n)=>{let i=new Set(e.map(a=>a.role));i.size!==e.length&&n.addIssue({code:"custom",message:"discovery coverage roles must be unique"});for(let a of rt.options)i.has(a)||n.addIssue({code:"custom",message:`discovery coverage is missing role ${a}`})}),bf=_.object({task_uuid:It,status:_.literal("SUCCEEDED"),total:_.number().int().positive(),discovery_coverage:Bc.optional()}).strict(),yf=_.enum(["TASK_FAILED","PROVIDER_CAPABILITY_LIMIT","WEBSITE_UNREACHABLE"]),xf=_.object({task_uuid:It,status:_.literal("FAILED"),total:_.literal(0),error_code:yf,error_message:_.string().min(1),failure_stage:Kc}).strict(),dv=_.discriminatedUnion("status",[hf,Sf,bf,xf]),Ef=_.object({url:_i,raw_html:_.string().min(1)}).strict(),uv=_.object({task_uuid:It,status:_.literal("SUCCEEDED"),page:_.number().int().positive(),page_size:_.number().int().min(1).max(20),total:_.number().int().positive(),total_pages:_.number().int().positive(),pages:_.array(Ef).max(20),discovery_coverage:Bc.optional()}).strict().superRefine((e,n)=>{e.total_pages!==Math.ceil(e.total/e.page_size)&&n.addIssue({code:"custom",path:["total_pages"],message:"total_pages must equal ceil(total / page_size)"}),e.pages.length>e.page_size&&n.addIssue({code:"custom",path:["pages"],message:"pages must not exceed page_size"})}),gv=_.object({task_code:qt}).strict(),If=_.object({task_code:qt,status:_.literal("NOT_STARTED")}).strict(),Rf=_.object({task_code:qt,status:_.literal("PROCESSING")}).strict(),Tf=_.object({task_code:qt,status:_.literal("SUCCEEDED"),urls:_.array(_i)}).strict(),kf=_.literal("SITEMAP_DISCOVERY_FAILED"),Af=_.object({task_code:qt,status:_.literal("FAILED"),error_code:kf,error_message:_.string().min(1)}).strict(),_v=_.discriminatedUnion("status",[If,Rf,Tf,Af]),hv=_.object({company_name:_.string().regex(/\S/u)}).strict(),Pf=_.object({company_name:_.string(),brand_name:_.string(),main_products:_.array(_.string()),industry:_.array(_.string()),subfields:_.array(_.string()),business_intro:_.string(),registered_capital:_.string(),legal_representative:_.string(),target_markets:_.array(_.string()),target_customer_industries:_.array(_.string()),target_customer_roles:_.array(_.string()),purchase_scenarios:_.string(),differentiators:_.array(_.string()),competitors:_.array(_.object({name:_.string(),official_url:_.string()}).strict()).max(3),qualifications:_.array(_.string()),representative_cases:_.array(_.string()),acquisition_channels:_.array(_.string()),desired_domain:_.string(),brand_tone:_.string(),timezone:_.string()}).strict(),hi=_.object({company_uuid:_.string().uuid(),company_info:Pf,created_at:_.string().datetime(),updated_at:_.string().datetime()}),wf=hi.extend({status:_.literal("NOT_STARTED"),last_error_code:_.null(),last_error_message:_.null(),started_at:_.null(),completed_at:_.null()}).strict(),vf=hi.extend({status:_.literal("PROCESSING"),last_error_code:_.null(),last_error_message:_.null(),started_at:_.string().datetime(),completed_at:_.null()}).strict(),Wc=hi.extend({status:_.literal("SUCCEEDED"),last_error_code:_.null(),last_error_message:_.null(),started_at:_.string().datetime(),completed_at:_.string().datetime()}).strict(),Vc=hi.extend({status:_.literal("FAILED"),last_error_code:_.string().min(1),last_error_message:_.string().min(1),started_at:_.string().datetime(),completed_at:_.string().datetime()}).strict(),Sv=_.discriminatedUnion("status",[Wc,Vc]),fv=_.discriminatedUnion("status",[wf,vf,Wc,Vc]),Cf=["BAD_REQUEST","NOT_FOUND","PAYLOAD_TOO_LARGE","INTERNAL_SERVER_ERROR","UNAUTHORIZED","FORBIDDEN","INVALID_TASK_TYPE","TASK_URL_REQUIRED","INVALID_PLANNED_NUM","URL_LIST_REQUIRED","URL_LIST_LIMIT_EXCEEDED","INVALID_URL_LIST","INVALID_PAGINATION","INVALID_TASK_CODE","INVALID_HOME_URL","TASK_CODE_HOME_URL_CONFLICT","SITEMAP_TASK_NOT_FOUND","SITEMAP_DISCOVERY_FAILED","TASK_NOT_FOUND","PROVIDER_CAPABILITY_LIMIT","TASK_FAILED","WEBSITE_UNREACHABLE"],Df=_.enum(Cf),bv=_.object({error_code:Df,error_message:_.string().min(1),failure_stage:Kc.optional(),task_uuid:It.optional(),task_code:qt.optional()}).strict();function jf(e){try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}}import{z as L}from"zod";var Me=L.string().url().refine(Lf,{message:"URL must use http or https"}),Hc=L.string().min(1).max(512),Si=L.string().datetime({offset:!0}),$c=L.enum(["scraping","completed","failed","expired"]),Ev=L.object({url:Me,ignore_cache:L.boolean(),sitemap:L.enum(["include","skip"]),include_subdomains:L.boolean(),ignore_query_parameters:L.boolean(),limit:L.number().int().min(1).max(1e5)}).strict(),Iv=L.object({links:L.array(Me).max(1e5)}).strict(),Rv=L.object({url:Me,limit:L.number().int().min(1).max(1e5),max_discovery_depth:L.literal(1),crawl_entire_domain:L.literal(!1),allow_subdomains:L.literal(!0),sitemap:L.literal("skip")}).strict(),Tv=L.object({crawl_id:Hc,expires_at:Si.optional()}).strict(),kv=L.object({status:$c,urls:L.array(Me).max(1e5),next:Me.optional(),expires_at:Si}).strict(),Av=L.object({url:Me,formats:L.tuple([L.literal("rawHtml")]),only_main_content:L.literal(!1),max_age:L.number().int().nonnegative()}).strict(),Pv=L.object({url:Me,raw_html:L.string().min(1),status_code:L.number().int().min(100).max(599).nullable()}).strict(),wv=L.object({urls:L.array(Me).min(1).max(1e4),formats:L.tuple([L.literal("rawHtml")]),ignore_invalid_urls:L.literal(!1),max_age:L.number().int().nonnegative(),max_concurrency:L.number().int().positive().optional()}).strict(),vv=L.object({batch_id:Hc,expires_at:Si.optional()}).strict(),Of=L.object({url:Me,raw_html:L.string().min(1)}).strict(),Cv=L.object({status:$c,total:L.number().int().nonnegative(),completed:L.number().int().nonnegative(),pages:L.array(Of).max(1e4),next:Me.optional(),expires_at:Si}).strict().superRefine((e,n)=>{e.completed>e.total&&n.addIssue({code:"custom",path:["completed"],message:"completed must not exceed total"})}),Nf=L.object({url:Me,error_message:L.string().min(1)}).strict(),Dv=L.object({errors:L.array(Nf).max(1e4),robots_blocked:L.array(Me).max(1e4)}).strict(),jv=L.object({active:L.number().int().nonnegative(),waiting:L.number().int().nonnegative(),max_concurrency:L.number().int().positive()}).strict();function Lf(e){try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}}import{z as b}from"zod";var Xc=b.lazy(()=>xn),Mf=b.enum(["page","block"]),bi=b.enum(["component","page","pages"]),Uf=b.enum(["en-US","zh-CN","zh-TW","fr-FR","de-DE","es-ES","ja-JP","ko-KR"]),Rt=Uf,Qc=b.object({requested_locale:Rt,resolved_locale:Rt,fallback_used:b.boolean()}).strict(),yn=b.object({id:b.string().uuid(),key:b.string().min(1),name:b.string().min(1)}).strict(),fi=yn.extend({color:b.string().nullable()}).strict(),Uv=b.object({kind:Mf,category_id:b.string().uuid().optional(),tag_id:b.string().uuid().optional(),search:b.string().trim().min(1).max(200).optional(),limit:b.coerce.number().int().min(1).max(50).default(20),cursor:b.string().min(1).optional()}).strict(),qf=b.object({stable_key:b.string().min(1),type:bi,title:b.string().min(1).max(200),description:b.string().max(1e3),thumbnail_url:b.string().url().nullable(),resolved_version:b.number().int().positive(),content_schema_version:b.literal(3),category:yn.nullable(),tags:b.array(fi),page_count:b.number().int().nonnegative(),component_count:b.number().int().nonnegative(),locale:Qc}).strict(),qv=b.object({items:b.array(qf),facets:b.object({categories:b.array(yn),tags:b.array(fi)}).strict(),next_cursor:b.string().nullable()}).strict(),Fv=b.object({operation_id:b.string().uuidv7(),resolved_version:b.number().int().positive(),base_sitemap_id:b.string().uuid(),base_sitemap_version:b.number().int().positive(),sitemap:Xc,target_page_id:b.string().min(1).optional()}).strict(),Gv=b.object({next_sitemap:Xc,applied:b.object({stable_key:b.string().min(1),resolved_version:b.number().int().positive(),template_type:bi,page_ids:b.array(b.string().min(1)),block_ids:b.array(b.string().min(1))}).strict(),locale:Qc,warnings:b.array(b.string())}).strict(),Zc=b.object({nodeId:b.string().uuid(),type:b.string().trim().min(1).max(100),label:b.string().trim().min(1).max(200),variant:b.string().trim().min(1).max(100).optional(),order:b.number().int().nonnegative(),props:b.record(b.string(),b.unknown()),thumbnail:b.string().url().optional(),source:b.unknown().optional()}).strict(),Yc=b.object({nodeId:b.string().uuid().optional(),slug:b.string().regex(/^\/$|^\/[a-z0-9]+(?:-[a-z0-9]+)*(?:\/[a-z0-9]+(?:-[a-z0-9]+)*)*$/u),navigation:b.object({showInHeader:b.boolean(),showInFooter:b.boolean(),order:b.number().int().nonnegative()}).strict(),components:b.array(Zc).min(1).max(100),thumbnail:b.string().url().optional(),source:b.unknown().optional()}).strict(),Ff=b.union([Zc,Yc,b.object({pages:b.array(Yc).min(1).max(50),thumbnail:b.string().url().optional(),source:b.unknown().optional()}).strict()]),Gf=b.object({title:b.string().min(1).max(200),description:b.string().min(1).max(1e3),prompt:b.string().min(1).max(8192)}).strict(),zf=b.object({locale:Rt,title:b.string().min(1).max(200),content:b.object({description:b.string().min(1).max(1e3),prompt:b.string().min(1).max(8192),nodes:b.record(b.string().uuid(),Gf)}).strict()}).strict(),zv=b.object({templateId:b.string().uuid(),stableKey:b.string().min(1),type:bi,resolvedVersion:b.number().int().positive(),contentSchemaVersion:b.literal(3),structure:Ff,requestedLocale:Rt,resolvedLocale:Rt,fallbackUsed:b.boolean(),contents:b.array(zf).length(1)}).strict().superRefine((e,n)=>{(e.type==="component"&&!("type"in e.structure)||e.type==="page"&&!("components"in e.structure)||e.type==="pages"&&!("pages"in e.structure))&&n.addIssue({code:"custom",path:["structure"],message:"Template type and structure must match."});let i=Kf(e.structure),a=new Set(Object.keys(e.contents[0]?.content.nodes??{}));(i.size!==a.size||[...i].some(s=>!a.has(s)))&&n.addIssue({code:"custom",path:["contents",0,"content","nodes"],message:"Localized nodes must exactly match the structure nodes."}),e.contents[0]?.locale!==e.resolvedLocale&&n.addIssue({code:"custom",path:["contents"],message:"Resolved locale must match returned content."}),e.fallbackUsed!==(e.requestedLocale!==e.resolvedLocale)&&n.addIssue({code:"custom",path:["fallbackUsed"],message:"fallbackUsed must match locale resolution."})}),Kv=b.object({items:b.array(b.object({stableKey:b.string().min(1),type:bi,title:b.string().min(1).max(200),description:b.string().max(1e3),thumbnailUrl:b.string().url().nullable(),resolvedVersion:b.number().int().positive(),contentSchemaVersion:b.literal(3),category:yn.nullable(),tags:b.array(fi),pageCount:b.number().int().nonnegative(),componentCount:b.number().int().nonnegative(),requestedLocale:Rt,resolvedLocale:Rt,fallbackUsed:b.boolean()}).strict()),facets:b.object({categories:b.array(yn),tags:b.array(fi)}).strict(),nextCursor:b.string().nullable()}).strict().superRefine((e,n)=>{e.items.forEach((i,a)=>{i.fallbackUsed!==(i.requestedLocale!==i.resolvedLocale)&&n.addIssue({code:"custom",path:["items",a,"fallbackUsed"],message:"fallbackUsed must match locale resolution."})})});function Kf(e){if("type"in e)return new Set([e.nodeId]);let n="pages"in e?e.pages:[e];return new Set(n.flatMap(i=>[...i.nodeId?[i.nodeId]:[],...i.components.map(a=>a.nodeId)]))}function Bv(e){return Js({tenant_id:e.tenant_id,site_id:e.site_id,stable_key:e.stable_key,resolved_version:e.request.resolved_version,base_sitemap_id:e.request.base_sitemap_id,base_sitemap_version:e.request.base_sitemap_version,sitemap:e.request.sitemap,target_page_id:e.request.target_page_id??null})}import{z as q}from"zod";var Bf=["pending_dns","active","failed","removing"],Wf=q.enum(Bf),Vf=["serve_site","redirect_301"],Hf=q.enum(Vf),$f=["traffic","ownership","certificate_delegation"],ea=q.enum($f),Yf=["pending","verified"],Xf=q.enum(Yf),Qf=["not_applicable","unavailable","not_needed","auto_applied","confirmation_required","blocked"],Zf=q.enum(Qf),ta=q.enum(["prepare_configuration","apply_configuration","verify_dns","remediate_dns","confirm_dns_remediation"]),Jf=q.enum(["accepted","running","succeeded","failed"]),eb=q.object({code:q.string().min(1),message:q.string().min(1)}).strict(),tb=q.object({purpose:ea,verified:q.boolean(),observedValues:q.array(q.string())}).strict(),Jc=q.object({ready:q.boolean(),providerReady:q.boolean(),dnsVerified:q.boolean(),records:q.array(tb)}).strict(),em=q.object({type:q.string().min(1),name:q.string().min(1),value:q.string().min(1),ttl:q.number().nullable()}).strict(),nb=q.object({purpose:ea,action:q.enum(["none","create","update","blocked"]),before:em.nullable(),after:em.nullable()}).strict(),tm=q.object({domainId:q.string().min(1),status:Zf,changes:q.array(nb)}).strict(),ib=q.object({purpose:ea,type:q.string().min(1),name:q.string().min(1),value:q.string().min(1),verificationStatus:Xf}).strict(),nm=q.object({id:q.string().min(1),hostname:q.string().min(1),isPrimary:q.boolean(),routingMode:Hf,observedStatus:Wf,lastVerifiedAt:q.string().datetime().nullable(),dnsRecords:q.array(ib)}).strict().superRefine((e,n)=>{sb(e.hostname)||n.addIssue({code:"custom",path:["hostname"],message:"hostname must be a canonical ASCII hostname"}),e.isPrimary&&e.routingMode!=="serve_site"&&n.addIssue({code:"custom",path:["routingMode"],message:"a primary domain must serve the site"}),!e.isPrimary&&e.routingMode!=="redirect_301"&&n.addIssue({code:"custom",path:["routingMode"],message:"a non-primary domain must redirect with 301"})}),im=q.object({primaryDomain:nm.nullable(),redirectDomains:q.array(nm)}).strict().superRefine((e,n)=>{e.primaryDomain!==null&&(!e.primaryDomain.isPrimary||e.primaryDomain.routingMode!=="serve_site")&&n.addIssue({code:"custom",path:["primaryDomain"],message:"primaryDomain must be primary and serve the site"});for(let[a,s]of e.redirectDomains.entries())(s.isPrimary||s.routingMode!=="redirect_301")&&n.addIssue({code:"custom",path:["redirectDomains",a],message:"redirectDomains must be non-primary 301 redirects"});e.primaryDomain!==null&&e.redirectDomains.some(s=>s.hostname===e.primaryDomain?.hostname)&&n.addIssue({code:"custom",path:["redirectDomains"],message:"primaryDomain must not also be a redirect"});let i=[...e.primaryDomain===null?[]:[e.primaryDomain.hostname],...e.redirectDomains.map(a=>a.hostname)];new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["redirectDomains"],message:"domain hostnames must be unique"})}),yi=q.object({id:q.string().min(1),type:ta,status:Jf,error:eb.nullable(),result:q.union([Jc,tm]).nullable().optional()}).strict().superRefine((e,n)=>{if(e.status==="failed"&&e.error===null&&n.addIssue({code:"custom",path:["error"],message:"failed operations must include a stable error"}),e.status!=="failed"&&e.error!==null&&n.addIssue({code:"custom",path:["error"],message:"non-failed operations must not include an error"}),!(e.result===void 0||e.result===null)){if(e.status!=="succeeded"){n.addIssue({code:"custom",path:["result"],message:"operation results only belong to succeeded operations"});return}if(e.type==="verify_dns"){Jc.safeParse(e.result).success||n.addIssue({code:"custom",path:["result"],message:"verify_dns operations require a DNS verification result"});return}if(e.type==="remediate_dns"){tm.safeParse(e.result).success||n.addIssue({code:"custom",path:["result"],message:"remediate_dns operations require a DNS remediation result"});return}n.addIssue({code:"custom",path:["result"],message:"only verify_dns and remediate_dns operations may carry a result"})}});function sb(e){if(e!==e.trim()||e!==e.toLowerCase()||e.length>253||e.endsWith("."))return!1;let n=e.split(".");return n.length>=2&&n[n.length-1].length>=2&&n.every(i=>i.length>=1&&i.length<=63&&/^[a-z0-9-]+$/.test(i)&&!i.startsWith("-")&&!i.endsWith("-"))}import{z as ke}from"zod";import{z as f}from"zod";var ab=f.enum(["active","completed","canceled"]),ob=f.enum(["quality","domain","gsc","publish"]),xi=f.enum(["pending","running","succeeded","failed"]),am=xi,om=f.enum(["pending","running","completed"]),rb=f.object({group_code:f.string().min(1),name:f.string().min(1),score:f.number().nonnegative(),total_score:f.number().nonnegative(),pass_score:f.number().nonnegative(),running_status:om,result_text:f.string()}).strict(),cb=f.object({id:f.number().int().positive().optional(),quality_task_id:f.number().int().positive(),item_code:f.string().min(1),status:xi,is_repaired:f.boolean(),total_score:f.number().nonnegative(),score:f.number().nonnegative(),check_result:f.unknown().nullable(),remediation_items:f.unknown().nullable(),result_text:f.string(),created_at:f.string().min(1),updated_at:f.string().min(1),item_name:f.string().min(1),dimension_code:f.enum(["reach","trust","convert","safe"]),group_code:f.string().min(1),auto_fix:f.boolean()}).strict(),mb=f.object({dimension_code:f.enum(["reach","trust","convert","safe"]),name:f.string().min(1),alias_en:f.string().min(1),description:f.string(),tips:f.string(),score:f.number().nonnegative(),repaired_score:f.number().nonnegative(),total_score:f.number().nonnegative(),pass_score:f.number().nonnegative(),running_status:om,problem_group_count:f.number().int().nonnegative(),remediation_items:f.array(cb),groups:f.array(rb)}).strict(),lb=f.object({id:f.number().int().positive(),task_code:f.string().uuid(),scene_code:f.enum(["site_publish","vcp_published_pages","content_publish"]),tenant_id:f.string().min(1),vcp_site_id:R,cms_site_id:f.string().min(1),checked_url:f.string().url(),quality_params:f.record(f.string(),f.unknown()).nullable(),status:xi,error_info:f.record(f.string(),f.unknown()).nullable(),created_at:f.string().min(1),updated_at:f.string().min(1)}).strict(),pb=f.union([f.object({}).strict(),f.object({summary:f.object({final_score:f.number().nonnegative(),pass_score:f.number().nonnegative(),group_count:f.number().int().nonnegative(),problem_group_count:f.number().int().nonnegative()}).strict(),dimensions:f.array(mb)}).strict()]),sm=f.object({quality_info:lb,quality_detail:pb}).strict().superRefine((e,n)=>{let i="summary"in e.quality_detail;e.quality_info.status!=="failed"&&!i&&n.addIssue({code:"custom",message:"nonfailed quality tasks require complete detail",path:["quality_detail"]}),e.quality_info.status==="failed"&&i&&n.addIssue({code:"custom",message:"failed quality tasks require empty detail",path:["quality_detail"]})}),Jv=f.object({item_code:f.string().min(1),remediation_items:f.unknown().nullable()}).strict(),db=f.object({item_code:f.string().min(1),repair_status:f.enum(["succeeded","failed"]),message:f.string().min(1).optional(),error_code:f.string().min(1).optional(),metadata:f.record(f.string(),f.unknown()).optional()}).strict(),rm=f.object({items:f.array(db)}).strict(),eC=f.object({task_code:f.string().min(1),status:am,result:rm.optional()}).strict().superRefine((e,n)=>{e.status==="succeeded"&&e.result===void 0&&n.addIssue({code:"custom",path:["result"],message:"succeeded repair tasks require a complete result"}),(e.status==="pending"||e.status==="running")&&e.result!==void 0&&n.addIssue({code:"custom",path:["result"],message:"nonterminal repair tasks cannot expose a result"})}),dt=f.object({id:Ca,tenant_id:f.string().min(1),site_id:R,status:ab,current_step:ob,quality_task_code:f.string().uuid().nullable(),quality_task_status:xi,repair_task_code:f.string().min(1).nullable(),repair_task_status:am,publish_deployment_id:Ye.nullable(),domain_hostname:f.string().min(1).nullable(),domain_operation_type:ta.nullable(),domain_operation_payload:f.record(f.string(),f.unknown()).nullable(),domain_preparation_operation_id:f.string().min(1).nullable(),domain_operation_id:f.string().min(1).nullable(),revision:f.number().int().positive(),created_at:f.string().min(1),updated_at:f.string().min(1),completed_at:f.string().min(1).nullable(),canceled_at:f.string().min(1).nullable()}).strict().superRefine((e,n)=>{if(e.domain_operation_type===null){e.domain_operation_payload!==null&&n.addIssue({code:"custom",path:["domain_operation_payload"],message:"domain_operation_payload must be null without an active domain operation"}),e.domain_operation_id!==null&&n.addIssue({code:"custom",path:["domain_operation_id"],message:"domain_operation_id must be null without an active domain operation"});return}e.domain_hostname===null&&n.addIssue({code:"custom",path:["domain_hostname"],message:"an active domain operation requires a hostname"}),e.domain_operation_payload===null&&n.addIssue({code:"custom",path:["domain_operation_payload"],message:"an active domain operation requires a payload"})}),tC=f.object({}).strict(),nC=f.object({expected_revision:f.number().int().nonnegative(),current_step:f.enum(["domain","gsc","publish"]),skip_domain_binding:f.boolean().optional()}).strict(),iC=f.object({expected_revision:f.number().int().nonnegative()}).strict(),ub=f.object({workflow:dt.nullable(),can_cancel:f.boolean()}).strict(),sC=M(ub).strict(),gb=f.object({workflow:dt,can_cancel:f.boolean()}).strict(),aC=M(gb).strict(),_b=f.object({workflow:dt,deployment:f.lazy(()=>ut)}).strict(),oC=M(_b).strict(),hb=f.object({workflow:dt,can_cancel:f.boolean(),quality_result:sm.optional(),repair_result:rm.optional(),final_quality_result:sm.optional(),message:f.string().min(1).optional()}).strict(),rC=M(hb).strict();function Sb(e){return"summary"in e.quality_detail?e.quality_detail.dimensions.flatMap(n=>n.remediation_items.filter(i=>i.status==="succeeded"&&i.score<i.total_score&&i.auto_fix).map(i=>({item_code:i.item_code,remediation_items:i.remediation_items}))):[]}function fb(e,n){let i=e.map(r=>r.item_code),a=n.items.map(r=>r.item_code);if(new Set(i).size!==i.length||new Set(a).size!==a.length||i.length!==a.length)return!1;let s=new Set(i);return n.items.every(r=>s.has(r.item_code)&&r.repair_status==="succeeded")}function cC(e,n){if(!("summary"in e.quality_detail))return null;let i=Sb(e);if(i.length===0)return e;if(n===void 0||!fb(i,n))return null;let a=new Set(n.items.map(r=>r.item_code)),s=e.quality_detail.dimensions.map(r=>{let d=r.remediation_items.map(k=>a.has(k.item_code)?{...k,score:k.total_score,is_repaired:!0,result_text:""}:{...k}),c=r.groups.map(k=>{let I=d.filter(C=>C.group_code===k.group_code);return I.length===0?{...k}:{...k,score:I.reduce((C,F)=>C+F.score,0),result_text:I.map(C=>C.result_text).filter(Boolean).join("\u3001")}}),g=c.reduce((k,I)=>k+I.score,0);return{...r,score:g,repaired_score:g,problem_group_count:c.filter(k=>k.score!==k.total_score).length,remediation_items:d,groups:c}});return{quality_info:{...e.quality_info},quality_detail:{...e.quality_detail,summary:{...e.quality_detail.summary,final_score:Math.round(s.reduce((r,d)=>r+d.score,0)/s.length),problem_group_count:s.reduce((r,d)=>r+d.problem_group_count,0)},dimensions:s}}}var bb=ke.object({hostname:ke.string().min(1),expected_revision:ke.number().int().nonnegative()}).strict(),cm=ke.object({workflow:dt,operation:yi}).strict(),yb=M(cm).strict(),xb=ke.object({expected_revision:ke.number().int().nonnegative()}).strict(),Eb=ke.object({workflow:dt,operation:yi}).strict(),Ib=M(Eb).strict(),na=ke.object({workflow:dt,operation:yi.nullable()}).strict(),Rb=M(na).strict(),Tb=na,kb=M(Tb).strict(),gC=M(im).strict(),Ab=ke.object({published:ke.boolean(),hostname:ke.string(),url:ke.string(),sandbox_url:ke.union([ke.string().url(),ke.literal("")])}).strict().superRefine((e,n)=>{e.published||(e.hostname!==""&&n.addIssue({code:"custom",path:["hostname"],message:"unpublished sites must not include a hostname"}),e.url!==""&&n.addIssue({code:"custom",path:["url"],message:"unpublished sites must not include a URL"}))}),_C=M(Ab).strict(),hC=bb,SC=cm,fC=yb,bC=na,yC=Rb,xC=kb,EC=xb,IC=Ib;import{z as De}from"zod";var Pb=["started","success","failed","canceled"],ia=De.enum(Pb),wb=["inactive","pending_binding","active"],sa=De.enum(wb),vb=["domain","url_prefix"],aa=De.enum(vb),Cb=["not_connected","authorizing","matching_property","ready","failed","canceled","domain_mismatch"],oa=De.enum(Cb),He=De.string().nullable(),mm=De.object({}).strict(),ra=De.object({authorize_url:De.string().url(),custom_domain:He}).strict(),lm=M(ra),Db=De.object({auth_status:ia,binding_status:sa,credential_connected:De.boolean(),custom_domain:He,gsc_site_url:He,property_type:aa.nullable(),auth_error_code:He,auth_error_message:He}).strict(),pm=De.object({auth_status:ia,binding_status:sa,credential_connected:De.boolean(),custom_domain:He,gsc_site_url:He,property_type:aa.nullable(),auth_error_code:He,auth_error_message:He,current_domain:He,state:oa,ready:De.boolean()}).strict().superRefine((e,n)=>{let i=Ob(e,e.current_domain),a=i==="ready";e.state!==i&&n.addIssue({code:"custom",path:["state"],message:`state must equal ${i} for the supplied GSC facts`}),e.ready!==a&&n.addIssue({code:"custom",path:["ready"],message:`ready must equal ${String(a)} for the supplied GSC facts`})}),jb=M(pm);function En(e){let n=e?.trim()??"";if(!n)return"";let i=/^[a-z][a-z0-9+.-]*:\/\//i.test(n)?n:`https://${n}`;try{return new URL(i).hostname.replace(/\.+$/,"").toLowerCase()}catch{return n.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0].replace(/\.+$/,"").toLowerCase()}}function Ob(e,n){let i=e.gsc_site_url?.trim()??"",a=En(e.custom_domain),s=En(n??("current_domain"in e?e.current_domain:void 0)),r=a.length>0&&s.length>0&&a===s,d=Nb(i,e.property_type,s);return e.auth_status==="canceled"?"canceled":e.auth_status==="failed"?"failed":e.auth_status==="started"?"authorizing":!e.credential_connected||e.binding_status==="inactive"?"not_connected":i.length===0||e.property_type===null?"matching_property":!r||!d?"domain_mismatch":e.binding_status==="pending_binding"?"matching_property":e.auth_status==="success"&&e.binding_status==="active"&&e.credential_connected&&i.length>0&&r&&d?"ready":"failed"}function Nb(e,n,i){let a=e?.trim()??"",s=En(i);if(!a||!s||!n)return!1;if(n==="domain"){let r=/^sc-domain:(.+)$/i.exec(a);if(!r)return!1;let d=r[1].trim();if(!d||/[/:?#]/.test(d))return!1;let c=En(d);return c?s===c||s.endsWith(`.${c}`):!1}try{let r=new URL(a);return r.protocol!=="https:"||r.username||r.password||r.port||r.pathname!=="/"||r.search||r.hash?!1:En(r.hostname)===s}catch{return!1}}var AC=mm,PC=ra,wC=lm,vC=oa,CC=ia,DC=sa,jC=aa,OC=oa,NC=mm,LC=ra,MC=lm,UC=Db,qC=pm,FC=jb;var dm=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,um="VCP_E2B_PREVIEW_PROXY_DOMAIN must be a valid hostname.";function Lb(e){let n=e?.trim().toLowerCase()??"";if(!n)return null;if(n.length>253||!n.includes(".")||!n.split(".").every(i=>dm.test(i)))throw new Error(um);return n}function zC(e){let n=Lb(e.proxyDomain);if(!n)return null;let i=e.sandboxId.trim();if(!dm.test(i))throw new Error("sandboxId must be a valid DNS label.");if(`${i}.${n}`.length>253)throw new Error(um);return`https://${i}.${n}/`}function Mb(e,n,i=e){let a=new Map(e.map(c=>[c.slug,c])),s=new Map(i.map(c=>[c.id,c])),r=new Map(e.map(c=>{let g=s.get(c.id);return g&&g.slug!==null&&g.slug!==c.slug?[g.slug,c]:null}).filter(c=>c!==null)),d=new Set(i.map(c=>c.slug).filter(c=>c!==null&&!a.has(c)));return{primaryLinks:gm(n.primaryLinks,e,a,r,d,s,"showInHeader"),footerLinks:gm(n.footerLinks,e,a,r,d,s,"showInFooter")}}function gm(e,n,i,a,s,r,d){let c=new Set,g=[];for(let[F,B]of e.entries()){let ne=Ub(B.href),ce=ne===null?void 0:i.get(ne)??a.get(ne);if(ne!==null&&s.has(ne)&&!i.has(ne)&&!a.has(ne))continue;if(ce?.slug==="/"){g.push({kind:"independent",link:{...B,label:_m(B,ce,r)}});continue}if(!ce){g.push({kind:"independent",link:B});continue}if(!ce.navigation[d])continue;c.add(ce.slug);let Bt=ne===ce.slug?B.href:qb(B.href,ce.slug);g.push({kind:"page",page:ce,link:{...B,label:_m(B,ce,r),href:Bt},index:F})}let k=g.filter(F=>F.kind==="page").sort((F,B)=>F.page.navigation.order-B.page.navigation.order||F.index-B.index),I=0,C=g.map(F=>F.kind==="page"?k[I++].link:F.link);for(let F of[...n].filter(B=>B.slug!=="/"&&B.navigation[d]).sort((B,ne)=>B.navigation.order-ne.navigation.order))c.has(F.slug)||C.push({label:F.title,href:F.slug});return C}function _m(e,n,i){let a=i.get(n.id);return e.label===(a?.title??n.title)?n.title:e.label}function Ub(e){if(!e.startsWith("/")||e.startsWith("//"))return null;let n=e.search(/[?#]/u);return n===-1?e:e.slice(0,n)}function qb(e,n){let i=e.search(/[?#]/u);return i===-1?n:`${n}${e.slice(i)}`}import{z as E}from"zod";var hm=20*1024*1024,Fb=hm,Sm=["jpg","jpeg","png","gif","webp","bmp"],fm=["mp4","avi","mov","webm","mkv"],bm=["mp3","wav","aac","flac","ogg","wma","m4a"],ym=["pdf","doc","docx","xls","xlsx","ppt","pptx","txt","md","csv"],xm=[...ym,"zip","rar","json","xmind","psd","ai","fig","sketch"],Gb=[...Sm,...fm,...bm,...xm],Em=["image/jpeg","image/png","image/gif","image/webp","image/bmp"],Im=["video/mp4","video/x-msvideo","video/quicktime","video/webm","video/x-matroska"],Rm=["audio/mpeg","audio/wav","audio/x-wav","audio/vnd.wave","audio/aac","audio/flac","audio/x-flac","audio/ogg","audio/x-ms-wma","audio/mp4","audio/x-m4a"],zb=[...Em,...Im,...Rm],Tm=E.enum(["image","video","audio","file"]),km=E.enum(["external","ai_generated","unsplash"]),ca=E.object({resource_id:E.string().min(1),name:E.string().min(1).max(255),url:E.string().url(),thumbnail_url:E.union([E.string().url(),E.literal("")]),mime_type:E.string().trim().min(3).max(127),size:E.number().int().nonnegative(),width:E.number().int().positive().nullable(),height:E.number().int().positive().nullable(),source:km,created_at:E.string().min(1).nullable()}),Kb=E.object({page:E.coerce.number().int().min(1).default(1),page_size:E.coerce.number().int().min(1).max(100).default(24),keyword:E.string().trim().max(100).optional(),file_type:Tm.default("image")}),Bb=E.object({code:E.literal(0),message:E.string(),data:E.object({items:E.array(ca),page:E.number().int().min(1),page_size:E.number().int().min(1),total:E.number().int().nonnegative()})}),Wb=E.object({code:E.literal(0),message:E.string(),data:ca}),Tt=4,Vb="site.image_generation.max",Hb=E.object({quantity:E.number().int().min(1).max(Tt)}),ma=E.object({available:E.boolean(),remaining:E.number().nonnegative().nullable(),unlimited:E.boolean(),max_quantity:E.number().int().min(0).max(Tt)}),$b=E.object({code:E.literal(0),message:E.string(),data:ma}),Yb=E.object({prompt:E.string().trim().min(1).max(2e3),quantity:E.number().int().min(1).max(Tt)}),Am=E.discriminatedUnion("ok",[E.object({index:E.number().int().min(0).max(Tt-1),ok:E.literal(!0),url:E.httpUrl(),request_id:E.string().uuid()}),E.object({index:E.number().int().min(0).max(Tt-1),ok:E.literal(!1),error:E.enum(["quota","generate","network"]),message:E.string().trim().min(1).max(500),request_id:E.string().uuid().nullable()})]),Xb=E.object({code:E.literal(0),message:E.string(),data:E.object({quota:ma,items:E.array(Am).max(Tt)})}),Pm=E.object({provider_id:E.string().min(1),url:E.string().url(),thumbnail_url:E.string().url(),width:E.number().int().positive(),height:E.number().int().positive(),alt:E.string(),photographer_name:E.string().min(1),photographer_url:E.string().url(),photo_url:E.string().url(),download_location:E.string().url(),dominant_color:E.string().nullable()}),Qb=E.object({query:E.string().trim().min(1).max(100),page:E.coerce.number().int().min(1).default(1),page_size:E.coerce.number().int().min(1).max(30).default(18),orientation:E.enum(["landscape","portrait","squarish"]).optional()}),Zb=E.object({code:E.literal(0),message:E.string(),data:E.object({items:E.array(Pm),page:E.number().int().min(1),page_size:E.number().int().min(1),total:E.number().int().nonnegative(),total_pages:E.number().int().nonnegative()})}),wm=E.string().url().refine(iy,{message:"download_location must be an official Unsplash download URL"}),Jb=E.object({download_location:wm}),ey=E.object({code:E.literal(0),message:E.string(),data:E.object({reported:E.boolean()})}),ty=E.object({source_id:E.number().int().positive(),source_title:E.string().min(1).max(255),source_url:Xe,resource_id:E.number().int().positive()}),ny=E.object({code:E.literal(0),message:E.string(),data:E.object({reported:E.boolean()})});function iy(e){if(!URL.canParse(e))return!1;let n=new URL(e);return n.protocol==="https:"&&n.hostname==="api.unsplash.com"&&n.username===""&&n.password===""&&n.port===""&&n.hash===""&&/^\/photos\/[^/]+\/download$/.test(n.pathname)}import{z as Ae}from"zod";var sy=Ae.object({colorSeeds:Ae.object({primary:Ae.string().min(1).max(40),accent:Ae.string().min(1).max(40),foreground:Ae.string().min(1).max(40).optional()}).strict().optional(),surfaceMode:Ae.enum(["light","dark"]).optional(),fonts:Ae.object({heading:Ae.string().min(1).max(60),body:Ae.string().min(1).max(60)}).strict().optional()}).strict().refine(e=>e.colorSeeds!==void 0||e.surfaceMode!==void 0||e.fonts!==void 0,{message:"colorSeeds, surfaceMode, or fonts is required"}),ay=Ae.object({ok:Ae.literal(!0),design_plan_version:Ae.number().int().positive(),snapshot_id:T,site_design_context:Ae.lazy(()=>Ei).optional(),changed_files:Ae.array(Ae.string().min(1)).optional()});var da=t.object({heading:t.string().min(1).max(160).optional(),body:t.string().min(1).max(160).optional(),paletteIntent:t.string().min(1).max(400).optional(),surfaceMode:t.enum(["light","dark"]).optional(),radius:t.enum(["none","sm","md","lg","xl"]).optional(),density:t.enum(["compact","comfortable","airy","editorial"]).optional(),motionPreset:t.enum(["subtle","moderate","expressive"]).optional(),colorSeeds:t.object({primary:t.string().min(1).max(40),accent:t.string().min(1).max(40),foreground:t.string().min(1).max(40).optional(),neutral:t.string().min(1).max(40).optional(),supporting:t.array(t.string().min(1).max(40)).max(4).optional()}).optional(),imagePalette:t.object({background:t.string().min(1).max(40).optional(),foreground:t.string().min(1).max(40).optional(),card:t.string().min(1).max(40).optional(),muted:t.string().min(1).max(40).optional(),border:t.string().min(1).max(40).optional()}).optional(),themeId:t.string().min(1).max(60).optional(),themeDescription:t.string().min(1).max(400).optional(),aestheticNote:t.string().min(1).max(300).optional()}),la=t.enum(["material","reference","brief","industry"]),oy=t.object({market:t.object({value:t.string().min(1).max(200),source:la}),customer:t.object({value:t.string().min(1).max(200),source:la}),purpose:t.object({options:t.array(t.string().min(1).max(60)).min(2).max(4),selected:t.string().min(1).max(60),source:la})}),ry=t.enum(["text-options","motion-slider","positioning"]),ua=t.enum(["none","subtle","moderate","expressive"]),cy=t.enum(["compact","comfortable","airy","editorial"]),my=ua,Om=t.object({skill_name:t.string().min(1),rationale:t.string().min(4).max(200),confidence:t.enum(["high","medium","low"]).optional(),displayName:t.object({zh:t.string().min(1),en:t.string().min(1)}).partial().optional()}),ly=t.object({value:t.string(),label:t.string(),desc:t.string().optional(),impact:t.string().optional(),isRecommended:t.boolean().optional(),preselect:t.boolean().optional(),visualHints:da.optional(),conversionHints:St.optional()}),py=t.object({id:t.string(),type:ry,question:t.string(),tag:t.string(),aiThinking:t.string(),options:t.array(ly),source:t.enum(["ai-detected","always-ask"]),sourceDetail:t.string(),positioning:oy.optional()}),ga=t.object({questions:t.array(py).min(1).max(6)}),bD=t.object({tenant_id:t.string().min(1),site_id:R,brief_id:At,brief:t.string().min(20).max(1e3),site_default_locale:_e.optional(),owner_locale:_e.optional(),input_context:t.object({facts:t.array(kn).max(120),conflicts:t.array(Pn).max(20),reference:An.optional(),sources:t.array(t.object({type:Di,title:t.string().max(120).optional(),status:ji})).max(16).optional()}).optional()}),Nm=t.enum(["model_schema_invalid","provider_rate_limited","provider_unavailable","aborted","unknown"]),yD=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:H,at:t.string().min(1)}),t.object({type:t.literal("skill.selecting"),category:t.literal("page-generation"),available:t.array(t.object({id:t.string().min(1),name:t.string().min(1)})).max(20),at:t.string().min(1)}),t.object({type:t.literal("skill.selected"),category:t.literal("page-generation"),selected:t.object({id:t.string().min(1),name:t.string().min(1),reason:t.string().min(1).max(200)}),at:t.string().min(1)}),t.object({type:t.literal("clarify.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("clarify.archetype_proposals"),proposals:t.array(Om).min(1).max(5),at:t.string().min(1)}),t.object({type:t.literal("clarify.finished"),questions_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),error_category:Nm.optional(),retryable:t.boolean().optional(),attempts:t.number().int().positive().optional(),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),at:t.string().min(1)})]),xD="SITE_PLANNING_INPUT_FROZEN",ED="SITE_PLANNING_LOCKED",ID="SITE_STRUCTURE_CONFIRMATION_REQUIRED",RD="SITE_STRUCTURE_CONFIRMATION_STALE",TD=t.object({tenant_id:t.string().min(1),owner_user_id:wi,name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),kD=t.object({name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),AD=t.object({name:t.string().min(1).max(120)}),PD=t.object({name:t.string().min(1).max(120),default_locale:_e.optional()}),wD=t.object({body:t.string().min(20).max(1e3)}),vD=t.object({body:t.string().min(20).max(1e3)}),_a=t.string().url().refine(e=>{try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}},{message:"URL must use http or https protocol"}),CD=t.object({tenant_id:t.string().min(1),site_id:R.optional(),site_url:_a,site_name:t.string().trim().min(1).max(255).optional()}),DD=M(go),jD=M(_o),OD=M(ho),ND=M(vo),LD=M(Co),MD=M(Do),UD=M(Oo),qD=M(No),FD=M(Lo),GD=M(t.object({site_id:R,site_url:_a})),_t=t.object({id:R,tenant_id:t.string().min(1),owner_user_id:wi.nullable(),name:t.string().min(1),slug:t.string().min(1),status:ls,deployment_status:ps,archived_at:t.string().min(1).nullable(),current_sitemap_id:Ce.nullable(),confirmed_sitemap_id:Ce.nullable().optional(),confirmed_sitemap_version:t.number().int().positive().nullable().optional(),structure_confirmed_at:t.string().min(1).nullable().optional(),migration_content_requested:t.boolean().optional(),current_snapshot_id:T.nullable(),published_deployment_id:Ye.nullable().optional(),deployed_url:t.string().url().nullable(),default_locale:_e,owner_locale:_e.optional(),cms_site_id:$a.nullable().optional(),cms_site_url:_a.nullable().optional(),parent_site_id:R.nullable().optional(),mount_path:t.string().min(1).nullable().optional(),schema_version:t.literal(1),created_at:t.string().min(1),updated_at:t.string().min(1)}),ha=t.object({id:At,tenant_id:t.string().min(1),site_id:R,body:t.string().min(1),source:t.enum(["user","import","system"]),created_at:t.string().min(1),updated_at:t.string().min(1)}),zD=t.object({site:_t,brief:ha,next_step:t.literal("clarify")}),KD=t.object({site:_t,brief:ha}),BD=t.object({brief:ha}),dy=t.enum(["queued","running","succeeded","failed","cancelled"]),Lm=t.enum(["clarify","sitemap","workspace"]),Mm=t.enum(["clarify","sitemap","initial_generation","iteration","landing_page"]),Um=t.enum(["clarify","sitemap","workspace","summarize"]),$e=t.object({id:H,tenant_id:t.string().min(1),site_id:R,agent_type:Lm,run_kind:Mm,status:dy,model_route:Um,started_at:t.string().min(1).nullable(),finished_at:t.string().min(1).nullable(),error_code:t.string().min(1).nullable(),created_at:t.string().min(1),thread_id:Ge.nullable().optional()}),uy=t.enum(["workspace","landing_page","external"]),gy=t.enum(["user","background"]),qm=t.enum(["active","archived"]),ki=t.object({id:Ge,tenant_id:t.string().min(1),site_id:R,kind:uy,origin:gy,subject_key:t.string().min(1).max(200),title:t.string().min(1).max(200),status:qm,external_thread_id:t.string().min(1).max(200).nullable(),last_run_id:H.nullable(),last_activity_at:t.string().min(1),created_at:t.string().min(1),updated_at:t.string().min(1)}),WD=t.object({agent_run:$e,thread:ki.nullable()}),VD=t.object({run_id:H.optional(),site_id:R,agent_type:Lm,run_kind:Mm.optional(),model_route:Um,input:t.record(t.string(),t.unknown()).optional()}).superRefine((e,n)=>{In(e.input)&&n.addIssue({code:"custom",path:["input"],message:"Agent run input must not contain secrets"})}),HD=t.object({agent_run:$e,next_step:t.literal("stream_events")}),Fm=t.enum(["draft","candidate","deleting","current","failed"]),st=t.object({id:T,tenant_id:t.string().min(1),site_id:R,version:t.number().int().positive(),manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:t.string().min(1),template_version:qe.nullable().optional(),reason:t.enum(["initial_generation","workspace_edit","pre_deploy","manual_save","rollback","template_upgrade","subsite_clone"]),status:Fm,created_at:t.string().min(1)}),$D=t.object({snapshot_id:T,creation_key:t.string().min(1),manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:t.string().min(1),template_version:qe.optional(),reason:st.shape.reason,status:t.enum(["draft","candidate","current","failed"]).default("candidate"),source_run_id:H.optional()}),YD=t.object({site:_t,snapshot:st,next_step:t.literal("workspace")}),XD=t.object({expected_manifest_hash:st.shape.manifest_hash,manifest_hash:st.shape.manifest_hash,object_key:st.shape.object_key}).strict(),QD=t.union([t.object({base_snapshot_id:T.nullable(),source_run_id:H.optional()}).strict(),t.object({skip_base_check:t.literal(!0)}).strict()]),_y=t.object({site:_t,snapshot:st,next_step:t.literal("workspace")}),ZD=t.object({snapshot:st}),JD=t.object({status:t.literal("deleting"),snapshot_id:T,object_key:t.string().min(1)}),ej=t.object({status:t.literal("deleted"),snapshot_id:T}),Ai=t.object({id:wa,tenant_id:t.string().min(1),site_id:R,snapshot_id:T,version:t.number().int().positive(),accepted_commit:t.string().min(1),source_run_id:H.nullable(),created_at:t.string().min(1)}),hy=Ai.extend({reason:st.shape.reason,status:Fm}),tj=t.object({accepted_commit:t.string().min(1),source_run_id:H.optional()}),nj=t.object({site_version:Ai,next_step:t.literal("workspace")}),ij=t.object({owner_id:t.string().min(1)}).strict(),sj=t.discriminatedUnion("acquired",[t.object({acquired:t.literal(!0)}).strict(),t.object({acquired:t.literal(!1)}).strict()]),aj=t.object({owner_id:t.string().min(1)}).strict(),oj=t.object({released:t.literal(!0)}).strict(),rj="TEMPLATE_UPGRADE_LOCK_LOST",cj=t.object({base_snapshot_id:T,accepted_commit:Ai.shape.accepted_commit,owner_id:t.string().min(1)}).strict(),mj=_y.strict(),lj=t.object({site_versions:t.array(hy)}),pj=t.object({site:_t,snapshot:st,site_version:Ai,next_step:t.literal("workspace")}),dj=t.object({snapshot_id:T,force_rehydrate:t.boolean().optional()}),Sy=t.discriminatedUnion("status",[t.object({status:t.literal("ready"),snapshot_id:T,preview_url:t.string().min(1),launch_id:t.string().min(1).optional()}),t.object({status:t.literal("failed"),code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})]),uj=t.object({tenant_id:t.string().min(1),site_id:R,snapshot_id:T}).strict(),gj=Sy,Sa=t.enum(wt),Gm=t.enum(["quality_check","publish"]),ut=t.object({id:Ye,tenant_id:t.string().min(1),site_id:R,snapshot_id:T,type:Gm.default("publish"),version:t.number().int().positive(),status:Sa,provider:t.enum(["cloudflare"]),url:t.string().url().nullable(),error_code:t.string().min(1).nullable(),provider_deployment_id:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),_j=t.object({tenant_id:t.string().min(1),site_id:R,expected_snapshot_id:T}).strict(),hj=t.object({deployment:ut}),Sj=t.object({tenant_id:t.string().min(1),site_id:R,deployment_id:Ye}).strict(),fj=t.object({deployment:ut}),bj=t.object({}).strict(),yj=t.object({snapshot_id:T.optional()}).strict(),fy=t.object({deployment:ut}),xj=M(fy),Ej=t.object({deployment:ut.nullable()}),Ij=t.object({deployment:ut}),vm=t.object({id:Ye,type:Gm.default("publish"),status:Sa,url:t.string().url().nullable(),error_code:t.string().min(1).nullable(),provider_deployment_id:t.string().min(1).nullable()}),by=t.object({current:vm.nullable(),latest_released:vm.nullable()}),Rj=M(by),yy=t.enum(["deployment.snapshot","deployment.status.changed","deployment.finished","deployment.failed","deployment.realtime.recovered","server.error"]),Ft=t.object({id:t.string().min(1),tenant_id:t.string().min(1),site_id:R,deployment_id:Ye,seq:t.number().int().positive(),sent_at:t.string().min(1)}),Ii=t.object({deployment:ut,steps:Er.default([])}),Tj=t.discriminatedUnion("type",[Ft.extend({type:t.literal("deployment.snapshot"),payload:Ii}),Ft.extend({type:t.literal("deployment.status.changed"),payload:Ii}),Ft.extend({type:t.literal("deployment.finished"),payload:Ii}),Ft.extend({type:t.literal("deployment.failed"),payload:Ii}),Ft.extend({type:t.literal("deployment.realtime.recovered"),payload:t.object({action:t.literal("refresh")})}),Ft.extend({type:t.literal("server.error"),payload:t.object({code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})})]),kj=t.object({tenant_id:t.string().min(1),site_id:R,deployment_id:Ye,status:Sa,updated_at:t.string().min(1)}),xy="vcp:deployments",Aj={path:"/v1/sites/:site_id/deployments/:deployment_id/socket",redis_channel:xy,outbound_message_schema:"DeploymentWsServerMessageSchema",message_types:[...yy.options]},Ey=t.object({error:t.object({code:t.string().min(1),message:t.string().min(1),details:t.unknown().optional(),request_id:t.string().min(1).optional(),retryable:t.boolean().default(!1)})}),Pj=t.object({error:Ey.shape.error.extend({code:t.literal("AGENT_RUN_IN_FLIGHT"),details:t.object({code:t.literal("AGENT_RUN_IN_FLIGHT"),message:t.string().min(1),agent_run:$e})})}),wj=t.object({colors:t.record(t.string(),t.string()).default({}),typography:t.record(t.string(),t.string()).default({}),spacing:t.record(t.string(),t.string()).default({}),motion:t.record(t.string(),t.string()).default({})}),Iy=t.object({theme_id:t.string().min(1),paletteIntent:t.string().min(1),tone:t.string().min(1),mediaMood:t.string().min(1),motionLevel:ua.optional(),userVisualHints:da.optional()}),Ry=t.object({question:t.string().min(1),answer:t.string().min(1)}),vj=t.object({query:t.string().min(1),keywords:t.array(t.string()).default([]),orientation:t.enum(["landscape","portrait","square"]).optional(),role:t.enum(["hero","section","card","gallery","testimonial","decorative"]),altHint:t.string().min(1)}),Cj=t.object({id:t.string().min(1),role:t.enum(["site_background","nav_background","footer_background"]),query:t.string().min(1),keywords:t.array(t.string()).default([]),treatment:t.enum(["cover","fixed-cover","subtle-texture"]),altHint:t.string().optional()}),Ty=t.object({provider:t.enum(["unsplash","pexels"]),providerLabel:t.enum(["Unsplash","Pexels"]),providerHref:t.string().url(),photoHref:t.string().url().optional(),photographerName:t.string().optional(),photographerHref:t.string().url().optional(),requiresAttribution:t.boolean()}),Dj=t.object({src:t.string().min(1),alt:t.string().min(1),width:t.number().int().positive().optional(),height:t.number().int().positive().optional(),provider:t.enum(["unsplash","pexels","placeholder"]).optional(),providerId:t.string().optional(),photoUrl:t.string().url().optional(),photographer:t.string().optional(),photographerUrl:t.string().url().optional(),credit:t.string().optional(),dominantColor:t.string().optional(),attribution:Ty.optional()}),ky=t.enum(["system_recommended","user_picked","user_picked_extended","deterministic_fallback"]),Gt=t.object({id:t.string().min(1),name:t.string().min(1),category:t.literal("page-generation"),version:t.string().min(1).optional(),reason:t.string().min(1).max(200),source:ky.default("system_recommended")}),Q=t.string().min(1).max(2e3),Cm=t.string().min(1).max(120),Ei=t.object({visualDirection:Q,brandFeeling:Q,paletteIntent:Q,typographyIntent:Q,density:cy,motionLevel:my,motionPreset:t.enum(["subtle","moderate","expressive"]).optional(),mediaStrategy:Q,compositionRules:t.array(Q).max(20),avoidPatterns:t.array(Q).max(20),fonts:t.object({heading:t.string().min(1),body:t.string().min(1)}).optional(),colorSeeds:t.object({primary:t.string().min(1).max(40),accent:t.string().min(1).max(40),foreground:t.string().min(1).max(40).optional(),neutral:t.string().min(1).max(40).optional(),supporting:t.array(t.string().min(1).max(40)).max(4).optional()}).optional(),surfaceMode:t.enum(["light","dark"]).optional(),radius:t.enum(["none","sm","md","lg","xl"]).optional(),imagePalette:t.object({background:t.string().min(1).max(40).optional(),foreground:t.string().min(1).max(40).optional(),card:t.string().min(1).max(40).optional(),muted:t.string().min(1).max(40).optional(),border:t.string().min(1).max(40).optional()}).optional()}),fa=160,zm=t.object({routeGoal:Q,narrativeArc:Q,firstViewportIntent:Q,visualContinuity:Q,sectionRhythm:Q,avoidPatterns:t.array(Q).max(20),displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(fa).optional(),metaTitle:t.string().min(1).max(120).optional(),metaDescription:t.string().min(1).max(320).optional(),primaryKeyword:t.string().min(1).max(160).optional(),longTailKeywords:t.array(t.string().min(1).max(160)).max(3).optional()}),Km=t.enum(["model_call","validation","repair","preview","worker_group"]),gt=t.enum(["generating","generating_design_plan","checking_quality","updating_design_memory"]),Bm=t.object({sectionRole:Q,contentIntent:Q,layoutIntent:Q,visualIntent:Q,mediaIntent:Q,motionIntent:Q,copyTone:Q,displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(fa).optional(),ctaIntent:Q.optional(),continuityWithPrevious:Q.optional(),avoidRepeating:t.array(Q).max(20).optional(),industryRecipeRefs:t.array(Cm).max(12).optional(),templateRecipeRefs:t.array(Cm).max(12).optional()}),Wm=t.object({siteName:t.string().min(1).max(120),tagline:t.string().min(1).max(200).optional(),primaryCta:t.object({label:t.string().min(1).max(60),target:t.string().min(1).max(200)}).optional(),trustSignals:t.array(t.string().min(1).max(60)).max(6).optional(),industry:t.string().min(1).max(40).optional()}),Ay=t.enum(["solid","floating"]),Py=t.enum(["background","card","primary","frosted"]),wy=t.enum(["sticky","hide-on-scroll","static"]),vy=t.enum(["bar","island"]),Cy=t.object({variant:Ay,surface:Py.optional(),behavior:wy.optional(),shape:vy.optional()}),Dy=t.object({form:Q,layoutIntent:Q,scrollBehavior:Q,shell:Cy.optional(),avoidPatterns:t.array(Q).max(10).optional()}),jy=t.enum(["background","card","primary","inverse"]),Oy=t.object({surface:jy}),Ny=t.object({form:Q,composition:Q,shell:Oy.optional(),avoidPatterns:t.array(Q).max(10).optional()}),Ly=t.object({pattern:Q,intent:Q}),Vm=t.object({header:Dy,footer:Ny,mobileNav:Ly}),Hm=t.object({schemaVersion:t.literal(1).default(1),siteDesignContext:Ei,routeCards:t.record(t.string().min(1),zm),blockContexts:t.record(t.string().min(1),Bm),selectedSkillPacks:t.array(Gt).max(3).optional(),branding:Wm.optional(),chromeDesign:Vm.optional()}),jj=t.object({siteDesignContext:Ei.omit({imagePalette:!0}).optional(),routeCards:t.record(t.string().min(1),zm).optional(),blockContexts:t.record(t.string().min(1),Bm).optional(),branding:Wm.optional(),chromeDesign:Vm.optional()}),Re=t.string().trim().min(1),ba=t.object({id:Re,label:t.string().trim().min(1),type:t.string(),variant:t.string().optional(),order:t.number(),props:t.record(t.string(),t.unknown()),meta:t.object({aiGenerated:t.boolean(),userEdited:t.boolean(),lastEditedAt:t.string(),lastEditedBy:t.enum(["ai","user"]),userInstruction:t.string().optional()}).optional()}).strict(),$m=t.string().regex(Zt,"Page slug must be '/' or a lowercase ASCII kebab-case absolute path."),My=new RegExp(`^/(?:${Ct}(?:/${Ct})*)?(?:\\?[^#\\s]*)?(?:#[^\\s]*)?$`),Uy=/^(?:#[^\s]*|[a-z][a-z0-9+.-]*:[^\s]+|\/\/[^\s]+)$/i,qy=t.union([t.string().regex(My),t.string().regex(Uy)]),Dm=t.object({label:t.string(),href:qy}).passthrough(),Fy=t.object({primaryLinks:t.array(Dm),footerLinks:t.array(Dm)}),Ym=t.object({showInHeader:t.boolean(),showInFooter:t.boolean(),order:t.number()}).strict(),ya=t.object({id:Re,slug:$m,title:t.string().trim().min(1),blocks:t.array(ba).min(1),navigation:Ym}).strict(),Gy=ba.extend({type:t.string().nullable()}).strict(),zy=ya.extend({slug:$m.nullable(),navigation:Ym.extend({showInHeader:t.boolean().nullable(),showInFooter:t.boolean().nullable()}).strict(),blocks:t.array(Gy).min(1)}).strict(),Ky=ba.extend({id:t.string()}),By=ya.extend({id:t.string(),slug:t.string().min(1),blocks:t.array(Ky).min(1)}),jm=t.object({label:t.string(),href:t.string().min(1)}),Wy=t.object({primaryLinks:t.array(jm),footerLinks:t.array(jm)}),Vy=t.discriminatedUnion("kind",[t.object({kind:t.literal("brief_clarify"),brief_id:At,answer_ids:t.array(t.string().min(1)).max(10)}).strict(),t.object({kind:t.literal("step5_strategy"),strategy_version_id:t.string().uuid(),strategy_version:t.number().int().positive(),strategy_checksum:t.string().regex(/^[a-f0-9]{64}$/)}).strict()]),Ri=t.object({site_name:t.string().min(1).max(80).optional(),version:t.number().int().positive(),pages:t.array(ya).min(1),navigation:Fy,integrations:t.object({cms:t.unknown().optional(),analytics:t.unknown().optional()}).optional(),meta:t.object({generatedAt:t.string(),generatedBy:t.literal("sitemap-agent"),source_brief_id:t.string().optional(),source_answer_ids:t.array(t.string()).optional(),source:Vy.optional()}),skillSelection:Gt,visualTheme:Iy.optional(),userChoices:t.array(Ry).optional(),confirmedChoices:t.object({conversion:St.optional()}).optional(),seoKeywords:t.array(qn).min(1).max(50).optional()}).strict(),zt=Ri.superRefine((e,n)=>{Zm(e.pages,n)}),xn=Ri.extend({pages:t.array(zy).min(1)}).strict().superRefine((e,n)=>{Zm(e.pages,n)}),Hy=t.enum(["slug","showInHeader","showInFooter"]),$y=t.object({page_id:Re,fields:t.array(Hy).min(1).max(3)}).strict(),Yy=t.object({page_id:Re,block_id:Re,fields:t.tuple([t.literal("type")])}).strict(),Xm=100,Qm=500,Xy=t.object({pages:t.array($y).max(Xm),blocks:t.array(Yy).max(Qm)}).strict().superRefine((e,n)=>{let i=new Set;e.pages.forEach((s,r)=>{i.has(s.page_id)&&n.addIssue({code:"custom",path:["pages",r,"page_id"],message:`Duplicate page target '${s.page_id}'.`}),i.add(s.page_id),new Set(s.fields).size!==s.fields.length&&n.addIssue({code:"custom",path:["pages",r,"fields"],message:"Page target fields must be unique."})});let a=new Set;e.blocks.forEach((s,r)=>{let d=`${s.page_id}\0${s.block_id}`;a.has(d)&&n.addIssue({code:"custom",path:["blocks",r],message:`Duplicate block target '${s.page_id}/${s.block_id}'.`}),a.add(d)})}),Oj=t.object({sitemap:xn,targets:Xy}).strict(),Nj=t.object({pages:t.array(t.object({page_id:Re,slug:t.string().min(1).optional(),show_in_header:t.boolean().optional(),show_in_footer:t.boolean().optional()}).strict()).max(Xm),blocks:t.array(t.object({page_id:Re,block_id:Re,type:t.string().trim().min(1)}).strict()).max(Qm)}).strict().superRefine((e,n)=>{let i=new Set;e.pages.forEach((s,r)=>{i.has(s.page_id)&&n.addIssue({code:"custom",path:["pages",r,"page_id"],message:`Duplicate page output '${s.page_id}'.`}),i.add(s.page_id)});let a=new Set;e.blocks.forEach((s,r)=>{let d=`${s.page_id}\0${s.block_id}`;a.has(d)&&n.addIssue({code:"custom",path:["blocks",r],message:`Duplicate block output '${s.page_id}/${s.block_id}'.`}),a.add(d)})}),Lj=t.object({sitemap:zt}).strict();function Zm(e,n){let i=new Map,a=new Map,s=new Map,r=0;e.forEach((d,c)=>{let g=i.get(d.id);if(g!==void 0?n.addIssue({code:"custom",path:["pages",c,"id"],message:`Duplicate page id '${d.id}' (first used at pages.${g}.id).`}):i.set(d.id,c),d.blocks.forEach((I,C)=>{let F=a.get(I.id);F!==void 0?n.addIssue({code:"custom",path:["pages",c,"blocks",C,"id"],message:`Duplicate block id '${I.id}' (first used at pages.${F.pageIndex}.blocks.${F.blockIndex}.id).`}):a.set(I.id,{pageIndex:c,blockIndex:C})}),d.slug===null)return;d.slug==="/"&&(r+=1);let k=s.get(d.slug);k!==void 0?n.addIssue({code:"custom",path:["pages",c,"slug"],message:`Duplicate page slug '${d.slug}' (first used at pages.${k}.slug).`}):s.set(d.slug,c)}),(r!==1||e[0]?.slug!=="/")&&n.addIssue({code:"custom",path:["pages"],message:"Sitemap must contain exactly one home page at pages[0] with slug '/'."})}var Mj=Ri.omit({skillSelection:!0,visualTheme:!0,userChoices:!0,confirmedChoices:!0,seoKeywords:!0}).extend({meta:Ri.shape.meta.omit({source:!0}),site_name:t.string().min(1).max(80),pages:t.array(By).min(1),navigation:Wy}),Qy=t.enum(["ai","user"]),Kt=t.object({site_id:R,page_id:Re,edited_by:Qy.default("ai"),source_agent_run_id:H.optional()}),Uj=Kt.extend({block_id:Re,target_index:t.number().int().min(0)}),Zy=Kt.extend({block_id:Re}),Jy=Kt.extend({block_id:Re,instruction:t.string()}),qj=Kt.extend({block_id:Re,variant:t.string().min(1).nullable()}),Fj=Kt.extend({block_id:Re,props:t.record(t.string(),t.unknown()),mode:t.enum(["replace","merge"]).default("replace")}),Gj=Kt.extend({block:t.object({id:Re,label:t.string().trim().min(1),type:t.string().min(1),variant:t.string().min(1).optional(),props:t.record(t.string(),t.unknown()).default({}),insert_index:t.number().int().min(0).optional()})}),ex=t.enum(["move_block","delete_block","update_block_instruction","change_block_variant","update_block_props","add_block"]),zj=t.discriminatedUnion("operation",[t.object({operation:t.literal("delete_block"),input:Zy}).strict(),t.object({operation:t.literal("update_block_instruction"),input:Jy}).strict()]),tx=t.enum(["SITEMAP_EDIT_INVALID","SITEMAP_API_NOT_CONFIGURED","SITEMAP_NOT_FOUND","SITEMAP_PAGE_NOT_FOUND","SITEMAP_BLOCK_NOT_FOUND","SITEMAP_BLOCK_ALREADY_EXISTS","SITEMAP_LAST_BLOCK_DELETE_FORBIDDEN","SITEMAP_EDIT_FAILED"]),nx=t.object({status:t.literal("updated"),operation:ex,site_id:R,sitemap_id:Ce,version:t.number().int().positive(),changed_pages:t.array(Re).min(1),requires_code_patch:t.literal(!0)}),ix=t.object({status:t.literal("failed"),code:tx,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),Kj=t.discriminatedUnion("status",[nx,ix]),xa=t.object({question_id:t.string().min(1),value:t.string().min(1),label:t.string().min(1).optional(),question:t.string().min(1).optional(),option_label:t.string().min(1).optional(),motion_level:ua.optional(),visual_tonality:da.optional(),conversion:St.optional(),positioning:t.object({market:t.string().min(1).max(200),customer:t.string().min(1).max(200),purpose:t.string().min(1).max(60)}).optional()}),sx=t.object({id:t.string().trim().min(1).max(128),type:t.literal(1),search_intent:t.string().trim().min(1).max(255),path:t.string().trim().regex(/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*)?$/),channel:t.string().trim().min(1).max(80),content_format:t.string().trim().min(1).max(80),priority:t.enum(["P0","P1","P2","P3"])}).strict(),Bj=t.object({source:t.object({kind:t.literal("step5_strategy")}).strict()}).strict(),ax=t.object({item_key:Ln,title:t.string().trim().min(1).max(200),selected_option_id:vt,selected_label:t.string().trim().min(1).max(200),selected_value:t.string().trim().min(1).max(500),selected_description:t.string().trim().min(1).max(2e3),impact:t.string().trim().min(1).max(500).optional(),customer_note:t.string().trim().min(1).max(200).optional(),market_type:Mn.optional(),markets:t.array(Un).max(32).optional()}).strict(),ox=t.object({kind:t.literal("step5_strategy"),site_name:t.string().trim().min(1).max(80).optional(),strategy_version_id:t.string().uuid(),strategy_version:t.number().int().positive(),strategy_checksum:t.string().regex(/^[a-f0-9]{64}$/),decisions:t.array(ax).length(xe),seo_keywords:t.array(qn).min(1).max(50).optional()}).strict().superRefine((e,n)=>{e.decisions.forEach((i,a)=>{i.item_key!==ft[a]&&n.addIssue({code:"custom",path:["decisions",a,"item_key"],message:"Step5 sitemap decisions must use the canonical order."})})}),Jm=t.object({tenant_id:t.string().min(1),site_id:R,brief_id:At,brief:t.string().min(20).max(1e3),answers:t.array(xa).min(1).max(10),skillSelection:Gt,site_default_locale:_e.optional(),owner_locale:_e.optional(),cms_site_id:t.string().min(1).nullish(),intent_pages:t.array(sx).max(On).optional(),reference:An.optional(),input_context:t.object({facts:t.array(kn).max(120),conflicts:t.array(Pn).max(20)}).optional(),business_facts:ja.optional(),extra_requirement:t.string().trim().min(1).max(Pt).optional(),migration_products_enabled:t.boolean().optional()}),rx=Jm.pick({tenant_id:!0,site_id:!0,skillSelection:!0,site_default_locale:!0,owner_locale:!0,cms_site_id:!0,reference:!0,input_context:!0,business_facts:!0,extra_requirement:!0,migration_products_enabled:!0}).partial({skillSelection:!0}).extend({source:ox}).strict(),Wj=t.union([Jm,rx]),el=t.enum(["planning","generating","validating","ready"]),cx=t.enum(["salvaged","deterministic_fallback"]),mx=t.enum(["model_exception_settled_prefix","model_exception_safe_root"]),tl={outcome:cx.optional(),reason:mx.optional(),attempts:t.number().int().positive().optional()};function nl(e,n){if(e.type!=="sitemap.generated")return;let i=e.outcome!==void 0,a=e.reason!==void 0;i!==a&&n.addIssue({code:"custom",path:[i?"reason":"outcome"],message:"sitemap.generated outcome and reason must be provided together"})}var lx=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:H,at:t.string().min(1)}),t.object({type:t.literal("sitemap.generating"),stage:el,message:t.string().min(1).optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generated"),sitemap_id:Ce,sitemap:zt,...tl,at:t.string().min(1)}),t.object({type:t.literal("sitemap.clamped"),reason:t.enum(["page_early_stop","finalize_best_effort"]),original_page_count:t.number().int().nonnegative().optional(),final_page_count:t.number().int().nonnegative().optional(),original_block_count:t.number().int().nonnegative().optional(),final_block_count:t.number().int().nonnegative().optional(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.started"),slot_count:t.number().int().nonnegative(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.finished"),slot_count:t.number().int().nonnegative(),provider_counts:t.object({unsplash:t.number().int().nonnegative(),pexels:t.number().int().nonnegative(),placeholder:t.number().int().nonnegative()}),fallback_count:t.number().int().nonnegative(),error_codes:t.array(t.string()),at:t.string().min(1)}),t.object({type:t.literal("snapshot.created"),snapshot_id:T,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),snapshot_id:T.optional(),at:t.string().min(1)})]),Vj=lx.superRefine(nl),il=t.object({id:Ce,tenant_id:t.string().min(1),site_id:R,version:t.number().int().positive(),source_agent_run_id:H.nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}).strict();function sl(e,n){e.version!==e.sitemap.version&&n.addIssue({code:"custom",path:["sitemap","version"],message:`Sitemap JSON version ${e.sitemap.version} must equal record version ${e.version}.`})}var al=il.extend({sitemap:zt}).superRefine(sl),px=il.extend({sitemap:xn}).superRefine(sl),Hj=t.object({sitemap_id:Ce,creation_key:t.string().min(1),sitemap:zt,source_agent_run_id:H.optional()}),$j=t.object({sitemap_id:Ce,creation_key:t.string().min(1),sitemap:xn,expected_current_sitemap_id:Ce,expected_current_sitemap_version:t.number().int().positive(),migration_content_requested:t.boolean().optional()}),Yj=t.object({sitemap_id:Ce,creation_key:t.string().min(1),sitemap:zt,source_agent_run_id:H}),Xj=t.object({site:_t,sitemap:al,next_step:t.literal("workspace")}).strict(),Qj=t.object({site:_t,sitemap:px,next_step:t.literal("workspace")}).strict(),Zj=t.object({site:_t,sitemap:al,next_step:t.literal("sitemap_review")}).strict(),dx=t.object({id:Pa,tenant_id:t.string().min(1),site_id:R,brief_id:At,questions:ga,answers:t.array(xa),selected_archetype:Gt.optional(),completed_at:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),Jj=t.object({answers:t.array(xa).min(1),questions:ga,selected_archetype:Gt.optional()}),eO=t.object({clarify_session:dx}),tO=t.object({questions:ga,selected_archetype:Gt}),ux=t.object({id:vi,tenant_id:t.string().min(1),site_id:R,version:t.number().int().positive(),design_plan:Hm,source_agent_run_id:H.nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),nO=t.object({design_plan_id:vi.optional(),design_plan:Hm,source_agent_run_id:H.optional()}),iO=t.object({design_plan:ux}),Pi=t.enum(["initial_generation","iteration","landing_page"]),gx=t.object({label:t.string().min(1).max(48),prompt:t.string().min(1).max(160)}).strict(),_x=t.enum(["model","derived","mixed","advisor"]),ol=t.object({suggestions:t.array(gx).min(1).max(4),source:_x}).strict(),hx=t.enum(["clean","salvaged","deterministic_fallback","baseline_retained"]),Sx=t.enum(["generation_succeeded","entry_slots_omitted","quality_gate_exhausted","schema_gate_exhausted","generation_timeout","stream_schema_mismatch","stream_generation_error","generation_error","fallback_compiler_error","legacy_result_missing_metadata"]),fx=t.enum(["progress","assistant_final"]),rl=t.enum(["run.started","message.delta","user.message","plan.updated","clarify.partial","clarify.archetype_proposals","clarify.finished","sitemap.generating","sitemap.partial","sitemap.generated","sitemap.clamped","sitemap.updated","sitemap.resync.failed","sitemap.resync.warning","block.changed","tool.started","tool.finished","workspace.plan.created","workspace.worker.updated","workspace.task.updated","workspace.degraded","workspace.design_plan.outcome","workspace.suggestions","file.changed","snapshot.created","snapshot.finalized","preview.preparing","preview.ready","preview.build.started","preview.build.succeeded","preview.build.failed","run.failed","run.finished","media_resolution.started","media_resolution.finished","skill.selecting","skill.selected","activity.started","activity.updated","activity.finished","activity.failed"]),bx=t.object({id:t.string().min(1),title:t.string().min(1),status:t.enum(["pending","running","completed","failed"])}),kt=t.enum(["pending","running","completed","completed_with_skips","failed","skipped"]),Ea=t.enum(["style_media","chrome","sections","layout","pages","detect_typecheck","repair","finalize","sitemap_resync","preview"]),Ia=t.object({code:t.string().min(1),message:t.string().min(1),path:t.string().min(1).optional(),task_id:t.string().min(1).optional(),details:t.record(t.string(),t.unknown()).optional()}),ye=t.string().min(1).refine(e=>bl(e),{message:"Snapshot file paths must be safe relative POSIX paths without traversal."}),Ra=t.object({deduped_paths:t.array(ye),skipped_tasks:t.array(t.string().min(1)),failed_tasks:t.array(t.string().min(1)),fallback_files:t.array(t.string().min(1)),applied_paths:t.array(ye)}),Ta=t.object({group_id:t.string().min(1),phase:Ea,title:t.string().min(1),status:kt,task_ids:t.array(t.string().min(1)),depends_on_groups:t.array(t.string().min(1)),target_paths:t.array(ye)}),yx=t.enum(["style","media","chrome","section","layout","page"]),ka=t.object({task_id:t.string().min(1),group_id:t.string().min(1),kind:yx,target_path:ye,block_id:t.string().min(1).optional(),block_type:t.string().min(1).optional(),block_variant:t.string().min(1).optional(),block_order:t.number().int().nonnegative().optional(),user_instruction:t.string().min(1).optional(),page_id:t.string().min(1).optional(),page_slug:t.string().min(1).optional(),page_title:t.string().min(1).optional(),title:t.string().min(1).max(60).optional(),description:t.string().min(1).max(fa).optional(),status:kt,required_reads:t.array(ye).optional(),search_params_sections:t.array(ye).optional(),standard_form_view:ye.optional()}),Aa=t.object({from_group_id:t.string().min(1),to_group_id:t.string().min(1),reason:t.enum(["style_media","chrome","sections","layout","page_composition","quality_gate"])}),sO=t.object({plan_id:t.string().min(1),run_kind:Pi,model_route:t.object({planner:t.literal("workspace_planner"),worker:t.literal("workspace")}),groups:t.array(Ta),tasks:t.array(ka),dependencies:t.array(Aa),expected_outputs:t.array(ye),diagnostics:Ra}),aO=t.object({task_id:t.string().min(1),patch:t.unknown().optional(),snapshot_id:T.optional(),read_files:t.array(ye),diagnostics:t.array(Ia),status:kt}),cl=t.object({worker_count:t.number().int().nonnegative(),task_count:t.number().int().nonnegative(),group_count:t.number().int().nonnegative()}),ml=t.object({pending:t.number().int().nonnegative(),running:t.number().int().nonnegative(),completed:t.number().int().nonnegative(),completed_with_skips:t.number().int().nonnegative(),failed:t.number().int().nonnegative(),skipped:t.number().int().nonnegative()}),xx=t.object({type:t.literal("text"),text:t.string(),state:t.enum(["streaming","done"]).optional()}),Ex=t.object({type:t.literal("reasoning"),text:t.string(),state:t.enum(["streaming","done"]).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),Ix=t.object({type:t.literal("file"),mediaType:t.string().min(1),filename:t.string().min(1).optional(),url:t.string().min(1)}),Rx=t.object({type:t.literal("source-url"),sourceId:t.string().min(1),url:t.string().min(1),title:t.string().min(1).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),Tx=t.object({type:t.literal("source-document"),sourceId:t.string().min(1),mediaType:t.string().min(1),title:t.string().min(1),filename:t.string().min(1).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),kx=t.object({type:t.string().regex(/^data-[a-zA-Z0-9_-]+$/),id:t.string().min(1).optional(),data:t.unknown()}),Ax=t.object({type:t.string().regex(/^tool-[a-zA-Z0-9_-]+$/),toolCallId:t.string().min(1),state:t.enum(["input-streaming","input-available","output-available","output-error"]),input:t.unknown().optional(),output:t.unknown().optional(),errorText:t.string().min(1).optional()}),Px=t.object({type:t.literal("error"),errorText:t.string().min(1)}),wx=t.object({type:t.literal("step-start")}),Ti=t.union([xx,Ex,Ix,Rx,Tx,kx,Ax,Px,wx]),vx=t.string().min(1).max(512).refine(e=>bl(e)&&!/^[A-Za-z]:\//.test(e),{message:"Generated-code rescue paths must be safe relative POSIX paths without traversal."}),Cx=t.array(vx).min(1).max(64),Dx=t.array(t.string().min(1).max(120)).min(1).max(64),jx=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:H,at:t.string().min(1)}),t.object({type:t.literal("message.delta"),text:t.string().min(1),history_purpose:fx.optional(),at:t.string().min(1)}),t.object({type:t.literal("user.message"),client_message_id:t.string().min(1),message_id:t.string().min(1),parts:t.array(Ti).min(1),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:Vn.optional(),at:t.string().min(1)}),t.object({type:t.literal("plan.updated"),steps:t.array(bx),at:t.string().min(1)}),t.object({type:t.literal("clarify.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("clarify.archetype_proposals"),proposals:t.array(Om).min(1).max(5),at:t.string().min(1)}),t.object({type:t.literal("clarify.finished"),questions_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generating"),stage:el,message:t.string().min(1).optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generated"),sitemap_id:Ce,sitemap:zt,...tl,at:t.string().min(1)}),t.object({type:t.literal("sitemap.clamped"),reason:t.enum(["page_early_stop","finalize_best_effort"]),original_page_count:t.number().int().nonnegative().optional(),final_page_count:t.number().int().nonnegative().optional(),original_block_count:t.number().int().nonnegative().optional(),final_block_count:t.number().int().nonnegative().optional(),at:t.string().min(1)}).strict(),t.object({type:t.literal("sitemap.updated"),sitemap_id:Ce,version:t.number().int().positive(),reason:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("sitemap.resync.failed"),error_code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),diagnostics:t.unknown().optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.resync.warning"),code:t.string().min(1),message:t.string().min(1),diagnostics:t.unknown().optional(),at:t.string().min(1)}),t.object({type:t.literal("block.changed"),block_id:t.string().min(1),change_type:t.enum(["add","update","delete","move"]),at:t.string().min(1)}),t.object({type:t.literal("tool.started"),tool_call_id:t.string().min(1),name:t.string().min(1),summary:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("tool.finished"),tool_call_id:t.string().min(1),name:t.string().min(1),result_summary:t.string().min(1),interaction_request:_s.optional(),at:t.string().min(1)}),t.object({type:t.literal("workspace.plan.created"),plan_id:t.string().min(1),run_kind:Pi,groups:t.array(Ta),tasks:t.array(ka),dependencies:t.array(Aa),expected_outputs:t.array(ye),diagnostics:Ra,summary:cl,at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.worker.updated"),group_id:t.string().min(1),phase:Ea,status:kt,task_counts:ml,target_paths:t.array(ye),diagnostics:t.array(t.string().min(1)),at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.task.updated"),task_id:t.string().min(1),group_id:t.string().min(1),status:kt,target_path:ye,read_files_count:t.number().int().nonnegative(),diagnostics:t.array(t.string().min(1)),diagnostic_details:t.array(Ia).optional(),at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.degraded"),reason:t.enum(["block_placeholder","form_placeholder","patch_protected_dropped","preview_health_degraded","design_plan_fallback","generated_code_rescue","cms_page_directory_degraded","form_prebuild_skipped","form_section_fallback","first_settings_sync_failed"]),degraded_block_ids:t.array(t.string().min(1)).min(1).optional(),dropped_files:t.array(t.string().min(1)).min(1).optional(),degraded_file_paths:Cx.optional(),degraded_page_ids:Dx.optional(),snapshot_id:T.optional(),code:t.string().min(1).optional(),message:t.string().min(1).optional(),diagnostics:t.string().min(1).optional(),retryable:t.boolean().optional(),at:t.string().min(1)}).strict().superRefine((e,n)=>{if(!(e.reason==="generated_code_rescue")){for(let a of["degraded_file_paths","degraded_page_ids"])e[a]!==void 0&&n.addIssue({code:"custom",path:[a],message:`${a} is only allowed for generated_code_rescue`});return}e.degraded_file_paths===void 0&&n.addIssue({code:"custom",path:["degraded_file_paths"],message:"generated_code_rescue requires degraded_file_paths"});for(let a of["degraded_block_ids","dropped_files","snapshot_id","code","message","diagnostics","retryable"])e[a]!==void 0&&n.addIssue({code:"custom",path:[a],message:`${a} is not allowed for generated_code_rescue`})}),t.object({type:t.literal("workspace.design_plan.outcome"),design_plan_outcome:hx,reason:Sx,gate_diagnostics:t.object({gate:t.enum(["quality","schema"]),issue_codes:t.array(t.string().min(1)).max(20),issue_paths:t.array(t.string()).max(20),finish_reason:t.string().min(1).optional()}).strict().optional(),media_floor:t.object({total_blocks:t.number().int().min(0),media_bearing_blocks:t.number().int().min(0),hero_total:t.number().int().min(0),hero_media_bearing:t.number().int().min(0),pages_without_media:t.array(t.string().min(1)).max(50),met:t.boolean()}).strict().optional(),at:t.string().min(1)}).strict(),ol.extend({type:t.literal("workspace.suggestions"),at:t.string().min(1)}).strict(),t.object({type:t.literal("file.changed"),path:t.string().min(1),change_type:t.enum(["create","update","delete"]),diff:t.string().optional(),at:t.string().min(1)}),t.object({type:t.literal("snapshot.created"),snapshot_id:T,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),at:t.string().min(1)}),t.object({type:t.literal("snapshot.finalized"),snapshot_id:T,at:t.string().min(1)}),t.object({type:t.literal("preview.preparing"),at:t.string().min(1)}),t.object({type:t.literal("preview.ready"),url:t.string().url(),at:t.string().min(1),launch_id:t.string().min(1).optional()}),t.object({type:t.literal("preview.build.started"),snapshot_id:T,at:t.string().min(1)}),t.object({type:t.literal("preview.build.succeeded"),snapshot_id:T,at:t.string().min(1)}),t.object({type:t.literal("preview.build.failed"),snapshot_id:T,message:t.string().min(1),diagnostics:t.string().min(1),retryable:t.boolean(),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),error_category:Nm.optional(),retryable:t.boolean().optional(),attempts:t.number().int().positive().optional(),outcome:t.literal("retained_previous").optional(),details:t.record(t.string(),t.unknown()).optional(),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),snapshot_id:T.optional(),degraded_reason:Ht.optional(),build_verified:t.boolean().optional(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.started"),slot_count:t.number().int().nonnegative(),at:t.string().datetime()}),t.object({type:t.literal("media_resolution.finished"),slot_count:t.number().int().nonnegative(),provider_counts:t.object({unsplash:t.number().int().nonnegative(),pexels:t.number().int().nonnegative(),placeholder:t.number().int().nonnegative()}),fallback_count:t.number().int().nonnegative(),error_codes:t.array(t.string()),at:t.string().datetime()}),t.object({type:t.literal("skill.selecting"),category:t.literal("page-generation"),available:t.array(t.object({id:t.string().min(1),name:t.string().min(1)})).max(20),at:t.string().min(1)}),t.object({type:t.literal("skill.selected"),category:t.literal("page-generation"),selected:t.object({id:t.string().min(1),name:t.string().min(1),reason:t.string().min(1).max(200)}),at:t.string().min(1)}),t.object({type:t.literal("activity.started"),activity_id:t.string().min(1),parent_activity_id:t.string().min(1).optional(),kind:Km,title:t.string().min(1).max(200),detail:t.string().max(360).optional(),title_code:gt.optional(),detail_code:gt.optional(),locks_input:t.boolean(),at:t.string().min(1)}),t.object({type:t.literal("activity.updated"),activity_id:t.string().min(1),title:t.string().min(1).max(200).optional(),detail:t.string().max(360).optional(),title_code:gt.optional(),detail_code:gt.optional(),at:t.string().min(1)}),t.object({type:t.literal("activity.finished"),activity_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("activity.failed"),activity_id:t.string().min(1),detail:t.string().max(360).optional(),at:t.string().min(1)})]),ll=jx.superRefine(nl).superRefine((e,n)=>{if(e.type==="user.message"&&e.interaction_response&&!e.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"}),e.type!=="tool.finished")return;let i=e.name==="prepare_product_search_entry";i!==!!e.interaction_request&&n.addIssue({code:"custom",path:["interaction_request"],message:i?"prepare_product_search_entry requires interaction_request":"interaction_request is only valid for prepare_product_search_entry"})}),pa=t.object({id:va,tenant_id:t.string().min(1),site_id:R,agent_run_id:H,sequence:t.number().int().positive(),event_type:rl,payload:ll,created_at:t.string().min(1),thread_id:Ge.nullable().optional()}),oO=t.object({event_type:rl,payload:ll}).superRefine((e,n)=>{e.event_type!==e.payload.type&&n.addIssue({code:"custom",path:["payload","type"],message:"payload.type must match event_type"}),In(e.payload)&&n.addIssue({code:"custom",path:["payload"],message:"AgentEvent payload must not contain secrets"})}),rO=t.discriminatedUnion("status",[t.object({status:t.literal("appended"),agent_run:$e,event:pa,next_cursor:t.number().int().nonnegative()}),t.object({status:t.literal("duplicate_ignored"),agent_run:$e,event:pa,next_cursor:t.number().int().nonnegative()})]),cO=t.object({events:t.array(pa),next_cursor:t.number().int().nonnegative().optional()}),mO=t.object({after_sequence:t.coerce.number().int().nonnegative().default(0)}),lO=t.object({run_id:H.optional(),thread_id:Ge.optional()}).superRefine((e,n)=>{e.run_id&&e.thread_id&&n.addIssue({code:"custom",path:["thread_id"],message:"run_id and thread_id are mutually exclusive"})}),pO=t.enum(["implemented","skeleton","planned"]),dO=t.enum(["GET","POST","PUT","PATCH","DELETE"]),uO=[{method:"PATCH",path:"/internal/sites/:site_id/snapshots/:snapshot_id/manifest",tag:"snapshots",summary:"Compare-and-set the manifest hash for the active current snapshot after an in-place object replacement.",status:"implemented",request_body_schema:"UpdateCurrentSnapshotManifestRequestSchema",response_schema:"SnapshotRecordSchema",notes:["Internal Agent authentication is required. The update succeeds only when site current_snapshot_id, snapshot status, object key, and expected manifest hash still match."]},{method:"GET",path:"/health",tag:"system",summary:"API health check.",status:"implemented",response_schema:"ApiHealth"},{method:"POST",path:"/sites",tag:"sites",summary:"Create a site and Step 1 brief in the current dev context.",status:"implemented",request_body_schema:"CreateSiteBriefRequestSchema",response_schema:"CreateSiteBriefResponseSchema"},{method:"POST",path:"/sites/drafts",tag:"sites",summary:"Create a draft site without a brief in the current tenant so /s/:site_id can collect Step 1 later.",status:"implemented",request_body_schema:"CreateSiteDraftRequestSchema",response_schema:"SiteRecordSchema"},{method:"GET",path:"/sites",tag:"sites",summary:"List current tenant sites.",status:"implemented",response_schema:"SiteRecordSchema[]"},{method:"GET",path:"/sites/by-cms/:cms_site_id",tag:"sites",summary:"Resolve an external CMS site id to one tenant-scoped VCP site.",status:"implemented",response_schema:"SiteRecordSchema",notes:["Used by the browser /d/:cms_site_id handoff route; lookup is scoped by current request tenant and returns 404 when the CMS site has not been synchronized."]},{method:"GET",path:"/sites/:site_id",tag:"sites",summary:"Get one tenant-scoped site.",status:"implemented",response_schema:"SiteRecordSchema"},{method:"POST",path:"/sites/:site_id/workflow",tag:"site-workflows",summary:"Create one version-bound site workflow from a published flow definition.",status:"implemented",request_body_schema:"CreateSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/workflow",tag:"site-workflows",summary:"Read the current site workflow snapshot and derived menu state.",status:"implemented",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"PUT",path:"/sites/:site_id/workflow/website",tag:"site-workflows",summary:"Update the source website while website_scan is current.",status:"implemented",request_body_schema:"UpdateSiteWorkflowWebsiteRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/advance",tag:"site-workflows",summary:"Advance one non-terminal workflow node with an expected-current-node guard.",status:"implemented",request_body_schema:"AdvanceSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/complete",tag:"site-workflows",summary:"Complete the workflow from its final publishing node after server-side release checks pass.",status:"implemented",request_body_schema:"CompleteSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema",notes:["The browser supplies only the expected current node; the server verifies persisted release facts before completing the workflow."]},{method:"POST",path:"/sites/:site_id/workflow/tasks/register",tag:"site-workflows",summary:"Register a business-owned external task id and its idempotency key.",status:"implemented",request_body_schema:"RegisterWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/step2-site-initialization/tasks",tag:"site-workflows/step2-site-initialization",summary:"Create or reuse the current workflow's Step2 website crawl task.",status:"implemented",response_schema:"Step2SiteInitializationTaskResponseSchema",notes:["The server derives tenantId, sessionId, and siteUrl from trusted request/workflow state; the browser cannot submit upstream scope fields."]},{method:"GET",path:"/sites/:site_id/workflow/step2-site-initialization/tasks/:task_id",tag:"site-workflows/step2-site-initialization",summary:"Poll the workflow-owned Step2 website crawl task.",status:"implemented",response_schema:"Step2SiteInitializationTaskResponseSchema",notes:["The task id must match the current non-superseded website_crawl task reference for the workflow."]},{method:"POST",path:"/sites/:site_id/workflow/tasks/:task_type/replace",tag:"site-workflows",summary:"Replace one task reference while retaining its superseded history.",status:"implemented",request_body_schema:"ReplaceWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/tasks/website_crawl/replace-and-invalidate-dependents",tag:"site-workflows",summary:"Replace website crawl and invalidate basic-info and metrics dependents atomically.",status:"implemented",request_body_schema:"ReplaceCrawlWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/build",tag:"site-workflows",summary:"Start the server-owned site build and workspace snapshot lifecycle.",status:"implemented",request_body_schema:"StartSiteBuildRequestSchema",response_schema:"StartSiteBuildResponseSchema",notes:["The browser may start or query the build, but cannot write site build or deployment summary status directly."]},{method:"GET",path:"/sites/:site_id/workflow/customer-materials",tag:"site-workflows",summary:"Read the persisted no-website customer materials draft.",status:"implemented",response_schema:"CustomerMaterialsNullableResponseSchema"},{method:"PUT",path:"/sites/:site_id/workflow/customer-materials",tag:"site-workflows",summary:"Save the no-website customer materials before submission.",status:"implemented",request_body_schema:"CustomerMaterialsDraftSchema",response_schema:"CustomerMaterialsResponseSchema",notes:["A submitted record is immutable and rejects later writes."]},{method:"POST",path:"/sites/:site_id/workflow/customer-materials/submit",tag:"site-workflows",summary:"Submit and freeze customer materials before analysis.",status:"implemented",request_body_schema:"CustomerMaterialsDraftSchema",response_schema:"CustomerMaterialsResponseSchema",notes:["Repeated submissions return 409; clients may retry only the separate workflow advance."]},{method:"GET",path:"/sites/:site_id/designer/component-library/categories",tag:"designer-component-library",summary:"List the fixed insert-new-component category tree for a site.",status:"implemented",response_schema:"ListDesignerComponentCategoriesResponseSchema",notes:["The server validates site ownership and fixes category_group_key to insertNewComponent."]},{method:"GET",path:"/sites/:site_id/designer/component-library/resources",tag:"designer-component-library",summary:"List component resources from the fixed designer catalog group.",status:"implemented",query_schema:"ListDesignerComponentsQuerySchema",response_schema:"ListDesignerComponentsResponseSchema",notes:["The server fixes resource type to component and does not expose resource-platform secrets, internal hosts, or product-line selection."]},{method:"POST",path:"/sites/:site_id/designer/component-library/resources/:resource_id/install",tag:"designer-component-library",summary:"Install one exact component version and return a strict SiteEditEngine materialization.",status:"implemented",request_body_schema:"InstallDesignerComponentBodySchema",response_schema:"InstallDesignerComponentResponseSchema",notes:["The server downloads the resource ZIP with the configured secret, validates main.json identity and compatibility, and returns only the strict materialization plus immutable revision metadata."]},{method:"GET",path:"/sites/:site_id/designer/page-library/categories",tag:"designer-page-library",summary:"List the fixed insert-new-page category tree for a site.",status:"implemented",response_schema:"ListDesignerPageCategoriesResponseSchema",notes:["The server validates site ownership and fixes category_group_key to insertNewPage."]},{method:"GET",path:"/sites/:site_id/designer/page-library/resources",tag:"designer-page-library",summary:"List page and pages resources from the fixed designer catalog.",status:"implemented",query_schema:"ListDesignerPagesQuerySchema",response_schema:"ListDesignerPagesResponseSchema",notes:["The server fixes resource types to page and pages and does not expose resource-platform credentials or internal routing."]},{method:"POST",path:"/sites/:site_id/designer/page-library/resources/:resource_id/prepare",tag:"designer-page-library",summary:"Resolve one exact page resource version for designer-side draft configuration.",status:"implemented",request_body_schema:"PrepareDesignerPageBodySchema",response_schema:"PrepareDesignerPageResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-library/resources/:resource_id/install",tag:"designer-page-library",summary:"Install one exact page resource version and return a strict PageResourceArtifact.",status:"implemented",request_body_schema:"InstallDesignerPageBodySchema",response_schema:"InstallDesignerPageResponseSchema",notes:["The server validates the explicit resource type, immutable package identity, page selections, materializations, and package-local references."]},{method:"GET",path:"/sites/:site_id/designer/pages",tag:"designer-page-library",summary:"List designer pages from the stable first-phase fixture source.",status:"implemented",response_schema:"ListDesignerSitePagesResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-resources/enhance",tag:"designer-page-library",summary:"Echo a designer page-resource candidate without model execution or normalization.",status:"implemented",request_body_schema:"EnhanceDesignerPageResourceBodySchema",response_schema:"EnhanceDesignerPageResourceResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-resources/compose",tag:"designer-page-library",summary:"Compose exact page and component resources into one strict page artifact.",status:"implemented",request_body_schema:"ComposeDesignerPageResourceBodySchema",response_schema:"InstallDesignerPageResponseSchema",notes:["The server installs every immutable source, validates ordered page blocks, scopes component materializations, and returns one artifact without exposing resource-platform credentials."]},{method:"POST",path:"/sites/:site_id/designer/page-resources/blank",tag:"designer-page-library",summary:"Create the deterministic built-in blank page artifact for one configured route.",status:"implemented",request_body_schema:"InstallDesignerPageBodySchema",response_schema:"InstallDesignerPageResponseSchema"},{method:"PATCH",path:"/sites/:site_id",tag:"sites",summary:"Update site display name and optional generated-site locale for the current tenant.",status:"implemented",request_body_schema:"UpdateSiteRequestSchema",response_schema:"SiteRecordSchema"},{method:"DELETE",path:"/sites/:site_id",tag:"sites",summary:"Archive a site so it no longer appears in the tenant site list.",status:"implemented",response_schema:"SiteRecordSchema"},{method:"GET",path:"/sites/:site_id/workspace/source-files",tag:"sites",summary:"List source files available in the ready preview sandbox.",status:"implemented",response_schema:"WorkspaceSourceFileListItemSchema[]"},{method:"GET",path:"/sites/:site_id/workspace/source-file",tag:"sites",summary:"Read a source file from the ready preview sandbox.",status:"implemented",query_schema:"WorkspaceSourceFilePathQuerySchema",response_schema:"WorkspaceSourceFileResponseSchema"},{method:"GET",path:"/sites/:site_id/media-assets",tag:"media-assets",summary:"List or search enterprise image assets through the CMS adapter.",status:"implemented",query_schema:"ListMediaLibraryAssetsQuerySchema",response_schema:"ListMediaLibraryAssetsResponseSchema"},{method:"POST",path:"/sites/:site_id/media-assets",tag:"media-assets",summary:"Upload one validated image and create its enterprise asset.",status:"implemented",response_schema:"UploadMediaLibraryAssetResponseSchema",notes:["Accepts one multipart field named file; only the image MIME allowlist is accepted and the maximum size is 20 MiB."]},{method:"GET",path:"/sites/:site_id/media-assets/unsplash/search",tag:"media-assets",summary:"Search Unsplash through the VCP server-side client.",status:"implemented",query_schema:"SearchUnsplashMediaQuerySchema",response_schema:"SearchUnsplashMediaResponseSchema",notes:["The browser never receives the Unsplash access key; CMS is not involved in search."]},{method:"POST",path:"/sites/:site_id/media-assets/unsplash/:provider_id/use",tag:"media-assets",summary:"Best-effort report that an Unsplash image was selected.",status:"implemented",request_body_schema:"UseUnsplashMediaRequestSchema",response_schema:"UseUnsplashMediaResponseSchema",notes:["CMS report failure returns reported=false and does not roll back the image replacement."]},{method:"POST",path:"/sites/:site_id/sitemap",tag:"sitemaps",summary:"Confirm the currently reviewed Sitemap Draft and advance the site to structure_saved.",status:"implemented",request_body_schema:"ConfirmSiteStructureRequestSchema",response_schema:"PersistSiteSitemapDraftResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/sitemap-draft",tag:"sitemaps",summary:"Persist an agent-generated sitemap draft without confirming the structure.",status:"implemented",request_body_schema:"PersistGeneratedSitemapDraftRequestSchema",response_schema:"PersistGeneratedSitemapDraftResponseSchema"},{method:"GET",path:"/sites/:site_id/sitemap",tag:"sitemaps",summary:"Read the current Sitemap Draft for a site.",status:"implemented",response_schema:"SitemapDraftRecordSchema"},{method:"POST",path:"/sites/:site_id/clarify/answers",tag:"clarify",summary:"Persist the Step 2 clarify answers (and the answered questions) into the site's clarify session.",status:"implemented",request_body_schema:"PersistClarifyAnswersRequestSchema",response_schema:"PersistClarifyAnswersResponseSchema"},{method:"PATCH",path:"/sites/:site_id/clarify/archetype",tag:"clarify",summary:"Switch the Step 2 industry archetype (user_picked) into the site's clarify session via an idempotent upsert.",status:"implemented",request_body_schema:"UpdateClarifyArchetypeRequestSchema",response_schema:"PersistClarifyAnswersResponseSchema",notes:["Independent of generate: materializes a clarify_sessions row when none exists (using the supplied questions) or updates only selected_archetype; never writes answers/completed_at. Forces source=user_picked."]},{method:"POST",path:"/internal/sites/:site_id/design-plan",tag:"design-plans",summary:"Persist a generated design plan version for a site (internal agent-only write).",status:"implemented",request_body_schema:"PersistSiteDesignPlanRequestSchema",response_schema:"PersistSiteDesignPlanResponseSchema",notes:["Guarded by the internal agent token; only the Workspace/Sitemap agent writes design plans."]},{method:"GET",path:"/internal/sites/:site_id/design-plan",tag:"design-plans",summary:"Read the current (latest version) design plan for a site (internal agent-only read).",status:"implemented",response_schema:"DesignPlanRecordSchema",notes:["Guarded by the internal agent token; only the Workspace/Sitemap agent reads design plans."]},{method:"GET",path:"/sites/:site_id/design-plan",tag:"design-plans",summary:"Read the current (latest version) design plan for a site so Workspace UI can inspect the generated design contract.",status:"implemented",response_schema:"DesignPlanRecordSchema"},{method:"GET",path:"/sites/:site_id/brief",tag:"briefs",summary:"Read the persisted Step 1 brief for a site so the Workspace Agent can seed first full-site generation without a new write surface.",status:"implemented",response_schema:"BriefRecordSchema"},{method:"PUT",path:"/sites/:site_id/brief/draft",tag:"briefs",summary:"Save a draft site's Step 1 brief without advancing the workflow.",status:"implemented",request_body_schema:"SaveBriefDraftRequestSchema",response_schema:"SaveBriefDraftResponseSchema",notes:["Only sites in the editable build phase are writable; the brief row is upserted idempotently while site status, locale, and workflow stage remain unchanged."]},{method:"PATCH",path:"/sites/:site_id/brief",tag:"briefs",summary:"Create or update a draft site's Step 1 brief and advance it to Clarify without allowing later workflow states to roll back.",status:"implemented",request_body_schema:"UpdateBriefRequestSchema",response_schema:"UpdateBriefResponseSchema",notes:["Only sites in the editable build phase are writable; missing brief rows are created on first save; identical retries are idempotent."]},{method:"POST",path:"/internal/sites/:cms_site_id/external-sync",tag:"sites",summary:"Synchronize a trusted external CMS site URL into VCP by tenant_id + cms_site_id, creating a draft VCP site on first sync.",status:"implemented",request_body_schema:"ExternalSyncSiteRequestSchema",response_schema:"ExternalSyncSiteResponseSchema",notes:["This trusted external entry does not require browser login or internal bearer auth; tenant_id is written directly to tenants.id and the response uses the internal { code, data, message } success envelope."]},{method:"POST",path:"/internal/sites/:site_id/page-templates",tag:"page-templates",summary:"Create a private page template through the authenticated VCP internal service surface.",status:"implemented",request_body_schema:"PageTemplateCreateRequestSchema",response_schema:"PageTemplateCreateResponseSchema",notes:["Internal service endpoint; callers use the API bearer token plus trusted tenant/user headers. API delegates to Agent with its own AGENT_INTERNAL_TOKEN and never forwards caller Authorization."]},{method:"POST",path:"/internal/sites/:site_id/page-templates/promote",tag:"page-templates",summary:"Promote a private page template through the authenticated VCP internal service surface.",status:"implemented",request_body_schema:"PageTemplatePromoteRequestSchema",response_schema:"PageTemplatePromoteResponseSchema",notes:["Internal service endpoint; uses the same bearer + tenant/user context as create and delegates to Agent with API-owned credentials."]},{method:"POST",path:"/internal/sites/:site_id/page-templates/cleanup",tag:"page-templates",summary:"Clean up private page templates through the authenticated VCP internal service surface.",status:"implemented",request_body_schema:"PageTemplateCleanupRequestSchema",response_schema:"PageTemplateCleanupResponseSchema",notes:["Internal service endpoint; cleanup remains explicit and default-template protection is enforced by the Agent lifecycle service."]},{method:"POST",path:"/sites/:site_id/snapshots",tag:"snapshots",summary:"Persist snapshot metadata without changing the current site snapshot.",status:"implemented",request_body_schema:"PersistSiteSnapshotRequestSchema",response_schema:"PersistSiteSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/promote",tag:"snapshots",summary:"Promote a site snapshot as the current workspace version.",status:"implemented",request_body_schema:"PromoteSiteSnapshotRequestSchema",response_schema:"PromoteSiteSnapshotResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/lock/try-acquire",tag:"snapshots",summary:"Try to acquire the short-lived template-upgrade site lock.",status:"implemented",request_body_schema:"TryAcquireTemplateUpgradeLockRequestSchema",response_schema:"TryAcquireTemplateUpgradeLockResponseSchema",notes:["Internal agent-only endpoint; lock contention returns acquired=false instead of a user-facing conflict."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/lock/release",tag:"snapshots",summary:"Release the calling template-upgrade attempt's site lock.",status:"implemented",request_body_schema:"ReleaseTemplateUpgradeLockRequestSchema",response_schema:"ReleaseTemplateUpgradeLockResponseSchema",notes:["Internal agent-only endpoint; release is scoped by tenant, site, operation type, and owner."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/snapshots/:snapshot_id/promote",tag:"snapshots",summary:"CAS-promote a validated template-upgrade candidate and bind its accepted commit atomically.",status:"implemented",request_body_schema:"PromoteTemplateUpgradeSnapshotRequestSchema",response_schema:"PromoteTemplateUpgradeSnapshotResponseSchema",notes:["Internal agent-only endpoint; accepted_commit is never part of the public promote request or response."]},{method:"GET",path:"/internal/sites/:site_id/template-upgrade/state",tag:"snapshots",summary:"Inspect the projected tenant-scoped template-upgrade state without mutation.",status:"implemented",query_schema:"InspectTemplateUpgradeStateRequestSchema",response_schema:"InspectTemplateUpgradeStateResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and the repository path is read-only."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/prepare",tag:"snapshots",summary:"Prepare the tenant-scoped template-upgrade retry state for a target version.",status:"implemented",request_body_schema:"PrepareTemplateUpgradeStateRequestSchema",response_schema:"PrepareTemplateUpgradeStateResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and is never accepted in the request body."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/failure",tag:"snapshots",summary:"Record a finite validation failure for the prepared template-upgrade target.",status:"implemented",request_body_schema:"RecordTemplateUpgradeFailureRequestSchema",response_schema:"RecordTemplateUpgradeFailureResponseSchema",notes:["Internal agent-only endpoint; accepts a finite error code and never raw validation output."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/success",tag:"snapshots",summary:"Reset retry state after the prepared template-upgrade target succeeds.",status:"implemented",request_body_schema:"RecordTemplateUpgradeSuccessRequestSchema",response_schema:"RecordTemplateUpgradeSuccessResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and is never accepted in the request body."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/events",tag:"snapshots",summary:"Record one bounded template-upgrade observability event.",status:"implemented",request_body_schema:"RecordTemplateUpgradeEventRequestSchema",response_schema:"RecordTemplateUpgradeEventResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and the strict request excludes raw errors, source content, and file paths."]},{method:"GET",path:"/internal/template-upgrades/report",tag:"snapshots",summary:"Read tenant-scoped template-upgrade outcome, state, and duration aggregates.",status:"implemented",query_schema:"GetTemplateUpgradeReportQuerySchema",response_schema:"GetTemplateUpgradeReportResponseSchema",notes:["Internal endpoint; tenant identity is derived from trusted request context and all aggregates are tenant-scoped."]},{method:"GET",path:"/internal/template-upgrades/snapshot-deletions/pending",tag:"snapshots",summary:"List tenant-scoped stale template-upgrade snapshot deletions for dry-run or reconciliation.",status:"implemented",query_schema:"ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema",response_schema:"ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema",notes:["Defaults to retrying deleting tombstones. Including candidate snapshots is an explicit maintenance action and should use a conservative age threshold."]},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/abandon",tag:"snapshots",summary:"Mark an unpromoted candidate snapshot as failed.",status:"implemented",response_schema:"AbandonSiteSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/snapshots/:snapshot_id",tag:"snapshots",summary:"Read one tenant-scoped snapshot metadata record for a site.",status:"implemented",response_schema:"SnapshotRecordSchema"},{method:"DELETE",path:"/sites/:site_id/snapshots/:snapshot_id",tag:"snapshots",summary:"Prepare two-phase deletion of a candidate snapshot and return its object key; refuses non-candidate/current/referenced snapshots.",status:"implemented",response_schema:"DeleteSiteSnapshotResponseSchema",notes:["Internal Agent authentication is required. This endpoint only creates a deleting tombstone; object removal and completion are separate steps."]},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/deletion/complete",tag:"snapshots",summary:"Complete deletion after the snapshot object has been removed; only accepts deleting snapshots.",status:"implemented",response_schema:"CompleteSiteSnapshotDeletionResponseSchema",notes:["Internal Agent authentication is required; callers must remove the object before completing the DB deletion."]},{method:"POST",path:"/agent-runs",tag:"agent-runs",summary:"Create an agent run for event persistence and replay.",status:"implemented",request_body_schema:"CreateAgentRunRequestSchema",response_schema:"CreateAgentRunResponseSchema"},{method:"POST",path:"/agent-runs/:run_id/events",tag:"agent-runs",summary:"Append one normalized AgentEvent to a run.",status:"implemented",request_body_schema:"AppendAgentEventRequestSchema",response_schema:"AppendAgentEventResponseSchema",notes:["Internal-only write surface: only internal-service callers may append, except browser (oidc) contexts may append run.failed (the WS connect-stage unlock path, equivalent to POST /agent-runs/workspace/cancel). All other oidc appends \u2014 run.finished, run.started, tool/system/progress, file/snapshot \u2014 are rejected with 403 FORBIDDEN. The browser sends user messages over the Workspace WebSocket (recorded server-side as user.message) and otherwise only reads the GET replay."]},{method:"GET",path:"/agent-runs/:run_id/events",tag:"agent-runs",summary:"Replay AgentEvents after a run-local sequence cursor.",status:"implemented",response_schema:"ListAgentEventsResponseSchema"},{method:"POST",path:"/internal/agent-runs/fail-stale-in-flight",tag:"agent-runs",summary:"Fail stale in-flight workspace runs (internal maintenance, cross-tenant sweep).",status:"implemented",response_schema:"FailStaleInFlightWorkspaceRunsResponseSchema",notes:["Internal maintenance endpoint guarded by InternalAgentAuthGuard (Bearer VCP_AGENT_INTERNAL_TOKEN, production fail-closed); the /internal/** prefix is exempt from browser auth middleware so the guard is the sole trust boundary. Not exposed to the browser via agent-proxy; called by an external admin cron / controlled ops script."]},{method:"GET",path:"/deployments",tag:"deployments",summary:"Deployment resource summary endpoint until publish APIs land.",status:"skeleton"},{method:"POST",path:"/sites/:site_id/workspace/runs",tag:"workspace",summary:"Start an asynchronous Workspace Agent run from the current snapshot.",status:"implemented",request_body_schema:"StartWorkspaceRunRequestSchema",response_schema:"StartWorkspaceRunResponseSchema",notes:["Long-running work must be event-driven and must not block API transactions."]},{method:"GET",path:"/sites/:site_id/threads",tag:"workspace",summary:"List a site's named Agent threads (workspace conversations).",status:"implemented",response_schema:"SiteThreadListResponseSchema",notes:["The browser can only list threads that belong to the current site."]},{method:"POST",path:"/sites/:site_id/threads",tag:"workspace",summary:"Create a new named Agent thread for a site.",status:"implemented",request_body_schema:"CreateSiteThreadRequestSchema",response_schema:"SiteThreadResponseSchema",notes:["The created thread is scoped to the current site; the browser cannot create a thread for another site."]},{method:"PATCH",path:"/sites/:site_id/threads/:thread_id",tag:"workspace",summary:"Rename or archive an Agent thread.",status:"implemented",request_body_schema:"UpdateSiteThreadRequestSchema",response_schema:"SiteThreadResponseSchema",notes:["The server verifies the thread belongs to the current site and tenant before applying the update."]},{method:"GET",path:"/sites/:site_id/workspace/runs/active",tag:"workspace",summary:"Look up the site's current in-flight Workspace Agent run across all threads.",status:"implemented",response_schema:"ActiveWorkspaceRunResponseSchema",notes:["Scoped to the current site regardless of thread; the browser cannot query another site's active run."]},{method:"POST",path:"/v1/agent/workspace/:site_id/form-design-operations",tag:"agent/workspace",summary:"Create or replay a deterministic FORM_SPEC save operation.",status:"implemented",request_body_schema:"FormDesignSaveRequestSchema",response_schema:"FormDesignOperationResponseSchema"},{method:"GET",path:"/v1/agent/workspace/:site_id/form-design-operations/:operation_id",tag:"agent/workspace",summary:"Read a persisted FORM_SPEC save operation.",status:"implemented",response_schema:"FormDesignOperationResponseSchema"},{method:"POST",path:"/v1/agent/workspace/:site_id/form-design-operations/:operation_id/resume",tag:"agent/workspace",summary:"Resume a recoverable FORM_SPEC save with its original fingerprint.",status:"implemented",request_body_schema:"FormDesignResumeRequestSchema",response_schema:"FormDesignOperationResponseSchema"},{method:"GET",path:"/sites/:site_id/workspace/runs/latest",tag:"workspace",summary:"Look up the latest workspace Agent run for a site so Step 4 re-entry can replay persisted events without re-triggering the model.",status:"implemented",response_schema:"LatestWorkspaceRunResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/preview-sessions",tag:"sandbox-sessions",summary:"Persist or update an Agent-owned on-demand preview session; optional current/ready-session guards support current-snapshot CAS and guarded in-place snapshot advance.",status:"implemented",request_body_schema:"PersistPreviewSessionRequestSchema",response_schema:"PersistPreviewSessionResponseSchema"},{method:"GET",path:"/sites/:site_id/preview-sessions/current",tag:"sandbox-sessions",summary:"Read the latest tenant-scoped preview session for a site.",status:"implemented",response_schema:"SandboxSessionSchema"},{method:"POST",path:"/sites/:site_id/preview/activate",tag:"site-preview",summary:"Activate the existing preview sandbox for a site.",status:"implemented",response_schema:"SitePreviewActivateResponseSchema"},{method:"POST",path:"/v1/agent/site-preview/:site_id/activate",tag:"agent/site-preview",summary:"Activate the existing preview sandbox for a site through Agent.",status:"implemented",response_schema:"SitePreviewActivateResponseSchema"},{method:"POST",path:"/sites/:site_id/deployments",tag:"deployments",summary:"Queue an explicit user-confirmed publish from the latest current snapshot.",status:"implemented",request_body_schema:"CreateDeploymentRequestSchema",response_schema:"CreateDeploymentResponseSchema",notes:["The server resolves the latest current snapshot and validates site and snapshot existence, in-flight deployment state, and site operation lock before creating the deployment record and queue job.","The API returns after creating the deployment record and queue job; worker-service claims deployment_jobs for build and Cloudflare publish."]},{method:"POST",path:"/sites/:site_id/deployments/quality-check",tag:"deployments",summary:"Queue a quality-check deployment from a snapshot.",status:"implemented",request_body_schema:"CreateQualityCheckDeploymentRequestSchema",response_schema:"CreateDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/quality-check/status",tag:"deployments",summary:"Read the latest quality-check deployment status.",status:"implemented",response_schema:"GetDeploymentsStatusResponseSchema"},{method:"POST",path:"/internal/site-deployments/quality-check",tag:"deployments",summary:"Queue a quality-check deployment for the current site through the internal Agent API.",status:"implemented",response_schema:"InternalCreateDeploymentResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id.","POST accepts no request body; VCP resolves the current snapshot. Quality-check and publish deployments are independent."]},{method:"GET",path:"/internal/site-deployments/quality-check/status",tag:"deployments",summary:"Read the latest internal quality-check deployment status for the current site.",status:"implemented",response_schema:"InternalGetDeploymentsStatusResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id."]},{method:"POST",path:"/internal/site-deployments/publish",tag:"deployments",summary:"Queue a publish deployment for the current site through the internal Agent API.",status:"implemented",response_schema:"InternalCreateDeploymentResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id.","POST accepts no request body; VCP resolves the latest current snapshot. Quality-check and publish deployments are independent."]},{method:"GET",path:"/internal/site-deployments/publish/status",tag:"deployments",summary:"Read the latest internal publish deployment status for the current site.",status:"implemented",response_schema:"InternalGetDeploymentsStatusResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id."]},{method:"GET",path:"/sites/:site_id/deployments/current",tag:"deployments",summary:"Read the latest deployment for workspace refresh recovery.",status:"implemented",response_schema:"CurrentDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/status",tag:"deployments",summary:"Read current in-flight deployment and latest released deployment.",status:"implemented",response_schema:"GetDeploymentsStatusResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/:deployment_id",tag:"deployments",summary:"Read one tenant-scoped deployment for status polling.",status:"implemented",response_schema:"GetDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/cms/collections",tag:"cms",summary:"List CMS collections for a site.",status:"planned"},{method:"POST",path:"/sites/:site_id/cms/collections",tag:"cms",summary:"Create a CMS collection bound to generated content.",status:"planned"},{method:"GET",path:"/sites/:site_id/cms/collections/:collection_id/entries",tag:"cms",summary:"List CMS entries for a collection.",status:"planned"},{method:"POST",path:"/sites/:site_id/cms/collections/:collection_id/entries",tag:"cms",summary:"Create a CMS entry.",status:"planned"},{method:"PATCH",path:"/sites/:site_id/cms/collections/:collection_id/entries/:entry_id",tag:"cms",summary:"Update a CMS entry.",status:"planned"},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/version-record",tag:"versions",summary:"Record the sandbox accepted git commit for a promoted snapshot version.",status:"implemented",request_body_schema:"RecordSnapshotVersionRequestSchema",response_schema:"RecordSnapshotVersionResponseSchema"},{method:"GET",path:"/sites/:site_id/versions",tag:"versions",summary:"List snapshot-backed site versions.",status:"implemented",response_schema:"ListSiteVersionsResponseSchema"},{method:"POST",path:"/sites/:site_id/versions/:snapshot_id/restore",tag:"versions",summary:"Restore a site to an earlier snapshot version.",status:"implemented",response_schema:"RestoreSiteSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/domains/configuration",tag:"custom-domains",summary:"Read the authoritative site domain configuration.",status:"implemented",response_schema:"GetSiteDomainConfigurationResponseSchema"},{method:"GET",path:"/internal/sites/:site_id/active-domain",tag:"internal/active-domain",summary:"Read whether an internal site has an active primary domain.",status:"implemented",response_schema:"GetActiveSiteDomainResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/check",tag:"publish-workflow",summary:"Check a publish workflow domain and start its operation.",status:"implemented",request_body_schema:"CheckSitePublishDomainRequestSchema",response_schema:"CheckSitePublishDomainResponseSchema"},{method:"GET",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/operation",tag:"publish-workflow",summary:"Read the current publish workflow domain operation.",status:"implemented",response_schema:"GetSitePublishDomainOperationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/operation/reconcile",tag:"publish-workflow",summary:"Recover or reconcile the current publish workflow domain operation.",status:"implemented",response_schema:"ReconcileSitePublishDomainOperationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/remediation/confirm",tag:"publish-workflow",summary:"Confirm the current DNS remediation plan.",status:"implemented",request_body_schema:"ConfirmSitePublishDomainRemediationRequestSchema",response_schema:"ConfirmSitePublishDomainRemediationResponseSchema"},{method:"POST",path:"/sites/:site_id/integrations/gsc/auth/start",tag:"gsc",summary:"Start Google Search Console authorization for a site.",status:"implemented",request_body_schema:"StartGscAuthRequestSchema",response_schema:"StartGscAuthResponseSchema"},{method:"GET",path:"/sites/:site_id/integrations/gsc/status",tag:"gsc",summary:"Read Google Search Console authorization and property status.",status:"implemented",response_schema:"GscStatusResponseSchema"},{method:"GET",path:"/admin/tenants",tag:"admin",summary:"Admin tenant listing.",status:"planned"},{method:"GET",path:"/usage/summary",tag:"usage",summary:"Summarize tenant usage and cost controls.",status:"planned"},{method:"GET",path:"/sites/:site_id/publish-workflow/active",tag:"publish-workflow",summary:"Read the active site publish workflow.",status:"implemented",response_schema:"SitePublishWorkflowActiveResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/start",tag:"publish-workflow",summary:"Start or recover the site publish workflow.",status:"implemented",request_body_schema:"StartSitePublishWorkflowRequestSchema",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/repair-task",tag:"publish-workflow",summary:"Idempotently create the publish repair task.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"GET",path:"/sites/:site_id/publish-workflow/:workflow_id",tag:"publish-workflow",summary:"Read and reconcile a site publish workflow quality task.",status:"implemented",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"PATCH",path:"/sites/:site_id/publish-workflow/:workflow_id/step",tag:"publish-workflow",summary:"Move the site publish workflow to an allowed step.",status:"implemented",request_body_schema:"UpdateSitePublishWorkflowStepRequestSchema",response_schema:"SitePublishWorkflowMutationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/cancel",tag:"publish-workflow",summary:"Cancel a stable site publish workflow.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowMutationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/publish",tag:"publish-workflow",summary:"Start formal publishing for a site publish workflow.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowPublishResponseSchema"}],gO=[{method:"POST",path:"/v1/agent/clarify/:site_id",tag:"clarify",summary:"Stream Step 2 clarify questions as SSE; event_order includes optional skill.selecting, skill.selected, clarify.archetype_proposals, and run.failed on errors.",status:"implemented",request_body_schema:"ClarifyRunInputSchema without tenant_id/site_id",event_schema:"ClarifyStreamEventSchema",event_order:["run.started","skill.selecting","skill.selected","clarify.partial","clarify.archetype_proposals","clarify.finished","run.failed"]},{method:"POST",path:"/v1/agent/sitemap/:site_id",tag:"sitemap",summary:"Stream Step 3 sitemap generation as SSE; event_order includes sitemap.partial and run.failed on errors.",status:"implemented",request_body_schema:"Step5SitemapStartRequestSchema (browser marker only; API injects committed Step5 strategy)",event_schema:"SitemapStreamEventSchema",event_order:["run.started","sitemap.generating","sitemap.partial","sitemap.generated","sitemap.clamped","run.failed"]}],Ox=t.object({id:t.string().min(1),role:t.enum(["system","user","assistant"]),metadata:t.unknown().optional(),parts:t.array(Ti).min(1)}),pl=Ox.extend({role:t.literal("user")}),_O=t.object({base_snapshot_id:T.optional(),message:pl.optional(),thread_id:Ge.optional(),client_run_key:t.string().min(1).max(200).optional()}).superRefine((e,n)=>{In(e.message)&&n.addIssue({code:"custom",path:["message"],message:"Workspace startup message must not contain secrets",params:{errorCode:"WORKSPACE_MESSAGE_CONTAINS_SECRET"}})}),Nx=t.object({path:t.string().regex(/^\/v1\/workspace\/sites\/[^/]+\/socket$/),run_id:H,base_snapshot_id:T,run_kind:Pi}),hO=t.object({agent_run:$e,websocket:Nx,next_step:t.literal("workspace_socket")}),SO=t.object({agent_run:$e}),fO=t.object({thread_id:Ge.optional()}),bO=t.object({agent_run:$e.nullable(),thread:ki.nullable()}),yO=t.object({status:qm.default("active")}),xO=t.object({threads:t.array(ki)}),EO=t.object({title:t.string().trim().min(1).max(200)}).strict(),IO=t.object({title:t.string().trim().min(1).max(200).optional(),status:t.literal("archived").optional()}).strict().refine(e=>e.title!==void 0||e.status!==void 0,{message:"title or status is required"}),RO=t.object({thread:ki}),TO=t.object({agent_type:t.enum(["clarify","sitemap","workspace"]),thread_id:Ge.optional()}),kO=t.object({agent_run:$e}),AO=t.enum(["client.message.create","client.resource.operation.create","client.run.cancel","client.tool.approve","server.run.started","server.user.message","server.assistant.delta","server.tool.started","server.tool.completed","server.workspace.suggestions","workspace.plan.created","workspace.worker.updated","workspace.task.updated","server.patch.applied","server.sitemap.updated","server.snapshot.created","server.snapshot.finalized","server.preview.invalidated","preview.build.started","preview.build.succeeded","preview.build.failed","server.run.finished","server.run.failed","server.error","server.activity.started","server.activity.updated","server.activity.finished","server.activity.failed"]),te=t.object({id:t.string().min(1),tenant_id:t.string().min(1),site_id:R,run_id:H.optional(),correlation_id:t.string().min(1).optional(),seq:t.number().int().positive().optional(),sent_at:t.string().min(1)}),Lx=t.object({key:t.string().min(1),label:t.string().min(1),source_file:t.string().min(1).optional(),component_name:t.string().min(1).optional(),opening_element_range:t.object({start_line:t.number().int().positive(),start_column:t.number().int().nonnegative(),end_line:t.number().int().positive(),end_column:t.number().int().nonnegative()}).optional(),structural_path:t.string().min(1).optional(),text_preview:t.string().min(1).optional()}),Mx=t.discriminatedUnion("type",[te.extend({type:t.literal("client.message.create"),payload:t.object({client_message_id:t.string().min(1),in_reply_to_tool_call_id:t.string().min(1).optional(),current_route_id:an.optional(),interaction_response:Vn.optional(),selected_component:Lx.optional(),message:pl,base_snapshot_id:T.optional()}).superRefine((e,n)=>{e.interaction_response&&!e.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"})})}),te.extend({type:t.literal("client.run.cancel"),payload:t.object({run_id:H,reason:t.string().min(1).optional()})}),te.extend({type:t.literal("client.tool.approve"),payload:t.object({tool_call_id:t.string().min(1),decision:t.enum(["approve","reject"]),reason:t.string().min(1).optional()})}),mr]),Ux=t.discriminatedUnion("type",[te.extend({type:t.literal("server.run.started"),payload:t.object({run_id:H,agent_type:t.literal("workspace")})}),te.extend({type:t.literal("server.user.message"),payload:t.object({client_message_id:t.string().min(1),message_id:t.string().min(1),parts:t.array(Ti).min(1),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:Vn.optional()})}),te.extend({type:t.literal("server.assistant.delta"),payload:t.object({message_id:t.string().min(1),parts:t.array(Ti).min(1),status:t.enum(["streaming","ready"])})}),te.extend({type:t.literal("server.tool.started"),payload:t.object({tool_call_id:t.string().min(1),name:t.string().min(1),summary:t.string().min(1)})}),te.extend({type:t.literal("server.tool.completed"),payload:t.object({tool_call_id:t.string().min(1),name:t.string().min(1),result_summary:t.string().min(1),interaction_request:_s.optional()})}),te.extend({type:t.literal("server.workspace.suggestions"),payload:ol.extend({run_id:H}).strict()}),te.extend({type:t.literal("workspace.plan.created"),payload:t.object({plan_id:t.string().min(1),run_kind:Pi,groups:t.array(Ta),tasks:t.array(ka),dependencies:t.array(Aa),expected_outputs:t.array(ye),diagnostics:Ra,summary:cl})}),te.extend({type:t.literal("workspace.worker.updated"),payload:t.object({group_id:t.string().min(1),phase:Ea,status:kt,task_counts:ml,target_paths:t.array(ye),diagnostics:t.array(t.string().min(1))})}),te.extend({type:t.literal("workspace.task.updated"),payload:t.object({task_id:t.string().min(1),group_id:t.string().min(1),status:kt,target_path:ye,read_files_count:t.number().int().nonnegative(),diagnostics:t.array(t.string().min(1)),diagnostic_details:t.array(Ia).optional()})}),te.extend({type:t.literal("server.patch.applied"),payload:t.object({patch_batch_id:t.string().min(1),changed_files:t.array(t.string().min(1)),sitemap_resync_queued:t.boolean()})}),te.extend({type:t.literal("server.sitemap.updated"),payload:t.object({sitemap_id:Ce,version:t.number().int().positive(),reason:t.string().min(1)})}),te.extend({type:t.literal("server.snapshot.created"),payload:t.object({snapshot_id:T,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/)})}),te.extend({type:t.literal("server.snapshot.finalized"),payload:t.object({snapshot_id:T})}),te.extend({type:t.literal("server.preview.invalidated"),payload:t.object({reason:t.string().min(1),next_preview_url:t.string().url().optional(),launch_id:t.string().min(1).optional()})}),te.extend({type:t.literal("preview.build.started"),payload:t.object({snapshot_id:T})}),te.extend({type:t.literal("preview.build.succeeded"),payload:t.object({snapshot_id:T})}),te.extend({type:t.literal("preview.build.failed"),payload:t.object({snapshot_id:T,message:t.string().min(1),diagnostics:t.string().min(1),retryable:t.boolean()})}),te.extend({type:t.literal("server.run.finished"),payload:t.object({run_id:H,snapshot_id:T,degraded_reason:Ht.optional(),build_verified:t.boolean().optional()})}),te.extend({type:t.literal("server.run.failed"),payload:t.object({run_id:H,error_code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),outcome:t.literal("retained_previous").optional(),details:t.record(t.string(),t.unknown()).optional()})}),te.extend({type:t.literal("server.error"),payload:t.object({code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})}),te.extend({type:t.literal("server.activity.started"),payload:t.object({activity_id:t.string().min(1),parent_activity_id:t.string().min(1).optional(),kind:Km,title:t.string().min(1).max(200),title_code:gt.optional(),detail:t.string().max(360).optional(),detail_code:gt.optional(),locks_input:t.boolean()})}),te.extend({type:t.literal("server.activity.updated"),payload:t.object({activity_id:t.string().min(1),title:t.string().min(1).max(200).optional(),title_code:gt.optional(),detail:t.string().max(360).optional(),detail_code:gt.optional()})}),te.extend({type:t.literal("server.activity.finished"),payload:t.object({activity_id:t.string().min(1)})}),te.extend({type:t.literal("server.activity.failed"),payload:t.object({activity_id:t.string().min(1),detail:t.string().max(360).optional()})})]),qx=Ux.superRefine((e,n)=>{if(e.type==="server.user.message"&&e.payload.interaction_response&&!e.payload.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["payload","in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"}),e.type!=="server.tool.completed")return;let i=e.payload.name==="prepare_product_search_entry";i!==!!e.payload.interaction_request&&n.addIssue({code:"custom",path:["payload","interaction_request"],message:i?"prepare_product_search_entry requires interaction_request":"interaction_request is only valid for prepare_product_search_entry"})}),PO=t.union([Mx,qx]),wO={path:"/v1/workspace/sites/:site_id/socket",protocol:"ws",status:"implemented",inbound_message_schema:"WorkspaceClientMessageSchema",outbound_message_schema:"WorkspaceServerMessageSchema",query_parameters:[{name:"run_id",required:!1,schema:"string",summary:"Workspace run id returned by the API run-start response."},{name:"run_kind",required:!1,schema:"WorkspaceRunKindSchema",summary:"Workspace run mode; initial_generation can auto-start when base_snapshot_id is present."},{name:"base_snapshot_id",required:!1,schema:"string",summary:"Authoritative base snapshot id for this workspace run."},{name:"unattended",required:!1,schema:'"1"',summary:"Unattended mode for machine-driven runs: interactive tools are withheld so the run cannot stall waiting for a human answer. Server-to-server only; the browser proxy strips it."}],ai_sdk_ui_compatible:!0,notes:["Assistant UI output is carried as AI SDK UIMessage parts, including text, data-*, and tool-* parts.","Operational AgentEvents remain persisted separately for replay and audit."]},dl=t.string().regex(/^sha256:[a-f0-9]{64}$/),Fx=t.enum(["create","update","delete","str_replace"]),ul=t.enum(["sitemap_resync","smoke_test","prepare_preview"]),Gx=t.object({old_string:t.string().min(1).describe("Exact text to find in the current file. Must match the file uniquely; include enough surrounding context (usually 2-4 adjacent lines)."),new_string:t.string().describe("Replacement text. May be empty to delete the matched text."),replace_all:t.boolean().optional()}).strict(),zx=t.object({path:ye,operation:Fx,expected_hash:dl.optional(),full_content:t.string().describe("Complete file content for create/update patches. Only this single field is a string value: every double quote inside the source code must be escaped so the field stays valid JSON. Avoid ASCII double quotes inside JSX attribute values and use corner quotes like \u300C\u751F\u65E5\u5FEB\u4E50\u300D for visitor-facing quoted examples. The surrounding patch object and the patches array are ordinary JSON structures, not strings.").optional(),edits:t.array(Gx).min(1).max(20).optional()}).strict().superRefine((e,n)=>{let i=e.full_content!==void 0;if(e.operation==="delete"){i&&n.addIssue({code:"custom",path:["full_content"],message:"delete patches must not include full_content"}),e.edits!==void 0&&n.addIssue({code:"custom",path:["edits"],message:"edits is only allowed for str_replace patches"});return}if(eE(e.path)||n.addIssue({code:"custom",path:["path"],message:"Static App Router page paths must use lowercase ASCII kebab-case public segments."}),e.operation==="str_replace"){e.full_content!==void 0&&n.addIssue({code:"custom",path:["full_content"],message:"str_replace patches must not include full_content"}),(!e.edits||e.edits.length===0)&&n.addIssue({code:"custom",path:["edits"],message:"str_replace patches must include a non-empty edits array"});return}i||n.addIssue({code:"custom",path:["full_content"],message:"create/update patches must include full_content"}),e.edits!==void 0&&n.addIssue({code:"custom",path:["edits"],message:"edits is only allowed for str_replace patches"})}),Kx=t.object({kind:t.enum(["block","page","site","chrome"]),id:t.string().min(1).max(120)}),Bx=t.object({base_key:t.string().min(1).max(120).regex(/^[A-Za-z0-9._:-]+$/).refine(e=>!e.includes(".."),{message:"base_key must not contain '..'"}),owner:Kx,count:t.number().int().min(1).max(12),query:t.string().min(1).max(400),role:t.enum(["hero","section","card","gallery","testimonial","decorative","site_background","nav_background","footer_background"]),orientation:t.enum(["landscape","portrait","square"]).optional(),altHint:t.string().min(1).max(300)}),gl=t.object({site_id:R,base_snapshot_id:T,reason:t.string().min(1),patches:t.array(zx).min(1).describe("A real JSON array of patch objects. Never JSON.stringify this array, and never put an encoded JSON array inside a string \u2014 emit the array itself. Only full_content within a patch object is a string field."),media_requests:t.array(Bx).max(24).optional(),post_actions:t.array(ul).optional()});function _l(e,n){let i=new Set;for(let[a,s]of e.patches.entries())i.has(s.path)&&n.addIssue({code:"custom",path:["patches",a,"path"],message:`Duplicate patch path: ${s.path}`}),i.add(s.path)}var vO=gl.superRefine(_l),CO=gl.omit({base_snapshot_id:!0}).extend({site_id:R.optional()}).superRefine(_l),Wx=ge,Vx=t.object({path:Wx,operation:t.enum(["upsert","delete"]).optional()}),hl=t.enum(["sync_cms_pages","sync_cms_navigation"]),DO=t.object({files:t.array(Vx).min(1),post_actions:t.array(hl).optional()}).strict().overwrite(e=>e.post_actions?{...e,post_actions:[...new Set(e.post_actions)]}:e),Hx=t.enum(["BASE_SNAPSHOT_NOT_FOUND","PATCH_TARGET_NOT_FOUND","PATCH_TARGET_ALREADY_EXISTS","PATCH_EXPECTED_HASH_MISMATCH","PATCH_DIFF_UNSUPPORTED","PATCH_PROTECTED_FILE","PATCH_VALIDATION_FAILED","PATCH_MEDIA_REFERENCE_NOT_DECLARED","PATCH_BATCH_INVALID","PATCH_BATCH_FAILED","PATCH_BATCH_TOO_LARGE","STR_REPLACE_NOT_FOUND","STR_REPLACE_NOT_UNIQUE","STR_REPLACE_BINARY_FILE","STR_REPLACE_REQUIRES_READ"]),$x=t.object({status:t.literal("applied"),patch_batch_id:t.string().min(1),site_id:R,base_snapshot_id:T,snapshot_id:T,manifest_hash:dl,object_key:t.string().min(1),changed_files:t.array(ye).min(1),post_actions_queued:t.array(ul),dropped_protected_files:t.array(t.string().min(1)).min(1).optional()}),Yx=t.object({status:t.literal("failed"),code:Hx,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),jO=t.discriminatedUnion("status",[$x,Yx]),OO=t.object({ok:t.literal(!0),post_actions:t.array(t.object({action:hl,status:t.enum(["succeeded","failed"])}).strict()).default([])}),Sl=ge,Xx=t.enum(["text","binary"]),fl=t.object({path:Sl,kind:Xx,language:t.string().min(1).nullable(),size_bytes:t.number().int().nonnegative()}),NO=t.object({path:Sl}),Qx=fl.extend({kind:t.literal("text"),language:t.string().min(1),content:t.string()}),Zx=fl.extend({kind:t.literal("binary"),language:t.null(),mime_type:t.string().min(1),content_base64:t.string().min(1)}),LO=t.union([Qx,Zx]);function In(e){return typeof e=="string"?/authorization\s*:|bearer\s+|token\s*=|secret\s*=|api[_-]?key\s*=|access[_\s-]?key\s*=|\bsk-[a-z0-9_-]{20,}|eyJ[a-z0-9_-]{10,}\.[a-z0-9_-]{10,}\.[a-z0-9_-]{10,}/i.test(e):!e||typeof e!="object"?!1:Array.isArray(e)?e.some(n=>In(n)):Object.entries(e).some(([n,i])=>Jx(n)||In(i))}function Jx(e){let n=e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/\s+/g,"_").toLowerCase();return/(^|[_-])(authorization|token|secret|api[_-]?key|apikey|access[_-]?key|accesskey)([_-]|$)/.test(n)}function bl(e){let n=e.split("/");return e.length>0&&!e.startsWith("/")&&!e.includes("\\")&&n.every(i=>i!==""&&i!=="."&&i!=="..")}function eE(e){let n=/^app\/(?:(.*)\/)?page\.(?:tsx|jsx)$/.exec(e);if(!n)return!0;let a=(n[1]??"").split("/").filter(r=>r.length>0);return a.some(r=>r.startsWith("_"))?!0:a.filter(r=>!r.startsWith("@")&&!/^\(.+\)$/.test(r)).map(r=>r.replace(/^\((?:\.|\.\.|\.\.\.)\)/,"")).filter(r=>r.length>0).every(r=>/^\[.*\]$/.test(r)||Zt.test(`/${r}`))}var yl=t.enum(["idle","creating","restoring_snapshot","installing_dependencies","starting_preview","ready","active","stopping","stopped","failed"]),tE=t.object({id:Rn,tenant_id:t.string().min(1),site_id:R,sandbox_id:t.string().min(1).nullable(),status:yl,source_snapshot_id:T.nullable(),last_snapshot_id:T.nullable(),preview_url:t.string().url().nullable(),browser_preview_url:t.string().url().nullable().optional(),launch_id:t.string().min(1).nullable().optional(),last_activity_at:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),MO=t.object({session_id:Rn.optional(),sandbox_id:t.string().min(1).optional(),source_snapshot_id:T.optional(),last_snapshot_id:T,expected_current_snapshot_id:T.optional(),expected_ready_session_id:Rn.optional(),expected_ready_session_last_snapshot_id:T.optional(),status:yl,preview_url:t.string().url().optional(),launch_id:t.string().min(1).optional()}),UO=t.object({preview_session:tE,next_step:t.literal("preview")}),qO=t.object({failed_count:t.number().int().nonnegative()}),FO=t.object({site_id:R}),GO=t.object({status:t.enum(["cancelled","no_active_run"]),agent_run:$e.nullable()});export{mc as AESTHETIC_NOTE_MAX_LENGTH,Vb as AI_IMAGE_GENERATION_ENTITLEMENT,Tt as AI_IMAGE_GENERATION_MAX_QUANTITY,rS as APPLICATION_LIBRARY_ERROR_CODES,ZD as AbandonSiteSnapshotResponseSchema,Ab as ActiveSiteDomainDataSchema,bO as ActiveWorkspaceRunResponseSchema,Km as ActivityKindSchema,gt as ActivityTitleCodeSchema,ak as AdvanceSiteWorkflowRequestSchema,Nm as AgentErrorCategorySchema,va as AgentEventIdSchema,pa as AgentEventRecordSchema,ll as AgentEventSchema,rl as AgentEventTypeSchema,fx as AgentMessageHistoryPurposeSchema,Um as AgentModelRouteSchema,bx as AgentPlanStepSchema,WD as AgentRunContextResponseSchema,H as AgentRunIdSchema,Mm as AgentRunKindSchema,$e as AgentRunRecordSchema,dy as AgentRunStatusSchema,Lm as AgentRunTypeSchema,Ge as AgentThreadIdSchema,uy as AgentThreadKindSchema,gy as AgentThreadOriginSchema,ki as AgentThreadRecordSchema,qm as AgentThreadStatusSchema,Hb as AiImageGenerationPrecheckRequestSchema,$b as AiImageGenerationPrecheckResponseSchema,ma as AiImageGenerationQuotaSchema,kx as AiSdkUiDataPartSchema,Px as AiSdkUiErrorPartSchema,Ix as AiSdkUiFilePartSchema,Ti as AiSdkUiMessagePartSchema,Ox as AiSdkUiMessageSchema,Ex as AiSdkUiReasoningPartSchema,Tx as AiSdkUiSourceDocumentPartSchema,Rx as AiSdkUiSourceUrlPartSchema,wx as AiSdkUiStepStartPartSchema,xx as AiSdkUiTextPartSchema,Ax as AiSdkUiToolPartSchema,pO as ApiContractStatusSchema,Ey as ApiErrorEnvelopeSchema,M as ApiResponseSchema,oO as AppendAgentEventRequestSchema,rO as AppendAgentEventResponseSchema,YP as ApplicationCreateResponseSchema,dS as ApplicationLibraryApplicationSchema,XP as ApplicationLibraryApplicationsDataSchema,_c as ApplicationLibraryErrorCodeSchema,ZP as ApplicationLibraryErrorResponseSchema,QP as ApplicationLibraryTemplatesDataSchema,Sc as ApplicationTemplateCatalogDataSchema,cS as ApplicationTemplateCatalogItemSchema,oS as ApplicationTemplateConsumeDataSchema,$P as ApplicationTemplateCreateRequestSchema,lS as ApplicationTemplateCreateResponseSchema,mS as ApplicationTemplateCreatedApplicationSchema,ci as ApplicationTemplateDigestSchema,tS as ApplicationTemplateFieldSchema,aS as ApplicationTemplateReferenceSchema,pS as ApplicationTemplateSourceSchema,mi as ApplicationTemplateStableKeySchema,Gs as ApplicationTemplateV1Schema,Hx as ApplyPatchBatchErrorCodeSchema,Yx as ApplyPatchBatchFailureSchema,vO as ApplyPatchBatchInputSchema,zx as ApplyPatchBatchPatchSchema,ul as ApplyPatchBatchPostActionSchema,jO as ApplyPatchBatchResultSchema,$x as ApplyPatchBatchSuccessSchema,CO as ApplyPatchBatchToolInputSchema,Gx as ApplyPatchEditSchema,Fx as ApplyPatchOperationSchema,Om as ArchetypeProposalSchema,_E as AuditLogIdSchema,iE as AuthIdentityIdSchema,rE as AuthLoginCodeIdSchema,oE as AuthOidcStateIdSchema,sE as AuthSessionIdSchema,aE as AuthTokenIdSchema,cE as AuthWsTicketIdSchema,uf as BINDING_STATUSES,Bm as BlockGenerationContextSchema,vj as BlockMediaIntentSchema,ba as BlockSchema,Zg as BlockingSubsiteSchema,Wm as BrandingSchema,At as BriefIdSchema,ha as BriefRecordSchema,ja as BusinessFactsSchema,N0 as CHAT_COPY,O0 as CLARIFICATION_COPY,US as CMS_FORM_FIELD_TYPES,Br as CMS_MAIN_PRODUCTS_MAX_LENGTH,id as CMS_PAGE_DIRECTORY_MAX_DEPTH,nd as CMS_PAGE_DIRECTORY_MAX_NODES,xo as CMS_PAGE_URL_PATH_MAX_LENGTH,s1 as COMPONENT_I18N_FILE_SUFFIX,Yn as COMPONENT_I18N_NAMESPACE,Il as CONVERSION_CTA_LABEL_MAX_LENGTH,Cf as CRAWLER_INTERNAL_ERROR_CODES,qr as CURRENT_EDIT_ENGINE_VERSION,FO as CancelActiveWorkspaceRunRequestSchema,GO as CancelActiveWorkspaceRunResponseSchema,cm as CheckSitePublishDomainDataSchema,bb as CheckSitePublishDomainRequestSchema,yb as CheckSitePublishDomainResponseSchema,Vm as ChromeDesignSchema,Ny as ChromeFooterDesignSchema,Oy as ChromeFooterShellSchema,Dy as ChromeHeaderDesignSchema,Cy as ChromeHeaderShellSchema,Ly as ChromeMobileNavDesignSchema,ly as ClarifyQuestionOptionSchema,py as ClarifyQuestionSchema,ry as ClarifyQuestionTypeSchema,ga as ClarifyQuestionsSchema,bD as ClarifyRunInputSchema,Pa as ClarifySessionIdSchema,dx as ClarifySessionRecordSchema,yD as ClarifyStreamEventSchema,aw as CmsApplicationCoreInputSchema,ow as CmsApplicationCoreResultSchema,rw as CmsApplicationSeedInputSchema,cw as CmsApplicationSeedResultSchema,hE as CmsCollectionBindingIdSchema,tv as CmsCollectionBindingSchema,Pc as CmsFormSchemaProjectionSchema,Zi as CmsManagedPageTypeSchema,od as CmsPageDirectoryGroupSchema,Eo as CmsPageDirectoryNodeSchema,bo as CmsPageDirectorySchema,Ji as CmsPageTypeSchema,Xe as CmsPageUrlPathSchema,$a as CmsSiteIdSchema,Pf as CompanyInfoSchema,hv as CompanyInfoTaskCreateRequestSchema,Sv as CompanyInfoTaskCreateResponseSchema,fv as CompanyInfoTaskResponseSchema,rP as CompleteCustomerMaterialsRequestSchema,cP as CompleteDiagnosisRequestSchema,ej as CompleteSiteSnapshotDeletionResponseSchema,ok as CompleteSiteWorkflowRequestSchema,mP as CompleteStrategyRequestSchema,oP as CompleteWebsiteScanRequestSchema,o1 as ComponentI18nResourcesSchema,UR as ComposeDesignerPageResourceBodySchema,Eb as ConfirmSitePublishDomainRemediationDataSchema,xb as ConfirmSitePublishDomainRemediationRequestSchema,Ib as ConfirmSitePublishDomainRemediationResponseSchema,$j as ConfirmSiteStructureRequestSchema,BP as ConnectDynamicCollectionInputSchema,dw as ConnectFormInputSchema,St as ConversionHintsSchema,Df as CrawlerInternalErrorCodeSchema,bv as CrawlerInternalErrorSchema,qt as CrawlerTaskCodeSchema,rv as CrawlerTaskCreateRequestSchema,lv as CrawlerTaskCreateResponseSchema,yf as CrawlerTaskFailureErrorCodeSchema,Kc as CrawlerTaskFailureStageSchema,Ef as CrawlerTaskPageSchema,cv as CrawlerTaskPagesQuerySchema,uv as CrawlerTaskPagesResponseSchema,dv as CrawlerTaskStatusResponseSchema,It as CrawlerTaskUuidSchema,Pj as CreateAgentRunConflictResponseSchema,VD as CreateAgentRunRequestSchema,HD as CreateAgentRunResponseSchema,bj as CreateDeploymentRequestSchema,fy as CreateDeploymentResponseSchema,$E as CreateDocumentUploadRequestSchema,NE as CreateExternalSiteEditRequestSchema,LE as CreateExternalSiteEditResponseSchema,eI as CreateImageUploadRequestSchema,KE as CreateInputSourceRequestSchema,yj as CreateQualityCheckDeploymentRequestSchema,kD as CreateSiteBriefRequestSchema,zD as CreateSiteBriefResponseSchema,AD as CreateSiteDraftRequestSchema,TD as CreateSiteInputSchema,EO as CreateSiteThreadRequestSchema,ik as CreateSiteWorkflowRequestSchema,jl as CreateTextInputSourceRequestSchema,Ol as CreateUrlInputSourceRequestSchema,Ej as CurrentDeploymentResponseSchema,eP as CustomerMaterialsDraftResponseSchema,ws as CustomerMaterialsDraftSchema,tP as CustomerMaterialsNullableResponseSchema,vs as CustomerMaterialsRecordSchema,JA as CustomerMaterialsResponseSchema,vh as CustomerMaterialsStatusSchema,Ch as DEFAULT_FONTS,nc as DEFAULT_SITE_DESIGN_RADIUS_ID,sp as DEFAULT_SITE_LOCALE,V0 as DEFAULT_SUBSITE_PALETTE,Yk as DEPLOYMENT_ACTIVE_STATUSES,ct as DEPLOYMENT_LIFECYCLE_TRANSITIONS,cg as DEPLOYMENT_PROGRESS_STEP_CODES,xy as DEPLOYMENT_REALTIME_CHANNEL,wt as DEPLOYMENT_STATUSES,Xk as DEPLOYMENT_TERMINAL_STATUSES,Wg as DEPLOYMENT_TRANSITION_ERROR_CODE,Aj as DEPLOYMENT_WEBSOCKET_CONTRACT,mR as DESIGNER_COMPONENT_LIBRARY_ERROR_CODES,jR as DESIGNER_PAGE_LIBRARY_ERROR_CODES,BE as DOCUMENT_EXTENSION_WHITELIST,WE as DOCUMENT_MIME_WHITELIST,$f as DOMAIN_DNS_PURPOSES,Qf as DOMAIN_DNS_REMEDIATION_STATUSES,Yf as DOMAIN_DNS_VERIFICATION_STATUSES,Bf as DOMAIN_OBSERVED_STATUSES,Vf as DOMAIN_ROUTING_MODES,RR as DeleteDesignerPageErrorDetailsSchema,yR as DeleteDesignerPageRequestSchema,xR as DeleteDesignerPageResponseSchema,gd as DeleteDesignerPageResultSchema,JD as DeleteSiteSnapshotResponseSchema,Ye as DeploymentIdSchema,mE as DeploymentJobIdSchema,mg as DeploymentProgressStepCodeSchema,pg as DeploymentProgressStepSchema,lg as DeploymentProgressStepStatusSchema,Er as DeploymentProgressStepsSchema,ut as DeploymentRecordSchema,kj as DeploymentRedisPubSubEventSchema,Sa as DeploymentStatusSchema,vm as DeploymentStatusSummarySchema,xs as DeploymentTransitionError,Gm as DeploymentTypeSchema,Ii as DeploymentWsDeploymentPayloadSchema,Tj as DeploymentWsServerMessageSchema,yy as DeploymentWsServerMessageTypeSchema,hx as DesignPlanGenerationOutcomeSchema,Sx as DesignPlanGenerationReasonSchema,vi as DesignPlanIdSchema,jj as DesignPlanPatchSchema,ux as DesignPlanRecordSchema,Hm as DesignPlanSchema,wj as DesignTokensSchema,td as DesignerComponentCatalogItemSchema,go as DesignerComponentCategoriesDataSchema,uo as DesignerComponentCategoryNodeSchema,yt as DesignerComponentExactVersionSchema,ho as DesignerComponentInstallDataSchema,_o as DesignerComponentsDataSchema,yd as DesignerPageCatalogItemSchema,vo as DesignerPageCategoriesDataSchema,wo as DesignerPageCategoryNodeSchema,pd as DesignerPageDeleteBlockReasonSchema,ld as DesignerPageDisabledReasonSchema,Qt as DesignerPageExactVersionSchema,ko as DesignerPageGroupSchema,Do as DesignerPageInstallDataSchema,To as DesignerPageNodeSchema,Oo as DesignerPageResourcePreparationDataSchema,bd as DesignerPageResourceSourceSchema,Ad as DesignerPageResourceTemplateSchema,xt as DesignerPageResourceTypeSchema,Co as DesignerPagesDataSchema,$i as DesignerResourceVersionSchema,No as DesignerSitePagesDataSchema,NR as DesignerSiteRouteIdSchema,im as DomainConfigurationSchema,ea as DomainDnsPurposeSchema,ib as DomainDnsRecordSchema,nb as DomainDnsRemediationChangeSchema,em as DomainDnsRemediationRecordSchema,tm as DomainDnsRemediationResultSchema,Zf as DomainDnsRemediationStatusSchema,tb as DomainDnsVerificationObservationSchema,Jc as DomainDnsVerificationResultSchema,Xf as DomainDnsVerificationStatusSchema,Wf as DomainObservedStatusSchema,eb as DomainOperationErrorSchema,yi as DomainOperationSchema,Jf as DomainOperationStatusSchema,ta as DomainOperationTypeSchema,nm as DomainRecordSchema,Hf as DomainRoutingModeSchema,M0 as EDIT_ENGINE_VERSION_HEADER,U0 as EDIT_ENGINE_VERSION_SOURCE_HEADER,D0 as ERROR_COPY,kl as EXTERNAL_SITE_EDIT_INFRASTRUCTURE_REASONS,Tl as EXTERNAL_SITE_EDIT_PROMPT_MAX_LENGTH,Ps as EditEngineVersionParseError,Lo as EnhanceDesignerPageResourceBodySchema,FD as EnhanceDesignerPageResourceResponseSchema,qE as ExternalSiteEditCallbackAckSchema,UE as ExternalSiteEditCallbackPayloadSchema,Al as ExternalSiteEditCallbackStatusSchema,Ht as ExternalSiteEditDegradedReasonSchema,La as ExternalSiteEditOutcomeSchema,Na as ExternalSiteEditTaskIdSchema,Ma as ExternalSiteEditTaskSchema,Pl as ExternalSiteEditTaskStatusSchema,CD as ExternalSyncSiteRequestSchema,GD as ExternalSyncSiteResponseSchema,vl as ExtractedFactKindSchema,kn as ExtractedFactSchema,Fs as FIELD_TYPES,Jr as FONT_PAIRINGS,Ds as FONT_PAIRING_IDS,XS as FORM_DESIGN_ERROR_CODES,YS as FORM_DESIGN_FAILURE_STAGES,HS as FORM_DESIGN_OPERATION_STAGES,$S as FORM_DESIGN_OPERATION_STATUSES,pi as FORM_FIELD_TYPES,qS as FORM_SPEC_FIELD_TYPE_TO_CMS,Ec as FORM_SPEC_FILE_MIN_RUNTIME_VERSION,vS as FORM_SPEC_LOCALIZABLE_FIELD_PATHS,xc as FORM_SPEC_MULTISTEP_MIN_RUNTIME_VERSION,Iw as FORM_TEMPLATE_CATEGORY_COUNTS,Ew as FORM_TEMPLATE_CATEGORY_SLUGS,qO as FailStaleInFlightWorkspaceRunsResponseSchema,ri as FieldDeclSchema,wv as FirecrawlBatchCreateRequestSchema,vv as FirecrawlBatchCreatedResponseSchema,Nf as FirecrawlBatchErrorSchema,Dv as FirecrawlBatchErrorsResponseSchema,Of as FirecrawlBatchPageSchema,Cv as FirecrawlBatchStatusResponseSchema,Rv as FirecrawlCrawlCreateRequestSchema,Tv as FirecrawlCrawlCreatedResponseSchema,kv as FirecrawlCrawlStatusResponseSchema,$c as FirecrawlJobStatusSchema,Ev as FirecrawlMapRequestSchema,Iv as FirecrawlMapResponseSchema,jv as FirecrawlQueueStatusResponseSchema,Av as FirecrawlScrapeRequestSchema,Pv as FirecrawlScrapeResponseSchema,jy as FooterShellSurfaceSchema,yS as FormBlockIdSchema,ui as FormDefinitionIdSchema,BS as FormDesignAffectedFilesSchema,Qs as FormDesignErrorCodeSchema,Ow as FormDesignErrorSchema,Cc as FormDesignFailureStageSchema,ie as FormDesignHashSchema,Aw as FormDesignOpenResponseSchema,WS as FormDesignOperationFingerprintInputSchema,Ws as FormDesignOperationIdSchema,Dc as FormDesignOperationNextActionSchema,pE as FormDesignOperationRecordIdSchema,Dw as FormDesignOperationRecordSchema,Zs as FormDesignOperationResponseSchema,Oc as FormDesignOperationSchema,Xs as FormDesignOperationStageSchema,vc as FormDesignOperationStatusSchema,jw as FormDesignOperationTransitionRequestSchema,jc as FormDesignPreviewRefreshStatusSchema,ww as FormDesignQueryResponseSchema,vw as FormDesignResumeRequestSchema,Cw as FormDesignResumeResponseSchema,VS as FormDesignSaveRequestSchema,Pw as FormDesignSaveResponseSchema,wc as FormDesignSharedImpactSchema,Ys as FormDesignStandardizationSchema,fS as FormFieldDeclSchema,bn as FormFieldNameSchema,Vs as FormOptionValueSchema,xS as FormSpecBindingSchema,IS as FormSpecFieldNodeSchema,TS as FormSpecNodeSchema,ES as FormSpecOptionSchema,RS as FormSpecStepBreakNodeSchema,$s as FormSpecV1Schema,Rw as FormTemplateCatalogResponseSchema,Ac as FormTemplateCategorySlugSchema,LS as FormTemplateCategoryV1Schema,pt as FormTemplateTextSchema,MS as FormTemplateV1Schema,Pb as GSC_AUTH_STATUSES,wb as GSC_BINDING_STATUSES,vb as GSC_PROPERTY_TYPES,Yb as GenerateAiImagesRequestSchema,Xb as GenerateAiImagesResponseSchema,Am as GeneratedAiImageResultSchema,_C as GetActiveSiteDomainResponseSchema,Ij as GetDeploymentResponseSchema,by as GetDeploymentsStatusResponseSchema,ME as GetExternalSiteEditResponseSchema,gC as GetSiteDomainConfigurationResponseSchema,na as GetSitePublishDomainOperationDataSchema,Rb as GetSitePublishDomainOperationResponseSchema,IA as GetTemplateUpgradeReportQuerySchema,RA as GetTemplateUpgradeReportResponseSchema,LC as GoogleSearchConsoleAuthStartDataSchema,NC as GoogleSearchConsoleAuthStartRequestSchema,MC as GoogleSearchConsoleAuthStartResponseSchema,CC as GoogleSearchConsoleAuthStatusSchema,DC as GoogleSearchConsoleBindingStatusSchema,jC as GoogleSearchConsolePropertyTypeSchema,OC as GoogleSearchConsoleStateSchema,qC as GoogleSearchConsoleStatusDataSchema,UC as GoogleSearchConsoleStatusInputSchema,FC as GoogleSearchConsoleStatusResponseSchema,PC as GscAuthStartDataSchema,AC as GscAuthStartRequestSchema,wC as GscAuthStartResponseSchema,ia as GscAuthStatusSchema,sa as GscBindingStatusSchema,aa as GscPropertyTypeSchema,Db as GscStateInputSchema,vC as GscStateSchema,pm as GscStatusDataSchema,jb as GscStatusResponseSchema,yo as HOME_PAGE_URL_PATH,wy as HeaderShellBehaviorSchema,vy as HeaderShellShapeSchema,Py as HeaderShellSurfaceSchema,Ay as HeaderShellVariantSchema,gf as HomeUrlCrawlerTaskCreateRequestSchema,ms as HttpUrlSchema,XE as IMAGE_EXTENSION_WHITELIST,QE as IMAGE_MIME_WHITELIST,po as INSERT_NEW_COMPONENT_CATEGORY_GROUP_KEY,Po as INSERT_NEW_PAGE_CATEGORY_GROUP_KEY,ap as ISO_639_3_TO_SITE_LOCALE,Nl as ImageRoleSchema,pl as InboundUserMessageSchema,qP as IndustryClassificationRequestSchema,FP as IndustryClassificationResultSchema,Qh as IndustryConfidenceSchema,hc as InitializationResultSchema,wl as InputBundleStatusSchema,Pn as InputConflictSchema,tI as InputContextBundleSchema,ht as InputContextSourceIdSchema,Dl as InputSourceSchema,ji as InputSourceStatusSchema,Di as InputSourceTypeSchema,pA as InspectTemplateUpgradeStateRequestSchema,dA as InspectTemplateUpgradeStateResponseSchema,uR as InstallDesignerComponentBodySchema,OD as InstallDesignerComponentResponseSchema,LR as InstallDesignerPageBodySchema,MD as InstallDesignerPageResponseSchema,xj as InternalCreateDeploymentResponseSchema,_j as InternalEnsureSubsitePublishRequestSchema,hj as InternalEnsureSubsitePublishResponseSchema,W as InternalEntityIdSchema,Rj as InternalGetDeploymentsStatusResponseSchema,Sj as InternalGetSubsitePublishStatusRequestSchema,fj as InternalGetSubsitePublishStatusResponseSchema,uj as InternalPrepareSubsitePreviewRequestSchema,gj as InternalPrepareSubsitePreviewResponseSchema,Ah as KNOWLEDGE_CATEGORY_CODES,Wr as KnowledgeCategoryCodeSchema,HA as KnowledgeContextReadinessSchema,wh as KnowledgeSourceReadinessSchema,Vr as KnowledgeSourceReadinessStatusSchema,WA as KnowledgeTaskStatusBatchSchema,Ph as KnowledgeTaskStatusSchema,Jl as LEGACY_SITE_LOCALE_CODES,TO as LatestAgentRunQuerySchema,kO as LatestAgentRunResponseSchema,fO as LatestWorkspaceRunQuerySchema,SO as LatestWorkspaceRunResponseSchema,Fv as LauncherPromptTemplateApplyRequestSchema,Gv as LauncherPromptTemplateApplyResponseSchema,qf as LauncherPromptTemplateCatalogItemSchema,Uv as LauncherPromptTemplateCatalogQuerySchema,qv as LauncherPromptTemplateCatalogSchema,Mf as LauncherPromptTemplateKindSchema,Uf as LauncherPromptTemplateLocaleSchema,bi as LauncherPromptTemplateTypeSchema,mO as ListAgentEventsQuerySchema,cO as ListAgentEventsResponseSchema,DD as ListDesignerComponentCategoriesResponseSchema,dR as ListDesignerComponentsQuerySchema,jD as ListDesignerComponentsResponseSchema,ND as ListDesignerPageCategoriesResponseSchema,OR as ListDesignerPagesQuerySchema,LD as ListDesignerPagesResponseSchema,qD as ListDesignerSitePagesResponseSchema,Kb as ListMediaLibraryAssetsQuerySchema,Bb as ListMediaLibraryAssetsResponseSchema,lO as ListSiteAgentEventsQuerySchema,lj as ListSiteVersionsResponseSchema,TA as ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema,kA as ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema,HE as MAX_DOCUMENT_SOURCES_PER_SITE,VE as MAX_DOCUMENT_UPLOAD_BYTES,JE as MAX_IMAGE_SOURCES_PER_SITE,ZE as MAX_IMAGE_UPLOAD_BYTES,bm as MEDIA_LIBRARY_AUDIO_EXTENSIONS,Rm as MEDIA_LIBRARY_AUDIO_MIME_TYPES,ym as MEDIA_LIBRARY_DOCUMENT_EXTENSIONS,Gb as MEDIA_LIBRARY_EXTENSIONS,xm as MEDIA_LIBRARY_FILE_EXTENSIONS,Sm as MEDIA_LIBRARY_IMAGE_EXTENSIONS,Fb as MEDIA_LIBRARY_IMAGE_MAX_BYTES,Em as MEDIA_LIBRARY_IMAGE_MIME_TYPES,hm as MEDIA_LIBRARY_MAX_BYTES,zb as MEDIA_LIBRARY_MIME_TYPES,fm as MEDIA_LIBRARY_VIDEO_EXTENSIONS,Im as MEDIA_LIBRARY_VIDEO_MIME_TYPES,m1 as MIGRATION_PRODUCTS_CMS_DETAIL_PAGE_TITLE,c1 as MIGRATION_PRODUCTS_DETAIL_PREFIX,d1 as MIGRATION_PRODUCTS_DETAIL_VIEW_VARIANT,p1 as MIGRATION_PRODUCTS_LIST_VIEW_VARIANT,Yg as MIGRATION_PRODUCTS_ROUTE,tt as MIGRATION_PRODUCTS_SLUG,l1 as MIGRATION_PRODUCTS_VIEW_BLOCK_TYPE,SS as MODEL_DECLARABLE_FORM_FIELD_TYPES,Gh as MOTION_PRESETS,Os as MOTION_PRESET_IDS,oI as ManagedPageTemplateRouteManifestV1Schema,Dj as MediaAssetSchema,Ty as MediaAttributionSchema,ca as MediaLibraryAssetSchema,Tm as MediaLibraryFileTypeSchema,km as MediaLibrarySourceSchema,Kx as MediaRequestOwnerSchema,gE as MediaResolutionCacheIdSchema,pR as MockDesignerComponentInsertDataSchema,lR as MockDesignerComponentInsertRequestSchema,ua as MotionLevelSchema,af as NAV_ITEMS_LOCALIZABLE_FIELD_PATHS,of as NAV_ITEMS_MACHINE_FIELD_PATHS,Nh as NEXT_FONT_DISPLAY_NAMES,pn as NEXT_FONT_REGISTRY,op as NON_LATIN_SITE_LOCALE_CODES,Bw as NavItemSchema,ef as PAGE_SEO_LOCALIZABLE_FIELD_PATHS,tf as PAGE_SEO_MACHINE_FIELD_PATHS,Zt as PAGE_SLUG_PATTERN,Ct as PAGE_SLUG_SEGMENT_PATTERN_SOURCE,Xw as PLATFORM_MATERIALIZED_EXEMPTIONS,lf as PLATFORM_MATERIALIZED_FILES,pf as PLATFORM_MATERIALIZED_FILE_PATTERNS,Yw as PLATFORM_MATERIALIZERS,Mo as PLATFORM_OWNED_PAGE_SLUGS,Pd as PLATFORM_OWNED_ROUTE_FILE_PATHS,ud as PageDirectoryReconcileFailedPageSchema,es as PageDirectoryReconcileResultSchema,kR as PageDirectoryReconcileStateSchema,dd as PageDirectoryReconcileStatusSchema,ff as PageDiscoveryCoverageEntrySchema,pv as PageDiscoveryCoverageReasonSchema,Bc as PageDiscoveryCoverageSchema,Ym as PageNavigationSchema,ns as PageResourceArtifactSchema,Rd as PageResourceComponentReferenceSchema,Td as PageResourceComponentSchema,Ed as PageResourceDraftPageSchema,Id as PageResourceDraftSchema,Gn as PageResourceFinalRouteSchema,kd as PageResourcePageSchema,xd as PageResourcePageSelectionSchema,jo as PageResourceRouteMappingSchema,ya as PageSchema,zw as PageSeoDeclSchema,$m as PageSlugSchema,hd as PageTargetKindSchema,Xi as PageTargetProjectionHashSchema,Ao as PageTargetSchema,Sd as PageTargetSeoSchema,TR as PageTargetSetSchema,mI as PageTemplateCleanupRequestSchema,dI as PageTemplateCleanupResponseSchema,rI as PageTemplateCreateRequestSchema,lI as PageTemplateCreateResponseSchema,uI as PageTemplateErrorCodeSchema,Pe as PageTemplateIdSchema,wn as PageTemplatePagePathSchema,cI as PageTemplatePromoteRequestSchema,pI as PageTemplatePromoteResponseSchema,Jj as PersistClarifyAnswersRequestSchema,eO as PersistClarifyAnswersResponseSchema,Yj as PersistGeneratedSitemapDraftRequestSchema,Zj as PersistGeneratedSitemapDraftResponseSchema,MO as PersistPreviewSessionRequestSchema,UO as PersistPreviewSessionResponseSchema,nO as PersistSiteDesignPlanRequestSchema,iO as PersistSiteDesignPlanResponseSchema,Qj as PersistSiteSitemapDraftResponseSchema,Hj as PersistSiteSitemapRequestSchema,Xj as PersistSiteSitemapResponseSchema,$D as PersistSiteSnapshotRequestSchema,YD as PersistSiteSnapshotResponseSchema,oy as PositioningPrefillSchema,la as PositioningSourceSchema,MR as PrepareDesignerPageBodySchema,UD as PrepareDesignerPageResponseSchema,MA as PrepareSiteBuildInitialGenerationBaseRequestSchema,UA as PrepareSiteBuildInitialGenerationBaseResultSchema,lA as PrepareTemplateUpgradeStateRequestSchema,lh as PrepareTemplateUpgradeStateResponseSchema,dj as PrepareVersionPreviewRequestSchema,Sy as PrepareVersionPreviewResponseSchema,xr as ProductSearchAppConfigDraftSchema,gs as ProductSearchAppSlugSchema,xk as ProductSearchContractFixtureSchema,tg as ProductSearchDraftConfigSchema,we as ProductSearchFieldNameSchema,Ju as ProductSearchFilterMetaSchema,_s as ProductSearchInteractionRequestSchema,Vn as ProductSearchInteractionResponseSchema,yk as ProductSearchPopularTermsReadSchema,yr as ProductSearchPopularTermsSchema,ag as ProductSearchRequestSchema,rg as ProductSearchResponseSchema,an as ProductSearchRouteIdSchema,Zu as ProductSearchValueShapeSchema,QD as PromoteSiteSnapshotRequestSchema,_y as PromoteSiteSnapshotResponseSchema,cj as PromoteTemplateUpgradeSnapshotRequestSchema,mj as PromoteTemplateUpgradeSnapshotResponseSchema,om as QualityRunningStatusSchema,j0 as REFUSAL_COPY,uO as REST_API_ENDPOINTS,nf as ROOT_LAYOUT_METADATA_LOCALIZABLE_FIELD_PATHS,sf as ROOT_LAYOUT_METADATA_MACHINE_FIELD_PATHS,Tb as ReconcileSitePublishDomainOperationDataSchema,kb as ReconcileSitePublishDomainOperationResponseSchema,tj as RecordSnapshotVersionRequestSchema,nj as RecordSnapshotVersionResponseSchema,xA as RecordTemplateUpgradeEventRequestSchema,EA as RecordTemplateUpgradeEventResponseSchema,uA as RecordTemplateUpgradeFailureRequestSchema,gA as RecordTemplateUpgradeFailureResponseSchema,_A as RecordTemplateUpgradeSuccessRequestSchema,hA as RecordTemplateUpgradeSuccessResponseSchema,ER as RecoverDesignerPageProjectionRequestSchema,IR as RecoverDesignerPageProjectionResponseSchema,_d as RecoverDesignerPageProjectionResultSchema,Cl as ReferencePagePatternSchema,An as ReferenceSignalsSchema,ty as RegisterMediaResourceReferenceRequestSchema,ny as RegisterMediaResourceReferenceResponseSchema,rk as RegisterWorkflowTaskCommandRequestSchema,Wu as RegisterWorkflowTaskRequestSchema,aj as ReleaseTemplateUpgradeLockRequestSchema,oj as ReleaseTemplateUpgradeLockResponseSchema,lk as ReplaceCrawlWorkflowTaskCommandRequestSchema,Hu as ReplaceCrawlWorkflowTaskRequestSchema,mk as ReplaceWorkflowTaskCommandRequestSchema,Vu as ReplaceWorkflowTaskRequestSchema,KP as ResolvedFieldSchema,uw as ResolvedFormFieldSchema,dO as RestApiMethodSchema,pj as RestoreSiteSnapshotResponseSchema,Kw as RootLayoutMetadataSchema,zm as RouteGenerationCardSchema,Ug as RuleEngineInputSchema,zg as RuleEngineScoreRecordSchema,ys as RuleScoreDimensionKeySchema,Gg as RuleScoreDimensionSchema,$t as SELECTABLE_SITE_LOCALE_CODES,Qm as SITEMAP_RESOLVER_MAX_BLOCK_TARGETS,Xm as SITEMAP_RESOLVER_MAX_PAGE_TARGETS,NA as SITE_BUILD_CONTEXT_FILE_PATH,LA as SITE_BUILD_CONTEXT_MAX_BYTES,ju as SITE_BUILD_STATUSES,ur as SITE_BUILD_STATUS_CODES,Ou as SITE_DEPLOYMENT_STATUSES,gr as SITE_DEPLOYMENT_STATUS_CODES,js as SITE_DESIGN_DENSITY_IDS,tc as SITE_DESIGN_RADIUS_IDS,L1 as SITE_EDIT_DURABLE_HISTORY_CAPABILITY,$p as SITE_EDIT_MATERIALIZATION_MAX_FILE_CONTENT_BYTES,Vi as SITE_EDIT_MATERIALIZATION_MAX_FILE_COUNT,Hi as SITE_EDIT_MATERIALIZATION_MAX_TOTAL_CONTENT_BYTES,Zo as SITE_EDIT_PAGE_COMPOSITION_SCHEMA_VERSION,bT as SITE_EDIT_PAGE_COMPOSITION_V2_CAPABILITY,N_ as SITE_EDIT_RUNTIME_CONTAINER_TAGS,L_ as SITE_EDIT_RUNTIME_TEXT_TAGS,O_ as SITE_EDIT_RUNTIME_VOID_ELEMENT_TAGS,lT as SITE_EDIT_SIGNED_MUTATION_CAPABILITY,Ul as SITE_EDIT_SOURCE_ALLOWED_APP_FILES,qa as SITE_EDIT_SOURCE_ALLOWED_DIRS,Ml as SITE_EDIT_SOURCE_ALLOWED_ROOT_FILES,Li as SITE_EDIT_SOURCE_DELETE_CAPABILITY,ql as SITE_EDIT_TEXT_SOURCE_EXTENSIONS,Pt as SITE_EXTRA_REQUIREMENT_MAX_LENGTH,b1 as SITE_HAS_ACTIVE_SUBSITES_ERROR_CODE,y1 as SITE_HAS_SUBSITES_ERROR_CODE,ep as SITE_LOCALE_CODES,Gw as SITE_LOCALIZATION_STRUCTURES,xD as SITE_PLANNING_FROZEN_ERROR_CODE,ED as SITE_PLANNING_LOCKED_ERROR_CODE,ID as SITE_STRUCTURE_CONFIRMATION_REQUIRED_ERROR_CODE,RD as SITE_STRUCTURE_CONFIRMATION_STALE_ERROR_CODE,Nu as SITE_WORKFLOW_STATUSES,_r as SITE_WORKFLOW_STATUS_CODES,gO as SSE_STREAMS,Ap as STEP5_GEO_QUESTION_TYPES,On as STEP5_PRIMARY_INTENT_PAGE_LIMIT,to as STEP5_SEMRUSH_MIN_RELEVANCE_SCORE,up as STEP5_SEMRUSH_SEARCH_INTENTS,gp as STEP5_SEO_ALLOWED_INTENT_CODES,FI as STEP5_SEO_ALLOWED_SEARCH_INTENTS,WI as STEP5_SEO_KEYWORD_DEFAULT,Cp as STEP5_SEO_KEYWORD_MAX,vp as STEP5_SEO_KEYWORD_MIN,jn as STEP5_SEO_MAX_KEYWORD_DIFFICULTY,Ya as STEP5_SEO_MIN_FIT,Dn as STEP5_SEO_MIN_SEARCH_VOLUME,wp as STEP5_SEO_PAYLOAD_SCHEMA_VERSION,Kp as STEP5_SSE_EVENT_NAMES,xe as STEP5_STRATEGY_COUNT,ft as STEP5_STRATEGY_KEYS,Za as STEP5_STRATEGY_OPTION_IDS,ac as STEP6_AI_THEME_IDS,Ns as STEP6_AI_THEME_PRESETS,oc as STEP6_GENERATED_THEME_ID_PATTERN,H_ as SUBSITE_GLOSSARY_ENTRY_MAX_CHARS,$_ as SUBSITE_GLOSSARY_MAX_ENTRIES,sh as SUBSITE_MOUNT_PATH_PATTERN,J_ as SUBSITE_PALETTE_NOTE_MAX_CHARS,ah as SUBSITE_RESERVED_MOUNT_SEGMENTS,CI as SUPPORTED_SITE_LOCALES,Rn as SandboxSessionIdSchema,tE as SandboxSessionSchema,yl as SandboxSessionStatusSchema,vD as SaveBriefDraftRequestSchema,BD as SaveBriefDraftResponseSchema,TE as SaveSiteExtraRequirementRequestSchema,Qb as SearchUnsplashMediaQuerySchema,Zb as SearchUnsplashMediaResponseSchema,Rh as SiteBuildContextFileSchema,Ih as SiteBuildContextPayloadSchema,Eh as SiteBuildContextProvenanceSchema,xh as SiteBuildContextProvenanceSourceSchema,ls as SiteBuildStatusSchema,x1 as SiteDeletionBlockedDetailsSchema,ps as SiteDeploymentStatusSchema,Ei as SiteDesignContextSchema,cy as SiteDesignDensitySchema,my as SiteDesignMotionLevelSchema,Zn as SiteEditBoundaryKindSchema,t_ as SiteEditCapabilityConstraintSchema,Jg as SiteEditCapabilityModeSchema,Qn as SiteEditCapabilityModeViewSchema,T1 as SiteEditCapabilityReadRequestSchema,jd as SiteEditClassNameSourceDiagnosticSchema,Qe as SiteEditClassNameSourceRangeSchema,Ko as SiteEditClassNameSourceSchema,$R as SiteEditClassNameSourceStyleContextSchema,zo as SiteEditClassNameSourceStylesheetSchema,ss as SiteEditClassNameSourceWriteIntentSchema,KR as SiteEditCommandDiagnosticSchema,Cd as SiteEditCommandErrorSchema,U as SiteEditCompositionContextSchema,ae as SiteEditCompositionSelectorSchema,e_ as SiteEditConstraintKindSchema,xu as SiteEditDeletePageSourceOutputSchema,k_ as SiteEditDynamicConfidenceSchema,P_ as SiteEditDynamicDataBindingSchema,Or as SiteEditDynamicDataDetailSchema,Nr as SiteEditDynamicDataSummarySchema,A_ as SiteEditDynamicEvidenceSchema,jr as SiteEditDynamicSourceKindSchema,R_ as SiteEditDynamicSourceTypeSchema,T_ as SiteEditDynamicTargetKindSchema,Es as SiteEditEffectiveWriteTargetSchema,D1 as SiteEditEventSchema,ti as SiteEditExternalSourceKindSchema,ZR as SiteEditGetClassNameSourceCommandResultSchema,XR as SiteEditGetClassNameSourceInputSchema,QR as SiteEditGetClassNameSourceResultSchema,g0 as SiteEditGetDocumentInputSchema,_0 as SiteEditGetObjectEditContextInputSchema,RI as SiteEditGetSourceFileInputSchema,II as SiteEditGetSourceTreeInputSchema,YR as SiteEditGetStyleContextInputSchema,ei as SiteEditHistoryProvenanceSchema,o_ as SiteEditHistoryReadOnlyRecoveryStatusSchema,n_ as SiteEditHistoryRecoveryCodeSchema,i_ as SiteEditHistoryRecoveryDiagnosticSchema,U1 as SiteEditHistoryResultSchema,M1 as SiteEditHistoryStatusModeSchema,c_ as SiteEditHistoryStatusSchema,s_ as SiteEditHistoryUnavailableReasonSchema,r_ as SiteEditHistoryUnavailableStatusSchema,a_ as SiteEditHistoryWritableStatusSchema,v0 as SiteEditInitializeSessionInputSchema,fu as SiteEditInsertNodeSpecSchema,yu as SiteEditInsertPageResourceOutputSchema,ed as SiteEditMaterializationDataRequirementsSchema,Jp as SiteEditMaterializationEntrySchema,Zp as SiteEditMaterializationExportSchema,Qp as SiteEditMaterializationFileSchema,lo as SiteEditMaterializationPathTemplateSchema,bt as SiteEditMaterializationSchema,ar as SiteEditMaterializedComponentNodeSpecSchema,tr as SiteEditMoveTargetSchema,Jt as SiteEditMutationContextSchema,Jn as SiteEditNodeCapabilitySnapshotSchema,S0 as SiteEditObjectCapabilitiesSchema,b0 as SiteEditObjectDetailSchema,x0 as SiteEditObjectEditContextSchema,E0 as SiteEditObjectStyleDetailSchema,y0 as SiteEditObjectSummarySchema,NT as SiteEditOperationCommandResultSchema,or as SiteEditOperationErrorCodeSchema,rr as SiteEditOperationErrorSchema,Eu as SiteEditOperationOutputSchema,bu as SiteEditOperationParamsSchema,cs as SiteEditOperationPayloadSchema,rs as SiteEditOperationRequestSchema,Su as SiteEditOperationResultTargetSchema,jt as SiteEditOperationSelectionRefSchema,I_ as SiteEditOperationSummarySchema,hu as SiteEditOperationTargetSchema,nn as SiteEditOperationTypeSchema,Et as SiteEditOperationValueSchema,yT as SiteEditPageCompositionAnyVersionSchema,eu as SiteEditPageCompositionAtomicKindSchema,su as SiteEditPageCompositionBoundaryModeSchema,Vd as SiteEditPageCompositionBusinessMemberSchema,Bd as SiteEditPageCompositionContainerSchema,tn as SiteEditPageCompositionDiagnosticSchema,Kn as SiteEditPageCompositionErrorCodeSchema,Yo as SiteEditPageCompositionPlacementTargetSchema,Hd as SiteEditPageCompositionPlacementUnitSchema,Zd as SiteEditPageCompositionRuntimeRefSchema,Qd as SiteEditPageCompositionSchema,Jd as SiteEditPageCompositionSourceMemberKindSchema,Wd as SiteEditPageCompositionSourceMemberSchema,Jo as SiteEditPageCompositionSourceRangeSchema,Yd as SiteEditPageCompositionSupportedSchema,Xd as SiteEditPageCompositionUnsupportedSchema,iu as SiteEditPageCompositionV2BusinessMemberSchema,tu as SiteEditPageCompositionV2ContainerSchema,ou as SiteEditPageCompositionV2PlacementRelationSchema,cu as SiteEditPageCompositionV2PlacementSchema,au as SiteEditPageCompositionV2PlacementUnitSchema,du as SiteEditPageCompositionV2Schema,nu as SiteEditPageCompositionV2SourceMemberSchema,lu as SiteEditPageCompositionV2SupportedSchema,pu as SiteEditPageCompositionV2UnsupportedSchema,ru as SiteEditPageCompositionV2WriteModeSchema,mu as SiteEditPageCompositionVisualAnchorSchema,$d as SiteEditPagePlacementOptionSchema,$o as SiteEditPagePlacementSchema,Qo as SiteEditPageUnitResultTargetSchema,Xo as SiteEditPageUnitTargetSchema,h_ as SiteEditPatchPlanPatchSchema,$1 as SiteEditPatchPlanSchema,Is as SiteEditPropertiesSchema,Fd as SiteEditPropertyChangeSchema,u_ as SiteEditPropertyCreationSchema,p_ as SiteEditPropertyItemSchema,m_ as SiteEditPropertyResolutionSchema,l_ as SiteEditPropertySourceSchema,d_ as SiteEditPropertySpreadSchema,mn as SiteEditProvenanceChainSchema,C_ as SiteEditProvenanceHopSchema,h0 as SiteEditRenderDocumentSchema,cn as SiteEditRenderEntryRefSchema,w_ as SiteEditRenderEntrySchema,Dr as SiteEditRenderPageCompositionSchema,x_ as SiteEditRenderPageCompositionSupportedSchema,E_ as SiteEditRenderPageCompositionUnsupportedSchema,y_ as SiteEditRenderPagePlacementSchema,pT as SiteEditRequiredMutationContextEnvelopeSchema,kI as SiteEditResolveSourceLocationInputSchema,Mr as SiteEditSemanticSourceSchema,Wo as SiteEditSetPropsParamsSchema,OT as SiteEditSignedOperationRequestSchema,Fa as SiteEditSourceDeleteCapabilitySchema,Gl as SiteEditSourceDirectoryPathSchema,Vl as SiteEditSourceFileBinaryPreviewUnavailableReasonSchema,Hl as SiteEditSourceFileBinaryResponseSchema,xI as SiteEditSourceFileKindSchema,zl as SiteEditSourceFileListItemSchema,TI as SiteEditSourceFileResponseSchema,Wl as SiteEditSourceFileTextResponseSchema,os as SiteEditSourceIdentitySchema,$l as SiteEditSourceLocationRangeSchema,AI as SiteEditSourceLocationSchema,j_ as SiteEditSourceLocatorRangeSchema,ks as SiteEditSourceLocatorSchema,ge as SiteEditSourcePathSchema,Ga as SiteEditSourceTreeNodeSchema,EI as SiteEditSourceTreeResponseSchema,Kl as SiteEditSourceTreeTruncationReasonSchema,Bl as SiteEditSourceTreeTruncationSchema,sr as SiteEditStyleBreakpointSchema,Vo as SiteEditStyleDraftPropertySchema,f0 as SiteEditStyleModelSchema,nr as SiteEditStylePropertySchema,Ur as SiteEditStyleSourceSchema,ir as SiteEditStyleStateModeSchema,Ts as SiteEditTextSegmentSchema,Lr as SiteEditTextSourceSchema,v_ as SiteEditWriteTargetSchema,kE as SiteExtraRequirementResponseSchema,El as SiteExtraRequirementSchema,R as SiteIdSchema,_e as SiteLocaleSchema,Cj as SiteMediaIntentSchema,lE as SiteOperationLockIdSchema,Sh as SitePreviewActivateErrorCodeSchema,bh as SitePreviewActivateFailedSchema,fh as SitePreviewActivateReadySchema,wA as SitePreviewActivateResponseSchema,SC as SitePublishDomainCheckDataSchema,hC as SitePublishDomainCheckRequestSchema,fC as SitePublishDomainCheckResponseSchema,bC as SitePublishDomainOperationDataSchema,yC as SitePublishDomainOperationResponseSchema,xC as SitePublishDomainReconcileOperationResponseSchema,EC as SitePublishDomainRemediationConfirmRequestSchema,IC as SitePublishDomainRemediationConfirmResponseSchema,xi as SitePublishQualityTaskStatusSchema,Jv as SitePublishRepairInputItemSchema,db as SitePublishRepairResultItemSchema,rm as SitePublishRepairResultSchema,eC as SitePublishRepairTaskSnapshotSchema,am as SitePublishRepairTaskStatusSchema,sC as SitePublishWorkflowActiveResponseSchema,Ca as SitePublishWorkflowIdSchema,gb as SitePublishWorkflowMutationDataSchema,aC as SitePublishWorkflowMutationResponseSchema,_b as SitePublishWorkflowPublishDataSchema,oC as SitePublishWorkflowPublishResponseSchema,hb as SitePublishWorkflowQualityDataSchema,rC as SitePublishWorkflowQualityResponseSchema,dt as SitePublishWorkflowRecordSchema,iC as SitePublishWorkflowRevisionRequestSchema,ab as SitePublishWorkflowStatusSchema,ob as SitePublishWorkflowStepSchema,_t as SiteRecordSchema,dE as SiteTemplateUpgradeStateIdSchema,yO as SiteThreadListQuerySchema,xO as SiteThreadListResponseSchema,RO as SiteThreadResponseSchema,wa as SiteVersionIdSchema,hy as SiteVersionListItemSchema,Ai as SiteVersionRecordSchema,ze as SiteWorkflowIdSchema,Bu as SiteWorkflowRecordSchema,tk as SiteWorkflowSnapshotResponseSchema,us as SiteWorkflowSnapshotSchema,Lu as SiteWorkflowStatusSchema,Da as SiteWorkflowTaskRefIdSchema,nk as SiteWorkflowTaskRefResponseSchema,fr as SiteWorkflowTaskRefSchema,Gj as SitemapAddBlockInputSchema,xa as SitemapAnswerSchema,qj as SitemapChangeBlockVariantInputSchema,Zy as SitemapDeleteBlockInputSchema,Gy as SitemapDraftBlockSchema,zy as SitemapDraftPageSchema,px as SitemapDraftRecordSchema,xn as SitemapDraftSchema,Qy as SitemapEditActorSchema,tx as SitemapEditErrorCodeSchema,ix as SitemapEditFailureSchema,ex as SitemapEditOperationSchema,Kj as SitemapEditResultSchema,nx as SitemapEditSuccessSchema,Wj as SitemapGenerationInputSchema,cx as SitemapGenerationOutcomeSchema,mx as SitemapGenerationReasonSchema,el as SitemapGenerationStageSchema,Ce as SitemapIdSchema,sx as SitemapIntentPageSchema,Mj as SitemapModelOutputSchema,By as SitemapModelPageSchema,Uj as SitemapMoveBlockInputSchema,qy as SitemapNavigationHrefSchema,Re as SitemapNodeIdSchema,al as SitemapRecordSchema,Nj as SitemapResolverModelOutputSchema,Oj as SitemapResolverRequestSchema,Lj as SitemapResolverResponseSchema,Xy as SitemapResolverTargetsSchema,Jm as SitemapRunInputSchema,zt as SitemapSchema,Vy as SitemapSourceProvenanceSchema,Vj as SitemapStreamEventSchema,mv as SitemapTaskCreateRequestSchema,gv as SitemapTaskCreateResponseSchema,kf as SitemapTaskFailureErrorCodeSchema,_v as SitemapTaskResponseSchema,Jy as SitemapUpdateBlockInstructionInputSchema,Fj as SitemapUpdateBlockPropsInputSchema,Ry as SitemapUserChoiceSchema,Gt as SkillSelectionSchema,ky as SkillSelectionSourceSchema,dl as SnapshotContentHashSchema,ye as SnapshotFilePathSchema,T as SnapshotIdSchema,st as SnapshotRecordSchema,Fm as SnapshotStatusSchema,ra as StartGscAuthDataSchema,mm as StartGscAuthRequestSchema,lm as StartGscAuthResponseSchema,pk as StartSiteBuildRequestSchema,qA as StartSiteBuildResponseSchema,Th as StartSiteBuildResultSchema,tC as StartSitePublishWorkflowRequestSchema,_O as StartWorkspaceRunRequestSchema,hO as StartWorkspaceRunResponseSchema,fg as Step2FinalResultDataSourceSchema,$n as Step2FinalResultRequestSchema,wk as Step2FinalResultResponseSchema,Pk as Step2FinalResultSaveResponseSchema,Sg as Step2FinalResultSaveResultSchema,hs as Step2FinalResultTypeSchema,yg as Step2FinalResultViewSchema,Ir as Step2FinalScanCardKeySchema,Ss as Step2FinalScanCardSchema,hg as Step2FinalScanResultSchema,ln as Step2KnowledgeOpaqueIdSchema,VA as Step2KnowledgeScopeSchema,rt as Step2PageRoleSchema,Dk as Step2PageSelectionRequestSchema,jk as Step2PageSelectionResponseSchema,ug as Step2SiteInitializationCrawlerErrorCodeSchema,dg as Step2SiteInitializationStatusSchema,Ak as Step2SiteInitializationTaskResponseSchema,gg as Step2SiteInitializationTaskSchema,fs as Step3AgentAnalysisSchema,Ag as Step3AnalysisFindingSchema,Fk as Step3AnalysisJobResponseSchema,Ar as Step3AnalysisJobSchema,Tr as Step3AnalysisJobStatusSchema,Gk as Step3AnalysisLatestResponseSchema,Rr as Step3AnalysisProgressSchema,vg as Step3AnalysisResultSchema,qk as Step3AnalysisScheduleResponseSchema,kg as Step3AnalysisScheduleSchema,zk as Step3AnalysisSseFrameSchema,Mk as Step3AnalysisStartRequestSchema,kr as Step3AnalysisSummarySchema,Tg as Step3AnalystSchema,Uk as Step3AnalystsResponseSchema,Vk as Step4DiagnosisResponseSchema,Nn as Step5ActiveStrategyKeySchema,QI as Step5CommitStrategyRequestSchema,ZI as Step5CommitStrategyResponseSchema,Gp as Step5CommittedVersionSchema,ao as Step5DecisionCustomPayloadInputSchema,Mp as Step5DecisionCustomPayloadSchema,pp as Step5EvidenceReferenceSchema,kp as Step5GenerationStatusSchema,no as Step5GeoQuestionSchema,qp as Step5JobStatusSchema,Lp as Step5LegacyDecisionCustomPayloadInputSchema,Np as Step5LegacyDecisionCustomPayloadSchema,Dp as Step5LegacySeoKeywordInputSchema,so as Step5LegacySeoKeywordSchema,Un as Step5MarketCountrySchema,Mn as Step5MarketTypeSchema,zi as Step5OutputLocaleSchema,$I as Step5RegenerateItemRequestSchema,YI as Step5SaveDecisionRequestSchema,XI as Step5SaveDecisionResponseSchema,fp as Step5SemrushEmptyReasonCodeSchema,Sp as Step5SemrushIntentGroupSchema,Ep as Step5SemrushKeywordCandidateSchema,Ip as Step5SemrushKeywordCandidateSearchDataSchema,GI as Step5SemrushKeywordCandidateSearchRequestSchema,zI as Step5SemrushKeywordCandidateSearchResponseSchema,hp as Step5SemrushKeywordRecommendationSchema,Tp as Step5SemrushKeywordSelectionDataSchema,Rp as Step5SemrushKeywordSelectionItemSchema,KI as Step5SemrushKeywordSelectionRequestSchema,BI as Step5SemrushKeywordSelectionResponseSchema,_p as Step5SemrushRecommendationSeedSchema,yp as Step5SemrushRecommendationSnapshotSchema,dp as Step5SemrushRecommendationStatusSchema,Ja as Step5SemrushSearchIntentSchema,bp as Step5SemrushSelectionSummarySchema,jp as Step5SemrushSnapshotRefSchema,io as Step5SeoGeoPlanRowSchema,qn as Step5SeoKeywordSchema,Op as Step5SeoPayloadV2InputSchema,Bi as Step5SeoPayloadV2Schema,ax as Step5SitemapDecisionSchema,rx as Step5SitemapRunInputSchema,ox as Step5SitemapSourceSchema,Bj as Step5SitemapStartRequestSchema,VI as Step5StartStrategyRequestSchema,HI as Step5StartStrategyResponseSchema,Up as Step5StrategyDecisionInputSchema,Wi as Step5StrategyDecisionSchema,Ki as Step5StrategyItemSchema,oo as Step5StrategyJobSchema,Ln as Step5StrategyKeySchema,vt as Step5StrategyOptionIdSchema,Fi as Step5StrategyOptionSchema,mp as Step5StrategyPlanSchema,zp as Step5StrategySnapshotDataSchema,eR as Step5StrategySseFrameSchema,Fp as Step5StrategyVersionSnapshotSchema,lp as Step5StructureDetailSchema,Vh as Step6AiThemeCandidateSchema,oi as Step6ColorSeedsSchema,NP as Step6DesignAgentRecommendationsResponseSchema,PP as Step6DesignRecommendationGenerationInputSchema,Us as Step6DesignRecommendationModelOutputSchema,Hh as Step6DesignRecommendationSchema,RP as Step6DesignRecommendationsRequestSchema,TP as Step6DesignRecommendationsResponseSchema,pc as Step6DesignSelectionSchema,lc as Step6GeneratedThemeCardSchema,Xh as Step6GptDesignRecommendationModelOutputSchema,K0 as SubsiteGlossariesSchema,X_ as SubsiteGlossaryEntrySchema,ni as SubsiteHexColorSchema,oA as SubsiteMountPathSchema,W0 as SubsitePaletteLocalizationSchema,Q_ as SubsitePaletteModeSchema,Z_ as SubsitePaletteSeedsSchema,B0 as SubsiteSiteInfoSchema,X0 as SubsiteSyncDiffComputeRequestSchema,Q0 as SubsiteSyncDiffComputeResponseSchema,nh as SubsiteSyncDiffErrorCodeSchema,Z0 as SubsiteSyncDiffErrorResponseSchema,nA as SubsiteVisibleTextExportRequestSchema,iA as SubsiteVisibleTextExportResponseSchema,Du as TASK_EXECUTION_STATUSES,hr as TASK_EXECUTION_STATUS_CODES,rj as TEMPLATE_UPGRADE_LOCK_LOST_ERROR_CODE,Ls as THEME_PRESETS,sc as THEME_PRESET_IDS,dr as TaskExecutionStatusSchema,gh as TemplateUpgradeCasOutcomeSchema,Gr as TemplateUpgradeErrorCodeSchema,_h as TemplateUpgradeOutcomeCountsSchema,dh as TemplateUpgradeOutcomeSchema,hh as TemplateUpgradeSnapshotDeletionCandidateSchema,Lt as TemplateUpgradeStateSchema,ch as TemplateUpgradeStatusSchema,uh as TemplateUpgradeValidationStageSchema,qe as TemplateVersionSchema,ij as TryAcquireTemplateUpgradeLockRequestSchema,sj as TryAcquireTemplateUpgradeLockResponseSchema,wm as UnsplashDownloadLocationSchema,Pm as UnsplashMediaAssetSchema,wD as UpdateBriefRequestSchema,KD as UpdateBriefResponseSchema,tO as UpdateClarifyArchetypeRequestSchema,XD as UpdateCurrentSnapshotManifestRequestSchema,AR as UpdatePageDirectoryReconcileStateRequestSchema,nC as UpdateSitePublishWorkflowStepRequestSchema,PD as UpdateSiteRequestSchema,IO as UpdateSiteThreadRequestSchema,sk as UpdateSiteWorkflowWebsiteRequestSchema,kP as UpdateStep6DesignSelectionRequestSchema,AP as UpdateStep6DesignSelectionResponseSchema,ck as UpdateWorkflowTaskStatusRequestSchema,Wb as UploadMediaLibraryAssetResponseSchema,Kv as UpstreamPromptTemplateCatalogDataSchema,zv as UpstreamPromptTemplateConsumeDataSchema,_f as UrlListCrawlerTaskCreateRequestSchema,uE as UsageRecordIdSchema,Jb as UseUnsplashMediaRequestSchema,ey as UseUnsplashMediaResponseSchema,wi as UserIdSchema,Cb as VCP_GSC_STATES,oa as VcpGscStateSchema,cb as VcpQualityRemediationItemSchema,sm as VcpQualityResultSchema,da as VisualHintsSchema,Iy as VisualThemeSchema,ek as WORKFLOW_DEFINITIONS_V1,ds as WORKFLOW_DEFINITION_REGISTRY,wu as WORKFLOW_FLOW_TYPES,Mu as WORKFLOW_MENU_STATES,vu as WORKFLOW_NODE_CODES,Cu as WORKFLOW_TASK_TYPES,wO as WORKSPACE_WEBSOCKET_CONTRACT,lr as WorkflowClientCapabilitiesSchema,Sr as WorkflowDefinitionVersionSchema,Bn as WorkflowFlowTypeSchema,Ku as WorkflowMenuItemSchema,Uu as WorkflowMenuStateSchema,sn as WorkflowNodeCodeSchema,pr as WorkflowTaskTypeSchema,Mx as WorkspaceClientMessageSchema,sy as WorkspaceDesignApplyRequestSchema,ay as WorkspaceDesignApplyResponseSchema,Ia as WorkspaceDiagnosticSchema,Vx as WorkspaceDirectEditFileSchema,Wx as WorkspaceDirectEditPathSchema,hl as WorkspaceDirectEditPostActionSchema,DO as WorkspaceDirectEditRequestSchema,OO as WorkspaceDirectEditResponseSchema,Ra as WorkspaceExecutionDiagnosticsSchema,sO as WorkspaceExecutionPlanSchema,Bx as WorkspaceMediaRequestSchema,Aa as WorkspacePlanDependencySchema,cl as WorkspacePlanSummarySchema,yx as WorkspacePlanTaskKindSchema,ka as WorkspacePlanTaskSchema,Ru as WorkspaceResourceKindSchema,ku as WorkspaceResourceNavigationSelectionSchema,mr as WorkspaceResourceOperationClientMessageSchema,Tu as WorkspaceResourceOperationSummarySchema,Au as WorkspaceResourceOperationTransientInputSchema,Pi as WorkspaceRunKindSchema,Lx as WorkspaceSelectedComponentSchema,qx as WorkspaceServerMessageSchema,zj as WorkspaceSitemapEditRequestSchema,Nx as WorkspaceSocketDescriptorSchema,Zx as WorkspaceSourceFileBinaryResponseSchema,Xx as WorkspaceSourceFileKindSchema,fl as WorkspaceSourceFileListItemSchema,NO as WorkspaceSourceFilePathQuerySchema,LO as WorkspaceSourceFileResponseSchema,Qx as WorkspaceSourceFileTextResponseSchema,Sl as WorkspaceSourcePathSchema,gx as WorkspaceSuggestionSchema,ol as WorkspaceSuggestionsSchema,_x as WorkspaceSuggestionsSourceSchema,ml as WorkspaceTaskCountsSchema,PO as WorkspaceWebSocketMessageSchema,AO as WorkspaceWebSocketMessageTypeSchema,Ta as WorkspaceWorkerGroupSchema,Ea as WorkspaceWorkerPhaseSchema,aO as WorkspaceWorkerResultSchema,kt as WorkspaceWorkerStatusSchema,tw as applicationTemplateCatalogDataSchema,ew as applicationTemplateConsumeDataSchema,JP as applicationTemplateV1Schema,e1 as assertDeploymentTransition,hk as assertSiteBuildStatusTransition,_k as assertTaskExecutionStatusTransition,zC as buildE2bBrowserPreviewUrl,cC as buildFinalSitePublishQualityResult,wP as buildStep6FallbackThemeCards,Js as canonicalizeFormDesignJson,Bv as canonicalizeLauncherPromptTemplateOperation,Fo as canonicalizePageSlug,as as classifySiteEditPropertyName,fR as cmsPagePreviewUrlPath,iR as compareTemplateVersions,X1 as composeSiteEditRepeatInstanceKey,Uw as computeFormDesignOperationFingerprint,Ni as computeSiteEditCompositionKey,Kd as computeSiteEditSourceIdentityKey,In as containsSensitiveData,Dd as createSiteEditCommandFailureSchema,Go as createSiteEditCommandResultSchema,is as createSiteEditCommandSuccessSchema,CP as defaultStep6Selection,Ob as deriveVcpGscState,Nb as doesGscPropertyMatchDomain,Yu as findWorkflowDefinition,$u as findWorkflowDefinitionInRegistry,Cs as fontStack,JS as formDesignOperationFingerprintInput,t1 as getDeploymentHappyPathTransitions,Zk as getDeploymentTransitionPredecessors,Qk as getDeploymentTransitionTargets,ec as getFontPairing,ic as getMotionPreset,rc as getSiteDesignThemeRadius,Ui as getSiteEditSourceDeleteProtectionReason,Sb as getSitePublishRepairItems,uP as getThemePreset,Xu as getWorkflowDefinition,uk as getWorkflowNodeIndex,bE as hasAnyBusinessFact,H0 as hasLockedSeeds,Mw as hashAffectedFormDesignFiles,Lw as hashCmsFormSchemaProjection,gi as hashFormDesignJson,Nw as hashFormSpec,Uo as isCanonicalPageSlug,yh as isCmsMainProductsWithinLimit,SR as isCmsPageSelectable,So as isCmsTemplateUrlPath,YE as isConsentGranted,Vg as isDeploymentActiveStatus,Jk as isDeploymentTerminalStatus,W_ as isExactEditEngineVersion,OE as isExternalSiteEditInfrastructureReason,yw as isFormSpecLocalizableFieldPath,JI as isKnownStep5SseEventName,_1 as isMigrationProductsPresetBlockLabel,g1 as isMigrationProductsPresetPageTitle,OI as isNonLatinSiteLocale,Qw as isPlatformMaterializedFile,rh as isReservedSubsiteMountSegment,Xl as isSiteEditDesignDocumentPath,Xp as isSiteEditMaterializationPathTemplate,G_ as isSiteEditRuntimeContainerTag,z_ as isSiteEditRuntimeTextTag,R0 as isSiteEditRuntimeVoidElementTag,PI as isSiteEditSourceDeleteProtectedPath,Yl as isSiteEditSourceDirectoryPath,za as isSiteEditSourcePath,Mi as isSiteEditTextSourcePath,fb as isSitePublishRepairResultSuccessful,Vw as isSiteStructureKnownFieldPath,Ww as isSiteStructureLocalizableFieldPath,eo as isStep5SeoAllowedIntentCode,gk as isWorkflowTaskTypeForNode,f_ as makeSiteEditRepeatInstanceKey,u1 as migrationProductsCopyForLocale,mw as normalizeCmsApplicationSlug,iv as normalizeCmsPublicApiBase,kc as normalizeFormOptionLabelIdentity,En as normalizeGscDomain,ro as normalizeStep5SeoKeyword,vd as pageSlugToRouteFilePath,bR as parseCmsPageDirectory,a1 as parseComponentI18nResourcesJson,Lb as parseE2bPreviewProxyDomain,V_ as parseExactEditEngineVersion,SI as parseSiteEditCompositionKey,b_ as parseSiteEditRepeatInstanceKey,gT as parseSiteEditSourceIdentityKey,kw as projectFormSpecToCmsSchema,Mb as reconcileSitemapNavigation,Dh as resolveFont,Oh as resolveFontDisplayName,Tw as resolveFormTemplateText,dk as resolvePublishedWorkflowDefinition,vE as resolveRedisConnectionConfig,q0 as resolveRequestedEditEngineVersion,Ha as resolveSelectableSiteLocale,T0 as resolveSiteEditRuntimeOperationSummary,jI as resolveSiteLocaleFromIso6393,DI as resolveSiteTextDirection,$h as resolveStep6RadiusId,F0 as resolveSystemCurrentEditEngineVersion,Qu as selectPublishedWorkflowDefinition,nI as selectReferenceVisualImage,VT as siteBuildStatusFromCode,XT as siteBuildStatusToCode,HT as siteDeploymentStatusFromCode,QT as siteDeploymentStatusToCode,Fh as siteFontVariables,$T as siteWorkflowStatusFromCode,ZT as siteWorkflowStatusToCode,Y_ as splitSubsiteGlossaryEntry,Yh as step6GptVisualIdentity,Q1 as stripSiteEditRepeatInstanceKeys,YT as taskExecutionStatusFromCode,JT as taskExecutionStatusToCode,vP as toStep6GenerationVisualHints,qo as tryCanonicalizeAsciiPageSlug,vr as validateComponentI18nResources,xw as validateFormSpecIdentityTransition};
1
+ import{z as t}from"zod";import{z as le}from"zod";import{z as jl}from"zod";var W=jl.uuidv7(),bE=W,yE=W,xE=W,EE=W,IE=W,RE=W,TE=W,R=W,vt=W,Na=W,Ce=W,ji=W,T=W,La=W,H=W,Ma=W,Ke=W,vn=W,Xe=W,kE=W,AE=W,Ua=W,ze=W,qa=W,wE=W,PE=W,vE=W,yt=W,CE=W,DE=W,jE=W;var je=le.string().min(1).max(191).refine(e=>{if(/[^\x20-\x7e\xa0-\xff]/.test(e)||e.startsWith(" ")||e.endsWith(" ")||new TextEncoder().encode(e).length>191)return!1;try{return new Headers({"x-template-id":e}).get("x-template-id")===e}catch{return!1}},{message:"template_id must round-trip through HTTP headers and fit a 255-byte base64url filename"}),$t=le.string().min(1).refine(e=>e.startsWith("/")&&!e.startsWith("//")&&!/[?#\\\x00-\x20\x7f]/.test(e)&&!e.startsWith("/.vcp")&&!e.split("/").some(n=>{try{let i=decodeURIComponent(n);return i==="."||i===".."||/[/\\\x00-\x1f\x7f]/.test(i)||i.startsWith(".vcp")}catch{return!0}}),{message:"page_path must start with / and must not contain ? or #"});function Fa(e){let n=/^(?:src\/)?app\/\.vcp\/page-templates\/(.+)\/page\.tsx$/.exec(e);if(!n)return!1;let i=n[1].split("/"),s=i.pop();if(!/^[A-Za-z0-9_-]{1,255}$/.test(s)||!$t.safeParse(`/${i.join("/")}`).success||i.some(a=>!a||/[\[\]()%]/.test(a)||a.startsWith("_")||a.startsWith("@")))return!1;try{let a=atob(s.replace(/-/g,"+").replace(/_/g,"/")),r=Uint8Array.from(a,c=>c.charCodeAt(0)),u=new TextDecoder("utf-8",{fatal:!0}).decode(r);return je.safeParse(u).success&&btoa(String.fromCharCode(...new TextEncoder().encode(u))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")===s}catch{return!1}}var ME=le.object({page_path:$t,template_id:je,instruction:le.string().min(1).refine(e=>e.trim().length>0)}).strict(),Ga=e=>[...new Set(e)],UE=le.object({page_path:$t,template_id:je,exit_template_ids:le.array(je).default([]).transform(Ga)}).strict().refine(e=>!e.exit_template_ids.includes(e.template_id),{path:["exit_template_ids"],message:"exit_template_ids must not contain the promoted template"}),qE=le.object({page_path:$t,template_ids:le.array(je).min(1).transform(Ga)}).strict(),Oi={ok:le.literal(!0),site_id:R,page_path:$t,route_id:le.string().min(1),snapshot_id:T},FE=le.object({...Oi,template_id:je,status:le.literal("created")}).strict(),GE=le.object({...Oi,promoted_template_id:je,deleted_template_ids:le.array(je),status:le.literal("promoted")}).strict(),KE=le.object({...Oi,deleted_template_ids:le.array(je),status:le.literal("cleaned")}).strict(),zE=le.enum(["PAGE_TEMPLATE_REQUEST_INVALID","PAGE_TEMPLATE_PAGE_NOT_FOUND","PAGE_TEMPLATE_NOT_FOUND","PAGE_TEMPLATE_ALREADY_EXISTS","PAGE_TEMPLATE_ID_COLLISION","PAGE_TEMPLATE_MANAGED_SOURCE_INVALID","PAGE_TEMPLATE_SNAPSHOT_CONFLICT","PAGE_TEMPLATE_DYNAMIC_ROUTE_UNSUPPORTED","PAGE_TEMPLATE_SOURCE_UNSUPPORTED","PAGE_TEMPLATE_GENERATION_FAILED","PAGE_TEMPLATE_PATCH_FAILED"]);import{z as Cn}from"zod";var Ka=Cn.object({primary_products:Cn.string().trim().min(1).max(1e3).optional(),current_markets:Cn.string().trim().min(1).max(1e3).optional(),qualifications:Cn.string().trim().min(1).max(1e3).optional()}).strict();function VE(e){return Object.values(e).some(n=>typeof n=="string"&&n.trim().length>0)}import{z as Yt}from"zod";import{z as Ni}from"zod";var M=e=>Ni.object({code:Ni.number().int(),data:e,message:Ni.string()});var Ct=2e3,Ol=Yt.object({note:Yt.string().trim().max(Ct),updated_at:Yt.string().min(1)}).strict(),ZE=Yt.object({note:Yt.string().trim().max(Ct)}).strict(),JE=M(Ol.nullable());import{z as Xt}from"zod";var Nl=40,xt=Xt.object({protocol:Xt.enum(["phone","form","download","route","external"]),ctaLabel:Xt.string().min(1).max(Nl),ctaTarget:Xt.string().min(1).max(200).optional(),requiresOwnerDetail:Xt.boolean().optional()});var Dt=["queued","preparing_source","building","artifact_ready","deploying","released","lock_failed","source_prepare_failed","build_failed","artifact_fetch_failed","artifact_validation_failed","deploy_failed","cleanup_failed"];function iI(e){let n=e.VCP_REDIS_URL??e.REDIS_URL;if(n){let i=new URL(n);return{url:n,host:i.hostname,port:i.port?Number(i.port):6379,password:i.password?decodeURIComponent(i.password):void 0}}return{host:e.VCP_REDIS_HOST??"127.0.0.1",port:Ll(e.VCP_REDIS_PORT,56379)}}function Ll(e,n){if(!e)return n;let i=Number(e);return Number.isInteger(i)&&i>0?i:n}import{z as Q}from"zod";var Ba=W,za=200,Ml=4e3,Wa=Q.enum(["succeeded","degraded","no_changes","failed"]),Qt=Q.enum(["typecheck_unresolved","step_cap_reached","partial_apply_gave_up","patch_protected_dropped","preview_build_failed","preview_runtime_degraded","build_not_verified","external_blocked","cms_reconcile_failed","run_expired","sandbox_unavailable"]),Ul=["sandbox_unavailable"];function rI(e){return e!=null&&Ul.includes(e)}var ql=Q.enum(["pending","delivered","failed"]),Fl=Q.enum(["running","succeeded","degraded","no_changes","failed"]),cI=Q.object({site_id:R,external_run_id:Q.string().min(1).max(za),external_thread_id:Q.string().min(1).max(za),prompt:Q.string().min(1).max(Ml),thread_title:Q.string().trim().min(1).max(200).optional()}).strict(),Va=Q.object({id:Ba,site_id:R,external_run_id:Q.string().min(1),external_thread_id:Q.string().min(1),status:Fl,outcome:Wa.nullable(),degraded_reason:Qt.nullable(),vcp_run_id:H.nullable(),vcp_thread_id:Ke.nullable(),base_snapshot_id:T,snapshot_id:T.nullable(),preview_url:Q.string().url().nullable(),summary:Q.string().nullable(),error_code:Q.string().nullable(),build_verified:Q.boolean().nullable(),callback_status:ql,created_at:Q.string().min(1),started_at:Q.string().min(1).nullable(),finished_at:Q.string().min(1).nullable()}).strict(),mI=Q.object({task:Va}).strict(),lI=Q.object({task:Va}).strict(),pI=Q.object({task_id:Ba,external_run_id:Q.string().min(1),external_thread_id:Q.string().min(1),site_id:R,vcp_run_id:H.nullable(),outcome:Wa,degraded_reason:Qt.nullable(),snapshot_id:T.nullable(),preview_url:Q.string().url().nullable(),summary:Q.string().nullable(),error_code:Q.string().nullable(),build_verified:Q.boolean().nullable(),retryable:Q.boolean(),finished_at:Q.string().min(1)}).strict(),dI=Q.object({received:Q.literal(!0)}).strict();import{z as O}from"zod";var Li=O.enum(["text","url","document","image"]),Mi=O.enum(["pending","ready","failed"]),Gl=O.enum(["pending","ready","failed"]),Kl=O.enum(["product","price","contact","copy","audience","other"]),Dn=O.object({fact:O.string().min(1).max(300),kind:Kl,source_id:yt,quote:O.string().min(1).max(500),trust:O.enum(["verbatim","ocr"]).default("verbatim")}),zl=O.object({page_type:O.string().min(1).max(40),sections:O.array(O.string().min(1).max(40)).max(12)}),jn=O.object({source_id:yt,nav_structure:O.array(O.string().min(1).max(30)).max(12),page_patterns:O.array(zl).max(10),tone:O.array(O.string().min(1).max(20)).max(8),screenshot_ref:O.string().optional()}),Bl=O.object({source_id:yt,type:Li,status:Mi,title:O.string().max(120).optional(),original_ref:O.string().min(1),source_metadata:O.record(O.string(),O.unknown()),error_code:O.string().optional(),submitted:O.boolean().optional()}),On=O.object({topic:O.string().min(1).max(80),variants:O.array(O.object({value:O.string().min(1).max(300),source_id:yt})).min(2)}),Wl=O.object({type:O.literal("text"),content:O.string().min(20).max(1e4),title:O.string().min(1).max(120).optional()}).strict(),Vl=O.object({type:O.literal("url"),url:O.string().url().max(2048),rights_ack:O.boolean().optional(),title:O.string().min(1).max(120).optional()}).strict(),hI=O.discriminatedUnion("type",[Wl,Vl]),SI=[".docx",".html",".md",".txt"],fI=["application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/html","text/markdown","text/x-markdown","text/plain","application/octet-stream"],bI=10*1024*1024,yI=2,xI=O.object({consent_cross_border:O.union([O.literal(!0),O.literal("true")]),consent_text_version:O.string().min(1).max(120),title:O.string().min(1).max(120).optional()}).strict();function EI(e){return e===!0||e==="true"}var II=[".png",".jpg",".jpeg",".webp"],RI=["image/png","image/jpeg","image/webp","application/octet-stream"],TI=8*1024*1024,kI=10,Hl=O.enum(["asset","reference"]),AI=O.object({image_role:Hl,title:O.string().min(1).max(120).optional()}).strict(),wI=O.object({version:O.literal(1),site_id:R,tenant_id:O.string().min(1),user_prompt:O.string(),status:Gl,sources:O.array(Bl).max(16),facts:O.array(Dn).max(120),reference:jn.optional(),conflicts:O.array(On).max(20)}).superRefine((e,n)=>{let i=new Map(e.sources.map(s=>[s.source_id,s]));for(let[s,a]of e.facts.entries()){let r=i.get(a.source_id);(!r||r.type==="url")&&n.addIssue({code:"custom",path:["facts",s,"source_id"],message:"facts must reference a text/document/image source (never url)"})}if(e.reference){let s=i.get(e.reference.source_id),a=s?.type==="image"&&s.source_metadata.image_role==="reference";(!s||s.type!=="url"&&!a)&&n.addIssue({code:"custom",path:["reference","source_id"],message:"reference must point at a url source or reference image source"})}});function PI(e){for(let n of e.sources)if(n.type==="image"&&n.status==="ready"&&n.source_metadata?.image_role==="reference")return{source_id:n.source_id};return e.reference?.screenshot_ref?{source_id:e.reference.source_id}:null}import{z as D}from"zod";import{z as Nn}from"zod";var ae=Nn.object({routeId:Nn.string().min(1),templateId:je.optional()}).strict(),U=Nn.object({routeId:Nn.string().min(1),effectiveTemplateId:je.optional()}).strict();function Ui(e){return JSON.stringify([e.routeId,e.effectiveTemplateId??null])}function jI(e){let n;try{n=JSON.parse(e)}catch{return null}if(!Array.isArray(n)||n.length!==2)return null;let[i,s]=n,a=U.safeParse(s===null?{routeId:i}:{routeId:i,effectiveTemplateId:s});return a.success?a.data:null}var $l=["design.md","DESIGN.md"],Ha=["components/site","src/components/site","lib/generated","src/lib/generated","public"],Yl=["app/globals.css","src/app/globals.css"],Xl=[".cjs",".css",".cts",".html",".js",".json",".jsx",".md",".mdx",".mjs",".mts",".ts",".tsx",".txt",".yaml",".yml"],Ql=new Set(Xl),qi="source-delete",$a=D.literal(qi),_e=D.string().min(1).refine(Xa,"Invalid site edit source path"),Zl=D.string().min(1).refine(op,"Invalid site edit source directory path"),MI=D.enum(["text","binary"]),Ln=D.object({composition:U,path:_e,language:D.string().min(1).nullable(),sizeBytes:D.number().int().nonnegative(),contentHash:D.string().min(1).optional()}).strict(),Jl=D.discriminatedUnion("kind",[Ln.extend({kind:D.literal("text"),language:D.string().min(1),readonly:D.boolean().default(!1)}),Ln.extend({kind:D.literal("binary"),language:D.null(),mimeType:D.string().min(1).optional(),readonly:D.literal(!0)})]),Ya=D.lazy(()=>D.discriminatedUnion("kind",[D.object({kind:D.literal("directory"),name:D.string().min(1),path:Zl,children:D.array(Ya)}),D.object({kind:D.literal("file"),name:D.string().min(1),path:_e,file:Jl}).superRefine((e,n)=>{e.path!==e.file.path&&n.addIssue({code:"custom",path:["file","path"],message:"file.path must match node path"})})])),ep=D.enum(["max-files","max-depth","max-total-bytes"]),tp=D.object({reasons:D.array(ep).min(1),maxFiles:D.number().int().positive(),maxDepth:D.number().int().positive(),maxTotalBytes:D.number().int().positive()}),UI=D.object({composition:U,nodes:D.array(Ya),defaultPath:_e.optional(),totalFiles:D.number().int().nonnegative(),truncated:tp.optional()}).strict(),qI=D.object({composition:ae}).strict(),FI=D.object({path:_e,composition:ae}).strict(),np=Ln.extend({kind:D.literal("text"),language:D.string().min(1),readonly:D.boolean().default(!1),content:D.string()}),ip=D.enum(["too-large","unsupported-mime","bytes-unavailable"]),sp=Ln.extend({kind:D.literal("binary"),language:D.null(),readonly:D.literal(!0),mimeType:D.string().min(1),contentBase64:D.string().min(1).optional(),previewUnavailableReason:ip.optional()}),GI=D.discriminatedUnion("kind",[np,sp]),KI=D.object({key:D.string().min(1),composition:ae}).strict(),ap=D.object({startLine:D.number().int().positive(),startColumn:D.number().int().nonnegative(),endLine:D.number().int().positive(),endColumn:D.number().int().nonnegative()}),zI=D.object({key:D.string().min(1),composition:U,sourceFile:_e,componentName:D.string().min(1),openingElementRange:ap,structuralPath:D.string().min(1),textPreview:D.string().min(1).optional()}).strict();function Xa(e){return!eo(e)||Ja(e)?!1:Ki(e)||Za(e)||Qa(e)||Ha.some(n=>e===n||e.startsWith(`${n}/`))}function Fi(e){return Ki(e)||Ql.has(cp(e))}function op(e){return!eo(e)||Ja(e)?!1:e==="app"||e.startsWith("app/")||e==="src"||e==="src/app"||e.startsWith("src/app/")||Ha.some(n=>e===n||e.startsWith(`${n}/`)||n.startsWith(`${e}/`))}function rp(e){return Ki(e)}function Gi(e){return Xa(e)?rp(e)?"design-document":Qa(e)?"route-entry":Za(e)?"app-global-style":e.toLowerCase()==="lib/generated/media-assets.ts"||e.toLowerCase()==="src/lib/generated/media-assets.ts"?"generated-media-manifest":null:null}function BI(e){return Gi(e)!==null}function Qa(e){return/^(?:src\/)?app\/(?:.*\/)?page\.[cm]?[jt]sx?$/.test(e.toLowerCase())}function Za(e){return Yl.some(n=>n.toLowerCase()===e.toLowerCase())}function cp(e){let n=e.split("/").at(-1)??e,i=n.lastIndexOf(".");return i>0?n.slice(i).toLowerCase():""}function Ki(e){return!e.includes("/")&&$l.some(n=>n.toLowerCase()===e.toLowerCase())}function Ja(e){let n=e.toLowerCase(),i=n.split("/"),a=(i.at(-1)??n).replace(/\.[^.]+$/,"");return/^(?:src\/)?app\/api(?:\/|$)/.test(n)||/^(?:src\/)?app\/(?:.*\/)?route\.[cm]?[jt]sx?$/.test(n)||/^(?:src\/)?app\/(?:.*\/)?(?:action|actions)\.[cm]?[jt]sx?$/.test(n)||/(^|\/)[^/]+\.server\.[cm]?[jt]sx?$/.test(n)||n==="lib/server"||n.startsWith("lib/server")||n==="src/lib/server"||n.startsWith("src/lib/server")||n==="lib/db"||n.startsWith("lib/db")||n==="src/lib/db"||n.startsWith("src/lib/db")||n==="lib/cms"||n.startsWith("lib/cms/")||n==="src/lib/cms"||n.startsWith("src/lib/cms/")?!0:a==="server"||a==="db"||a==="database"||a==="auth"||a==="secret"||a==="secrets"||a==="token"||a==="tokens"||a==="credential"||a==="credentials"||i.includes("server")||i.includes("secrets")}function eo(e){return!e||e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(n=>!(n.length===0||n==="."||n===".."||n.startsWith(".")||n==="package.json"||n==="node_modules"||n==="recipes"||n.startsWith(".env")))}import{z as mp}from"zod";var Zt=["zh-CN","zh-HK","zh-TW","en-US","en-GB","ja-JP","ko-KR","es-ES","fr-FR","de-DE","pt-PT","ru-RU","ar-SA","id-ID","vi-VN","th-TH","it-IT","nl-NL","tr-TR","pl-PL","uk-UA","cs-CZ","sk-SK","hu-HU","ro-RO","el-GR","sv-SE","da-DK","fi-FI","hr-HR","lt-LT","lv-LV","et-EE","ga-IE","mt-MT","ka-GE","fa-IR","bn-BD","ta-IN","si-LK","ms-MY","fil-PH","my-MM","km-KH","lo-LA","mn-MN","kk-KZ"],lp=["en","ja","es","fr","de","ko","pt","pt-BR","it","ru","ar","hi","id","vi","th","tr","nl","pl","uk","sv","da","fi","no","cs","el","hu","ro","he","ms","fil","bn","ta","ca","sk","hr","bg","lt","lv","et","fa","sw","sr","is"],pp=[...Zt,...lp],dp=new Set(["ar","fa","he"]),HI=[{code:"zh-CN",label:"\u7B80\u4F53\u4E2D\u6587",englishName:"Chinese (Simplified)"},{code:"zh-HK",label:"\u7E41\u9AD4\u4E2D\u6587\uFF08\u9999\u6E2F\uFF09",englishName:"Chinese (Traditional, Hong Kong)"},{code:"zh-TW",label:"\u7E41\u9AD4\u4E2D\u6587\uFF08\u53F0\u7063\uFF09",englishName:"Chinese (Traditional, Taiwan)"},{code:"en-US",label:"English (US)",englishName:"English (United States)",common:!0},{code:"en-GB",label:"English (UK)",englishName:"English (United Kingdom)",common:!0},{code:"ja-JP",label:"\u65E5\u672C\u8A9E",englishName:"Japanese"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4",englishName:"Korean"},{code:"es-ES",label:"Espa\xF1ol",englishName:"Spanish"},{code:"fr-FR",label:"Fran\xE7ais",englishName:"French"},{code:"de-DE",label:"Deutsch",englishName:"German"},{code:"pt-PT",label:"Portugu\xEAs",englishName:"Portuguese"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",englishName:"Russian"},{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",englishName:"Arabic"},{code:"id-ID",label:"Bahasa Indonesia",englishName:"Indonesian"},{code:"vi-VN",label:"Ti\u1EBFng Vi\u1EC7t",englishName:"Vietnamese"},{code:"th-TH",label:"\u0E44\u0E17\u0E22",englishName:"Thai"},{code:"it-IT",label:"Italiano",englishName:"Italian"},{code:"nl-NL",label:"Nederlands",englishName:"Dutch"},{code:"tr-TR",label:"T\xFCrk\xE7e",englishName:"Turkish"},{code:"pl-PL",label:"Polski",englishName:"Polish"},{code:"uk-UA",label:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",englishName:"Ukrainian"},{code:"cs-CZ",label:"\u010Ce\u0161tina",englishName:"Czech"},{code:"sk-SK",label:"Sloven\u010Dina",englishName:"Slovak"},{code:"hu-HU",label:"Magyar",englishName:"Hungarian"},{code:"ro-RO",label:"Rom\xE2n\u0103",englishName:"Romanian"},{code:"el-GR",label:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC",englishName:"Greek"},{code:"sv-SE",label:"Svenska",englishName:"Swedish"},{code:"da-DK",label:"Dansk",englishName:"Danish"},{code:"fi-FI",label:"Suomi",englishName:"Finnish"},{code:"hr-HR",label:"Hrvatski",englishName:"Croatian"},{code:"lt-LT",label:"Lietuvi\u0173",englishName:"Lithuanian"},{code:"lv-LV",label:"Latvie\u0161u",englishName:"Latvian"},{code:"et-EE",label:"Eesti",englishName:"Estonian"},{code:"ga-IE",label:"Gaeilge",englishName:"Irish"},{code:"mt-MT",label:"Malti",englishName:"Maltese"},{code:"ka-GE",label:"\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8",englishName:"Georgian"},{code:"fa-IR",label:"\u0641\u0627\u0631\u0633\u06CC",englishName:"Persian"},{code:"bn-BD",label:"\u09AC\u09BE\u0982\u09B2\u09BE",englishName:"Bengali"},{code:"ta-IN",label:"\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD",englishName:"Tamil"},{code:"si-LK",label:"\u0DC3\u0DD2\u0D82\u0DC4\u0DBD",englishName:"Sinhala"},{code:"ms-MY",label:"Bahasa Melayu",englishName:"Malay"},{code:"fil-PH",label:"Filipino",englishName:"Filipino"},{code:"my-MM",label:"\u1019\u103C\u1014\u103A\u1019\u102C",englishName:"Burmese"},{code:"km-KH",label:"\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A",englishName:"Khmer"},{code:"lo-LA",label:"\u0EA5\u0EB2\u0EA7",englishName:"Lao"},{code:"mn-MN",label:"\u041C\u043E\u043D\u0433\u043E\u043B",englishName:"Mongolian"},{code:"kk-KZ",label:"\u049A\u0430\u0437\u0430\u049B",englishName:"Kazakh"}],up={en:"en-US",ja:"ja-JP",es:"es-ES",fr:"fr-FR",de:"de-DE",ko:"ko-KR",pt:"pt-PT",it:"it-IT",ru:"ru-RU",ar:"ar-SA",id:"id-ID",vi:"vi-VN",th:"th-TH",tr:"tr-TR",nl:"nl-NL",pl:"pl-PL",uk:"uk-UA",sv:"sv-SE",da:"da-DK",fi:"fi-FI",cs:"cs-CZ",el:"el-GR",hu:"hu-HU",ro:"ro-RO",ms:"ms-MY",fil:"fil-PH",bn:"bn-BD",ta:"ta-IN",sk:"sk-SK",hr:"hr-HR",lt:"lt-LT",lv:"lv-LV",et:"et-EE",fa:"fa-IR"},gp=new Set(Zt);function to(e){return gp.has(e)?e:up[e]}var _p="en";function $I(e){let n=e.toLowerCase().split("-",1)[0]??"";return dp.has(n)?"rtl":"ltr"}var hp={cmn:"zh-CN",eng:"en",jpn:"ja",spa:"es",fra:"fr",deu:"de",kor:"ko",por:"pt",ita:"it",rus:"ru",arb:"ar",ara:"ar",hin:"hi",ind:"id",vie:"vi",tha:"th",tur:"tr",nld:"nl",pol:"pl",ukr:"uk",swe:"sv",dan:"da",fin:"fi",nob:"no",nor:"no",ces:"cs",ell:"el",hun:"hu",ron:"ro",heb:"he",msa:"ms",zsm:"ms",tgl:"fil",ben:"bn",tam:"ta",cat:"ca",slk:"sk",hrv:"hr",bul:"bg",lit:"lt",lav:"lv",est:"et",pes:"fa",fas:"fa",swh:"sw",swa:"sw",srp:"sr",isl:"is"};function YI(e){return hp[e]??_p}var Sp=["zh-CN","zh-HK","zh-TW","ja-JP","ja","ko-KR","ko","ru-RU","ru","uk-UA","uk","bg","sr","mn-MN","kk-KZ","ar-SA","ar","fa-IR","fa","he","hi","th-TH","th","el-GR","el","ka-GE","bn-BD","bn","ta-IN","ta","si-LK","my-MM","km-KH","lo-LA"],fp=new Set(Sp);function XI(e){return fp.has(e)}var he=mp.enum(pp);import{z as bp}from"zod";var no=bp.string().uuid();import{z as o}from"zod";import{z as $}from"zod";var rt=$.string().trim().min(1).max(128),jt=$.string().trim().min(1).max(500),yp=["\u4EA7\u54C1","\u90E8\u4EF6/\u8017\u6750","\u5E94\u7528\u65B9\u6848","\u5B9A\u5236/OEM","\u670D\u52A1","\u8D44\u8D28/\u80FD\u529B"],xp=$.enum(yp),Jt=$.object({id:rt,keyword:$.string().trim().min(1).max(255),business_id:rt,business_name:$.string().trim().min(1).max(255),category:xp,selling_points:$.string().trim().max(2e3),section_id:rt,content_usage:$.enum(["product","category","solution","service","capability","article","faq"]),intent:jt,semantic_group:rt,primary_business:$.boolean(),monthly_volume:$.number().int().min(1),keyword_difficulty:$.number().min(0).max(100).nullable(),variants:$.array($.string().trim().min(1).max(255)),source:$.literal("semrush"),source_evidence:$.array(jt).min(1)}).strict(),zi=$.object({schema_version:$.literal(1),snapshot_id:rt,dependency_hash:$.string().regex(/^[a-f0-9]{64}$/),language:$.string().trim().min(2).max(35),database:$.string().regex(/^[a-z]{2}$/),generated_at:$.string().datetime({offset:!0}),entries:$.array(Jt),candidates:$.array(Jt),search_result_ids:$.array(rt).optional()}).strict().superRefine((e,n)=>{for(let i of["entries","candidates"]){let s=e[i];(new Set(s.map(a=>a.id)).size!==s.length||new Set(s.map(a=>a.keyword.normalize("NFKC").trim().toLowerCase())).size!==s.length)&&n.addIssue({code:"custom",path:[i],message:"\u5173\u952E\u8BCD\u4E0D\u80FD\u91CD\u590D"})}}),Mn=$.object({snapshot_id:rt,entry_ids:$.array(rt).min(1)}).strict().superRefine((e,n)=>{new Set(e.entry_ids).size!==e.entry_ids.length&&n.addIssue({code:"custom",path:["entry_ids"],message:"\u5173\u952E\u8BCD\u4E0D\u80FD\u91CD\u590D"})}),tR=$.object({expected_revision:$.number().int().nonnegative(),business_subject:$.string().trim().min(1).max(255)}).strict(),io=$.object({points:$.array(jt).length(3),comparison:$.array($.object({dimension:jt,recommended:jt,alternative:jt}).strict()).min(1).max(4)}).strict();var pe=o.string().trim().min(1).max(128),ct=o.string().trim().min(1).max(200),qe=o.string().trim().min(1).max(2e3),Bi=o.string().trim().max(200),en=o.string().regex(/^[a-f0-9]{64}$/),Wi=o.enum(["en-US","zh-CN","zh-TW","fr-FR","de-DE","es-ES","ja-JP","ko-KR"]),mt=["market","persona","product","brand","competition","structure","language","keywords","risk"],Te=mt.length,Vi=o.enum(mt),Fn=o.enum([...mt,"seogeo","content","conversion"]),oo=["recommended","conservative","focused"],ro=o.enum(oo),tn=o.union([ro,o.literal("confirmed")]),Gn=o.enum(["single_country","regional_combination","multi_market"]),Kn=o.object({code:o.string().trim().regex(/^[A-Z]{2}$/),name_zh:ct,name_en:ct,region:ct}).strict(),Ep=o.object({id:ro,presentation:io.nullish(),sections:o.array(o.object({id:o.string().trim().min(1).max(128),label:o.string().trim().min(1).max(200)}).strict()).max(30).optional(),label:ct,note:qe,impact:o.string().trim().max(500).nullish(),set_value:o.string().trim().max(500).nullish(),site_locale:he.nullish(),market_type:Gn.nullish(),markets:o.array(Kn).max(32).optional()}).loose(),Ip=o.object({lead:o.string().trim().min(1).max(500),title:ct,columns:o.array(o.string().trim().min(1).max(80)).min(1).max(8),rows:o.array(o.array(o.string().trim().max(500)).min(1).max(8)).max(100)}).strict().superRefine((e,n)=>{e.rows.forEach((i,s)=>{i.length!==e.columns.length&&n.addIssue({code:"custom",path:["rows",s],message:"Each Step5 plan row must match the column count."})})}),Rp=o.object({goal:qe,issue:qe,criteria:o.array(qe).min(1).max(12),resources:o.array(qe).min(1).max(12),risks:o.array(qe).min(1).max(12),execution:o.object({standard:o.array(qe).min(1).max(12),acceptance:o.array(qe).min(1).max(12),downstream:o.array(qe).min(1).max(12)}).strict()}).strict(),Tp=o.object({source_type:o.enum(["step2","step3"]),source_id:pe,field_path:o.string().trim().max(300).nullish()}).strict(),kp=o.enum(["ready","disabled","empty","timeout","rate_limited","quota_exhausted","failed"]),Ap=["INFORMATIONAL","NAVIGATIONAL","COMMERCIAL","TRANSACTIONAL"],co=o.enum(Ap),Un=50,qn=60,so=7,oR=["COMMERCIAL","TRANSACTIONAL"],wp=["C","T"];function mo(e){return wp.includes(e)}var Pp=o.object({id:pe,term:o.string().trim().min(1).max(255),source_type:o.enum(["step2","step3","step5"]),source_id:pe,field_path:o.string().trim().min(1).max(300),source_field:o.string().trim().min(1).max(300).optional(),source_evidence:o.string().trim().min(1).max(2e3).optional(),business_subject:o.string().trim().min(1).max(255).optional(),reason:o.string().trim().min(1).max(1e3).optional()}).strict(),vp=o.object({keyword:o.string().trim().min(1).max(255),normalized_keyword:o.string().trim().min(1).max(255),intents:o.array(co).min(1).max(4),search_volume:o.number().int().min(Un),keyword_difficulty:o.number().min(0).max(qn),cpc:o.number().nonnegative().nullish(),trend:o.array(o.number().int().min(0).max(100)).length(12),serp_features:o.array(o.string().trim().min(1).max(80)).max(64),fit:o.object({seo:o.number().int().min(0).max(100),geo:o.number().int().min(0).max(100),buyer:o.number().int().min(0).max(100)}).strict(),recommended_channel:o.enum(["SEO","GEO","DUAL"]),priority:o.enum(["P0","P1","P2","P3"]),already_in_plan:o.boolean(),page_level:o.union([o.literal(1),o.literal(2)]).default(1)}).strict(),Cp=o.object({id:pe,intent:co,title:ct,landing_page_type:o.enum(["blog","product","category","landing"]),keywords:o.array(vp).min(1).max(100)}).strict(),Dp=o.enum(["NO_SEEDS","NO_PROVIDER_CANDIDATES","NO_METRIC_ELIGIBLE_CANDIDATES","NO_COMMERCIAL_INTENT_CANDIDATES","NO_FIT_ELIGIBLE_CANDIDATES"]),jp=o.object({fetched_count:o.number().int().nonnegative(),unique_count:o.number().int().nonnegative(),metric_gate_pass_count:o.number().int().nonnegative(),commercial_intent_pass_count:o.number().int().nonnegative(),fit_pass_count:o.number().int().nonnegative(),selected_count:o.number().int().nonnegative()}).strict().superRefine((e,n)=>{let i=[e.fetched_count,e.unique_count,e.metric_gate_pass_count,e.commercial_intent_pass_count,e.fit_pass_count,e.selected_count];i.some((s,a)=>a>0&&s>i[a-1])&&n.addIssue({code:"custom",message:"Semrush selection counts must be monotonically non-increasing."})}),ao={provider:o.literal("semrush"),api_version:o.literal("v4"),fetched_at:o.string().datetime({offset:!0}),context_hash:en,status:kp,seeds:o.array(Pp).max(20),intent_groups:o.array(Cp).max(16),selection_summary:jp.optional(),empty_reason_code:Dp.nullish(),error_code:o.string().trim().regex(/^[A-Z0-9_]+$/).max(64).nullish()},Op=o.discriminatedUnion("schema_version",[o.object({schema_version:o.literal(1),...ao,database:o.string().trim().regex(/^[A-Z]{2}$/),country:o.string().trim().regex(/^[A-Z]{2}$/)}).strict(),o.object({schema_version:o.literal(2),...ao,database:o.string().trim().regex(/^[a-z]{2}$/),country:o.string().trim().regex(/^[A-Z]{2}$/)}).strict()]).superRefine((e,n)=>{if(e.schema_version===1&&e.database!==e.country&&n.addIssue({code:"custom",path:["database"],message:"Semrush database must match the ISO country code."}),e.status==="ready"&&e.intent_groups.length===0&&n.addIssue({code:"custom",path:["intent_groups"],message:"Ready Semrush recommendations require an intent group."}),e.status==="ready"&&e.error_code&&n.addIssue({code:"custom",path:["error_code"],message:"Ready Semrush recommendations cannot contain an error code."}),e.empty_reason_code&&e.status!=="empty"&&n.addIssue({code:"custom",path:["empty_reason_code"],message:"Semrush empty reason is only valid for an empty snapshot."}),e.selection_summary){let i=e.intent_groups.reduce((s,a)=>s+a.keywords.length,0);e.selection_summary.selected_count!==i&&n.addIssue({code:"custom",path:["selection_summary","selected_count"],message:"Semrush selected count must match the persisted keywords."})}}),lo=0,Np=o.union([o.literal(lo),o.literal(1)]),rR=o.object({seed_keyword:o.string().trim().min(1).max(255),database:o.string().trim().toLowerCase().regex(/^[a-z]{2}$/).default("us"),limit:o.number().int().min(1).max(100).default(20),offset:o.number().int().nonnegative().default(0),min_search_volume:o.number().int().nonnegative().default(Un),max_keyword_difficulty:o.number().finite().min(0).max(100).default(qn),min_relevance_score:Np.default(lo)}).strict(),Lp=o.object({keyword:o.string().trim().min(1).max(255),search_volume:o.number().int().nonnegative().nullable(),keyword_difficulty:o.number().nonnegative().nullable(),cpc:o.number().nonnegative().nullable(),competition:o.number().nonnegative().nullable(),result_count:o.number().int().nonnegative().nullable(),intent:o.string().trim().max(64).nullable(),trend:o.array(o.string()).nullable(),serp_features:o.array(o.string()).nullable(),fit:o.number().finite().min(0).max(10),currency:o.string().trim().regex(/^[A-Z]{3}$/).nullable()}).strict(),Mp=o.object({request_id:o.string().trim().min(1).max(128),snapshot_id:o.string().uuid(),seed_keyword:o.string().trim().min(1).max(255),database:o.string().trim().min(1).max(16),limit:o.number().int().min(1).max(100),offset:o.number().int().nonnegative(),freshness:o.enum(["live","cached","historical"]),collected_at:o.string().datetime({offset:!0}),items:o.array(Lp).max(100),result_count:o.number().int().nonnegative()}).strict(),cR=o.object({code:o.literal(0),message:o.string(),data:Mp}).strict(),mR=o.object({snapshot_id:o.string().uuid(),selected_keywords:o.array(o.string().trim().min(2).max(160)).min(1).max(50)}).strict(),Up=o.object({candidate_id:pe,keyword:o.string().trim().min(2).max(160),classification_status:o.string().trim().min(1).max(64),selection_status:o.string().trim().min(1).max(64),selected_at:o.string().datetime({offset:!0})}).strict(),qp=o.object({selection_batch_id:pe,snapshot_id:o.string().uuid(),selected_count:o.number().int().nonnegative(),created_count:o.number().int().nonnegative(),updated_count:o.number().int().nonnegative(),deselected_count:o.number().int().nonnegative(),items:o.array(Up).max(50)}).strict().superRefine((e,n)=>{e.selected_count!==e.items.length&&n.addIssue({code:"custom",path:["selected_count"],message:"selected_count must equal items.length."})}),lR=o.object({code:o.literal(0),message:o.string(),data:qp}).strict(),Fp=o.enum(["ok","degraded"]),Gp=["category","selection","application","parameter","cost","trust","compliance","delivery"],po=o.object({id:pe,question:o.string().trim().min(8).max(300).refine(e=>/^[\x20-\x7E]+$/.test(e)),question_type:o.enum(Gp),intent_strength:o.enum(["high","medium","low"]),source:o.enum(["ai_generation","user_input"])}).strict(),Kp=po.extend({source:o.literal("ai_generation")}).strict(),Hi=o.object({key:Fn,position:o.number().int().min(1).max(11),category:ct,title:ct,summary:qe,rationale:qe,parameter:o.string().trim().max(500).nullish(),options:o.array(Ep).max(3),keyword_library:zi.nullish(),plan:Ip.nullish(),structure_detail:Rp.nullish(),note_tips:o.array(o.string().trim().min(1).max(200)).max(6),note_placeholder:o.string().trim().min(1).max(300),evidence_refs:o.array(Tp).min(1).max(8),semrush_recommendations:Op.nullish(),seo_payload:o.lazy(()=>$i).nullish(),geo_questions:o.array(Kp).max(20).optional(),generation_status:Fp.optional()}).loose().superRefine((e,n)=>{let i=mt.indexOf(e.key)+1;i>0&&e.position!==i&&n.addIssue({code:"custom",path:["position"],message:`Step5 strategy ${e.key} uses an invalid position.`}),e.key!=="keywords"&&e.keyword_library&&n.addIssue({code:"custom",path:["keyword_library"],message:"Only the keywords card can carry an enterprise keyword library."}),e.options.length!==(e.key==="keywords"?0:3)&&n.addIssue({code:"custom",path:["options"],message:"Keywords use no options; ordinary cards require three options."}),e.key==="keywords"&&(e.note_tips.length||e.geo_questions?.length||e.seo_payload||e.semrush_recommendations)&&n.addIssue({code:"custom",message:"The enterprise keyword library cannot carry legacy SEO/GEO content."}),e.options.forEach((s,a)=>{s.id!==oo[a]&&n.addIssue({code:"custom",path:["options",a,"id"],message:"Step5 strategy options must use the canonical order."})}),e.semrush_recommendations&&e.key!=="seogeo"&&n.addIssue({code:"custom",path:["semrush_recommendations"],message:"Semrush recommendations are only valid for the seogeo item."}),e.seo_payload&&e.key!=="seogeo"&&n.addIssue({code:"custom",path:["seo_payload"],message:"SEO payloads are only valid for the seogeo item."}),(e.geo_questions?.length??0)>0&&e.key!=="seogeo"&&n.addIssue({code:"custom",path:["geo_questions"],message:"GEO questions are only valid for the seogeo item."}),e.structure_detail&&e.key!=="structure"&&n.addIssue({code:"custom",path:["structure_detail"],message:"Structure detail is only valid for the structure item."}),e.geo_questions&&new Set(e.geo_questions.map(s=>s.question.trim().toLocaleLowerCase())).size!==e.geo_questions.length&&n.addIssue({code:"custom",path:["geo_questions"],message:"GEO citation questions must be unique."})}),uo=9,go=o.object({id:pe,type:o.union([o.literal(1),o.literal(2)]).default(1),cells:o.tuple([o.string().trim().max(500),o.string().trim().max(500),o.string().trim().max(500),o.string().trim().max(500),o.string().trim().max(500),o.string().trim().max(500)])}).strict(),zp=2,Bp=0,pR=20,Wp=50,_o=o.object({id:pe,keyword:o.string().trim().min(1).max(500),intent_code:o.string().trim().min(1).max(16),intent_type:o.string().trim().min(1).max(200),strength:o.enum(["high","medium"]),search_volume:o.number().int().nonnegative().nullable(),cpc:o.number().finite().nonnegative().nullable()}).strict(),Vp=_o.superRefine((e,n)=>{mo(e.intent_code)||n.addIssue({code:"custom",path:["intent_code"],message:"New legacy SEO keyword selections must use commercial or transactional intent."})}),zn=o.object({id:pe,keyword:o.string().trim().min(2).max(160),normalized_keyword:o.string().trim().min(2).max(160),intc:o.enum(["I","N","C","T"]),keyword_type:o.string().trim().min(1).max(80),intent_strength:o.enum(["high","medium","low"]),monthly_volume:o.number().int().nonnegative().nullable(),keyword_difficulty:o.number().finite().min(0).max(100).nullable(),fit:o.number().finite().min(0).max(10).nullable(),sem_cpc:o.number().finite().nonnegative().nullable(),currency:o.string().trim().regex(/^[A-Z]{3}$/).nullable(),landing_page:o.string().trim().regex(/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*(?:\/[a-z0-9]+(?:-[a-z0-9]+)*)*)?$/),content_format:o.string().trim().min(1).max(80),priority:o.enum(["P0","P1","P2","P3"]),source:o.enum(["step5_generation","semrush"]),source_market:o.string().trim().toLowerCase().regex(/^[a-z]{2,8}$/),metric_timestamp:o.string().datetime({offset:!0}).nullable()}).strict().superRefine((e,n)=>{let i=So(e.keyword);e.normalized_keyword!==i&&n.addIssue({code:"custom",path:["normalized_keyword"],message:"normalized_keyword must match the canonical keyword form."})}),Hp=o.object({request_id:o.string().trim().min(1).max(128),snapshot_id:pe,selected_keywords:o.array(o.string().trim().min(2).max(160)).min(1).max(50)}).strict(),$i=o.object({schema_version:o.literal(zp),seo_keywords:o.array(zn).min(Bp).max(Wp),semrush_snapshot_refs:o.array(Hp).max(20).optional(),geo_questions:o.array(po).max(20).optional()}).strict().superRefine(ad),$p=$i.superRefine((e,n)=>{e.seo_keywords.forEach((i,s)=>{mo(i.intc)||n.addIssue({code:"custom",path:["seo_keywords",s,"intc"],message:"New SEO keyword selections must use commercial or transactional intent."})})}),Yp=o.object({rows:o.array(go).max(100).optional(),seo_keywords:o.array(_o).max(100).optional()}).strict(),Xp=o.object({rows:o.array(go).max(100).optional(),seo_keywords:o.array(Vp).max(100).optional()}).strict(),Qp=o.union([$i,Yp]),Zp=o.union([$p,Xp]),Jp=o.object({item_key:Vi,selected_option_id:tn,note:Bi,custom_payload:Zp.optional(),keyword_selection:Mn.optional()}).strict().superRefine((e,n)=>{(e.custom_payload||(e.item_key==="keywords"?e.selected_option_id!=="confirmed"||e.note!==""||!e.keyword_selection:e.selected_option_id==="confirmed"||e.keyword_selection!==void 0))&&n.addIssue({code:"custom",message:"\u666E\u901A\u5361\u4EC5\u63A5\u53D7\u65B9\u6848\u4E0E\u5907\u6CE8\uFF1B\u4F01\u4E1A\u5173\u952E\u8BCD\u5E93\u4EC5\u63A5\u53D7\u5DF2\u751F\u6210\u5FEB\u7167\u4E2D\u7684\u5173\u952E\u8BCD ID"})}),Yi=o.object({item_key:Vi,selected_option_id:tn,note:Bi,custom_payload:Qp.optional(),keyword_selection:Mn.optional(),keyword_library:zi.optional(),market_type:Gn.nullish(),markets:o.array(Kn).max(32).optional(),selected_value:o.unknown().nullable(),accepted_at:o.string().datetime({offset:!0})}).loose(),ed=o.enum(["running","succeeded","failed"]),td=o.object({schema_version:o.literal(1),source_job_id:pe,site_id:pe,output_locale:Wi.optional(),items:o.array(Hi).length(Te),decisions:o.array(Yi).length(Te)}).loose(),nd=o.object({strategy_version_id:pe,site_id:pe,source_job_id:pe,output_locale:Wi.optional(),version:o.number().int().positive(),checksum:en,snapshot:td,committed_at:o.string().datetime({offset:!0})}).loose(),ho=o.object({job_id:pe,site_id:pe,output_locale:Wi.optional(),status:ed,keyword_library_needs_update:o.boolean().optional(),revision:o.number().int().nonnegative(),items:o.array(Hi).max(Te),decisions:o.array(Yi).max(Te),output_checksum:en.nullish(),error_code:o.string().trim().max(64).nullish(),error_message:o.string().trim().max(500).nullish(),committed_version:nd.nullish()}).loose().superRefine((e,n)=>{let i=e.items.map(a=>a.key);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["items"],message:"Step5 job items must have unique keys."});let s=e.decisions.map(a=>a.item_key);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["decisions"],message:"Step5 job decisions must have unique item keys."})}),dR=o.object({force_refresh:o.boolean().optional().default(!1)}).strict(),uR=ho.extend({cached:o.boolean()}).strict(),gR=o.object({expected_revision:o.number().int().nonnegative()}).strict(),_R=o.object({expected_revision:o.number().int().nonnegative(),selected_option_id:tn,note:Bi,keyword_selection:Mn.optional()}).strict().superRefine((e,n)=>{(e.selected_option_id==="confirmed"?!e.keyword_selection||e.note!=="":e.keyword_selection)&&n.addIssue({code:"custom",message:"\u4F01\u4E1A\u5173\u952E\u8BCD\u53EA\u63A5\u53D7\u5DF2\u751F\u6210\u6761\u76EE\u7684 ID\uFF1B\u666E\u901A\u7B56\u7565\u53EA\u63A5\u53D7\u65B9\u6848\u548C\u5907\u6CE8"})}),hR=o.object({revision:o.number().int().positive(),decision:Yi}).strict(),SR=o.object({idempotency_key:o.string().trim().min(8).max(128),expected_revision:o.number().int().nonnegative(),decisions:o.array(Jp).length(Te)}).strict().superRefine((e,n)=>{let i=e.decisions.map(s=>s.item_key);new Set(i).size!==mt.length&&n.addIssue({code:"custom",path:["decisions"],message:`Step5 commit must contain ${Te} unique decisions.`}),mt.forEach(s=>{i.includes(s)||n.addIssue({code:"custom",path:["decisions"],message:`Step5 commit is missing ${s}.`})})}),fR=o.object({strategy_version_id:pe,version:o.number().int().positive(),checksum:en,next_path:o.string().trim().min(1).max(500)}).strict(),id=ho.extend({completed:o.number().int().min(0).max(Te),total:o.literal(Te)}).loose(),sd=["snapshot","strategy_item_start","strategy_item_done","strategy_items_invalidated","strategy_generation_done","failed"];function bR(e){return typeof e=="string"&&sd.includes(e)}var yR=o.discriminatedUnion("event",[o.object({id:o.number().int().nonnegative(),event:o.literal("snapshot"),data:id}).strict(),o.object({id:o.number().int().positive(),event:o.literal("strategy_item_start"),data:o.object({key:Vi,position:o.number().int().min(1).max(Te)}).strict()}).strict(),o.object({id:o.number().int().positive(),event:o.literal("strategy_item_done"),data:o.object({item:Hi}).strict()}).strict(),o.object({id:o.number().int().positive(),event:o.literal("strategy_items_invalidated"),data:o.object({after_position:o.number().int().min(0).max(Te)}).strict()}).strict(),o.object({id:o.number().int().positive(),event:o.literal("strategy_generation_done"),data:o.object({item_count:o.literal(Te),schema_version:o.literal(1),checksum:en}).strict()}).strict(),o.object({id:o.number().int().positive(),event:o.literal("failed"),data:o.object({code:o.string().trim().min(1).max(64),message:o.string().trim().min(1).max(500),retryable:o.boolean(),item_key:Fn.optional()}).loose()}).loose()]);function ad(e,n){let i=new Set;e.seo_keywords.forEach((r,u)=>{i.has(r.normalized_keyword)&&n.addIssue({code:"custom",path:["seo_keywords",u,"normalized_keyword"],message:"SEO keywords must be unique after Unicode normalization."}),i.add(r.normalized_keyword),(r.monthly_volume===null||r.monthly_volume<Un)&&n.addIssue({code:"custom",path:["seo_keywords",u,"monthly_volume"],message:`Selected SEO keywords require monthly_volume >= ${Un}.`}),(r.keyword_difficulty===null||r.keyword_difficulty>qn)&&n.addIssue({code:"custom",path:["seo_keywords",u,"keyword_difficulty"],message:`Selected SEO keywords require keyword_difficulty <= ${qn}.`}),(r.fit===null||r.fit<so)&&n.addIssue({code:"custom",path:["seo_keywords",u,"fit"],message:`Selected SEO keywords require fit >= ${so.toFixed(1)}.`})});let s=new Set((e.semrush_snapshot_refs??[]).flatMap(r=>r.selected_keywords.map(So)));e.seo_keywords.forEach((r,u)=>{r.source==="semrush"&&!s.has(r.normalized_keyword)&&n.addIssue({code:"custom",path:["seo_keywords",u,"source"],message:"Semrush keywords must reference a persisted Semrush snapshot selection."})});let a=(e.geo_questions??[]).map(r=>r.question.trim().toLocaleLowerCase());new Set(a).size!==a.length&&n.addIssue({code:"custom",path:["geo_questions"],message:"GEO citation questions must be unique."})}function So(e){return e.normalize("NFKC").trim().replace(/\s+/g," ").toLowerCase()}import{z as od}from"zod";var Fe=od.string().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/);function IR(e,n){let i=Fe.safeParse(e),s=Fe.safeParse(n);if(!i.success||!s.success)return null;let a=fo(i.data),r=fo(s.data);for(let c=0;c<3;c+=1){let g=bo(a.release[c],r.release[c]);if(g!==0)return g}if(!a.prerelease&&!r.prerelease)return 0;if(!a.prerelease)return 1;if(!r.prerelease)return-1;let u=Math.max(a.prerelease.length,r.prerelease.length);for(let c=0;c<u;c+=1){let g=a.prerelease[c],k=r.prerelease[c];if(g===void 0)return-1;if(k===void 0)return 1;if(g===k)continue;let I=/^\d+$/u.test(g),C=/^\d+$/u.test(k);return I&&C?bo(BigInt(g),BigInt(k)):I?-1:C?1:rd(g,k)}return 0}function fo(e){let n=e.indexOf("+"),i=n===-1?e:e.slice(0,n),s=i.indexOf("-"),a=s===-1?i:i.slice(0,s),r=s===-1?void 0:i.slice(s+1),[u,c,g]=a.split(".");return{release:[BigInt(u),BigInt(c),BigInt(g)],...r?{prerelease:r.split(".")}:{}}}function bo(e,n){return e<n?-1:e>n?1:0}function rd(e,n){return e<n?-1:e>n?1:0}import{z as V}from"zod";import{z as Ee}from"zod";var Xi=64,cd=512*1024,Qi=4*1024*1024,md=/^(?!\/)(?!.*\\)(?!.*(?:^|\/)\.\.(?:\/|$))(?!.*\/\/).+/;function ld(e){return md.test(e)}var yo=Ee.string().min(1).refine(ld,{message:"Materialization pathTemplate must be a safe relative path."}),pd=Ee.object({pathTemplate:yo,content:Ee.string(),role:Ee.string().min(1).optional()}).strict(),dd=Ee.union([Ee.object({kind:Ee.literal("default")}).strict(),Ee.object({kind:Ee.literal("named"),name:Ee.string().min(1)}).strict()]),ud=Ee.object({pathTemplate:yo,export:dd}).strict(),gd=Ee.array(Ee.never()).optional(),Et=Ee.object({instanceBaseName:Ee.string().min(1),files:Ee.array(pd).min(1).max(Xi),entry:ud,dataRequirements:gd}).strict().superRefine((e,n)=>{let i=new Set,s=e.entry.pathTemplate,a=0;for(let[r,u]of e.files.entries()){i.has(u.pathTemplate)&&n.addIssue({code:"custom",path:["files",r,"pathTemplate"],message:`Duplicate materialization pathTemplate: ${u.pathTemplate}`}),i.add(u.pathTemplate);let c=new TextEncoder().encode(u.content).length;c>cd&&n.addIssue({code:"custom",path:["files",r,"content"],message:"Materialization file content exceeds the per-file byte limit."}),a+=c}i.has(s)||n.addIssue({code:"custom",path:["entry","pathTemplate"],message:"Materialization entry pathTemplate must match a file."}),a>Qi&&n.addIssue({code:"custom",path:["files"],message:"Materialization exceeds the total content byte limit."})});var xo="insertNewComponent",PR={categoryGroupMissing:"DESIGNER_COMPONENT_CATEGORY_GROUP_MISSING",unavailable:"DESIGNER_COMPONENT_LIBRARY_UNAVAILABLE",timeout:"DESIGNER_COMPONENT_LIBRARY_TIMEOUT",invalidResponse:"DESIGNER_COMPONENT_LIBRARY_INVALID_RESPONSE",incompatibleResource:"DESIGNER_COMPONENT_RESOURCE_INCOMPATIBLE"},Zi=V.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),Eo=V.lazy(()=>V.object({id:V.string().uuid(),key:V.string().min(1),name:V.string(),children:V.array(Eo)}).strict()),Io=V.object({category_group_key:V.literal(xo),categories:V.array(Eo)}).strict(),_d=V.object({resource_id:V.string().min(1),name:V.string(),description:V.string().nullable(),thumbnail_url:V.string().nullable(),resolved_version:Zi,category_id:V.string().uuid().nullable()}).strict(),Ro=V.object({category_group_key:V.literal(xo),items:V.array(_d),next_cursor:V.string().min(1).nullable()}).strict(),vR=V.object({resource_id:V.string().min(1),resolved_version:Zi,anchor_block_id:V.string().min(1),placement:V.enum(["before","after"])}).strict(),CR=V.object({status:V.literal("mock_acknowledged")}).strict(),DR=V.object({category_id:V.string().uuid().optional(),include_descendants:V.enum(["true","false"]).optional().transform(e=>e==="true"),limit:V.coerce.number().int().min(1).max(100).optional().default(20),cursor:V.string().min(1).optional()}).strict().superRefine((e,n)=>{e.include_descendants&&!e.category_id&&n.addIssue({code:"custom",message:"include_descendants requires category_id"})}),It=Zi,jR=V.object({version:It}).strict(),To=V.object({resource_id:V.string().min(1),resolved_version:It,revision_id:V.string().uuid().optional(),digest_sha256:V.string().regex(/^[a-f0-9]{64}$/),materialization:Et}).strict();import{z as y}from"zod";import{z as h}from"zod";var Po="/",vo=255,hd=5e3,Sd=64;function fd(e){if(!e.startsWith("/")||e.includes("//")||/[?#\\\s\u0000-\u001f\u007f]/u.test(e))return!1;try{let n=decodeURIComponent(e);return n.includes("//")||/[?#\\\s\u0000-\u001f\u007f]/u.test(n)||n.split("/").length!==e.split("/").length||/%25/iu.test(e)?!1:n.split("/").every(i=>![".",".."].includes(i))}catch{return!1}}var Qe=h.string().min(1).max(vo).refine(fd,"url_path must be a safe site-relative path"),ts=h.string().max(vo),Bn=h.preprocess(e=>e===0?!1:e===1?!0:e,h.boolean()),nn=h.union([h.url(),Qe]),ns=h.enum(["landing_page","general_page","detail_page"]),is=h.enum([...ns.options,"list_page","category_page","tag_page","author_page","search_page","date_page"]);function MR(e){return e.vcp_managed&&e.url!==null&&ns.safeParse(e.page_type).success&&Qe.safeParse(e.url_path).success}function ko(e){return e.includes("{")||e.includes("}")}function UR(e){if(!ko(e.url_path))return Ao(e.url_path);if(e.url===null)return null;let n=/^[a-z][a-z0-9+.-]*:\/\//iu.test(e.url)?bd(e.url):e.url;return n===null||ko(n)?null:Ao(n)}function Ao(e){let n=Qe.safeParse(e);return n.success?n.data:null}function bd(e){try{return new URL(e).pathname}catch{return null}}var Co=h.lazy(()=>h.object({cms_page_id:h.number().int().positive(),title:h.string().trim().min(1).max(255),url_path:ts,url:nn.nullable(),page_type:is,vcp_managed:Bn,children:h.array(Co)}).strict()),yd=h.object({group_id:h.string().min(1),title:h.string().trim().min(1).max(255),collection_slug:h.string(),pages:h.array(Co)}).strict(),wo=h.object({groups:h.array(yd)}).strict(),Do=h.lazy(()=>h.object({id:h.number().int().positive(),title:h.string().trim().min(1).max(120),url_path:ts,parent_id:h.number().int().nonnegative(),group_type:h.string().min(1),page_type:is,plugin_id:h.number().int().nonnegative(),is_default:Bn,is_published:Bn,url:nn.nullable(),vcp_managed:Bn,children:h.array(Do)})),xd=h.object({plugin_id:h.number().int().nonnegative(),slug:h.string(),group_name:h.string().trim().min(1).max(255),pages:h.array(Do)}).passthrough(),Ed=h.array(xd);function jo(e){return{cms_page_id:e.id,title:e.title,url_path:e.url_path,url:e.url,page_type:e.page_type,vcp_managed:e.vcp_managed,children:e.children.map(n=>jo(n))}}function qR(e){if(!Id(e))return null;let n=wo.safeParse(e);if(n.success)return n.data;let i=Ed.safeParse(e);if(!i.success)return null;let s=wo.safeParse({groups:i.data.map(a=>({group_id:String(a.plugin_id),title:a.group_name,collection_slug:a.slug,pages:a.pages.map(jo)}))});return s.success?s.data:null}function Id(e){let n=Array.isArray(e)?e:Ji(e)&&Array.isArray(e.groups)?e.groups:[],i=[];for(let a of n)if(!(!Ji(a)||!Array.isArray(a.pages)))for(let r of a.pages)i.push({node:r,depth:1});let s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>hd||a.depth>Sd)return!1;if(!(!Ji(a.node)||!Array.isArray(a.node.children)))for(let r of a.node.children)i.push({node:r,depth:a.depth+1})}return!0}function Ji(e){return typeof e=="object"&&e!==null}var Rd=h.enum(["invalid_url_path","missing_url","not_vcp_managed","unsupported_page_type"]),Td=h.enum(["home_page","invalid_url_path","not_selectable","not_vcp_managed","page_has_children","last_selectable_page","cms_unbound","unsupported_page_type"]),Oo=h.lazy(()=>h.object({cms_page_id:h.number().int().positive().nullable(),title:h.string().trim().min(1).max(255),url_path:ts,preview_url_path:Qe.nullable(),url:nn.nullable(),page_type:is,vcp_managed:h.boolean(),selectable:h.boolean(),disabled_reason:Rd.nullable(),can_delete:h.boolean(),delete_block_reason:Td.nullable(),has_cms_children:h.boolean(),children:h.array(Oo)}).strict()),No=h.object({group_id:h.string().min(1),title:h.string().trim().min(1).max(255),pages:h.array(Oo)}).strict(),FR=h.object({base_snapshot_id:T,expected_url_path:Qe}).strict(),kd=h.enum(["succeeded","failed"]),Ad=h.object({url_path:Qe,phase:h.enum(["ensure","binding","delete"]),code:h.string().min(1),message:h.string().min(1)}).strict(),ss=h.object({status:kd,checked_count:h.number().int().nonnegative(),ensured_count:h.number().int().nonnegative(),deleted_count:h.number().int().nonnegative(),already_absent_count:h.number().int().nonnegative(),failed_pages:h.array(Ad),warnings:h.array(h.string().min(1))}).strict(),wd=h.object({result_snapshot_id:T,deleted_files:h.array(h.string().min(1)),updated_files:h.array(h.string().min(1)),preserved_shared_files:h.array(h.string().min(1)),warnings:h.array(h.string().min(1)),next_url:nn.nullable(),previous_url:nn.nullable(),cms_reconcile_result:ss}).strict(),GR=h.object({code:h.literal(0),message:h.string(),data:wd}).strict(),KR=h.object({snapshot_id:T}).strict(),Pd=h.object({snapshot_id:T,warnings:h.array(h.string().min(1)),cms_reconcile_result:ss}).strict(),zR=h.object({code:h.literal(0),message:h.string(),data:Pd}).strict(),BR=h.object({source_committed:h.boolean(),result_snapshot_id:T.optional(),cms_reconcile_result:ss.optional()}).strict().superRefine((e,n)=>{e.source_committed&&!e.result_snapshot_id&&n.addIssue({code:"custom",path:["result_snapshot_id"],message:"committed source requires result_snapshot_id"})}),vd=ns,Cd=h.object({title:h.string().min(1).max(255).optional(),description:h.string().min(1).max(1e3).optional(),keywords:h.string().min(1).max(255).optional(),meta_tags_json:h.record(h.string(),h.unknown()).optional(),schema_json:h.union([h.record(h.string(),h.unknown()),h.array(h.unknown())]).optional(),breadcrumbs_json:h.array(h.unknown()).optional()}).strict(),Lo=h.object({url_path:Qe,title:h.string().trim().min(1).max(255),kind:vd,route_file:h.string().min(1),collection_id:h.string().trim().min(1).optional(),seo:Cd.optional()}).strict().superRefine((e,n)=>{e.kind==="detail_page"&&e.seo&&n.addIssue({code:"custom",path:["seo"],message:"detail_page target cannot carry seo (owned by the collection binding flow)"}),e.kind==="detail_page"&&!e.collection_id&&n.addIssue({code:"custom",path:["collection_id"],message:"detail_page target requires collection_id"}),e.kind!=="detail_page"&&e.collection_id&&n.addIssue({code:"custom",path:["collection_id"],message:`${e.kind} target cannot have collection_id`}),e.kind==="landing_page"!=(e.url_path===Po)&&n.addIssue({code:"custom",path:["kind"],message:"The home target must be the only landing_page target."})}),Dd=h.object({complete:h.literal(!0),targets:h.array(Lo)}).strict().superRefine((e,n)=>{e.targets.length<1&&n.addIssue({code:"too_small",minimum:1,inclusive:!0,origin:"array",path:["targets"],message:"A complete page target set must contain at least one page."}),e.targets.filter(s=>s.url_path===Po).length!==1&&n.addIssue({code:"custom",path:["targets"],message:"A complete page target set must contain exactly one home page."})}),WR=h.discriminatedUnion("complete",[Dd,h.object({complete:h.literal(!1),targets:h.array(Lo),errors:h.array(h.string().min(1)).min(1)}).strict()]),es=h.string().regex(/^sha256:[0-9a-f]{64}$/),VR=h.object({projection_hash:es.nullable()}).strict(),HR=h.object({expected_projection_hash:es.nullable(),projection_hash:es}).strict();var Mo="insertNewPage",JR={categoryGroupMissing:"DESIGNER_PAGE_CATEGORY_GROUP_MISSING",unavailable:"DESIGNER_PAGE_LIBRARY_UNAVAILABLE",timeout:"DESIGNER_PAGE_LIBRARY_TIMEOUT",invalidResponse:"DESIGNER_PAGE_LIBRARY_INVALID_RESPONSE",incompatibleResource:"DESIGNER_PAGE_RESOURCE_INCOMPATIBLE"},Rt=y.enum(["page","pages"]),jd=y.object({resource_id:y.string().min(1),resource_type:Rt,resolved_version:It,template_page_id:y.string().min(1)}).strict(),Uo=y.lazy(()=>y.object({id:y.string().uuid(),key:y.string().min(1),name:y.string(),children:y.array(Uo)}).strict()),qo=y.object({category_group_key:y.literal(Mo),categories:y.array(Uo)}).strict(),Od=y.object({resource_id:y.string().min(1),resource_type:Rt,name:y.string(),description:y.string().nullable(),thumbnail_url:y.string().nullable(),preview_images:y.array(y.object({url:y.string().min(1),page_id:y.string().min(1).nullable(),is_primary:y.boolean()}).strict()).optional(),resolved_version:It,category_id:y.string().uuid().nullable()}).strict(),Fo=y.object({category_group_key:y.literal(Mo),items:y.array(Od),next_cursor:y.string().min(1).nullable()}).strict(),eT=y.object({category_id:y.string().uuid().optional(),include_descendants:y.enum(["true","false"]).optional().transform(e=>e==="true"),limit:y.coerce.number().int().min(1).max(100).optional().default(20),cursor:y.string().min(1).optional()}).strict().superRefine((e,n)=>{e.include_descendants&&!e.category_id&&n.addIssue({code:"custom",message:"include_descendants requires category_id"})}),sn=It,Wn=y.string().regex(/^\/[a-z0-9]+(?:-[a-z0-9]+)*$/),tT=y.string().regex(/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*)?$/),Nd=y.object({template_page_id:y.string().min(1),title:y.string().trim().min(1).max(120),final_route:Wn}).strict(),Ld=y.object({template_page_id:y.string().min(1),title:y.string().trim().min(1).max(120),source:jd.optional(),blocks:y.array(y.discriminatedUnion("kind",[y.object({kind:y.literal("package-component"),instance_id:y.string().min(1),component_id:y.string().min(1),label:y.string().trim().min(1).max(120)}).strict(),y.object({kind:y.literal("component-resource"),instance_id:y.string().min(1),resource_id:y.string().min(1),resolved_version:It,label:y.string().trim().min(1).max(120)}).strict()])).optional(),route:y.object({input:y.string(),append_random_suffix:y.boolean().optional(),random_suffix_length:y.number().int().min(4).max(16).optional(),final:Wn}).strict()}).strict(),Md=y.object({resource_id:y.string().min(1),resource_type:Rt,resolved_version:sn,pages:y.array(Ld).min(1)}).strict().superRefine((e,n)=>{lt(e.pages.map(i=>i.template_page_id),"pages",n),lt(e.pages.map(i=>i.route.final),"routes",n);for(let[i,s]of e.pages.entries()){if(!s.blocks)continue;let a=new Set;for(let[r,u]of s.blocks.entries())a.has(u.instance_id)&&n.addIssue({code:"custom",path:["pages",i,"blocks",r,"instance_id"],message:`Duplicate block instance identifier within page: ${u.instance_id}`}),a.add(u.instance_id)}});function as(e,n){e.resource_type==="page"&&e.pages.length!==1&&n.addIssue({code:"custom",path:["pages"],message:"page resources must contain exactly one page"}),e.resource_type==="pages"&&e.pages.length<2&&n.addIssue({code:"custom",path:["pages"],message:"pages resources must contain at least two pages"})}function lt(e,n,i){let s=new Set;for(let[a,r]of e.entries())s.has(r)&&i.addIssue({code:"custom",path:[n,a],message:`Duplicate ${n} identifier: ${r}`}),s.add(r)}var nT=y.object({resource_type:Rt,version:sn,pages:y.array(Nd).min(1)}).strict().superRefine((e,n)=>{as(e,n),lt(e.pages.map(i=>i.template_page_id),"pages",n),lt(e.pages.map(i=>i.final_route),"routes",n)}),Ud=y.object({instance_id:y.string().min(1),component_id:y.string().min(1)}).strict(),qd=y.object({component_id:y.string().min(1),materialization:Et}).strict(),Fd=y.object({template_page_id:y.string().min(1),title:y.string().trim().min(1).max(120),final_route:Wn,materialization:Et,components:y.array(Ud)}).strict(),os=y.object({resource_id:y.string().min(1),resource_type:Rt,resolved_version:sn,revision_id:y.string().uuid().optional(),digest_sha256:y.string().regex(/^[a-f0-9]{64}$/),components:y.array(qd),pages:y.array(Fd).min(1),project_dependencies:y.record(y.string(),y.never()).optional()}).strict().superRefine((e,n)=>{as(e,n);let i=e.components.map(a=>a.component_id),s=new Set(i);lt(i,"components",n),lt(e.pages.map(a=>a.template_page_id),"pages",n),lt(e.pages.map(a=>a.final_route),"routes",n);for(let[a,r]of e.pages.entries()){let u=new Set;for(let[c,g]of r.components.entries())s.has(g.component_id)||n.addIssue({code:"custom",path:["pages",a,"components",c,"component_id"],message:`Unknown component reference: ${g.component_id}`}),u.has(g.instance_id)&&n.addIssue({code:"custom",path:["pages",a,"components",c,"instance_id"],message:`Duplicate component instance identifier within page: ${g.instance_id}`}),u.add(g.instance_id)}}),Go=os,Ko=y.object({template_page_id:y.string().min(1),title:y.string().trim().min(1).max(120),final_route:Wn,route_file_path:y.string().regex(/^app\/[a-z0-9]+(?:-[a-z0-9]+)*\/page\.tsx$/)}).strict(),Gd=y.object({template_page_id:y.string().min(1),title:y.string().trim().min(1).max(120),composition_supported:y.boolean(),blocks:y.array(y.object({instance_id:y.string().min(1),component_id:y.string().min(1),label:y.string().trim().min(1).max(120)}).strict())}).strict(),zo=y.object({resource_id:y.string().min(1),resource_type:Rt,resolved_version:sn,pages:y.array(Gd).min(1)}).strict().superRefine((e,n)=>{as(e,n),lt(e.pages.map(i=>i.template_page_id),"pages",n)}),iT=y.object({resource_type:Rt,version:sn}).strict(),sT=y.object({draft:Md}).strict(),Bo=y.object({groups:y.array(No)}).strict(),Wo=y.object({candidate:y.record(y.string(),y.unknown())}).strict();var Ot="[a-z0-9]+(?:-[a-z0-9]+)*",an=new RegExp(`^/(?:${Ot}(?:/${Ot})*)?$`),Vo=["/privacy","/cookie-policy","/system/not-found"],Kd=Vo.map(e=>`app/${e.slice(1)}/page.tsx`);function zd(e){return e.replace(/[^A-Za-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()}function Ho(e){return typeof e=="string"&&an.test(e)}function $o(e){if(typeof e!="string")return null;let n=e.trim();if(/[^\x00-\x7F]/.test(n))return null;let i=n.replace(/^\/+|\/+$/g,"");if(i==="")return"/";let s=i.split("/");if(s.some(c=>c==="."||c===".."))return null;let a=i.toLowerCase();if(a==="index"||a==="home")return"/";let r=s.map(zd).filter(c=>c.length>0);if(r.length===0)return null;let u=`/${r.join("/")}`;return Ho(u)?u:null}function Yo(e){let n=$o(e);if(n===null)throw new Error("Page slug must be an ASCII route without traversal segments.");return n}function Bd(e){let n=Yo(e);return n==="/"?"app/page.tsx":`app/${n.slice(1)}/page.tsx`}import{z as J}from"zod";import{z as d}from"zod";import{z as Oe}from"zod";var Wd=Oe.object({code:Oe.string().min(1),message:Oe.string().min(1)}),mT=Oe.object({code:Oe.string().min(1),message:Oe.string().min(1)});function rs(e){return Oe.object({ok:Oe.literal(!0),composition:U,data:e}).strict()}function Vd(e){let n={ok:Oe.literal(!1),composition:U,error:Wd.extend({code:e.codeSchema})};return e.currentSchema&&(n.current=e.currentSchema.optional()),e.diagnosticsSchema&&(n.diagnostics=Oe.array(e.diagnosticsSchema).optional()),e.dataSchema&&(n.data=e.dataSchema.optional()),Oe.object(n).strict()}function Xo(e){return Oe.discriminatedUnion("ok",[rs(e.dataSchema),Vd({codeSchema:e.codeSchema,currentSchema:e.currentSchema,diagnosticsSchema:e.diagnosticsSchema,dataSchema:e.failureDataSchema})])}import{z as Y}from"zod";var Ze=Y.object({start:Y.number().int().nonnegative(),end:Y.number().int().nonnegative()}).superRefine((e,n)=>{e.end<e.start&&n.addIssue({code:"custom",path:["end"],message:"end must be greater than or equal to start"})}),Hd=Y.object({code:Y.enum(["missing-class-name","unsupported-attribute-name","source-locator-warning","invalid-new-attr","version-conflict","write-failed"]),message:Y.string().min(1)}),Qo=Y.object({path:Y.string().min(1),content:Y.string(),hash:Y.string().min(1).optional()}),gT=Y.object({composition:U,revision:Y.string().min(1),entryCss:Qo,stylesheets:Y.array(Qo).default([])}).strict(),_T=Y.object({composition:ae}).strict(),hT=Y.object({key:Y.string().min(1),composition:ae}).strict(),Zo=Y.object({key:Y.string().min(1),composition:U,filePath:Y.string().min(1),componentName:Y.string().min(1),sourceKind:Y.enum(["missing","stringLiteral","expression"]),attrRaw:Y.string().min(1).nullable(),valueRaw:Y.string().min(1).nullable(),attrRange:Ze.nullable(),openingElementRange:Ze,version:Y.object({documentVersion:Y.number().int().nonnegative(),contentHash:Y.string().min(1)}),diagnostics:Y.array(Hd),computedStyle:Y.record(Y.string(),Y.string()).optional()}).strict().superRefine((e,n)=>{if(e.sourceKind==="missing"){(e.attrRaw!==null||e.valueRaw!==null||e.attrRange!==null)&&n.addIssue({code:"custom",message:"missing className source must not include attr raw or range"});return}(e.attrRaw===null||e.valueRaw===null||e.attrRange===null)&&n.addIssue({code:"custom",message:"present className source must include attr raw and ranges"})}),ST=Zo,fT=rs(Zo),cs=Y.object({source:Y.enum(["style-panel","class-source-editor"]),operation:Y.enum(["replace-static-classname","replace-expression","create-attribute","remove-attribute"])});import{z as Be}from"zod";var $d=new Set(["children","key","ref","dangerouslysetinnerhtml"]),Yd=new Set(["data-designer-hover-outline","data-designer-select-outline"]),Xd=/^[A-Za-z_$][A-Za-z0-9_$:-]*$/u;function Qd(e){return{code:"protected-attribute",message:`Property is protected from generic site editing: ${e}`}}function Zd(){return{code:"invalid-attribute-name",message:"Property name must be a valid single JSX attribute name"}}function Jd(e){let n=e.toLowerCase();return $d.has(n)||n.startsWith("data-vcp-")||Yd.has(n)||/^on[a-z]/iu.test(e)}function ms(e){if(!Xd.test(e))return{owner:"blocked",name:e,diagnostic:Zd()};if(Jd(e))return{owner:"blocked",name:e,diagnostic:Qd(e)};let n=e.toLowerCase();return n==="classname"||n==="class"?{owner:"class-name-source",name:e}:n==="style"?{owner:"style",name:e}:{owner:"generic",name:e}}import{z as Je}from"zod";var Tt=Je.lazy(()=>Je.union([Je.string(),Je.number().finite(),Je.boolean(),Je.null(),Je.array(Tt),Je.record(Je.string(),Tt)]));var Jo=Be.string().min(1),eu=Be.discriminatedUnion("operation",[Be.object({operation:Be.literal("set"),name:Jo,value:Tt}).strict(),Be.object({operation:Be.literal("remove"),name:Jo}).strict()]).superRefine((e,n)=>{let i=ms(e.name);i.owner==="blocked"&&n.addIssue({code:"custom",path:["name"],message:i.diagnostic?.message??"Property is not available for site editing"})}),er=Be.object({kind:Be.literal("set-props"),scope:Be.enum(["selection","template"]),changes:Be.array(eu).min(1)}).strict().superRefine((e,n)=>{let i=new Map;for(let[s,a]of e.changes.entries()){let r=ms(a.name),u=tu(r),c=i.get(u);c!==void 0?n.addIssue({code:"custom",path:["changes",s,"name"],message:`Duplicate property change; first declared at index ${c}`}):i.set(u,s)}});function tu(e){return e.owner==="class-name-source"||e.owner==="style"?`owner:${e.owner}`:`name:${e.name}`}import{z as nu}from"zod";var tr=nu.enum(["src","alt","poster","href","width","height"]);import{z as Nt}from"zod";var on=Nt.object({editingSessionId:Nt.string().min(1),lockId:Nt.string().min(1),ownerId:Nt.string().min(1),leaseAssertion:Nt.string().min(1)}).strict(),vT="signed-designer-mutations-v1",CT=Nt.object({mutationContext:on}).strict();import{z as p}from"zod";import{z as rn}from"zod";var Vn="::",ls=rn.object({file:rn.string().min(1),component:rn.string().min(1),structuralPath:rn.string().min(1),key:rn.string().min(1)}).superRefine((e,n)=>{let i=iu(e.file,e.component,e.structuralPath);e.key!==i&&n.addIssue({code:"custom",path:["key"],message:"key must match file::component::structuralPath"})});function iu(e,n,i){return`${e}${Vn}${n}${Vn}${i}`}function OT(e){let[n,i,...s]=e.split(Vn);return!n||!i||s.length===0?null:{file:n,component:i,structuralPath:s.join(Vn)}}var Hn=p.enum(["VERSION_STALE","RECOVERY_REQUIRED","MULTIPLE_PAGE_RETURNS","INDIRECT_RETURN_ONLY","PAGE_CONTAINER_AMBIGUOUS","NO_SAFE_PAGE_PLACEMENT","MEMBER_NOT_INDEPENDENT","UNSUPPORTED_ROUTE_STRUCTURE","RUNTIME_ANCHOR_UNRESOLVED","ROUTE_RETURN_NOT_FOUND"]),cn=p.object({code:p.string().min(1),message:p.string().min(1)}).strict(),su=p.union([p.object({kind:p.literal("virtual-route-root"),key:p.string().min(1)}).strict(),p.object({kind:p.literal("jsx-container"),key:p.string().min(1),sourceMemberKey:p.string().min(1),sourceFile:p.string().min(1),componentName:p.string().min(1).optional()}).strict(),p.object({kind:p.literal("starter-placeholder"),key:p.string().min(1),sourceFile:p.string().min(1).optional()}).strict()]),au=p.object({key:p.string().min(1),kind:p.enum(["jsx-element","jsx-fragment","jsx-expression","null-return","starter-placeholder"]),containerKey:p.string().min(1),label:p.string().min(1),sourceFile:p.string().min(1).optional(),isAtomic:p.boolean()}).strict(),ou=p.object({key:p.string().min(1),sourceMemberKey:p.string().min(1),containerKey:p.string().min(1),label:p.string().min(1),isIndependent:p.boolean()}).strict(),ru=p.object({key:p.string().min(1),containerKey:p.string().min(1),businessMemberKeys:p.array(p.string().min(1)),isMultiMember:p.boolean()}).strict(),ir=p.object({kind:p.literal("page-composition"),placementKey:p.string().min(1),documentVersion:p.number().int().nonnegative(),composition:ae}).strict(),cu=p.object({kind:p.literal("page-composition"),placementKey:p.string().min(1),documentVersion:p.number().int().nonnegative(),composition:U,placementUnitKey:p.string().min(1),relation:p.enum(["before","after","prepend","append"])}).strict(),sr=p.object({kind:p.literal("page-composition"),placementKey:p.string().min(1),documentVersion:p.number().int().nonnegative(),composition:ae,placementUnitKey:p.string().min(1),relation:p.enum(["before","after","prepend","append"])}).strict(),ar=p.object({kind:p.literal("page-unit"),composition:ae,placementUnitKey:p.string().min(1)}).strict(),or=p.object({kind:p.literal("page-unit"),composition:U,placementUnitKey:p.string().min(1)}).strict();function et(e,n,i,s,a){let r=new Set;for(let[u,c]of e.entries()){let g=s(c);r.has(g)&&n.addIssue({code:"custom",path:[i,u,a],message:`Duplicate ${i} key: ${g}`}),r.add(g)}}var mu=p.object({status:p.literal("supported"),version:p.number().int().nonnegative(),composition:U,container:su,sourceMembers:p.array(au),businessMembers:p.array(ou),placementUnits:p.array(ru),placements:p.array(cu)}).strict().superRefine((e,n)=>{et(e.sourceMembers,n,"sourceMembers",c=>c.key,"key"),et(e.businessMembers,n,"businessMembers",c=>c.key,"key"),et(e.placementUnits,n,"placementUnits",c=>c.key,"key"),et(e.placements,n,"placements",c=>c.placementKey,"placementKey");let i=new Set(e.sourceMembers.map(c=>c.key)),s=new Set(e.placementUnits.map(c=>c.key)),a=new Map(e.sourceMembers.map(c=>[c.key,c])),r=new Map(e.businessMembers.map(c=>[c.key,c]));for(let[c,g]of e.sourceMembers.entries()){g.containerKey!==e.container.key&&!i.has(g.containerKey)&&n.addIssue({code:"custom",path:["sourceMembers",c,"containerKey"],message:"Source member parent must reference the page container or another source member."}),g.containerKey===g.key&&n.addIssue({code:"custom",path:["sourceMembers",c,"containerKey"],message:"Source member cannot contain itself."});let k=new Set([g.key]),I=g.containerKey;for(;I!==e.container.key;){if(k.has(I)){n.addIssue({code:"custom",path:["sourceMembers",c,"containerKey"],message:"Source member hierarchy must be acyclic."});break}k.add(I);let C=a.get(I);if(!C)break;I=C.containerKey}}e.container.kind==="jsx-container"&&!i.has(e.container.sourceMemberKey)&&n.addIssue({code:"custom",path:["container","sourceMemberKey"],message:"Container sourceMemberKey must reference a source member."});for(let[c,g]of e.businessMembers.entries())i.has(g.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",c,"sourceMemberKey"],message:"Business member must reference a source member."}),s.has(g.containerKey)||n.addIssue({code:"custom",path:["businessMembers",c,"containerKey"],message:"Business member must reference a placement unit container."});for(let[c,g]of e.placementUnits.entries()){let k=a.get(g.containerKey);k?k.containerKey!==e.container.key&&n.addIssue({code:"custom",path:["placementUnits",c,"containerKey"],message:"Placement unit must reference a direct child of the page container."}):n.addIssue({code:"custom",path:["placementUnits",c,"containerKey"],message:"Placement unit containerKey must reference a source member."});let I=new Set;for(let[C,F]of g.businessMemberKeys.entries()){let B=r.get(F);if(!B){n.addIssue({code:"custom",path:["placementUnits",c,"businessMemberKeys",C],message:"Placement unit must reference existing business members."});continue}I.has(F)&&n.addIssue({code:"custom",path:["placementUnits",c,"businessMemberKeys",C],message:"Placement unit cannot reference the same business member twice."}),I.add(F),B.containerKey!==g.key&&n.addIssue({code:"custom",path:["placementUnits",c,"businessMemberKeys",C],message:"Business member containerKey must match its placement unit."});let ne=B.sourceMemberKey,ce=new Set;for(;ne&&ne!==g.containerKey&&!ce.has(ne);)ce.add(ne),ne=a.get(ne)?.containerKey;ne!==g.containerKey&&n.addIssue({code:"custom",path:["placementUnits",c,"businessMemberKeys",C],message:"Placement unit business members must belong to its source subtree."})}}for(let[c,g]of e.businessMembers.entries())e.placementUnits.find(I=>I.key===g.containerKey)?.businessMemberKeys.includes(g.key)||n.addIssue({code:"custom",path:["businessMembers",c,"containerKey"],message:"Business member must be listed by its placement unit container."});let u=new Map;for(let c of e.placementUnits)u.set(c.containerKey,(u.get(c.containerKey)??0)+1);for(let[c,g]of e.sourceMembers.entries())g.containerKey===e.container.key&&u.get(g.key)!==1&&n.addIssue({code:"custom",path:["sourceMembers",c,"key"],message:"Every direct source member must be owned by exactly one placement unit."});for(let[c,g]of e.placements.entries())mr(g.composition,e.composition)||n.addIssue({code:"custom",path:["placements",c,"composition"],message:"Page placement composition must match page composition."}),g.documentVersion!==e.version&&n.addIssue({code:"custom",path:["placements",c,"documentVersion"],message:"Page placement version must match page composition version."}),s.has(g.placementUnitKey)||n.addIssue({code:"custom",path:["placements",c,"placementUnitKey"],message:"Placement option must reference an existing placement unit."})}),lu=p.object({status:p.literal("unsupported"),version:p.number().int().nonnegative(),composition:U,reason:Hn,diagnostics:p.array(cn)}).strict(),pu=p.discriminatedUnion("status",[mu,lu]),rr=2,qT="page-composition-v2",cr=p.object({start:p.number().int().nonnegative(),end:p.number().int().nonnegative(),startLine:p.number().int().positive().optional(),startColumn:p.number().int().nonnegative().optional(),endLine:p.number().int().positive().optional(),endColumn:p.number().int().nonnegative().optional()}).strict().superRefine((e,n)=>{e.end<e.start&&n.addIssue({code:"custom",path:["end"],message:"Source range end must be greater than or equal to start."});let i=[e.startLine,e.startColumn,e.endLine,e.endColumn],s=i.some(r=>r!==void 0),a=i.every(r=>r!==void 0);s&&!a&&n.addIssue({code:"custom",path:["startLine"],message:"Source line and column locations must be provided together."}),e.startLine!==void 0&&e.endLine!==void 0&&e.endLine<e.startLine&&n.addIssue({code:"custom",path:["endLine"],message:"Source range endLine must not precede startLine."}),e.startLine!==void 0&&e.endLine===e.startLine&&e.startColumn!==void 0&&e.endColumn!==void 0&&e.endColumn<e.startColumn&&n.addIssue({code:"custom",path:["endColumn"],message:"Source range endColumn must not precede startColumn."})}),du=p.object({key:p.string().min(1),instanceIndex:p.number().int().nonnegative().optional(),instanceCount:p.number().int().positive().optional(),textSegmentIndex:p.number().int().nonnegative().optional()}).strict().superRefine((e,n)=>{e.instanceIndex!==void 0&&e.instanceCount!==void 0&&e.instanceIndex>=e.instanceCount&&n.addIssue({code:"custom",path:["instanceIndex"],message:"instanceIndex must be lower than instanceCount."})}),uu=p.enum(["component-call","native-jsx","dynamic-expression","indirect-expression","text","starter-placeholder"]),gu=p.enum(["none","dynamic-expression","indirect-expression","text","starter-placeholder"]),_u=p.discriminatedUnion("kind",[p.object({kind:p.literal("virtual-route-root"),key:p.null(),routeReturn:p.object({sourceIdentity:ls,sourceRange:cr}).strict()}).strict(),p.object({kind:p.literal("jsx-container"),key:p.string().min(1),sourceMemberKey:p.string().min(1)}).strict(),p.object({kind:p.literal("starter-placeholder"),key:p.string().min(1),sourceMemberKey:p.string().min(1),replacementMode:p.literal("replace")}).strict()]),hu=p.object({key:p.string().min(1),kind:uu,parentKey:p.string().min(1).nullable(),childKeys:p.array(p.string().min(1)),order:p.number().int().nonnegative(),label:p.string().min(1),sourceIdentity:ls,sourceRange:cr.nullable(),atomicKind:gu}).strict().superRefine((e,n)=>{let i=e.kind==="component-call"||e.kind==="native-jsx"?"none":e.kind;e.atomicKind!==i&&n.addIssue({code:"custom",path:["atomicKind"],message:`atomicKind must be ${i} for ${e.kind}.`});let s=new Set;for(let[a,r]of e.childKeys.entries())s.has(r)&&n.addIssue({code:"custom",path:["childKeys",a],message:`Duplicate child source member key: ${r}`}),s.add(r)}),Su=p.object({key:p.string().min(1),sourceMemberKey:p.string().min(1),placementUnitKey:p.string().min(1),label:p.string().min(1),isIndependent:p.boolean()}).strict(),fu=p.enum(["independent","atomic","container"]),bu=p.object({key:p.string().min(1),containerKey:p.string().min(1).nullable(),sourceMemberKeys:p.array(p.string().min(1)).min(1),businessMemberKeys:p.array(p.string().min(1)),order:p.number().int().nonnegative(),boundaryMode:fu,isIndependent:p.boolean(),isMultiMember:p.boolean()}).strict().superRefine((e,n)=>{nr(e.sourceMemberKeys,n,"sourceMemberKeys","source member"),nr(e.businessMemberKeys,n,"businessMemberKeys","business member");let i=e.sourceMemberKeys.length>1||e.businessMemberKeys.length>1;e.isMultiMember!==i&&n.addIssue({code:"custom",path:["isMultiMember"],message:"isMultiMember must reflect the source and business member cardinality."});let s=e.boundaryMode==="independent";e.isIndependent!==s&&n.addIssue({code:"custom",path:["isIndependent"],message:"isIndependent must match boundaryMode."})}),yu=p.enum(["before","after","prepend","append","replace"]),xu=p.enum(["insert-sibling","insert-child","replace-placeholder"]),Eu=p.object({kind:p.literal("page-composition"),placementKey:p.string().min(1),documentVersion:p.number().int().nonnegative(),composition:U,placementUnitKey:p.string().min(1),containerKey:p.string().min(1).nullable(),relation:yu,writeMode:xu}).strict().superRefine((e,n)=>{let i=e.relation==="before"||e.relation==="after"?"insert-sibling":e.relation==="prepend"||e.relation==="append"?"insert-child":"replace-placeholder";e.writeMode!==i&&n.addIssue({code:"custom",path:["writeMode"],message:`writeMode must be ${i} for ${e.relation}.`})}),Iu=p.object({key:p.string().min(1),placementUnitKey:p.string().min(1),runtimeRefs:p.array(du).min(1)}).strict(),Ru=p.object({schemaVersion:p.literal(rr),status:p.literal("supported"),version:p.number().int().nonnegative(),composition:U,container:_u,sourceMembers:p.array(hu),businessMembers:p.array(Su),placementUnits:p.array(bu),placements:p.array(Eu),visualAnchors:p.array(Iu).optional(),diagnostics:p.array(cn)}).strict().superRefine((e,n)=>{Au(e,n)}),Tu=p.object({schemaVersion:p.literal(rr),status:p.literal("unsupported"),version:p.number().int().nonnegative(),composition:U,reason:Hn,diagnostics:p.array(cn)}).strict(),ku=p.discriminatedUnion("status",[Ru,Tu]),FT=p.union([ku,pu]);function nr(e,n,i,s){let a=new Set;for(let[r,u]of e.entries())a.has(u)&&n.addIssue({code:"custom",path:[i,r],message:`Duplicate ${s} key: ${u}`}),a.add(u)}function mr(e,n){return Ui(e)===Ui(n)}function Au(e,n){et(e.sourceMembers,n,"sourceMembers",I=>I.key,"key"),et(e.businessMembers,n,"businessMembers",I=>I.key,"key"),et(e.placementUnits,n,"placementUnits",I=>I.key,"key"),et(e.placements,n,"placements",I=>I.placementKey,"placementKey"),et(e.visualAnchors??[],n,"visualAnchors",I=>I.key,"key"),wu(e,n);let i=new Map(e.sourceMembers.map(I=>[I.key,I])),s=new Map(e.businessMembers.map(I=>[I.key,I])),a=new Map(e.placementUnits.map(I=>[I.key,I]));Pu(e,i,n),e.container.kind!=="virtual-route-root"&&(i.has(e.container.sourceMemberKey)||n.addIssue({code:"custom",path:["container","sourceMemberKey"],message:"Container sourceMemberKey must reference a source member."}));let r=new Map,u=new Map,c=new Set;for(let[I,C]of e.placementUnits.entries()){C.containerKey!==e.container.key&&n.addIssue({code:"custom",path:["placementUnits",I,"containerKey"],message:"Placement unit containerKey must match the page container."});let F=`${C.containerKey??"<virtual>"}:${C.order}`;c.has(F)&&n.addIssue({code:"custom",path:["placementUnits",I,"order"],message:"Placement unit order must be unique within its container."}),c.add(F);for(let[B,ne]of C.sourceMemberKeys.entries()){i.has(ne)||n.addIssue({code:"custom",path:["placementUnits",I,"sourceMemberKeys",B],message:"Placement unit must reference existing source members."});let ce=r.get(ne);ce&&ce!==C.key&&n.addIssue({code:"custom",path:["placementUnits",I,"sourceMemberKeys",B],message:`Source member is already assigned to ${ce}.`}),r.set(ne,C.key)}for(let[B,ne]of C.businessMemberKeys.entries()){let ce=s.get(ne);if(!ce){n.addIssue({code:"custom",path:["placementUnits",I,"businessMemberKeys",B],message:"Placement unit must reference existing business members."});continue}ce.placementUnitKey!==C.key&&n.addIssue({code:"custom",path:["placementUnits",I,"businessMemberKeys",B],message:"Placement unit and business member must reference each other."}),C.sourceMemberKeys.includes(ce.sourceMemberKey)||n.addIssue({code:"custom",path:["placementUnits",I,"businessMemberKeys",B],message:"Business member sourceMemberKey must belong to the placement unit."});let Ht=u.get(ne);Ht&&Ht!==C.key&&n.addIssue({code:"custom",path:["placementUnits",I,"businessMemberKeys",B],message:`Business member is already assigned to ${Ht}.`}),u.set(ne,C.key)}}for(let[I,C]of e.businessMembers.entries()){i.has(C.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",I,"sourceMemberKey"],message:"Business member must reference a source member."});let F=a.get(C.placementUnitKey);if(!F){n.addIssue({code:"custom",path:["businessMembers",I,"placementUnitKey"],message:"Business member must reference a placement unit."});continue}F.businessMemberKeys.includes(C.key)||n.addIssue({code:"custom",path:["businessMembers",I,"placementUnitKey"],message:"Business member and placement unit must reference each other."}),F.sourceMemberKeys.includes(C.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",I,"sourceMemberKey"],message:"Business member sourceMemberKey must belong to its placement unit."});let B=F.isIndependent&&F.businessMemberKeys.length===1;C.isIndependent!==B&&n.addIssue({code:"custom",path:["businessMembers",I,"isIndependent"],message:"Business member independence must match its placement unit boundary."})}let g=new Set;for(let[I,C]of e.placements.entries()){C.documentVersion!==e.version&&n.addIssue({code:"custom",path:["placements",I,"documentVersion"],message:"Page placement version must match page composition version."}),mr(C.composition,e.composition)||n.addIssue({code:"custom",path:["placements",I,"composition"],message:"Page placement composition must match page composition."});let F=a.get(C.placementUnitKey);F?C.containerKey!==F.containerKey&&n.addIssue({code:"custom",path:["placements",I,"containerKey"],message:"Placement containerKey must match its placement unit."}):n.addIssue({code:"custom",path:["placements",I,"placementUnitKey"],message:"Placement option must reference a placement unit."});let B=`${C.placementUnitKey}:${C.relation}`;g.has(B)&&n.addIssue({code:"custom",path:["placements",I,"relation"],message:"A placement unit cannot expose the same relation more than once."}),g.add(B),C.relation==="replace"&&e.container.kind!=="starter-placeholder"&&n.addIssue({code:"custom",path:["placements",I,"relation"],message:"replace is only valid for a starter placeholder container."}),e.container.kind==="starter-placeholder"&&C.relation!=="replace"&&n.addIssue({code:"custom",path:["placements",I,"relation"],message:"Starter placeholder placements must use replace."})}let k=new Set;for(let[I,C]of(e.visualAnchors??[]).entries())a.has(C.placementUnitKey)||n.addIssue({code:"custom",path:["visualAnchors",I,"placementUnitKey"],message:"Visual anchor must reference a placement unit."}),k.has(C.placementUnitKey)&&n.addIssue({code:"custom",path:["visualAnchors",I,"placementUnitKey"],message:"A placement unit may expose only one visual anchor."}),k.add(C.placementUnitKey)}function wu(e,n){let i=[];e.container.key!==null&&i.push({key:e.container.key,path:["container","key"],namespace:"container"});for(let[a,r]of e.sourceMembers.entries())i.push({key:r.key,path:["sourceMembers",a,"key"],namespace:"source member"});for(let[a,r]of e.businessMembers.entries())i.push({key:r.key,path:["businessMembers",a,"key"],namespace:"business member"});for(let[a,r]of e.placementUnits.entries())i.push({key:r.key,path:["placementUnits",a,"key"],namespace:"placement unit"});for(let[a,r]of(e.visualAnchors??[]).entries())i.push({key:r.key,path:["visualAnchors",a,"key"],namespace:"visual anchor"});let s=new Map;for(let a of i){let r=s.get(a.key);r?n.addIssue({code:"custom",path:a.path,message:`${a.namespace} key collides with ${r}: ${a.key}`}):s.set(a.key,a.namespace)}}function Pu(e,n,i){let s=new Set;for(let[a,r]of e.sourceMembers.entries()){let u=`${r.parentKey??"<root>"}:${r.order}`;if(s.has(u)&&i.addIssue({code:"custom",path:["sourceMembers",a,"order"],message:"Source member order must be unique among siblings."}),s.add(u),r.parentKey===r.key&&i.addIssue({code:"custom",path:["sourceMembers",a,"parentKey"],message:"Source member cannot be its own parent."}),r.parentKey!==null){let k=n.get(r.parentKey);k?k.childKeys.includes(r.key)||i.addIssue({code:"custom",path:["sourceMembers",a,"parentKey"],message:"Source parent and child references must be bidirectional."}):i.addIssue({code:"custom",path:["sourceMembers",a,"parentKey"],message:"Source member parentKey must reference a source member."})}for(let[k,I]of r.childKeys.entries()){if(I===r.key){i.addIssue({code:"custom",path:["sourceMembers",a,"childKeys",k],message:"Source member cannot be its own child."});continue}let C=n.get(I);C?C.parentKey!==r.key&&i.addIssue({code:"custom",path:["sourceMembers",a,"childKeys",k],message:"Source parent and child references must be bidirectional."}):i.addIssue({code:"custom",path:["sourceMembers",a,"childKeys",k],message:"Source child key must reference a source member."})}let c=new Set,g=r;for(;g;){if(c.has(g.key)){i.addIssue({code:"custom",path:["sourceMembers",a,"parentKey"],message:"Source member graph must be acyclic."});break}c.add(g.key),g=g.parentKey===null?void 0:n.get(g.parentKey)}}}var mn=d.enum(["update-text","update-array-item","remove-node","insert-child","replace-node","move-node","set-class-name-source","set-props","apply-style-draft","source-edit","insert-page-resource","delete-page-source"]),vu=d.discriminatedUnion("kind",[d.object({kind:d.literal("node"),key:d.string().min(1)}).strict(),ar,d.object({kind:d.literal("route"),composition:ae}).strict(),d.object({kind:d.literal("source-file"),path:_e}).strict(),d.object({kind:d.literal("source-batch"),paths:d.array(_e).min(1)}).superRefine((e,n)=>{let i=new Set;for(let[s,a]of e.paths.entries())i.has(a)&&n.addIssue({code:"custom",path:["paths",s],message:`Duplicate source target path: ${a}`}),i.add(a)}).strict(),d.object({kind:d.literal("project")}).strict()]),Cu=d.discriminatedUnion("kind",[d.object({kind:d.literal("node"),key:d.string().min(1)}).strict(),or,d.object({kind:d.literal("route"),composition:U}).strict(),d.object({kind:d.literal("source-file"),path:_e}).strict(),d.object({kind:d.literal("source-batch"),paths:d.array(_e).min(1)}).strict(),d.object({kind:d.literal("project")}).strict()]),pr=d.enum(["display","position","top","right","bottom","left","zIndex","flexDirection","flexWrap","flexGrow","flexShrink","flexBasis","order","gridTemplateColumns","gridTemplateRows","columns","gridColumn","gridRow","gap","gapX","gapY","spaceX","spaceY","alignItems","justifyContent","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","width","height","minWidth","minHeight","maxWidth","maxHeight","overflow","fontFamily","fontSize","fontWeight","lineHeight","letterSpacing","textAlign","textTransform","textDecoration","textOverflow","textIndent","writingMode","whiteSpace","wordBreak","lineClamp","fontVariantNumeric","screenReaderOnly","color","backgroundColor","backgroundImage","backgroundRepeat","backgroundSize","backgroundPosition","backgroundAttachment","backgroundClip","backgroundOrigin","borderStyle","borderWidth","borderRadius","borderColor","objectFit","objectPosition","aspectRatio","opacity","boxShadow","transform","transformOrigin","transitionProperty","transitionDuration","transitionTimingFunction","animation","pointerEvents","cursor","userSelect","fontStyle","textUnderlineOffset","scrollMarginTop","alignSelf","flex","outlineStyle","resize","ringWidth","ringColor","backdropFilter","overscrollBehavior","divideWidth","divideColor"]),dr=d.enum(["hover","active","focus","disabled"]),ur=d.enum(["sm","md","lg","xl","2xl"]),lr=d.union([d.object({relation:d.enum(["before","after"]),anchorKey:d.string().min(1)}),d.object({relation:d.enum(["prepend","append"]),parentKey:d.string().min(1)}),sr]),gr=d.object({kind:d.literal("component-call"),component:d.never().optional(),materialization:Et,props:d.record(d.string(),d.never()).optional()}).strict(),Du=d.union([d.object({kind:d.literal("native-tag"),tag:d.string().min(1),text:d.string().optional()}),d.object({kind:d.literal("component-call"),component:d.object({source:d.string().min(1),exportName:d.string().min(1)}),materialization:d.never().optional(),props:d.record(d.string(),d.unknown()).optional()}).strict(),gr]),ju=d.discriminatedUnion("kind",[d.object({kind:d.literal("update-text"),segmentIndex:d.number().int().min(0),value:d.string()}),d.object({kind:d.literal("update-array-item"),segmentIndex:d.number().int().min(0),index:d.number().int().min(0),value:d.string()}),d.object({kind:d.literal("remove-node")}),d.object({kind:d.literal("insert-child"),node:Du,position:d.union([lr,ir])}),d.object({kind:d.literal("replace-node"),node:gr}),d.object({kind:d.literal("move-node"),target:lr,preserveBindings:d.boolean().optional()}),d.object({kind:d.literal("set-class-name-source"),filePath:d.string().min(1),expectedVersion:d.object({documentVersion:d.number().int().nonnegative(),contentHash:d.string().min(1)}),oldAttrRaw:d.string().min(1).nullable(),oldAttrRange:Ze.nullable(),openingElementRange:Ze,newAttrRaw:d.string().min(1).nullable(),intent:cs}),er,d.object({kind:d.literal("apply-style-draft"),className:d.object({filePath:d.string().min(1),expectedVersion:d.object({documentVersion:d.number().int().nonnegative(),contentHash:d.string().min(1)}),oldAttrRaw:d.string().min(1).nullable(),oldAttrRange:Ze.nullable(),openingElementRange:Ze,newAttrRaw:d.string().min(1).nullable(),intent:cs}).optional(),props:d.partialRecord(tr,d.string()).optional()}).superRefine((e,n)=>{!e.className&&!e.props&&n.addIssue({code:"custom",message:"apply-style-draft requires className or props"})}),d.object({kind:d.literal("source-edit"),conflictPolicy:d.enum(["compare-and-swap","overwrite"]),edits:d.array(d.discriminatedUnion("operation",[d.object({operation:d.literal("upsert"),path:_e,content:d.string(),baseContentHash:d.string().min(1).nullable().optional()}).strict().superRefine((e,n)=>{Fi(e.path)||n.addIssue({code:"custom",path:["path"],message:"source-edit upsert only accepts allowlisted text source files"}),e.content.includes("\0")&&n.addIssue({code:"custom",path:["content"],message:"source-edit content must be valid text"})}),d.object({operation:d.literal("delete"),path:_e,capability:$a,confirmDelete:d.literal(!0),confirmPath:_e,baseContentHash:d.string().min(1).nullable().optional()}).strict().superRefine((e,n)=>{e.capability!==qi&&n.addIssue({code:"custom",path:["capability"],message:"delete requires source-delete capability"}),e.confirmPath!==e.path&&n.addIssue({code:"custom",path:["confirmPath"],message:"delete confirmation path must match edit path"}),Fi(e.path)||n.addIssue({code:"custom",path:["path"],message:"source-edit delete only accepts allowlisted text source files"});let i=Gi(e.path);i&&n.addIssue({code:"custom",path:["path"],message:`Protected source file cannot be deleted: ${e.path} (${i})`})})])).min(1),reason:d.string().min(1).optional()}).strict().superRefine((e,n)=>{let i=new Set;for(let[s,a]of e.edits.entries())i.has(a.path)&&n.addIssue({code:"custom",path:["edits",s,"path"],message:`Duplicate source edit path: ${a.path}`}),i.add(a.path),e.conflictPolicy==="compare-and-swap"&&a.baseContentHash===void 0&&n.addIssue({code:"custom",path:["edits",s,"baseContentHash"],message:"source-edit compare-and-swap requires baseContentHash for every edit"})}),d.object({kind:d.literal("insert-page-resource"),artifact:os}).strict(),d.object({kind:d.literal("delete-page-source"),expectedUrlPath:d.string().startsWith("/")}).strict()]),_r=d.enum(["NODE_NOT_FOUND","HOME_PAGE_LOCKED","ROUTE_NOT_FOUND","CAPABILITY_REJECTED","CONSTRAINT_VIOLATED","INVALID_PARAMS","PLAN_FAILED","TRANSACTION_PREFLIGHT_FAILED","ROUTE_REBUILD_FAILED","HISTORY_COMMIT_FAILED","MATERIALIZATION_CONFLICT","MATERIALIZATION_REJECTED","MUTATION_ASSERTION_REQUIRED","MUTATION_ASSERTION_INVALID","VERSION_STALE","AST_PARSE_ERROR","UNSUPPORTED_OPERATION","LOCATOR_FAILED","INVALID_TARGET","WRITE_IO_ERROR","CONCURRENT_MODIFIED","ROLLBACK_FAILED","RECOVERY_REQUIRED","RECOVERY_PERSIST_FAILED","MUTATION_SESSION_REQUIRED","LEASE_ASSERTION_INVALID","LEASE_ASSERTION_EXPIRED","LEASE_ASSERTION_SCOPE_MISMATCH","CROSS_PAGE_MOVE_UNSUPPORTED","INTERNAL_ERROR"]),hr=d.object({code:_r,message:d.string().min(1),details:d.record(d.string(),d.unknown()).optional()}),Lt=d.object({key:d.string().min(1),instanceIndex:d.number().int().nonnegative().optional(),instanceCount:d.number().int().positive().optional()}),ps=d.object({id:d.string().min(1),siteId:R,baseSnapshotId:T,composition:ae,kind:mn,target:vu,documentVersion:d.number().int().nonnegative(),selectionRef:Lt.optional(),mutationContext:on.optional(),params:ju}).strict().superRefine((e,n)=>{if(e.kind!==e.params.kind&&n.addIssue({code:"custom",path:["params","kind"],message:"params.kind must match operation kind"}),e.kind==="source-edit"){if(e.target.kind!=="source-file"&&e.target.kind!=="source-batch")n.addIssue({code:"custom",path:["target","kind"],message:"source-edit requires a source-file or source-batch target"});else if(e.params.kind==="source-edit"){let i=e.params.edits.map(a=>a.path),s=e.target.kind==="source-file"?[e.target.path]:e.target.paths;Mu(i,s)||n.addIssue({code:"custom",path:["target"],message:"source-edit target paths must match edit paths"})}}else(e.target.kind==="source-file"||e.target.kind==="source-batch")&&n.addIssue({code:"custom",path:["target","kind"],message:"source targets are only valid for source-edit"});e.target.kind==="page-unit"&&(e.kind!=="insert-child"&&e.kind!=="replace-node"&&e.kind!=="move-node"&&e.kind!=="remove-node"&&n.addIssue({code:"custom",path:["target","kind"],message:"page-unit target is only valid for page-level operations"}),e.kind==="move-node"&&e.params.kind==="move-node"&&(!("kind"in e.params.target)||e.params.target.kind!=="page-composition")&&n.addIssue({code:"custom",path:["params","target","kind"],message:"page-unit move-node target requires page-composition placement"})),e.params.kind==="insert-child"&&"kind"in e.params.position&&e.params.position.kind==="page-composition"&&e.target.kind!=="page-unit"&&n.addIssue({code:"custom",path:["params","position","kind"],message:"page-composition position requires page-unit target"}),e.kind==="replace-node"&&e.target.kind!=="page-unit"&&n.addIssue({code:"custom",path:["target","kind"],message:"replace-node requires a page-unit target"}),e.kind==="insert-page-resource"||e.kind==="delete-page-source"?e.target.kind!=="project"&&n.addIssue({code:"custom",path:["target","kind"],message:`${e.kind} requires a project target`}):e.target.kind==="project"&&n.addIssue({code:"custom",path:["target","kind"],message:"project target is only valid for insert-page-resource or delete-page-source"}),e.kind==="insert-child"&&e.target.kind==="page-unit"&&e.params.kind==="insert-child"&&(!("kind"in e.params.position)||e.params.position.kind!=="page-composition")&&n.addIssue({code:"custom",path:["params","position","kind"],message:"page-unit target requires page-composition position"})}),ek=ps,Ou=d.object({kind:d.literal("insert-page-resource"),package_instance_id:d.string().min(1),pages:d.array(Ko).min(1)}).strict().superRefine((e,n)=>{let i=new Set,s=new Set;for(let[a,r]of e.pages.entries())i.has(r.template_page_id)&&n.addIssue({code:"custom",path:["pages",a,"template_page_id"],message:`Duplicate template page route mapping: ${r.template_page_id}`}),s.has(r.final_route)&&n.addIssue({code:"custom",path:["pages",a,"final_route"],message:`Duplicate final route mapping: ${r.final_route}`}),i.add(r.template_page_id),s.add(r.final_route)}),Nu=d.object({kind:d.literal("delete-page-source"),deleted_files:d.array(d.string().min(1)),updated_files:d.array(d.string().min(1)),preserved_shared_files:d.array(d.string().min(1)),warnings:d.array(d.string().min(1))}).strict(),Lu=d.discriminatedUnion("kind",[Ou,Nu]),Sr=d.object({requestId:d.string().min(1),kind:mn,composition:U,target:Cu,resultVersion:d.number().int().nonnegative(),affectedFiles:d.array(d.string().min(1)).optional(),selectionRef:Lt.optional(),output:Lu.optional()}).strict(),ds=Sr.superRefine((e,n)=>{let i=e.kind==="insert-page-resource"||e.kind==="delete-page-source";i&&e.target.kind!=="project"?n.addIssue({code:"custom",path:["target","kind"],message:`${e.kind} result requires a project target`}):!i&&e.target.kind==="project"&&n.addIssue({code:"custom",path:["target","kind"],message:"project result target requires a project operation"}),i&&!e.output&&n.addIssue({code:"custom",path:["output"],message:`${e.kind} result requires typed output`}),e.output&&e.output.kind!==e.kind&&n.addIssue({code:"custom",path:["output","kind"],message:"output.kind must match operation kind"})}),tk=Xo({dataSchema:ds,codeSchema:_r,failureDataSchema:Sr.partial()});function Mu(e,n){return e.length===n.length&&e.every((i,s)=>i===n[s])}var Uu=J.enum(["component","page","pages"]),qu=J.object({resource_kind:Uu,resource_name:J.string().trim().min(1).max(200),file_count:J.number().int().min(1).max(64),total_bytes:J.number().int().min(0).max(4*1024*1024),content_digest:J.string().regex(/^sha256:[a-f0-9]{64}$/),custom_prompt:J.string().trim().min(1).max(4e3).optional(),final_routes:J.array(J.string().min(1)).max(64)}).strict(),Fu=J.discriminatedUnion("kind",[J.object({kind:J.literal("none")}).strict(),J.object({kind:J.literal("primary"),items:J.array(J.object({label:J.string().trim().min(1).max(120),href:J.string().startsWith("/").max(200)}).strict()).min(1).max(64)}).strict().superRefine((e,n)=>{let i=new Set;for(let[s,a]of e.items.entries())i.has(a.href)&&n.addIssue({code:"custom",path:["items",s,"href"],message:`Duplicate navigation href: ${a.href}`}),i.add(a.href)})]),Gu=J.object({base_snapshot_id:J.string().min(1),operation:ps,navigation_selection:Fu.optional()}).strict().superRefine((e,n)=>{e.base_snapshot_id!==e.operation.baseSnapshotId&&n.addIssue({code:"custom",path:["operation","baseSnapshotId"],message:"Resource operation baseSnapshotId must match base_snapshot_id."})});function Ku(e){return(e.kind==="insert-child"||e.kind==="replace-node")&&(e.params.kind==="insert-child"||e.params.kind==="replace-node")&&e.params.node.kind==="component-call"&&"materialization"in e.params.node&&e.params.node.materialization?[e.params.node.materialization]:e.kind==="insert-page-resource"&&e.params.kind==="insert-page-resource"?[...e.params.artifact.components.map(n=>n.materialization),...e.params.artifact.pages.map(n=>n.materialization)]:[]}var fr=J.object({id:J.string().min(1),tenant_id:J.string().min(1),site_id:J.string().min(1),run_id:J.string().min(1).optional(),correlation_id:J.string().min(1).optional(),sent_at:J.string().min(1),type:J.literal("client.resource.operation.create"),payload:J.object({client_message_id:J.string().min(1),display:qu,transient_resource_input:Gu}).strict()}).strict().superRefine((e,n)=>{let{display:i,transient_resource_input:s}=e.payload;e.site_id!==s.operation.siteId&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation","siteId"],message:"Resource operation siteId must match envelope site_id."}),(i.resource_kind==="component"?s.operation.kind==="insert-child"||s.operation.kind==="replace-node":s.operation.kind==="insert-page-resource")||n.addIssue({code:"custom",path:["payload","transient_resource_input","operation","kind"],message:i.resource_kind==="component"?"component resources require insert-child or replace-node.":`${i.resource_kind} resources require insert-page-resource.`});let u=Ku(s.operation).flatMap(g=>g.files),c=u.reduce((g,k)=>g+new TextEncoder().encode(k.content).byteLength,0);if(u.length>Xi&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation"],message:"Resource operation exceeds the aggregate file count limit."}),c>Qi&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation"],message:"Resource operation exceeds the aggregate content byte limit."}),i.file_count!==u.length&&n.addIssue({code:"custom",path:["payload","display","file_count"],message:"Resource summary file_count must match the transient operation."}),i.total_bytes!==c&&n.addIssue({code:"custom",path:["payload","display","total_bytes"],message:"Resource summary total_bytes must match the transient operation."}),s.operation.kind==="insert-page-resource"&&s.operation.params.kind==="insert-page-resource"){let g=s.operation.params.artifact;g.resource_type!==i.resource_kind&&n.addIssue({code:"custom",path:["payload","display","resource_kind"],message:"Resource summary kind must match the page artifact resource_type."});let k=g.pages.map(I=>I.final_route);(k.length!==i.final_routes.length||k.some((I,C)=>I!==i.final_routes[C]))&&n.addIssue({code:"custom",path:["payload","display","final_routes"],message:"Resource summary final_routes must match the page artifact routes."})}if(s.navigation_selection?.kind==="primary"){let g=new Set(i.final_routes);for(let[k,I]of s.navigation_selection.items.entries())g.has(I.href)||n.addIssue({code:"custom",path:["payload","transient_resource_input","navigation_selection","items",k,"href"],message:"Navigation selection href must reference a final resource route."})}});import{z as w}from"zod";var zu=["with_website","without_website"],$n=w.enum(zu),us=w.string().trim().url().refine(e=>{let n=new URL(e).protocol;return n==="http:"||n==="https:"},{message:"Website must use the http or https protocol."}),Bu=["welcome","website_scan","customer_materials","analysis","diagnosis","strategy","structure_planning","preview_personalization","publishing"],ln=w.enum(Bu),Wu=["company_info","website_crawl","website_basic_info_extract","website_metrics_evaluate","intelligent_analysis","strategy_recommendation"],yr=w.enum(Wu),Vu=["started","running","succeeded","failed","invalidated"],xr=w.enum(Vu),Hu=["draft","structure_saved","generating","workspace_ready"],gs=w.enum(Hu),$u=["not_deployed","deploying","deployed"],_s=w.enum($u),Yu=["active","completed"],Xu=w.enum(Yu),Qu=["completed","current","locked"],Zu=w.enum(Qu),Er={draft:10,structure_saved:20,generating:30,workspace_ready:40},Ir={not_deployed:10,deploying:20,deployed:30},Rr={active:10,completed:20},Tr={started:10,running:20,succeeded:30,failed:40,invalidated:50};function Yn(e){return new Map(Object.entries(e).map(([n,i])=>[i,n]))}var Ju=Yn(Er),eg=Yn(Ir),tg=Yn(Rr),ng=Yn(Tr);function dk(e){let n=Ju.get(e);if(!n)throw new Error(`Unknown site build status code: ${e}`);return n}function uk(e){let n=eg.get(e);if(!n)throw new Error(`Unknown site deployment status code: ${e}`);return n}function gk(e){let n=tg.get(e);if(!n)throw new Error(`Unknown site workflow status code: ${e}`);return n}function _k(e){let n=ng.get(e);if(!n)throw new Error(`Unknown task execution status code: ${e}`);return n}function hk(e){return Er[e]}function Sk(e){return Ir[e]}function fk(e){return Rr[e]}function bk(e){return Tr[e]}var hs=[{definition_version:1,published:!0,required_client_capability:null,definitions:{with_website:[{id:"01900000-0000-7000-8000-000000000001",node_code:"welcome",label:"\u6B22\u8FCE\u542F\u52A8",sort_order:1,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000002",node_code:"website_scan",label:"\u521D\u59CB\u5316\u9700\u6C42\u4E0E\u5B98\u7F51\u626B\u63CF",sort_order:2,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000003",node_code:"analysis",label:"\u667A\u80FD\u5206\u6790",sort_order:3,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000004",node_code:"diagnosis",label:"\u8BCA\u65AD\u62A5\u544A",sort_order:4,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000005",node_code:"strategy",label:"\u7B56\u7565\u4E0E\u5EFA\u8BAE",sort_order:5,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000014",node_code:"structure_planning",label:"\u7ED3\u6784\u89C4\u5212",sort_order:6,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000015",node_code:"preview_personalization",label:"\u9884\u89C8\u4E0E\u4E2A\u6027\u5316",sort_order:7,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000016",node_code:"publishing",label:"\u7F51\u7AD9\u53D1\u5E03",sort_order:8,is_enabled:!0}],without_website:[{id:"01900000-0000-7000-8000-00000000000b",node_code:"welcome",label:"\u6B22\u8FCE\u542F\u52A8",sort_order:1,is_enabled:!0},{id:"01900000-0000-7000-8000-00000000000c",node_code:"customer_materials",label:"\u5BA2\u6237\u8D44\u6599\u63D0\u4F9B",sort_order:2,is_enabled:!0},{id:"01900000-0000-7000-8000-00000000000d",node_code:"analysis",label:"\u667A\u80FD\u5206\u6790",sort_order:3,is_enabled:!0},{id:"01900000-0000-7000-8000-00000000000e",node_code:"strategy",label:"\u7B56\u7565\u4E0E\u5EFA\u8BAE",sort_order:4,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000017",node_code:"structure_planning",label:"\u7ED3\u6784\u89C4\u5212",sort_order:5,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000018",node_code:"preview_personalization",label:"\u9884\u89C8\u4E0E\u4E2A\u6027\u5316",sort_order:6,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000019",node_code:"publishing",label:"\u7F51\u7AD9\u53D1\u5E03",sort_order:7,is_enabled:!0}]}}],yk=hs[0].definitions,kr=w.number().int().min(1),ig=w.object({id:W,flow_type:$n,definition_version:kr,node_code:ln,label:w.string().min(1),sort_order:w.number().int().min(1),is_enabled:w.boolean(),state:Zu}),Ar=w.object({id:qa,tenant_id:w.string().min(1),site_id:R,workflow_id:ze,node_code:ln,task_type:yr,external_task_id:w.string().min(1),execution_status:xr,idempotency_key:w.string().min(1),attempt_no:w.number().int().min(1),source_crawl_task_ref_id:w.string().uuid().nullable(),succeeded_at:w.string().min(1).nullable(),superseded_at:w.string().min(1).nullable(),site_url:w.string().url().nullable(),created_at:w.string().min(1),updated_at:w.string().min(1)}),sg=w.object({id:ze,tenant_id:w.string().min(1),site_id:R,flow_type:$n,website:us.nullable(),definition_version:kr,current_node_code:ln,status:Xu,started_at:w.string().min(1),completed_at:w.string().min(1).nullable(),created_at:w.string().min(1),updated_at:w.string().min(1)}),Ss=w.object({workflow:sg,menu:w.array(ig),task_refs:w.array(Ar),site:w.object({default_locale:he.optional(),status:gs,deployment_status:_s,archived_at:w.string().min(1).nullable(),current_sitemap_id:w.string().nullable().optional(),current_sitemap_version:w.number().int().positive().nullable().optional(),confirmed_sitemap_id:w.string().nullable().optional(),confirmed_sitemap_version:w.number().int().positive().nullable().optional(),structure_confirmed_at:w.string().min(1).nullable().optional(),current_snapshot_id:w.string().nullable(),deployed_url:w.string().url().nullable(),cms_site_id:w.string().min(1).nullish()})}),xk=M(Ss),Ek=M(Ar),br=w.array(w.string().min(1).max(64)).max(16).optional(),Ik=w.discriminatedUnion("flow_type",[w.object({flow_type:w.literal("with_website"),website:us,client_capabilities:br}).strict(),w.object({flow_type:w.literal("without_website"),website:w.null().optional(),client_capabilities:br}).strict()]),Rk=w.object({expected_current_node:w.literal("website_scan"),website:us}).strict(),Tk=w.object({expected_current_node:ln}).strict(),kk=w.object({expected_current_node:w.literal("publishing")}).strict(),ag=w.object({node_code:ln,task_type:yr,external_task_id:w.string().min(1).max(255),idempotency_key:w.string().min(1).max(255),site_url:w.string().url().optional()}),Ak=ag.extend({workflow_id:ze}).strict(),wk=w.object({external_task_id:w.string().min(1).max(255),execution_status:xr}),og=w.object({previous_external_task_id:w.string().min(1).max(255),external_task_id:w.string().min(1).max(255),idempotency_key:w.string().min(1).max(255),site_url:w.string().url().optional()}),Pk=og.extend({workflow_id:ze}).strict(),rg=w.object({previous_external_task_id:w.string().min(1).max(255),external_task_id:w.string().min(1).max(255),idempotency_key:w.string().min(1).max(255),site_url:w.string().url()}),vk=rg.extend({workflow_id:ze}).strict(),Ck=w.object({}).strict();function cg(e,n,i){return e.find(s=>s.definition_version===i)?.definitions[n]}function mg(e,n){return cg(hs,e,n)}function lg(e,n=1){let i=mg(e,n);if(!i)throw new Error(`Unknown workflow definition: ${e} v${n}.`);return i}function pg(e,n,i){let s=new Set(i);return e.filter(a=>a.published&&(a.required_client_capability===null||s.has(a.required_client_capability))).sort((a,r)=>r.definition_version-a.definition_version).map(a=>({definition_version:a.definition_version,items:a.definitions[n]}))[0]}function Dk(e,n){return pg(hs,e,n)}function jk(e,n){return lg(e).findIndex(i=>i.node_code===n)}function Ok(e,n){return e==="website_scan"?n==="website_crawl"||n==="website_basic_info_extract"||n==="website_metrics_evaluate":e==="customer_materials"?n==="company_info":e==="analysis"?n==="intelligent_analysis":e==="strategy"?n==="strategy_recommendation":!1}function Nk(e,n){if(e===n)return n;if(!{started:["running","succeeded","failed","invalidated"],running:["succeeded","failed","invalidated"],succeeded:["invalidated"],failed:["invalidated"],invalidated:[]}[e].includes(n))throw new Error(`Invalid task execution status transition: ${e} -> ${n}`);return n}function Lk(e,n){if(e===n)return n;if(!{draft:["structure_saved"],structure_saved:["generating","draft"],generating:["workspace_ready","structure_saved"],workspace_ready:[]}[e].includes(n))throw new Error(`Invalid site build status transition: ${e} -> ${n}`);return n}import{z as x}from"zod";var fs=x.string().min(1).max(120).regex(/^[a-z][a-z0-9_-]*$/),Pe=x.string().min(1).max(120).regex(/^[A-Za-z_][A-Za-z0-9_]*$/),dg=x.enum(["text","select","multi_select","tags","category_list","boolean","number"]),pn=x.string().min(1).max(512).regex(/^\/(?:[^?#]*)$/),ug=x.object({minimum:x.number().finite(),maximum:x.number().finite(),step:x.number().finite().positive()}).strict().refine(e=>e.minimum<e.maximum,{message:"minimum must be less than maximum"}),gg=x.string().trim().min(1).max(100),Pr=x.array(gg).max(5).refine(e=>new Set(e.map(n=>n.toLowerCase())).size===e.length,{message:"popular_terms must be unique ignoring case"}),Fk=x.array(x.string()).max(20).transform(e=>{let n=new Set;return e.map(i=>i.trim()).filter(i=>{if(i.length===0||i.length>100)return!1;let s=i.toLowerCase();return n.has(s)?!1:(n.add(s),!0)}).slice(0,5)}),vr=x.object({filter_enabled:x.boolean(),selected_fields:x.array(Pe).max(64),selected_card_fields:x.array(Pe).max(64).default([]),popular_terms_enabled:x.boolean().default(!1),popular_terms:Pr.optional()}).strict(),_g=x.object({app_slug:fs}).extend(vr.shape).strict(),bs=x.object({kind:x.literal("product_search_confirmation"),baseline_snapshot_id:T,target_route_id:pn,applications:x.array(x.object({app_slug:fs,label:x.string().min(1).max(200),popular_terms:Pr.default([]),current_config:vr.nullable().default(null),affected_routes:x.array(pn).max(64).default([]),fields:x.array(x.object({field_name:Pe,label:x.string().min(1).max(200),value_shape:dg,option_count:x.number().int().nonnegative().optional(),filter_meta:ug.optional()}).strict()).max(64)}).strict()).min(1).max(12),current_config:_g.nullable().optional(),affected_routes:x.array(pn).min(1).max(64).optional()}).strict(),hg=x.object({kind:x.literal("product_search_confirmation"),action:x.enum(["confirm","modify"]),app_slug:fs,filter_enabled:x.boolean(),popular_terms_enabled:x.boolean().default(!1),selected_fields:x.array(Pe).max(64),selected_card_fields:x.array(Pe).max(64).default([])}).strict().superRefine((e,n)=>{e.filter_enabled&&e.selected_fields.length===0&&n.addIssue({code:"custom",path:["selected_fields"],message:"selected_fields must not be empty while filters are enabled"}),new Set(e.selected_fields).size!==e.selected_fields.length&&n.addIssue({code:"custom",path:["selected_fields"],message:"selected_fields must be unique"}),new Set(e.selected_card_fields).size!==e.selected_card_fields.length&&n.addIssue({code:"custom",path:["selected_card_fields"],message:"selected_card_fields must be unique"})}),Xn=x.union([hg,x.object({kind:x.literal("product_search_confirmation"),action:x.literal("cancel")}).strict()]),dn=x.union([x.string().max(255),x.number().finite(),x.boolean()]),Sg=x.object({values:x.array(dn).min(1).max(20).refine(e=>new Set(e.map(n=>`${typeof n}:${String(n)}`)).size===e.length,{message:"values must be unique"})}).strict(),fg=x.object({min:x.number().finite().optional(),max:x.number().finite().optional(),include_unlabeled:x.boolean().optional()}).strict().refine(e=>e.min!==void 0||e.max!==void 0||e.include_unlabeled===!0,{message:"a numeric boundary or include_unlabeled is required"}).refine(e=>e.min===void 0||e.max===void 0||e.min<=e.max,{message:"min must not be greater than max"}),bg=x.object({q:x.string().max(200),page:x.number().int().min(1).max(500),page_size:x.union([x.literal(9),x.literal(20)]),sort:x.enum(["published_at_desc","published_at_asc","product_name_asc","product_name_desc"]),filters:x.record(Pe,x.union([Sg,fg])).superRefine((e,n)=>{Object.keys(e).length>12&&n.addIssue({code:"custom",message:"filters must contain at most 12 fields"})}),display_fields:x.array(Pe).max(64).default([]),missing_count_fields:x.array(Pe).max(12).default([]),relaxation_count_fields:x.array(Pe).max(12).default([]),facets:x.array(x.object({field:Pe,query:x.string().max(100),page:x.number().int().min(1).max(100),page_size:x.literal(10),include_values:x.array(dn).max(20)}).strict()).max(8)}).strict(),wr=x.object({value:dn,label:x.string().max(200),count:x.number().int().nonnegative()}).strict(),yg=x.union([dn,x.array(dn).max(50)]),xg=x.object({items:x.array(x.object({id:x.number().int().positive(),thumbnail:x.string().max(2048).nullable(),title:x.string().max(300),summary:x.string().max(2e3),category:x.string().max(300).nullable(),field_values:x.record(Pe,yg).default({}),url:x.string().min(1).max(2048)}).strict()).max(20),page:x.object({total:x.number().int().nonnegative(),page:x.number().int().positive(),page_size:x.union([x.literal(9),x.literal(20)])}).strict(),facets:x.array(x.object({field:Pe,total:x.number().int().nonnegative(),page:x.number().int().positive(),page_size:x.literal(10),values:x.array(wr).max(10),selected_values:x.array(wr).max(20)}).strict()).max(8),missing_counts:x.record(Pe,x.number().int().nonnegative()).default({}),relaxation_counts:x.record(Pe,x.number().int().nonnegative()).default({})}).strict(),Gk=x.object({contract_version:x.literal(1),request:bg,response:xg}).strict();import{z as tt}from"zod";var ys=4,Bk=20,Wk=1440*60*1e3,Vk=1e6,Eg=["image/png","image/jpeg","image/webp"],xs=tt.enum(Eg),Hk="WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT",$k="WORKSPACE_ATTACHMENT_TOO_LARGE",Yk="WORKSPACE_ATTACHMENT_LIMIT",Xk="WORKSPACE_ATTACHMENT_BOUND",Qk=tt.object({attachment_id:tt.string().min(1),media_type:xs,width:tt.number().int().positive(),height:tt.number().int().positive(),size_bytes:tt.number().int().nonnegative(),filename:tt.string().min(1).max(120),image_url:tt.string().min(1),created_at:tt.string().min(1)}).strict(),Cr="[A-Za-z0-9_-]+",Ig=new RegExp(`^/sites/(${Cr})/workspace/attachments/(${Cr})/image$`);function Zk(e,n){return`/sites/${encodeURIComponent(e)}/workspace/attachments/${encodeURIComponent(n)}/image`}function Es(e){let n=Ig.exec(e);return n?{site_id:n[1],attachment_id:n[2]}:null}function Jk(e){let n=[];for(let i of e){if(i.type!=="file"||typeof i.url!="string")continue;let s=Es(i.url);s&&n.push({attachment_id:s.attachment_id,site_id:s.site_id,media_type:typeof i.mediaType=="string"?i.mediaType:"",filename:typeof i.filename=="string"&&i.filename.trim()!==""?i.filename:"image",url:i.url})}return n}import{z as un}from"zod";var Rg=["deployment_queued","prepare_source","build_artifact","publish_site","site_released","cleanup_release"],Tg=un.enum(Rg),kg=un.enum(["running","succeeded","failed"]),Ag=un.object({code:Tg,status:kg,message:un.string().trim().min(1)}).strict(),Dr=un.array(Ag);import{z as A}from"zod";var wg=A.enum(["pending","running","succeeded","failed"]),Pg=A.enum(["TASK_FAILED","WEBSITE_UNREACHABLE"]),vg=A.object({task_id:A.string().uuid(),site_url:A.string().url(),crawler_task_id:A.string().min(1).max(255).nullable(),crawler_error_code:Pg.nullable().optional(),crawler_failure_stage:A.enum(["URL_DISCOVERY","PAGE_CRAWL","TASK_SCHEDULING","RESULT_PERSISTENCE"]).nullable().optional(),page_count:A.number().int().min(0).max(20),status:wg,error:A.string().nullable(),created_at:A.string().min(1),updated_at:A.string().min(1)}),a1=M(vg),Is=A.enum(["existing_site","new_site"]),Or=A.enum(["google_indexing","ai_recommendation","qualification_verifiability","content_freshness","inquiry_form","inquiry_response","privacy_compliance","prohibited_content"]),jr=A.object({observed_result:A.enum(["pass","fail","unknown"])}).strict(),Nr=A.object({kind:A.literal("ai_crawlability"),checks:A.object({ai_access_guidance:jr,structured_data_presence:jr}).strict()}).strict(),Rs=A.object({label:A.string().trim(),value:A.union([A.string(),A.number(),A.boolean(),A.null()]),summary:A.string().trim(),tone:A.enum(["good","warn","bad","unknown"]),status:A.enum(["ok","unknown"]),assessment:Nr.optional()}),Qn=A.object({key:A.string().trim().min(1).max(100),label:A.string().trim().min(1).max(100),value:A.union([A.string().max(1e3),A.number(),A.boolean(),A.null()]),tone:A.enum(["good","warn","bad","unknown"]),status:A.enum(["ok","unknown"]),evidence:A.string().trim().max(2e3).optional(),assessment:Nr.optional()}).strict(),Cg=A.object({url:A.string().url().max(2048),title:A.string().trim().max(300),words:A.number().int().nonnegative().max(1e7)}).strict(),Dg=A.object({site_url:A.string().url().max(2048),scanned_at:A.string().datetime({offset:!0}),reach:A.array(Qn).max(64),trust:A.array(Qn).max(64),convert:A.array(Qn).max(64),safe:A.array(Qn).max(64),pages:A.array(Cg).max(100)}).strict(),Zn=A.object({company_task_id:A.string().min(1).max(128),scan_task_id:A.string().min(1).max(128),type:Is,result:A.object({company_name:A.string(),website:A.string().url().optional(),primary_product:A.string(),current_market:A.string(),qualifications:A.string(),scan_cards:A.record(A.string(),Rs),scan_result:Dg.optional()})}),jg=A.object({saved:A.literal(!0),company_task_id:A.string().min(1).max(128),scan_task_id:A.string().min(1).max(128)}),o1=M(jg),Og=A.enum(["snapshot","task"]),Ng=Zn.shape.result.extend({type:Is,structured_facts:A.unknown().optional()}).extend({company_name:A.string(),primary_product:A.string(),current_market:A.string(),qualifications:A.string()}),Lg=A.object({site_id:A.string().min(1).max(128),company_task_id:A.string().min(1).max(128),scan_task_id:A.string().min(1).max(128),type:Is,data_source:Og,result:Ng}),r1=M(Lg.nullable());import{z as Se}from"zod";var pt=Se.enum(["company","product_service","case_qualification","market","contact_inquiry","privacy_compliance","news_freshness"]),Mg=Se.object({ordinal:Se.number().int().min(1).max(1e4),path:Se.string().min(1).max(2048).refine(e=>!Fg(e),{message:"path must be a site-relative path, not an absolute URL"}),last_modified:Se.string().max(64).nullable()}).strict(),l1=Se.object({candidates:Se.array(Mg).min(1).max(1e4),selection_limit:Se.number().int().min(1).max(19)}).strict().superRefine((e,n)=>{let i=e.candidates.map(s=>s.ordinal).sort((s,a)=>s-a);for(let[s,a]of i.entries())if(a!==s+1){n.addIssue({code:"custom",path:["candidates"],message:"candidates ordinals must be unique and consecutive from 1"});return}}),Ug=Se.object({ordinal:Se.number().int().positive().max(1e4),roles:Se.array(pt).min(1).max(7)}).strict(),qg=Se.object({role:pt,status:Se.enum(["selected","not_found"]),selected_ordinals:Se.array(Se.number().int().positive().max(1e4)).max(19)}).strict(),p1=Se.object({selections:Se.array(Ug).max(19),coverage:Se.array(qg).length(7)}).strict().superRefine((e,n)=>{let i=new Set;for(let[a,r]of e.coverage.entries())i.has(r.role)&&n.addIssue({code:"custom",path:["coverage",a,"role"],message:"coverage roles must be unique"}),i.add(r.role);for(let a of pt.options)i.has(a)||n.addIssue({code:"custom",path:["coverage"],message:`coverage must include every page role (missing ${a})`});let s=new Map;for(let a of e.selections)for(let r of a.roles){let u=s.get(r)??new Set;u.add(a.ordinal),s.set(r,u)}for(let[a,r]of e.coverage.entries()){let u=s.get(r.role);r.selected_ordinals.some(g=>!u?.has(g))&&n.addIssue({code:"custom",path:["coverage",a,"selected_ordinals"],message:"selected_ordinals must reference selections carrying the same role"})}});function Fg(e){let n=e.toLowerCase();return n.startsWith("http://")||n.startsWith("https://")||e.startsWith("//")}import{z as S}from"zod";var _1=S.object({force_refresh:S.boolean().optional()}),Mr=S.enum(["running","succeeded","failed"]),Gg=S.object({agent_id:S.string().min(1),name:S.string().min(1),icon:S.string().min(1),capability:S.string().min(1),data_source:S.string().min(1),output_topics:S.string().min(1)}),Kg=S.object({site_mode:S.enum(["existing_site","new_site"]),scan_required:S.boolean(),scheduled_agent_ids:S.array(S.string().min(1)),omitted_agent_ids:S.array(S.string().min(1)),next_stage:S.enum(["diagnostic_report","strategy"])}),zg=S.object({t:S.string(),d:S.string(),evidence:S.object({from:S.string(),url:S.string().nullable().optional(),value:S.string().nullable().optional()})}),Bg=S.enum(["complete","partial","insufficient_data","failed"]),Wg=S.enum(["ok","failed","insufficient_data"]),Ts=S.object({agent_id:S.string().min(1),name:S.string().min(1),icon:S.string().min(1),status:Wg,topics:S.array(S.object({topic_id:S.string().min(1),status:Bg,evidence_refs:S.array(S.string())})).length(3),findings:S.array(zg).max(3),elapsed_ms:S.number().nonnegative(),note:S.string().optional(),error:S.string().optional()}),Ur=S.object({total:S.number().int().nonnegative(),ok:S.number().int().nonnegative(),degraded:S.number().int().nonnegative(),total_findings:S.number().int().nonnegative(),elapsed_ms:S.number().nonnegative(),site_mode:S.enum(["existing_site","new_site"]).optional(),scheduled_agent_ids:S.array(S.string()).optional(),omitted_agent_ids:S.array(S.string()).optional(),scheduled:S.number().int().nonnegative().optional(),complete:S.number().int().nonnegative().optional(),partial:S.number().int().nonnegative().optional(),insufficient:S.number().int().nonnegative().optional(),failed:S.number().int().nonnegative().optional(),next_stage:S.enum(["diagnostic_report","strategy"]).optional()}),Vg=S.object({agents_done:S.boolean(),analysis:S.record(S.string(),Ts),step4_scoring_input:S.unknown().optional(),summary:Ur}),qr=S.object({job_id:S.string().min(1),site_id:S.string().min(1),model_version:S.string().min(1),output_locale:S.string().min(2),cached:S.boolean().optional(),status:Mr,result:Vg.nullable().optional(),error:S.string().nullable().optional()}),h1=M(S.array(Gg)),S1=M(Kg),f1=M(qr),b1=M(qr.nullable()),nt=S.object({id:S.union([S.number().int().nonnegative(),S.string().regex(/^(0|[1-9]\d*)$/u).transform(Number)]).pipe(S.number().int().nonnegative())}),Lr=S.object({percent:S.number().int().min(0).max(100),phase:S.enum(["preparing","analyzing","finalizing","completed","failed"]),stage:S.enum(["queued","baseline_ready","source_pages_ready","external_evidence_ready","knowledge_evidence_ready","page_evidence_ready","analysis_context_ready","preparation_saved","workflow_ready","agent_started","agent_completed","workflow_completed","scoring_input_ready","red_texts_ready","result_ready","result_persisted","completed","failed"]),agents_done:S.number().int().nonnegative(),agents_total:S.number().int().nonnegative(),agent_id:S.string().min(1).optional()}),y1=S.discriminatedUnion("event",[nt.extend({event:S.literal("snapshot"),data:S.object({job_id:S.string().min(1),status:Mr,done:S.number().int().nonnegative(),total:S.number().int().nonnegative(),results:S.array(Ts),progress:Lr.optional()})}),nt.extend({event:S.literal("progress"),data:Lr}),nt.extend({event:S.literal("preparing_started"),data:S.object({stage:S.literal("baseline")})}),nt.extend({event:S.literal("preparing_progress"),data:S.object({stage:S.enum(["context","external_evidence"])})}),nt.extend({event:S.literal("preparing_done"),data:S.object({evidence_count:S.number().int().nonnegative(),rule_count:S.number().int().nonnegative(),degraded_capabilities:S.array(S.string())})}),nt.extend({event:S.literal("agent_start"),data:S.object({agent_id:S.string().min(1),name:S.string().min(1),icon:S.string().min(1)})}),nt.extend({event:S.literal("agent_done"),data:Ts}),nt.extend({event:S.literal("done"),data:S.object({agents_done:S.literal(!0),summary:Ur})}),nt.extend({event:S.literal("failed"),data:S.object({message:S.string().min(1)})})]);import{z as j}from"zod";var As=j.enum(["reach","trust","convert","safe"]),Ie=j.number().finite(),Hg=j.number().finite().positive(),ks=["reach","trust","convert","safe"],$g=17,Yg=j.enum(["passed","partial","failed"]),Xg=j.object({landing_page_mode:j.enum(["intent_dynamic","static","none"]),ab_test_enabled:j.boolean()}).strict(),Qg=j.union([j.boolean(),j.number().finite(),Yg,Xg]).nullable(),Zg=j.union([j.boolean(),j.number().finite()]).nullable(),Jg=j.object({competitor_avg:j.number().finite(),score_items:j.record(j.string(),Qg),penalty_items:j.record(j.string(),Zg),red_texts:j.array(j.string())}).strict(),e_=j.record(As,Jg),t_=j.object({key:As,score:Ie,pass_score:Ie,gap:Ie}),n_=j.object({key:j.string(),title:j.string(),is_redline_option:j.boolean().optional(),score:Ie,max_score:Hg,pass_score:Ie,passed:j.boolean(),description:j.string()}),i_=j.object({key:As,title:j.string(),alias:j.string(),slogan:j.string(),score:Ie,max_score:j.literal(100),pass_score:Ie,competitor_average:Ie,status:j.enum(["reached","near","not_reached"]),status_name:j.enum(["\u8FBE\u6807","\u63A5\u8FD1","\u672A\u8FBE\u6807"]),summary:j.string(),sub_dimensions:j.array(n_),red_texts:j.array(j.string()),redline_hit:j.boolean().optional()}),s_=j.object({id:j.number().int().positive(),task_code:j.string().min(1).max(128),is_sync:j.literal(0),status:j.literal("succeeded"),rules:e_,scores_list:j.object({overview:j.object({pass_scores:j.object({reach:Ie,trust:Ie,convert:Ie,safe:Ie}),total_score:Ie,total_pass_score:Ie,score_gap:Ie,competitor_average_score:Ie,scoring_criteria_text:j.string().min(1),gap_dimensions:j.array(t_).max(4),overall_passed:j.boolean(),all_scores_passed:j.boolean(),diagnosis_passed:j.boolean(),commitment_eligible:j.boolean(),safe_redline_hit:j.boolean()}),dimensions:j.array(i_).length(4)}),created_at:j.string().datetime({offset:!0}),updated_at:j.string().datetime({offset:!0})}).superRefine((e,n)=>{a_(e.scores_list.dimensions)||n.addIssue({code:"custom",path:["scores_list","dimensions"],message:"dimensions must include each canonical score dimension."}),e.scores_list.dimensions.reduce((s,a)=>s+a.sub_dimensions.length,0)!==$g&&n.addIssue({code:"custom",path:["scores_list","dimensions"],message:"dimensions must include 17 subdimensions in total."});for(let[s,a]of e.scores_list.dimensions.entries()){if(a.redline_hit===void 0)continue;let r=a.sub_dimensions.findIndex(u=>u.is_redline_option===void 0);r!==-1&&n.addIssue({code:"custom",path:["scores_list","dimensions",s,"sub_dimensions",r,"is_redline_option"],message:"subdimensions must define is_redline_option when redline_hit is defined."})}}),R1=M(s_);function a_(e){let n=e.map(i=>i.key);return n.length===ks.length&&new Set(n).size===ks.length&&ks.every(i=>n.includes(i))}var dt={queued:["preparing_source","lock_failed","deploy_failed"],preparing_source:["building","source_prepare_failed","deploy_failed"],building:["artifact_ready","build_failed","artifact_fetch_failed","artifact_validation_failed","deploy_failed"],artifact_ready:["deploying","deploy_failed"],deploying:["released","deploy_failed"],released:[],lock_failed:[],source_prepare_failed:[],build_failed:[],artifact_fetch_failed:[],artifact_validation_failed:[],deploy_failed:[],cleanup_failed:[]};for(let e of Object.values(dt))Object.freeze(e);Object.freeze(dt);var A1=Object.freeze(Dt.filter(e=>dt[e].length>0)),w1=Object.freeze(Dt.filter(e=>dt[e].length===0)),o_=Object.freeze(["preparing_source","building","artifact_ready","deploying","released"]),r_="DEPLOYMENT_TRANSITION_INVALID",ws=class extends Error{constructor(n,i){super(`Invalid deployment transition: ${n} -> ${i}`),this.currentStatus=n,this.nextStatus=i,this.code=r_,this.name="DeploymentTransitionError"}};function P1(e){return dt[e]}function v1(e){return Dt.filter(n=>dt[n].some(i=>i===e))}function c_(e){return dt[e].length>0}function C1(e){return!c_(e)}function D1(e,n){if(!dt[e].some(i=>i===n))throw new ws(e,n);return n}function j1(){return o_}import{z as m_}from"zod";var L1=".i18n.json",Jn="translation",Fr=new Set(["__proto__","constructor","prototype"]);function Kr(e){if(!ei(e)||Object.keys(e).length===0)return ut("I18N_ROOT_INVALID","Component i18n resources must be a non-empty object.",[]);for(let[n,i]of Object.entries(e)){if(Fr.has(n))return Gr([n]);if(!l_(n))return ut("I18N_LOCALE_INVALID",`Component i18n locale must be canonical BCP-47: ${n}`,[n]);if(!ei(i))return ut("I18N_NAMESPACE_INVALID",`Component i18n locale ${n} must contain only the translation namespace.`,[n]);let s=Object.keys(i);if(s.length!==1||s[0]!==Jn)return ut("I18N_NAMESPACE_INVALID",`Component i18n locale ${n} must contain only the translation namespace.`,[n]);let a=i[Jn];if(!ei(a))return ut("I18N_RESOURCE_TREE_INVALID",`Component i18n translation namespace for ${n} must be an object.`,[n,Jn]);let r=[{value:a,path:[n,Jn]}];for(;r.length>0;){let u=r.pop();for(let[c,g]of Object.entries(u.value)){let k=[...u.path,c];if(Fr.has(c))return Gr(k);if(typeof g!="string"){if(!ei(g))return ut("I18N_RESOURCE_TREE_INVALID","Component i18n resource leaves must be strings.",k);r.push({value:g,path:k})}}}}return{success:!0,data:e}}function M1(e){let n;try{n=JSON.parse(e)}catch{return ut("I18N_JSON_INVALID","Component i18n resource file must contain valid JSON.",[])}return Kr(n)}var U1=m_.custom(e=>Kr(e).success,"Invalid component i18n resources.");function l_(e){try{let n=Intl.getCanonicalLocales(e);return n.length===1&&n[0]===e}catch{return!1}}function ei(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let n=Object.getPrototypeOf(e);return n===Object.prototype||n===null}function Gr(e){return ut("I18N_RESOURCE_KEY_FORBIDDEN",`Component i18n resource key is forbidden: ${e.at(-1)??""}`,e)}function ut(e,n,i){return{success:!1,error:{code:e,message:n,path:i}}}var it="products",p_=`/${it}`,F1=p_,G1=`${it} detail`,K1="cms_collection_view",z1="list",B1="detail",We={zhHans:{pageTitle:"\u4EA7\u54C1\u4E2D\u5FC3",blockLabel:"\u4EA7\u54C1\u6982\u89C8",detailBlockLabel:"\u4EA7\u54C1\u8BE6\u60C5",heroBlockLabel:"\u4EA7\u54C1\u7B80\u4ECB",homeLabel:"\u9996\u9875"},zhHant:{pageTitle:"\u7522\u54C1\u4E2D\u5FC3",blockLabel:"\u7522\u54C1\u6982\u89BD",detailBlockLabel:"\u7522\u54C1\u8A73\u60C5",heroBlockLabel:"\u7522\u54C1\u7C21\u4ECB",homeLabel:"\u9996\u9801"},en:{pageTitle:"Products",blockLabel:"Products overview",detailBlockLabel:"Product details",heroBlockLabel:"Products Introduction",homeLabel:"Home"},de:{pageTitle:"Produkte",blockLabel:"Produkt\xFCbersicht",detailBlockLabel:"Produktdetails",heroBlockLabel:"Produkteinf\xFChrung",homeLabel:"Startseite"},fr:{pageTitle:"Produits",blockLabel:"Aper\xE7u des produits",detailBlockLabel:"D\xE9tails du produit",heroBlockLabel:"Pr\xE9sentation des produits",homeLabel:"Accueil"},es:{pageTitle:"Productos",blockLabel:"Resumen de productos",detailBlockLabel:"Detalles del producto",heroBlockLabel:"Introducci\xF3n de productos",homeLabel:"Inicio"},ja:{pageTitle:"\u88FD\u54C1",blockLabel:"\u88FD\u54C1\u6982\u8981",detailBlockLabel:"\u88FD\u54C1\u8A73\u7D30",heroBlockLabel:"\u88FD\u54C1\u7D39\u4ECB",homeLabel:"\u30DB\u30FC\u30E0"},ko:{pageTitle:"\uC81C\uD488",blockLabel:"\uC81C\uD488 \uAC1C\uC694",detailBlockLabel:"\uC81C\uD488 \uC0C1\uC138",heroBlockLabel:"\uC81C\uD488 \uC18C\uAC1C",homeLabel:"\uD648"}},d_=new Set(Object.values(We).map(e=>e.pageTitle)),u_=new Set(Object.values(We).flatMap(e=>[e.blockLabel,e.detailBlockLabel,e.heroBlockLabel]));function W1(e){let n=e?.trim().toLowerCase()??"";if(n==="zh-tw"||n==="zh-hk"||n==="zh-mo")return We.zhHant;if(n.startsWith("zh"))return We.zhHans;switch(n.split("-")[0]){case"de":return We.de;case"fr":return We.fr;case"es":return We.es;case"ja":return We.ja;case"ko":return We.ko;case"en":default:return We.en}}function V1(e){return d_.has(e.trim())}function H1(e){return u_.has(e.trim())}import{z as Mt}from"zod";var Q1="SITE_HAS_ACTIVE_SUBSITES",Z1="SITE_HAS_SUBSITES",g_=Mt.object({site_id:R,name:Mt.string().min(1),mount_path:Mt.string().min(1),archived_at:Mt.string().nullable()}),J1=Mt.object({subsites:Mt.array(g_)});import{z as fe}from"zod";var i0=fe.object({key:fe.string().min(1),composition:ae}).strict(),ni=fe.enum(["component-boundary","repeat-region","conditional-region","fragment-region","opaque-region"]),__=fe.enum(["direct","proxy","upstream","readonly","unsupported"]),h_=fe.enum(["component-boundary","repeat-region","conditional-region","opaque-region","void-element","read-only","cross-file-required","import-required"]),ti=fe.object({mode:__,reasonCode:fe.string().min(1).optional()}),S_=fe.object({kind:h_,message:fe.string().min(1)}),ii=fe.object({composition:U,key:fe.string().min(1),canUpdateText:fe.boolean(),canInsertChild:fe.boolean(),canMove:fe.boolean(),canRemove:fe.boolean(),editModes:fe.object({updateText:ti.optional(),insertChild:ti.optional(),move:ti.optional(),remove:ti.optional()}).optional(),constraints:fe.array(S_)}).strict();import{z}from"zod";var l0=z.discriminatedUnion("type",[z.object({type:z.literal("site-edit.document.changed"),siteId:R,snapshotId:T,composition:U,version:z.number().int().nonnegative(),at:z.string().min(1)}).strict(),z.object({type:z.literal("site-edit.operation.planned"),siteId:R,operationId:z.string().min(1),baseSnapshotId:T,composition:U,changedFiles:z.array(z.string().min(1)),at:z.string().min(1)}).strict(),z.object({type:z.literal("site-edit.operation.completed"),siteId:R,composition:U,result:ds,at:z.string().min(1)}).strict(),z.object({type:z.literal("site-edit.operation.failed"),siteId:R,composition:U,requestId:z.string().min(1),error:hr,at:z.string().min(1)}).strict(),z.object({type:z.literal("site-edit.capability.changed"),siteId:R,composition:U,keys:z.array(z.string().min(1)),at:z.string().min(1)}).strict(),z.object({type:z.literal("site-edit.graph.invalidated"),siteId:R,composition:U,at:z.string().min(1)}).strict(),z.object({type:z.literal("site-edit.graph.ready"),siteId:R,composition:U,version:z.number().int().nonnegative(),at:z.string().min(1)}).strict(),z.object({type:z.literal("site-edit.graph.error"),siteId:R,composition:U,message:z.string().min(1),at:z.string().min(1)}).strict(),z.object({type:z.literal("site-edit.snapshot.changed"),siteId:R,composition:U,snapshotId:T,previousSnapshotId:z.string().min(1).nullable(),at:z.string().min(1)}).strict()]);import{z as ee}from"zod";var g0="durable-history-v1",si=ee.object({initiatingComposition:U.optional(),affectedCompositions:ee.array(U)}).strict(),_0=ee.enum(["writable","read-only-recovery","unavailable"]),f_=ee.enum(["INDEX_CORRUPT","ENTRY_MISSING","BLOB_MISSING","FILESYSTEM_UNAVAILABLE","ROLLBACK_INCOMPLETE","UNKNOWN"]),b_=ee.object({code:f_,message:ee.string().min(1),occurredAt:ee.iso.datetime().optional()}).strict(),y_=ee.enum(["NOT_INITIALIZED","FILESYSTEM_UNAVAILABLE","UNSUPPORTED_RUNTIME"]),zr={revision:ee.number().int().nonnegative(),undoDepth:ee.number().int().nonnegative(),redoDepth:ee.number().int().nonnegative()},x_=ee.object({mode:ee.literal("writable"),composition:U,...zr,canUndo:ee.boolean(),canRedo:ee.boolean(),provenance:si.optional()}).strict().superRefine((e,n)=>{e.canUndo!==e.undoDepth>0&&n.addIssue({code:"custom",path:["canUndo"],message:"canUndo must reflect undoDepth."}),e.canRedo!==e.redoDepth>0&&n.addIssue({code:"custom",path:["canRedo"],message:"canRedo must reflect redoDepth."})}),E_=ee.object({mode:ee.literal("read-only-recovery"),composition:U,...zr,canUndo:ee.literal(!1),canRedo:ee.literal(!1),recoveryDiagnostic:b_,provenance:si.optional()}).strict(),I_=ee.object({mode:ee.literal("unavailable"),composition:U,revision:ee.literal(0),undoDepth:ee.literal(0),redoDepth:ee.literal(0),canUndo:ee.literal(!1),canRedo:ee.literal(!1),reason:y_,provenance:si.optional()}).strict(),R_=ee.discriminatedUnion("mode",[x_,E_,I_]),h0=ee.object({composition:U,status:R_,provenance:si}).strict();import{z as G}from"zod";var ai=G.enum(["api-field","cms-field","i18n-message","config-entry"]),Ps=G.object({kind:G.enum(["jsx-node","value-path","route-export","external-entry"]),file:G.string().min(1).optional(),isProxy:G.boolean(),displayPath:G.string().min(1).optional(),sourceType:ai.optional(),sourceId:G.string().min(1).optional()}),T_=G.discriminatedUnion("status",[G.object({status:G.literal("resolved"),value:Tt}).strict(),G.object({status:G.literal("undefined")}).strict(),G.object({status:G.literal("unresolved")}).strict()]),k_=G.object({kind:G.enum(["literal","boolean-shorthand","expression","binding","repeat-template"]),raw:G.string().optional()}).strict(),A_=G.object({name:G.string().min(1),source:k_,resolution:T_,editMode:G.enum(["direct","proxy","upstream","readonly","unsupported"]),sourceScope:G.enum(["node","repeat-item","repeat-template"]),allowedWriteScopes:G.array(G.enum(["selection","template"])),effectiveWriteTarget:Ps.optional(),diagnostics:G.array(G.object({code:G.string().min(1),message:G.string().min(1)}).strict())}).strict(),w_=G.object({raw:G.string().min(1),sourceRange:Ze,order:G.number().int().nonnegative(),diagnostics:G.array(G.object({code:G.string().min(1),message:G.string().min(1)}).strict())}).strict(),P_=G.object({selection:G.enum(["direct","materialize","unsupported"]),template:G.enum(["direct","unsupported"])}).strict(),vs=G.object({documentVersion:G.number().int().nonnegative(),selectionRef:Lt.optional(),items:G.array(A_),spreads:G.array(w_),creation:P_}).strict().superRefine((e,n)=>{let i=e.selectionRef;i&&i.instanceIndex!==void 0&&i.instanceCount!==void 0&&i.instanceIndex>=i.instanceCount&&n.addIssue({code:"custom",path:["selectionRef","instanceIndex"],message:"instanceIndex must be smaller than instanceCount"})});import{z as be}from"zod";var v_=be.string().min(1).refine(e=>!e.startsWith("/")&&!e.includes(".."),{message:"Patch paths must be safe relative POSIX paths."}),C_=be.string().regex(/^sha256:[a-f0-9]{64}$/),D_=be.object({path:v_,operation:be.enum(["create","update","delete"]),expectedHash:C_.optional(),fullContent:be.string().optional()}).superRefine((e,n)=>{e.operation==="delete"&&e.fullContent!==void 0&&n.addIssue({code:"custom",path:["fullContent"],message:"delete patches must not include fullContent"}),e.operation!=="delete"&&e.fullContent===void 0&&n.addIssue({code:"custom",path:["fullContent"],message:"create/update patches must include fullContent"})}),j_=be.object({siteId:R,baseSnapshotId:T,operationId:be.string().min(1),reason:be.string().min(1),patches:be.array(D_).min(1),changedCompositions:be.array(U),changedRouteIds:be.array(be.string().min(1)).optional(),diagnostics:be.array(be.object({code:be.string().min(1),message:be.string().min(1),path:be.string().min(1).optional()})).default([])}).strict().superRefine((e,n)=>{let i=new Set;for(let[a,r]of e.patches.entries())i.has(r.path)&&n.addIssue({code:"custom",path:["patches",a,"path"],message:`Duplicate patch path: ${r.path}`}),i.add(r.path);let s=[...new Set(e.changedCompositions.map(a=>a.routeId))];e.changedRouteIds!==void 0&&(e.changedRouteIds.length!==s.length||e.changedRouteIds.some((a,r)=>a!==s[r]))&&n.addIssue({code:"custom",path:["changedRouteIds"],message:"changedRouteIds must be the stable deduplicated route projection of changedCompositions."})}),k0=j_.transform(e=>({...e,changedRouteIds:[...new Set(e.changedCompositions.map(n=>n.routeId))]}));var Cs="::repeat-item#";function O_(e,n){return`${e}${Cs}${n}`}function w0(e,n){return n.reduce((i,s)=>O_(i,s),e)}function N_(e){if(typeof e!="string"||e.length===0)return null;let n=[],i=e;for(;;){let s=i.lastIndexOf(Cs);if(s<0)break;let a=Number(i.slice(s+Cs.length));if(!Number.isInteger(a)||a<0)return null;n.unshift({repeatIndex:a}),i=i.slice(0,s)}return!i||n.length===0?null:{baseKey:i,parts:n}}function P0(e){return N_(e)?.baseKey??e??null}import{z as m}from"zod";import{z as ke}from"zod";var L_=ke.object({placementKey:ke.string().min(1),placementUnitKey:ke.string().min(1),relation:ke.enum(["before","after","prepend","append"])}).strict(),M_=ke.object({status:ke.literal("supported"),containerKey:ke.string().min(1),hasBusinessMembers:ke.boolean(),placementUnitKeys:ke.array(ke.string().min(1)),placements:ke.array(L_)}).strict().superRefine((e,n)=>{let i=new Set(e.placementUnitKeys);i.size!==e.placementUnitKeys.length&&n.addIssue({code:"custom",path:["placementUnitKeys"],message:"Render page composition placement unit keys must be unique."});let s=new Set;e.placements.forEach((a,r)=>{s.has(a.placementKey)&&n.addIssue({code:"custom",path:["placements",r,"placementKey"],message:"Render page composition placement keys must be unique."}),s.add(a.placementKey),i.has(a.placementUnitKey)||n.addIssue({code:"custom",path:["placements",r,"placementUnitKey"],message:"Render page composition placement must reference a projected unit."})})}),U_=ke.object({status:ke.literal("unsupported"),reason:Hn,diagnostics:ke.array(cn)}).strict(),Br=ke.discriminatedUnion("status",[M_,U_]);var q_=m.object({canUpdateText:m.boolean(),canInsertChild:m.boolean(),canMove:m.boolean(),canRemove:m.boolean()}),Wr=m.enum(["vcp-cms-collection","vcp-cms-form","vcp-cms-settings","vcp-cms-navigation","site-api-route","external-api","unknown-api"]),F_=m.enum(["cms-field","api-field"]),G_=m.enum(["text","attribute","richtext","repeat-region","conditional-region","component-prop"]),K_=m.enum(["exact","safe-derived","partial","unknown"]),z_=m.object({file:m.string().min(1),symbol:m.string().min(1).optional(),reason:m.string().min(1)}),B_=m.object({sourceKind:Wr,sourceType:F_,endpointPattern:m.string().min(1).optional(),operation:m.string().min(1).optional(),collection:m.string().min(1).optional(),fieldPath:m.string().min(1).optional(),valuePath:m.string().min(1).optional(),targetKind:G_,targetName:m.string().min(1),confidence:K_,readonly:m.literal(!0),evidence:m.array(z_)}),Vr=m.object({hasDynamicData:m.boolean(),bindings:m.array(B_)}),Hr=m.object({hasDynamicData:m.boolean(),sourceKinds:m.array(Wr),primaryEndpoint:m.string().min(1).optional(),primaryCollection:m.string().min(1).optional(),primaryFieldPath:m.string().min(1).optional()}),W_=m.object({key:m.string().min(1),pageCompositionUnitKey:m.string().min(1).optional(),operationSummary:q_,dynamicDataSummary:Hr.optional()}).strict(),V0=m.object({composition:ae}).strict(),H0=m.object({key:m.string().min(1),composition:ae,selectionRef:Lt.optional()}).strict(),$0=m.object({siteId:R,snapshotId:T,composition:U,version:m.number().int().nonnegative(),entries:m.array(W_),pageComposition:Br}).strict(),$r=m.object({kind:m.enum(["literal","binding","imported-binding","repeat-template"]),file:m.string().min(1),expression:m.string().min(1),bindingName:m.string().min(1).optional(),path:m.array(m.union([m.string(),m.number()])).optional()}),Ds=m.object({index:m.number().int().min(0),value:m.string(),editable:m.boolean(),source:$r.nullable()}),gn=m.object({key:m.string().min(1),label:m.string().min(1),tag:m.string().min(1)}),Y0=m.object({composition:U,key:m.string().min(1),canUpdateText:m.boolean(),canInsertChild:m.boolean(),canMove:m.boolean(),canRemove:m.boolean(),boundaryKind:ni.nullable(),isOpaque:m.boolean()}).strict(),V_=m.object({kind:m.enum(["jsx-node","component-proxy","value-binding","route-export"]),file:m.string().min(1),componentName:m.string().min(1),isProxy:m.boolean()}),Yr=m.object({kind:m.union([m.enum(["jsx-literal","component-prop","binding","imported-binding","object-field","array-item","repeat-template","conditional-branch"]),ai]),file:m.string().min(1),displayPath:m.string().min(1),externalSource:m.object({sourceType:ai,sourceId:m.string().min(1),adapterId:m.string().min(1).optional()}).optional()}),H_=m.object({kind:Yr.shape.kind,file:m.string().min(1),displayName:m.string().min(1),canEditHere:m.boolean()}),_n=m.object({finalSource:Yr.nullable(),chain:m.array(H_),confidence:m.enum(["exact","safe-derived","partial","unknown"]),editMode:m.enum(["direct","proxy","upstream","readonly","unsupported"]),diagnostics:m.array(m.object({code:m.string().min(1),message:m.string().min(1)}))}),$_=m.object({kind:m.literal("css-style-model"),properties:m.array(m.object({property:pr,value:m.union([m.string(),m.number(),m.boolean(),m.null()]),resolvedValue:m.union([m.string(),m.number(),m.boolean(),m.null()]).optional(),breakpoint:ur.optional(),state:dr.optional(),variants:m.array(m.string().min(1)).optional(),options:m.array(m.union([m.string(),m.number()])).optional(),editable:m.boolean(),diagnostics:m.array(m.object({code:m.string().min(1),message:m.string().min(1)})).optional(),operationBoundary:m.array(mn).optional()}))}),X0=m.union([m.record(m.string(),m.unknown()),$_]),Xr=m.object({kind:m.literal("class-name-source"),className:m.string(),sourceKind:m.enum(["missing","static-attribute","static-expression","dynamic-expression"]),editable:m.boolean(),operationBoundary:m.array(mn),sourcePath:m.string().min(1).optional(),diagnostics:m.array(m.object({code:m.enum(["missing-class-name","dynamic-binding","non-string-binding"]),message:m.string().min(1)})).optional()}),Y_=m.object({startLine:m.number().int().positive(),startColumn:m.number().int().nonnegative(),endLine:m.number().int().positive(),endColumn:m.number().int().nonnegative()}),js=m.object({sourceFile:m.string().min(1),componentName:m.string().min(1),openingElementRange:Y_,structuralPath:m.string().min(1),textPreview:m.string().min(1).optional()}),Q0=m.object({composition:U,key:m.string().min(1),tag:m.string().min(1),componentName:m.string().min(1),sourceFile:m.string().min(1),sourceLocator:js.optional(),label:m.string().min(1),capabilities:ii,writeTarget:V_,effectiveWriteTarget:Ps.optional(),provenanceChain:_n.optional(),componentSemantic:m.record(m.string(),m.unknown()).optional(),contentModel:m.record(m.string(),m.unknown()).optional(),mediaModel:m.record(m.string(),m.unknown()).optional(),styleSource:Xr.optional(),conditional:m.record(m.string(),m.unknown()).optional(),dynamicData:Vr.optional(),properties:vs.optional(),textSegments:m.array(Ds),boundaryKind:ni.nullable(),isOpaque:m.boolean(),ancestors:m.array(gn),children:m.array(gn),siblings:m.array(gn)}).strict(),Z0=m.object({composition:U,key:m.string().min(1),tag:m.string().min(1),label:m.string().min(1),sourceLocator:js.optional(),capabilities:m.object({constraints:ii.shape.constraints}),isOpaque:m.boolean(),provenanceChain:m.object({editMode:_n.shape.editMode,diagnostics:_n.shape.diagnostics}).optional(),dynamicDataSummary:Hr.optional(),ancestors:m.array(gn)}).strict(),J0=m.object({composition:U,key:m.string().min(1),tag:m.string().min(1),label:m.string().min(1),sourceLocator:js.optional(),isOpaque:m.boolean(),ancestors:m.array(gn),componentName:m.string().min(1),sourceFile:m.string().min(1),capabilities:ii,provenanceChain:m.object({editMode:_n.shape.editMode,diagnostics:_n.shape.diagnostics}).optional(),textSegments:m.array(m.object({index:Ds.shape.index,editable:Ds.shape.editable,sourceKind:$r.shape.kind.nullable()})),dynamicData:Vr.optional(),properties:vs.optional(),boundaryKind:ni.nullable()}).strict(),eA=m.object({composition:U,key:m.string().min(1),mediaModel:m.record(m.string(),m.unknown()).optional(),styleSource:Xr.optional()}).strict();var X_=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Q_=["article","aside","div","footer","form","header","li","main","nav","ol","section","select","table","tbody","tfoot","thead","tr","ul"],Z_=["a","button","em","h1","h2","h3","h4","h5","h6","label","p","small","span","strong"],J_=new Set(X_),eh=new Set(Q_),th=new Set(Z_),nh={canUpdateText:!1,canInsertChild:!1,canMove:!1,canRemove:!1};function nA(e){return J_.has(Os(e))}function ih(e){return eh.has(Os(e))}function sh(e){return th.has(Os(e))}function iA(e){let{operationSummary:n}=e;return n?{canUpdateText:n.canUpdateText,canInsertChild:n.canInsertChild,canMove:n.canMove,canRemove:n.canRemove}:e.fallbackMode!=="preview"?{...nh}:{canUpdateText:sh(e.tagName),canInsertChild:ih(e.tagName),canMove:!1,canRemove:!1}}function Os(e){return e?.trim().toLowerCase()??""}import{z as ah}from"zod";var cA=ah.object({composition:ae,mutationContext:on.optional()}).strict();var lA={PATCH_VALIDATION_FAILED:"The code didn't pass validation. Try describing the change more specifically.",PATCH_BATCH_FAILED:"The site code couldn't be generated. Please regenerate the site.",PATCH_BATCH_INVALID:"The change couldn't be applied. Try simpler instructions.",VALIDATION_FAILED:"Your message couldn't be sent as written. Please edit it and try again.",WORKSPACE_MESSAGE_CONTAINS_SECRET:"Your message looks like it contains a secret or token, so it wasn't sent. Remove it and try again.",WORKSPACE_RUN_INPUT_REQUIRED:"Nothing to work on: the request had no instruction, so no edit was started. Describe the change you want and send it.",WORKSPACE_TOOL_RESULT_INVALID:"This change couldn't be completed and was rolled back. Please try again.",WORKSPACE_TOOL_FAILED:"A tool step failed. Please try again.",WORKSPACE_TOOL_RESULT_MISSING:"The tool didn't return a usable result. Please try again.",WORKSPACE_MODEL_STREAM_FAILED:"The model stream ended unexpectedly. Please try again.",WORKSPACE_MODEL_STREAM_ABORTED:"Generation was interrupted before finishing. Please try again.",MODEL_OUTPUT_TRUNCATED:"The response was too long and was cut off before any change was applied. Try again, or split the request into smaller changes.",WORKSPACE_EDIT_NOT_APPLIED:"No change was applied. Try describing the change differently.",PRODUCT_SEARCH_APPLY_NOT_AVAILABLE:"Product search changes aren't available yet. Please try again later.",WORKSPACE_INITIAL_EXECUTION_FAILED:"Initial generation failed. Please retry from the brief.",WORKSPACE_INITIAL_GENERATION_CHECK_FAILED:"Initial generation could not be verified. Please retry.",WORKSPACE_INITIAL_GENERATION_FINALIZE_FAILED:"Initial generation could not finalize. Please retry.",WORKSPACE_INITIAL_GENERATION_QUALITY_GATE_FAILED:"Initial generation failed quality checks. Please regenerate the site.",WORKSPACE_ITERATION_QUALITY_GATE_FAILED:"Quality check failed. The change was rolled back; try a smaller or more specific request.",WORKSPACE_SOCKET_DEAD:"The workspace connection was lost. Please retry.",WORKSPACE_RUN_CANCELLED:"The run was cancelled.",WORKSPACE_RUN_ABANDONED:"This run was interrupted and did not finish. Please try again.",WORKSPACE_RUN_REQUEST_FAILED:"Couldn't start the workspace. Please try again.",WORKSPACE_RUN_BAD_RESPONSE:"The server response was malformed. Please try again.",WORKSPACE_SOCKET_UNAVAILABLE:"Workspace connection unavailable. Please try again.",WORKSPACE_SOCKET_ERROR:"The workspace connection had an error. Please try again.",WORKSPACE_SOCKET_CLOSED:"The workspace connection closed. Please try again.",WORKSPACE_SOCKET_OPEN_TIMEOUT:"Couldn't reach the workspace in time. Please try again.",WORKSPACE_CLIENT_MESSAGE_ID_MISSING:"Something went wrong sending your message. Please try again.",SITE_SNAPSHOT_REQUIRED:"This site has no usable snapshot yet. Complete Step 3 first.",AGENT_TIMEOUT:"That took longer than expected. Try breaking the change into smaller pieces.",SANDBOX_NOT_AVAILABLE:"The preview environment isn't ready. Your edits have still been saved.",PREVIEW_BUILD_FAILED:"Preview is available, but the production build failed. Fix the reported build error before deploying.",PREVIEW_BUILD_NOT_CONFIGURED:"Preview is available, but the production build check is not configured.",PREVIEW_BUILD_SANDBOX_NOT_FOUND:"Preview is available, but the build check could not find the active preview sandbox.",WS_CONNECTION_ERROR:"Connection lost. Reconnecting\u2026",USER_MESSAGE_PERSIST_FAILED:"Your message wasn't saved. Please send it again.",CLARIFICATION_REPLY_STALE:"That question has expired. Please tell me what you'd like to do now.",CLARIFY_MODEL_FAILED:"Clarify couldn't finish generating questions. Please try again.",WORKSPACE_RUN_IN_FLIGHT:"Another session is already running. Please try again in a moment.",SITE_OPERATION_LOCKED:"Another change is already running for this site. Wait for it to finish, then try again.",WORKSPACE_THREAD_NOT_FOUND:"That conversation no longer exists. Switching back to the default conversation.",WORKSPACE_THREAD_ARCHIVED:"This conversation is archived. Start a new one to continue.",WORKSPACE_THREAD_BUSY:"This conversation is still running. Wait for it to finish before archiving.",WORKSPACE_THREAD_READ_ONLY:"Background conversations are read-only here.",WORKSPACE_THREAD_INVALID:"This conversation can't accept new requests right now. Refresh and try again.",EDIT_ENGINE_VERSION_INVALID:"Invalid editor version. Refresh the page and try again.",SANDBOX_DEPENDENCY_SYNC_FAILED:"The preview runtime could not be prepared. Please try again.",SANDBOX_PREVIEW_FAILED:"The site preview failed to start. Please try again.",SANDBOX_DEPENDENCY_VERSION_MISMATCH:"The preview runtime could not be verified. Please try again.",SANDBOX_RUNTIME_NOT_READY:"The preview needs to be refreshed before this change can be applied. Refresh the preview and try again.",GENERIC:"Something went wrong. Please try again."},pA={UNDO_OR_ROLLBACK:"I can't roll back from chat. Use the version history at the top right to pick a restore point.",HISTORY_RECALL:"Tell me what you'd like to change now\u2014I'll work from the current page state.",OUT_OF_SCOPE:"That's outside what I can do from chat. Try the corresponding panel on the right."},dA={CARD_HEADER:"Needs your confirmation",FREE_TEXT_PLACEHOLDER:"Or describe what you'd like instead",SUBMIT_LABEL:"Submit"},uA={SEND_FAILED_RETRY:"Send failed \u2014 tap to retry"};var Qr="0.10.3",_A="x-vcp-edit-engine-version",hA="x-vcp-edit-engine-version-source",Ns=class extends Error{constructor(n="Invalid edit-engine version."){super(n),this.code="EDIT_ENGINE_VERSION_INVALID",this.name="EditEngineVersionParseError"}},oh=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z]+(?:\.[0-9A-Za-z]+)*)?$/;function rh(e){return oh.test(e)}function ch(e){if(typeof e!="string"||!rh(e))throw new Ns;return e}function SA(e){return e==null?{version:Qr,source:"fallback_current"}:{version:ch(e),source:"explicit"}}function fA(){return{version:Qr,source:"system_current"}}import{z as Ge}from"zod";var mh=200,lh=200;function ph(e){let n=e.indexOf(":");if(n<=0)return null;let i=e.slice(0,n).trim(),s=e.slice(n+1).trim();return i.length===0||s.length===0?null:{source:i,target:s}}var dh=Ge.string().min(3).max(mh).refine(e=>ph(e)!==null,{message:'glossary entries must be "source:target" pairs split on a half-width colon, e.g. "\u7C73:Rice"'}),xA=Ge.array(dh).max(lh),EA=Ge.object({website_name:Ge.string().min(1).max(200),website_industry:Ge.string().min(1).max(200).optional(),website_description:Ge.string().min(1).max(1e3).optional()}),uh=Ge.enum(["regional","fonts_only"]),oi=Ge.string().regex(/^#[0-9a-fA-F]{6}$/,'color must be a "#rrggbb" value'),gh=Ge.object({primary:oi.optional(),accent:oi.optional(),foreground:oi.optional(),neutral:oi.optional()}),_h=600,IA=Ge.object({mode:uh.default("regional"),seeds:gh.optional(),note:Ge.string().min(1).max(_h).optional()}),RA={mode:"regional"};function TA(e){return e===void 0?!1:Object.values(e).some(n=>typeof n=="string"&&n.length>0)}import{z as ve}from"zod";var hh=ve.string().trim().min(1),Ut=ve.string().uuid(),Sh=ve.string().min(1).max(2048).refine(e=>e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(n=>n.length>0&&n!=="."&&n!==".."),"object_key must be a relative snapshot store path without empty, '.' or '..' segments"),Zr=ve.object({snapshot_id:Ut,object_key:Sh}),wA=ve.object({tenant_id:hh,parent_site_id:Ut,subsite_site_id:Ut,base:Zr,target:Zr}),PA=ve.object({subsite_site_id:Ut,pending_pages:ve.array(ve.string().min(1)),hash_diverged_count:ve.number().int().nonnegative(),child_only_count:ve.number().int().nonnegative(),base_snapshot_id:Ut,target_snapshot_id:Ut}),fh=ve.enum(["SUBSITE_DIFF_REQUEST_INVALID","SUBSITE_DIFF_STORE_NOT_CONFIGURED","SUBSITE_DIFF_MANIFEST_MISSING","SUBSITE_DIFF_MANIFEST_INVALID"]),vA=ve.object({error_code:fh,message:ve.string().min(1),side:ve.enum(["base","target"]).optional()});import{z as de}from"zod";var OA=de.object({tenant_id:de.string().min(1),site_id:R,snapshot_id:T,manifest_hash:de.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:de.string().min(1).max(2048),page_slug:de.string().max(512).optional()}),NA=de.object({site_id:R,snapshot_id:T,unit_count:de.number().int().nonnegative(),file_count:de.number().int().nonnegative(),markdown:de.string().min(1),page_slug:de.string().optional(),page_file:de.string().optional(),entries:de.array(de.object({id:de.string().min(1),file_path:de.string().min(1),line:de.number().int().nullable(),kind:de.string().min(1),text:de.string(),media_key:de.string().optional()})).optional()});import{z as bh}from"zod";var yh=/^\/[a-z0-9][a-z0-9-]{0,30}$/,xh=Object.freeze(["api","_next","assets","static","robots.txt","sitemap.xml",".well-known"]),Eh=new Set(xh);function Ih(e){return Eh.has(e)}var UA=bh.string().regex(yh).refine(e=>!Ih(e.slice(1)),{message:"mount_path must not use a reserved segment (api, _next, assets, static, robots.txt, sitemap.xml, .well-known)"});import{z as oe}from"zod";var Rh=oe.enum(["active","paused","blocked"]),Jr=oe.enum(["typecheck_failed","health_failed","validation_failed"]),Th={status:Rh,attempts:oe.number().int().nonnegative(),attempted_template_version:Fe.nullable(),last_error_code:Jr.nullable()},qt=oe.object(Th).strict(),ri=oe.object({template_id:oe.string().trim().min(1),target_template_version:Fe}).strict(),KA=ri,kh=oe.discriminatedUnion("action",[oe.object({action:oe.literal("proceed"),state:qt.extend({status:oe.literal("active")})}).strict(),oe.object({action:oe.literal("skip_not_newer"),state:qt.extend({status:oe.literal("active")})}).strict(),oe.object({action:oe.literal("skip_paused"),state:qt.extend({status:oe.literal("paused")})}).strict(),oe.object({action:oe.literal("skip_blocked"),state:qt.extend({status:oe.literal("blocked")})}).strict()]),zA=ri,BA=kh,WA=ri.extend({error_code:Jr}),VA=oe.object({state:qt}).strict(),HA=ri,$A=oe.object({state:qt}).strict();import{z as K}from"zod";var Ah=744*60*60*1e3,wh=K.enum(["eligible","fast_path","upgraded","skipped","lock_skipped","cas_aborted","validation_failed","blocked","paused"]),Ph=K.enum(["typecheck","build","health","validation"]),vh=K.enum(["not_attempted","promoted","aborted"]),JA=K.object({template_id:K.string().trim().min(1).max(128),from_version:Fe.nullable(),to_version:Fe,outcome:wh,attempt:K.number().int().nonnegative().max(2147483647),duration_ms:K.number().int().nonnegative().max(2147483647),replaced_group_count:K.number().int().nonnegative().max(2147483647),skipped_group_count:K.number().int().nonnegative().max(2147483647),validation_stage:Ph.nullable(),cas_outcome:vh.nullable()}).strict(),ew=K.object({recorded:K.literal(!0)}).strict(),ec=K.object({from:K.iso.datetime(),to:K.iso.datetime()}).strict().refine(({from:e,to:n})=>Date.parse(e)<Date.parse(n),{message:"from must be earlier than to",path:["to"]}).refine(({from:e,to:n})=>Date.parse(n)-Date.parse(e)<=Ah,{message:"report window must not exceed 31 days",path:["to"]}),tw=ec,Ch=K.object({eligible:K.number().int().nonnegative(),fast_path:K.number().int().nonnegative(),upgraded:K.number().int().nonnegative(),skipped:K.number().int().nonnegative(),lock_skipped:K.number().int().nonnegative(),cas_aborted:K.number().int().nonnegative(),validation_failed:K.number().int().nonnegative(),blocked:K.number().int().nonnegative(),paused:K.number().int().nonnegative()}).strict(),nw=K.object({window:ec,outcome_counts:Ch,current_state_counts:K.object({blocked:K.number().int().nonnegative(),paused:K.number().int().nonnegative()}).strict(),duration_ms:K.object({p50:K.number().int().nonnegative().nullable(),p95:K.number().int().nonnegative().nullable(),sample_count:K.number().int().nonnegative()}).strict()}).strict(),iw=K.object({older_than:K.iso.datetime(),limit:K.coerce.number().int().min(1).max(200).default(50),include_candidates:K.enum(["true","false"]).default("false").transform(e=>e==="true")}).strict(),Dh=K.object({site_id:R,snapshot_id:T,status:K.enum(["candidate","deleting"]),created_at:K.iso.datetime()}).strict(),sw=K.object({snapshots:K.array(Dh)}).strict();import{z as st}from"zod";var jh=st.enum(["PREVIEW_SESSION_NOT_FOUND","PREVIEW_SESSION_INVALID","PREVIEW_SESSION_STALE","PREVIEW_SESSION_LOOKUP_FAILED","PREVIEW_SANDBOX_NOT_FOUND","PREVIEW_SANDBOX_CONNECT_FAILED","PREVIEW_SANDBOX_OWNERSHIP_MISMATCH","PREVIEW_ACTIVATION_TIMEOUT","PREVIEW_PREFLIGHT_FAILED","PREVIEW_ENV_LOOKUP_FAILED","PREVIEW_SERVER_START_FAILED","PREVIEW_HEALTH_CHECK_FAILED","SANDBOX_NOT_CONFIGURED"]),Oh=st.object({status:st.literal("ready"),preview_url:st.string().url()}).strict(),Nh=st.object({status:st.literal("failed"),code:jh,message:st.string().min(1),retryable:st.boolean()}).strict(),rw=st.discriminatedUnion("status",[Oh,Nh]);import{z as me}from"zod";var uw="build-context.json",gw=2e5,tc=me.string().regex(/^sha256:[a-f0-9]{64}$/u),nc=1e3;function Lh(e){return Array.from(e).length<=nc}var Mh=me.object({kind:me.enum(["customer_materials","website_scan_diagnosis","committed_strategy"]),digest:tc}).strict(),Uh=me.object({schema_version:me.literal(1),flow_type:$n,sources:me.array(Mh).min(2).max(2)}).strict().superRefine((e,n)=>{let i=new Set(e.sources.map(a=>a.kind)),s=e.flow_type==="with_website"?["website_scan_diagnosis","committed_strategy"]:["customer_materials","committed_strategy"];(i.size!==s.length||s.some(a=>!i.has(a)))&&n.addIssue({code:"custom",path:["sources"],message:"Site-build provenance sources must match the persisted workflow flow."})}),qh=me.object({schema_version:me.literal(1),seed:tc.optional(),cms_settings:me.object({main_products:me.string().trim().min(1).refine(Lh,{message:`main_products must contain at most ${nc} characters`}).optional()}).strict().optional(),provenance:Uh.optional()}).strict(),Fh=me.object({schema_version:me.literal(1),site_id:R,workflow_id:ze,brief:me.string().min(1),source:me.enum(["business_provider","mock"]),payload:qh}).strict().superRefine((e,n)=>{e.source==="business_provider"&&!e.payload.provenance&&n.addIssue({code:"custom",path:["payload","provenance"],message:"Business site-build context requires persisted provenance."})}),_w=me.object({source_snapshot_id:T,source_run_id:H,build_context:Fh,page_slugs:me.array(me.string().min(1)).optional()}).strict(),hw=me.object({disposition:me.enum(["reused","rebased"]),snapshot_id:T}).strict(),Gh=me.object({snapshot:Ss,workspace_run_id:H.nullable()}).strict(),Sw=M(Gh);import{z as Ve}from"zod";import{z as Ne}from"zod";import{z as re}from"zod";import{z as Kh}from"zod";var zh=["company_profile","product_manual","product_list","customer_case","product_help","qualification","industry_material"],ic=Kh.enum(zh);var sc=re.enum(["pending","running","ready","failed","missing"]),Bh=re.object({task_id:re.string().min(1).max(500),status:sc}).strict(),Iw=re.object({items:re.array(Bh).max(100)}).strict(),hn=re.string().trim().min(1).max(255),Rw=re.object({knowledge_site_id:hn,source_ids:re.array(hn).min(1).max(200)}).strict().superRefine((e,n)=>{new Set(e.source_ids).size!==e.source_ids.length&&n.addIssue({code:"custom",message:"Knowledge source IDs must be unique.",path:["source_ids"]})}),Wh=re.object({source_file_id:hn,category_code:ic.nullable(),category_confirmed:re.boolean(),status:sc}).strict(),Tw=re.object({ready:re.boolean(),files:re.array(Wh),counts:re.object({total:re.number().int().nonnegative(),pending:re.number().int().nonnegative(),running:re.number().int().nonnegative(),ready:re.number().int().nonnegative(),failed:re.number().int().nonnegative(),missing:re.number().int().nonnegative(),unclassified:re.number().int().nonnegative()}).strict()}).strict();var ue=e=>Ne.string().trim().max(e),ac=Ne.array(Ne.string().trim().min(1).max(120)).max(20),Ls=Ne.object({company_name:Ne.string().trim().min(1).max(200),brand_name:ue(200),primary_products:Ne.string().trim().min(1).max(1e3),industry:ue(200),applications:ue(1e3),business_summary:ue(2e3),registered_capital:ue(200).default(""),legal_representative:ue(200).default(""),target_markets:ac,customer_industries:ue(1e3),customer_roles:ue(1e3),buying_scenarios:ue(2e3),differentiators:ue(2e3),competitors:ue(1e3),trust_proof:ue(2e3),customer_cases:ue(3e3),channels:ac,expected_domain:ue(255),brand_tone:ue(500),contact_name:ue(200),contact_info:ue(500),timezone:ue(100),launch_timing:ue(200),input_source_ids:Ne.array(hn).max(50)}).strict(),Vh=Ne.enum(["draft","submitted"]),Ms=Ls.extend({id:W,tenant_id:Ne.string().min(1),site_id:R,workflow_id:ze,status:Vh,submitted_at:Ne.string().min(1).nullable(),created_at:Ne.string().min(1),updated_at:Ne.string().min(1)}).strict(),Cw=M(Ms),Dw=M(Ms),jw=M(Ms.nullable());var Uw=Zn.extend({expected_current_node:Ve.literal("website_scan"),type:Ve.literal("existing_site"),result:Zn.shape.result.extend({website:Ve.string().url(),scan_cards:Ve.partialRecord(Or,Rs).refine(e=>Object.keys(e).length>0,{message:"At least one recognized scan card is required."})}).strict()}).strict(),qw=Ve.object({expected_current_node:Ve.literal("customer_materials"),materials:Ls}).strict(),Fw=Ve.object({expected_current_node:Ve.literal("diagnosis")}).strict(),Gw=Ve.object({expected_current_node:Ve.literal("strategy")}).strict();import{z as P}from"zod";var Sn={Inter:{import:"Inter"},"Inter Tight":{import:"Inter_Tight"},"DM Sans":{import:"DM_Sans"},"Source Sans 3":{import:"Source_Sans_3"},"Libre Franklin":{import:"Libre_Franklin"},Montserrat:{import:"Montserrat"},Archivo:{import:"Archivo"},"Space Grotesk":{import:"Space_Grotesk"},Manrope:{import:"Manrope"},"IBM Plex Sans":{import:"IBM_Plex_Sans"},Oswald:{import:"Oswald"},"Roboto Condensed":{import:"Roboto_Condensed"},"Bebas Neue":{import:"Bebas_Neue",weights:["400"]},"Playfair Display":{import:"Playfair_Display"},Lora:{import:"Lora"},Fraunces:{import:"Fraunces"},"Cormorant Garamond":{import:"Cormorant_Garamond"},"JetBrains Mono":{import:"JetBrains_Mono"},"IBM Plex Mono":{import:"IBM_Plex_Mono"},"Noto Sans SC":{import:"Noto_Sans_SC",download:!1},"Noto Serif SC":{import:"Noto_Serif_SC",download:!1}},Hh={heading:"Inter",body:"Inter"},oc=Sn.Inter;function ci(e){return e.trim().replace(/\s+/g,"_").toLowerCase()}var lc=(()=>{let e=new Map;for(let[n,i]of Object.entries(Sn))e.set(ci(n),i),e.set(ci(i.import),i);return e})();function $h(e){return typeof e!="string"||e.trim().length===0?oc:lc.get(ci(e))??oc}var Yh=(()=>{let e=new Map;for(let[n,i]of Object.entries(Sn))e.set(i.import,n);return e})();function Xh(e){if(typeof e!="string"||e.trim().length===0)return"Inter";let n=lc.get(ci(e));return n?Yh.get(n.import)??"Inter":"Inter"}var Qh=Object.keys(Sn),rc='ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',cc='Georgia, "Times New Roman", serif',mc='"SFMono-Regular", Consolas, monospace',Zh=new Set(["serif","sans-serif","sans serif","monospace","mono","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace"]),Jh=new Set(["Playfair Display","Lora","Fraunces","Cormorant Garamond","Noto Serif SC"].map(e=>e.toLowerCase())),eS=new Set(["JetBrains Mono","IBM Plex Mono"].map(e=>e.toLowerCase()));function tS(e){let n=e.toLowerCase();return eS.has(n)||n.includes("mono")?"mono":Jh.has(n)||n.includes("serif")?"serif":"sans"}function Us(e,n){let i=g=>(g??"").trim().replace(/^['"]|['"]$/g,"").replace(/[^A-Za-z0-9 _-]+/g,"").trim().slice(0,60),s=i(e),a=i(n),r=g=>Zh.has(g.toLowerCase());if(s&&r(s)){let g=s.toLowerCase();return g.includes("mono")?mc:g.includes("serif")?cc:rc}let u=s;u||(u=r(a)?"":a),u||(u="Inter");let c=tS(u);return c==="mono"?`"${u}", ${mc}`:c==="serif"?`"${u}", ${cc}`:`"${u}", ${rc}`}function nS(e){return{"--site-font-sans":Us(e?.body,"Inter"),"--site-font-heading":Us(e?.heading,e?.body??"Inter")}}var qs=["archivo-inter","playfair-source-sans","space-grotesk-manrope","fraunces-libre-franklin","noto-serif-sc-noto-sans-sc","noto-sans-sc"],pc=[{id:"archivo-inter",heading:"Archivo",body:"Inter"},{id:"playfair-source-sans",heading:"Playfair Display",body:"Source Sans 3"},{id:"space-grotesk-manrope",heading:"Space Grotesk",body:"Manrope"},{id:"fraunces-libre-franklin",heading:"Fraunces",body:"Libre Franklin"},{id:"noto-serif-sc-noto-sans-sc",heading:"Noto Serif SC",body:"Noto Sans SC"},{id:"noto-sans-sc",heading:"Noto Sans SC",body:"Noto Sans SC"}];function dc(e){let n=pc.find(i=>i.id===e);if(!n)throw new Error(`Unknown font pairing: ${e}`);return n}var Fs=["compact","comfortable","airy"],uc=["none","sm","md","lg","xl"],gc="lg",Gs=["subtle","moderate","expressive"],iS=[{id:"subtle",motionLevel:"subtle"},{id:"moderate",motionLevel:"moderate"},{id:"expressive",motionLevel:"expressive"}];function _c(e){let n=iS.find(i=>i.id===e);if(!n)throw new Error(`Unknown motion preset: ${e}`);return n}var hc=["ocean","forest","clay","violet","graphite","crimson"],Sc=["ai-forest","ai-navy","ai-steel"],fc=/^gen-[0-9a-f]{8}$/,Ks=[{id:"ai-forest",name:"\u5DE5\u4E1A\u58A8\u7EFF \xB7 Industrial Teal",description:"\u6C89\u7A33\u4E13\u4E1A\uFF0C\u7A81\u51FA\u7CBE\u5BC6\u4E0E\u53EF\u4FE1\u3002",fallbackReason:"\u7A33\u5B9A\u4E13\u4E1A\u7684\u9ED8\u8BA4\u9009\u62E9\u3002",colorSeeds:{primary:"#0E7C6F",accent:"#2F6FED",foreground:"#0F1B2D"},surfaceMode:"light",radius:"sm"},{id:"ai-navy",name:"\u79D1\u6280\u6DF1\u84DD \xB7 Deep Tech Blue",description:"\u7406\u6027\u79D1\u6280\u611F\uFF0C\u5F3A\u8C03\u6280\u672F\u5B9E\u529B\u4E0E\u6570\u636E\u53EF\u4FE1\u3002",fallbackReason:"\u6280\u672F\u8868\u8FBE\u7684\u5907\u9009\u3002",colorSeeds:{primary:"#1E3A8A",accent:"#2F6FED",foreground:"#0F1B2D"},surfaceMode:"light",radius:"md"},{id:"ai-steel",name:"\u7CBE\u5BC6\u94F6\u7070 \xB7 Precision Steel",description:"\u514B\u5236\u6E05\u6670\uFF0C\u9002\u5408\u53C2\u6570\u4E0E\u5DE5\u7A0B\u7EC6\u8282\u8868\u8FBE\u3002",fallbackReason:"\u53C2\u6570\u4FE1\u606F\u8F83\u591A\u65F6\u7684\u5907\u9009\u3002",colorSeeds:{primary:"#475569",accent:"#94A3B8",foreground:"#111827"},surfaceMode:"light",radius:"none"}],zs=[{id:"ocean",colorSeeds:{primary:"#1e3a5f",accent:"#2563eb",foreground:"#0f172a"},surfaceMode:"light",radius:"md"},{id:"forest",colorSeeds:{primary:"#14532d",accent:"#16a34a",foreground:"#0f172a"},surfaceMode:"light",radius:"lg"},{id:"clay",colorSeeds:{primary:"#7c2d12",accent:"#ea580c",foreground:"#1c1917"},surfaceMode:"light",radius:"xl"},{id:"violet",colorSeeds:{primary:"#3b0764",accent:"#7c3aed",foreground:"#18181b"},surfaceMode:"light",radius:"lg"},{id:"graphite",colorSeeds:{primary:"#1f2937",accent:"#0d9488",foreground:"#111827"},surfaceMode:"light",radius:"none"},{id:"crimson",colorSeeds:{primary:"#7f1d1d",accent:"#dc2626",foreground:"#1f1012"},surfaceMode:"light",radius:"sm"}];function Ww(e){let n=zs.find(i=>i.id===e);if(!n)throw new Error(`Unknown theme preset: ${e}`);return n}function bc(e){return zs.find(n=>n.id===e)?.radius??Ks.find(n=>n.id===e)?.radius}var Bs=P.string().regex(/^#[0-9A-F]{6}$/i),fn=P.string().trim().min(1).max(500),yc=P.string().datetime({offset:!0}),sS=P.enum(hc),aS=P.enum(Sc),oS=P.string().regex(fc),bn=P.union([sS,aS,oS]),yn=P.enum(qs),xn=P.enum(Gs),En=P.enum(Fs),mi=P.enum(uc),xc=300,rS=P.string().trim().min(1).max(xc),li=P.object({primary:Bs,accent:Bs,foreground:Bs}).strict(),cS=P.object({id:bn,rank:P.number().int().min(1).max(3),name:P.string().trim().min(1).max(120),description:P.string().trim().min(1).max(240),color_seeds:li,surface_mode:P.enum(["light","dark"]),radius:mi,font_pairing_id:yn,motion_preset_id:xn,density:En,reason:fn}).strict(),Ec=P.object({name:P.string().trim().min(1).max(120),description:P.string().trim().min(1).max(240),reason:fn,color_seeds:li,surface_mode:P.enum(["light","dark"]),radius:mi,font_pairing_id:yn,motion_preset_id:xn,density:En}).strict(),Ic=P.object({version:P.number().int().min(1),recommendation_id:P.string().uuid(),theme_preset_id:bn,color_seeds:li,surface_mode:P.enum(["light","dark"]),font_pairing_id:yn,motion_preset_id:xn,density:En,radius:mi.optional(),aesthetic_note:rS.optional(),updated_at:yc}).strict(),mS=P.object({id:P.string().uuid(),version:P.number().int().min(1),catalog_version:P.string().trim().min(1).max(80),source:P.object({mode:P.enum(["ai","fallback"]),fallback_reason:P.string().trim().min(1).max(80).nullable()}).strict(),inputs:P.object({industry:P.string().trim().min(1).max(160).optional(),site_language:P.string().trim().min(2).max(35),owner_locale:he.optional(),strategy_version:P.number().int().min(1),input_digest:P.string().regex(/^sha256:[a-f0-9]{64}$/)}).strict(),theme:P.object({recommended_id:bn,candidate_ids:P.array(bn).length(3),candidates:P.array(cS).length(3)}).strict().superRefine((e,n)=>{e.recommended_id!==e.candidate_ids[0]&&n.addIssue({code:"custom",path:["recommended_id"],message:"recommended_id must be the first candidate"}),e.candidates.some((i,s)=>i.id!==e.candidate_ids[s]||i.rank!==s+1)&&n.addIssue({code:"custom",path:["candidates"],message:"Candidates must follow candidate_ids order."})}),font:P.object({recommended_id:yn,reason:fn}).strict(),motion:P.object({recommended_id:xn,reason:fn}).strict(),density:P.object({recommended_id:En,reason:fn}).strict(),conversion:xt.optional(),generated_at:yc}).strict(),nP=P.object({force_refresh:P.boolean().optional()}).strict(),iP=P.object({request_id:P.string().trim().min(1).max(160),site_id:R,cached:P.boolean(),recommendation:mS,selection:Ic}).strict(),sP=P.object({recommendation_id:P.string().uuid(),expected_version:P.number().int().min(1),theme_preset_id:bn,color_seeds:li,surface_mode:P.enum(["light","dark"]),font_pairing_id:yn,motion_preset_id:xn,density:En,radius:mi.optional(),aesthetic_note:P.string().trim().max(xc).optional()}).strict(),aP=P.object({selection:Ic}).strict(),oP=P.object({tenant_id:P.string().trim().min(1).max(160),site_id:R,site_language:P.string().trim().min(2).max(35),owner_locale:he,industry:P.string().trim().min(1).max(160).optional(),strategy_version_id:P.string().uuid(),strategy_version:P.number().int().min(1),strategy_checksum:P.string().regex(/^[a-f0-9]{64}$/),strategy_summary:P.array(P.string().trim().min(1).max(500)).min(1).max(Te),reference_image_source_id:yt.optional(),owner_whole_site_request:P.string().trim().min(1).max(Ct).optional()}).strict(),Ws=P.object({theme_candidates:P.array(Ec).length(3),conversion:xt.optional()}).strict().superRefine((e,n)=>{let i=new Set;e.theme_candidates.forEach((s,a)=>{let r=JSON.stringify(s.color_seeds).toUpperCase();i.has(r)&&n.addIssue({code:"custom",path:["theme_candidates",a,"color_seeds"],message:"Theme candidates must have pairwise distinct color_seeds"}),i.add(r)})});function rP(){return Ks.map(e=>Ec.parse({name:e.name,description:e.description,reason:e.fallbackReason,color_seeds:e.colorSeeds,surface_mode:e.surfaceMode,radius:e.radius,font_pairing_id:qs[0],motion_preset_id:Gs[0],density:Fs[1]}))}function lS(e){return e.radius??bc(e.theme_preset_id)??"lg"}function cP(e){let n=dc(e.font_pairing_id),i=_c(e.motion_preset_id);return{colorSeeds:e.color_seeds,surfaceMode:e.surface_mode,fonts:{heading:n.heading,body:n.body},density:e.density,motionLevel:i.motionLevel,motionPreset:i.id,radius:lS(e)}}function mP(e,n){let i=e.theme.candidates[0];return{version:1,recommendation_id:e.id,theme_preset_id:i.id,color_seeds:i.color_seeds,surface_mode:i.surface_mode,font_pairing_id:e.font.recommended_id,motion_preset_id:e.motion.recommended_id,density:e.density.recommended_id,radius:i.radius,updated_at:n.toISOString()}}import{z as Vs}from"zod";function pS(e){return JSON.stringify([e.color_seeds.primary.toUpperCase(),e.color_seeds.accent.toUpperCase(),e.color_seeds.foreground.toUpperCase(),e.surface_mode,e.font_pairing_id,e.radius,e.motion_preset_id,e.density])}var dS=Vs.object(Ws.shape).strict().superRefine((e,n)=>{let i=new Set;e.theme_candidates.forEach((s,a)=>{let r=pS(s);i.has(r)&&n.addIssue({code:"custom",path:["theme_candidates",a],message:"Theme candidates must have pairwise distinct visual identities"}),i.add(r)})}),uP=Vs.union([Ws,dS.safeExtend({model_profile:Vs.literal("azure-gpt")})]);import{z as gt}from"zod";var SP=gt.object({site_id:R,site_language:gt.string().trim().min(2).max(35),business_facts:gt.array(gt.string().trim().min(1).max(1e3)).min(1).max(8)}).strict(),uS=gt.enum(["high","medium","low"]),fP=gt.object({skill_name:gt.string().trim().min(1).max(80).nullable(),confidence:uS,reason:gt.string().trim().min(1).max(240)}).strict();import{z as X}from"zod";var Hs=["title","text","richtext","number","boolean","date","datetime","url","email","color","select","multiselect","tag"],pi=X.object({name:X.string().min(1).max(100),type:X.enum(Hs),label:X.string().min(1).max(255),required:X.boolean().optional(),options:X.array(X.string()).optional()}),xP=X.object({name:X.string(),cms_type:X.string(),label:X.string().optional(),required:X.boolean().optional(),value_shape:X.string().optional(),front_display:X.enum(["visible","internal","forbidden"]).optional(),choices:X.array(X.object({value:X.union([X.string(),X.number()]),label:X.string()})).optional()}),EP=X.object({route_file_path:X.string().min(1),target_component_path:X.string().min(1),content_type_hint:X.string().min(1),collection_purpose:X.enum(["generic","product"]).optional(),required_fields:X.array(pi).optional(),mode:X.enum(["bind_existing","provision"]),list_mode:X.enum(["page","embedded"]).optional(),fields:X.array(pi).optional(),seed_records:X.array(X.record(X.string(),X.unknown())).optional()});import{z as N}from"zod";var In=N.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),di=N.string().regex(/^[a-f0-9]{64}$/),ui=N.string().regex(/^[a-z][a-z0-9-]{0,99}$/),gi=N.string().regex(/^[a-z0-9]{1,30}$/),Me=e=>N.string().max(e).refine(n=>n.trim().length>0,"Value must not be blank"),Rc=N.object({id:N.string().uuid(),key:Me(100),name:Me(255)}).strict(),kc=new Set(["title","summary","description","category","thumbnail","url","admin_id"]),gS=new Set(["title","summary","description","image_query"]),_S=new Set(["category","thumbnail","url","admin_id","page","pages","route","path","component","components","snapshot","run","site_id","cms_site_id","tenant_id","token","secret","password","authorization","headers","__proto__","prototype","constructor"]),Tc=new Set(["select","multiselect"]),hS=new Set(["title","text","richtext","date","datetime","url","email","color"]),SS=N.object({name:Me(100),label:Me(255),type:N.enum(Hs),required:N.boolean().optional(),options:N.array(Me(100)).max(100).optional()}).strict().superRefine((e,n)=>{let i=e.options??[];Tc.has(e.type)&&i.length===0&&n.addIssue({code:"custom",path:["options"],message:"Choice fields require at least one option"}),!Tc.has(e.type)&&i.length>0&&n.addIssue({code:"custom",path:["options"],message:"Only choice fields may declare options"}),new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["options"],message:"Field options must be unique"}),kc.has(e.name)&&n.addIssue({code:"custom",path:["name"],message:"Reserved CMS field names cannot be declared"})}),fS=N.array(SS).min(1).max(200),bS=N.array(N.record(N.string(),N.unknown())).max(1e3);function Le(e,n,i){e.addIssue({code:"custom",path:n,message:i})}var yS=N.object({name:Me(30),slug:gi,collection_purpose:N.enum(["generic","product"]).optional(),fields:fS,seed_records:bS}).strict().superRefine((e,n)=>{let i=e.fields.map(a=>a.name);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["fields"],message:"Field names must be unique"}),i.some(a=>!kc.has(a))||n.addIssue({code:"custom",path:["fields"],message:"At least one custom field is required"});let s=new Map(e.fields.map(a=>[a.name,a]));e.seed_records.forEach((a,r)=>{for(let[u,c]of Object.entries(a)){let g=["seed_records",r,u];if(_S.has(u)){Le(n,g,"Seed cannot write reserved or runtime-owned fields");continue}if(u==="image_query"){(typeof c!="string"||c.trim()==="")&&Le(n,g,"image_query must be a non-empty string");continue}if(gS.has(u)){typeof c!="string"&&Le(n,g,"Seed skeleton text fields must be strings");continue}let k=s.get(u);if(!k){Le(n,g,"Seed contains an undeclared field");continue}if(c==null){Le(n,g,"Seed field values must not be null");continue}if(k.type==="select")(typeof c!="string"||!(k.options??[]).includes(c))&&Le(n,g,"Seed select value must be one of the declared options");else if(k.type==="multiselect")(!Array.isArray(c)||c.length===0||c.some(I=>typeof I!="string"||!(k.options??[]).includes(I)))&&Le(n,g,"Seed multiselect value must contain only declared options");else if(k.type==="number")(typeof c!="number"||!Number.isFinite(c))&&Le(n,g,"Seed number values must be finite numbers");else if(k.type==="boolean")typeof c!="boolean"&&Le(n,g,"Seed boolean values must be booleans");else if(k.type==="tag"){let I=Array.isArray(c)?c:[c];(I.length===0||I.some(C=>typeof C!="string"||C.trim()===""))&&Le(n,g,"Seed tag values must be non-empty strings")}else hS.has(k.type)&&typeof c!="string"&&Le(n,g,"Seed text-like values must be strings")}for(let u of e.fields)u.required&&!(u.name in a)&&Le(n,["seed_records",r,u.name],"Required fields must be present in every seed record")}),new TextEncoder().encode(JSON.stringify(e)).byteLength>1024*1024&&n.addIssue({code:"custom",path:[],message:"Application template must not exceed 1048576 UTF-8 bytes"})}),$s=N.object({schema_version:N.literal(1),application:yS}).strict(),xS=N.object({templateId:N.string().uuid(),stableKey:ui,resolvedVersion:In,digest:di,template:$s}).strict(),ES=xS,IS={alreadyCreated:"APPLICATION_ALREADY_CREATED",slugConflict:"APPLICATION_SLUG_CONFLICT",createInProgress:"APPLICATION_CREATE_IN_PROGRESS",cmsUnbound:"APPLICATION_CMS_UNBOUND",templateVersionUnavailable:"APPLICATION_TEMPLATE_VERSION_UNAVAILABLE",createFailed:"APPLICATION_CREATE_FAILED",createResultUnknown:"APPLICATION_CREATE_RESULT_UNKNOWN"},Ac=N.enum(Object.values(IS)),wc=N.object({category_status:N.enum(["succeeded","failed","not_attempted"]),seed_status:N.enum(["skipped","succeeded","partial","failed"]),requested_count:N.number().int().nonnegative(),written_count:N.number().int().nonnegative().nullable(),published_count:N.number().int().nonnegative().nullable(),errors:N.array(N.object({stage:N.enum(["category","seed","receipt"]),code:Me(100)}).strict()).max(20)}).strict(),RS=N.object({templateId:N.string().uuid(),stableKey:ui,title:Me(200),description:N.string().max(1e3),thumbnailUrl:N.string().url().nullable(),resolvedVersion:In,digest:di,application:N.object({name:Me(30),slug:gi}).strict(),categories:N.array(Rc),tags:N.array(Rc),status:N.enum(["available","creating","created","conflict","failed"]),errorCode:Ac.nullable().optional(),template:$s.optional()}).strict(),Pc=N.object({items:N.array(RS)}).strict(),kP=N.object({version:In}).strict(),TS=N.object({app_slug:gi,name:Me(30),template:N.object({stable_key:ui,version:In,digest:di}).strict()}).strict(),kS=N.object({status:N.literal("created"),application:TS,initialization:wc}).strict(),AP=kS,AS=N.object({stable_key:ui,version:In,digest:di,created_at:N.string().datetime().nullable(),initialization:wc.nullable()}).strict(),wS=N.object({app_slug:gi,name:Me(30),collection_slug:N.string().min(1),detail_prefix:N.string().min(1).optional(),source:AS.nullable()}).strict(),wP=N.object({applications:N.array(wS)}).strict(),PP=Pc,vP=N.object({code:Ac,message:Me(500)}).strict(),CP=$s,DP=ES,jP=Pc;import{z as se}from"zod";var vc=e=>se.string().max(e).refine(n=>n.trim().length>0,"Value must not be blank"),PS=pi.strict(),Dc=se.array(PS).min(1).max(200),vS=se.array(se.record(se.string(),se.unknown())).max(1e3),CS=se.string().regex(/^[a-z0-9]{1,30}$/),Ys=se.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),MP=se.object({name:vc(30),slug:vc(50),collection_purpose:se.enum(["generic","product"]).optional(),fields:Dc}).strict(),Cc=se.object({collection_slug:CS,detail_prefix:se.string().min(1).max(255),plugin_id:Ys.optional()}).strict(),UP=se.discriminatedUnion("kind",[Cc.extend({kind:se.literal("created")}),Cc.extend({kind:se.literal("exists")})]),qP=se.object({fields:Dc,seed_records:vS,category_id:Ys}).strict(),DS=se.record(se.string().min(1),se.string().min(1).nullable()),FP=se.object({ids:se.array(Ys).max(1e3),urls:DS,failed:se.array(se.unknown()).max(1e3)}).strict();function GP(e){return e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase().slice(0,30)}import{z as ge}from"zod";var _i=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number","file"],jS=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number"],OS=ge.object({name:ge.string().min(1).max(100),type:ge.enum(jS),label:ge.string().min(1).max(255),required:ge.boolean().optional(),options:ge.array(ge.string()).optional()}),NS=ge.string().regex(/^[a-z][a-z0-9-]{0,48}$/).optional(),BP=ge.object({mode:ge.enum(["bind_existing","provision"],{error:'mode is required. Use "bind_existing" or "provision". Never call connect_form with {}.'}),form_hint:ge.string().min(1).optional(),name:ge.string().min(1).max(255).optional(),component_slug:NS,description:ge.string().min(1).max(1e3).optional(),fields:ge.array(OS).optional()}).superRefine((e,n)=>{e.mode==="bind_existing"&&!e.form_hint?.trim()&&n.addIssue({code:"custom",path:["form_hint"],message:"form_hint is required for bind_existing"}),e.mode==="provision"&&!e.name?.trim()&&n.addIssue({code:"custom",path:["name"],message:"name is required for provision"})}),WP=ge.object({name:ge.string(),label:ge.string(),cms_type:ge.string(),required:ge.boolean()});import{z as l}from"zod";var Rn=/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/,Gt=/^[A-Za-z][A-Za-z0-9_-]{0,127}$/,hi=/^[A-Za-z][A-Za-z0-9_]{0,99}$/,Lc=/^[A-Za-z0-9][A-Za-z0-9_-]{0,99}$/,Qs=/^[a-z][a-z0-9-]{0,99}$/,Mc=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/,jc=2,Oc=3,Si=l.string().regex(Rn),LS=l.string().regex(Rn),Zs=l.string().regex(Rn),Tn=l.string().regex(hi),Js=l.string().regex(Lc),MS=l.discriminatedUnion("status",[l.object({status:l.literal("unbound"),form_code:l.null()}).strict(),l.object({status:l.literal("bound"),form_code:l.string().regex(Gt)}).strict(),l.object({status:l.literal("missing"),form_code:l.string().regex(Gt)}).strict()]),US=l.object({value:Js,label:l.string().trim().min(1).max(255)}).strict(),qS=l.object({kind:l.literal("field"),field_name:Tn,type:l.enum(_i),label:l.string().trim().min(1).max(255),required:l.boolean(),span:l.enum(["full","half"]),options:l.array(US).max(100),max_files:l.number().int().min(1).max(5).optional()}).strict(),FS=l.object({kind:l.literal("step-break"),step_id:l.string().regex(Rn)}).strict(),GS=l.discriminatedUnion("kind",[qS,FS]),KS=l.object({field_name:Tn,type:l.enum(_i),last_label:l.string().max(255)}).strict(),zS=l.object({field_name:Tn,value:Js,last_label:l.string().max(255)}).strict(),BS=l.discriminatedUnion("kind",[l.object({kind:l.literal("custom")}).strict(),l.object({kind:l.literal("template"),slug:l.string().regex(Qs),version:l.string().regex(Mc)}).strict()]),WS={select:2,radio:2,multiselect:1,DropdownSelection:2,RadioButton:2,Checkbox:1};function He(e){return e.toLowerCase()}function Uc(e,n){return e.trim().toLocaleLowerCase(n)}function Ft(e,n){return`${He(e)}\0${n}`}function ye(e,n,i,s){let a=new Set;for(let r of e){if(a.has(r)){s.addIssue({code:"custom",path:n,message:i});return}a.add(r)}}function ea(e,n,i,s){let a=WS[e]??0;a>0&&n<a?s.addIssue({code:"custom",path:i,message:`choice field requires at least ${a} option${a===1?"":"s"}`}):a===0&&n>0&&s.addIssue({code:"custom",path:i,message:"non-choice fields must use an empty options array"})}var ta=l.object({schema_version:l.literal(1),min_runtime_version:l.number().int().positive(),form_definition_id:Si,binding:MS,content_locale:he,features:l.object({multistep:l.boolean()}).strict(),copy:l.object({title:l.string().max(255),description:l.string().max(1e3),submit_button:l.string().trim().min(1).max(100),success_message:l.string().trim().min(1).max(500),error_message:l.string().max(500)}).strict(),layout:l.object({columns:l.enum(["one","two"])}).strict(),nodes:l.array(GS).min(1).max(200),source:BS,retired:l.object({fields:l.array(KS).max(1e3),options:l.array(zS).max(5e3)}).strict(),compatibility:l.object({standardization_version:l.number().int().positive(),diagnostics:l.array(l.string().trim().min(1).max(500)).max(100)}).strict()}).strict().superRefine((e,n)=>{let i=e.nodes.flatMap((c,g)=>c.kind==="field"?[[g,c]]:[]),s=i.map(([,c])=>c);s.length===0&&n.addIssue({code:"custom",path:["nodes"],message:"at least one field node is required"});let a=e.nodes.filter(c=>c.kind==="step-break");!e.features.multistep&&a.length>0&&n.addIssue({code:"custom",path:["nodes"],message:"step-break requires the multistep feature"}),e.features.multistep&&(e.min_runtime_version<jc&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`multistep requires runtime version ${jc}`}),a.length===0&&n.addIssue({code:"custom",path:["nodes"],message:"multistep requires at least one step-break"}));for(let[c,g]of e.nodes.entries())g.kind==="step-break"&&(c===0||c===e.nodes.length-1||e.nodes[c-1]?.kind==="step-break"||e.nodes[c+1]?.kind==="step-break")&&n.addIssue({code:"custom",path:["nodes",c],message:"step-break must separate two non-empty steps"});ye(a.map(c=>c.step_id),["nodes"],"step_id must be unique",n),ye(s.map(c=>He(c.field_name)),["nodes"],"field_name must be unique",n),ye(e.retired.fields.map(c=>He(c.field_name)),["retired","fields"],"retired field_name must be unique",n);let r=new Set(e.retired.fields.map(c=>He(c.field_name)));for(let[c,g]of i)r.has(He(g.field_name))&&n.addIssue({code:"custom",path:["nodes",c,"field_name"],message:"retired field_name cannot be reused"}),ea(g.type,g.options.length,["nodes",c,"options"],n),g.type==="file"?e.min_runtime_version<Oc&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`file fields require runtime version ${Oc}`}):g.max_files!==void 0&&n.addIssue({code:"custom",path:["nodes",c,"max_files"],message:"max_files is only valid for file fields"}),ye(g.options.map(k=>k.value),["nodes",c,"options"],"option value must be unique within a field",n),ye(g.options.map(k=>Uc(k.label,e.content_locale)),["nodes",c,"options"],"option label must be unique within a field",n);ye(e.retired.options.map(c=>Ft(c.field_name,c.value)),["retired","options"],"retired option identity must be unique",n);let u=new Set(e.retired.options.map(c=>Ft(c.field_name,c.value)));for(let[c,g]of i)for(let[k,I]of g.options.entries())u.has(Ft(g.field_name,I.value))&&n.addIssue({code:"custom",path:["nodes",c,"options",k,"value"],message:"retired option value cannot be reused"})}),VS=["copy.title","copy.description","copy.submit_button","copy.success_message","copy.error_message","nodes.*.label","nodes.*.options.*.label"],HS=new Set(VS);function ZP(e){let n=e.map(i=>typeof i=="number"||/^\d+$/.test(i)?"*":i).join(".");return HS.has(n)}function JP(e,n){let i=[],s=e.nodes.filter(c=>c.kind==="field"),a=new Map(n.nodes.filter(c=>c.kind==="field").map(c=>[He(c.field_name),c])),r=new Map(n.retired.fields.map(c=>[He(c.field_name),c])),u=new Map(n.retired.options.map(c=>[Ft(c.field_name,c.value),c]));for(let c of s){let g=He(c.field_name),k=a.get(g),I=r.get(g);k&&k.field_name!==c.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:c.field_name}),k&&k.type!==c.type&&i.push({code:"FIELD_TYPE_CHANGED",field_name:c.field_name}),!k&&I&&I.field_name!==c.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:c.field_name}),!k&&I&&I.type!==c.type&&i.push({code:"FIELD_TYPE_CHANGED",field_name:c.field_name}),!k&&!r.has(g)&&i.push({code:"FIELD_RETIREMENT_MISSING",field_name:c.field_name});let C=new Set(k?.options.map(F=>F.value)??[]);for(let F of c.options){let B=u.get(Ft(c.field_name,F.value));!C.has(F.value)&&B&&B.field_name!==c.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:c.field_name}),!C.has(F.value)&&!B&&i.push({code:"OPTION_RETIREMENT_MISSING",field_name:c.field_name,value:F.value})}}for(let c of e.retired.fields){let g=r.get(He(c.field_name));g&&g.field_name!==c.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:c.field_name}),g&&g.type!==c.type&&i.push({code:"FIELD_TYPE_CHANGED",field_name:c.field_name}),g||i.push({code:"FIELD_RETIREMENT_MISSING",field_name:c.field_name})}for(let c of e.retired.options){let g=u.get(Ft(c.field_name,c.value));g&&g.field_name!==c.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:c.field_name}),g||i.push({code:"OPTION_RETIREMENT_MISSING",field_name:c.field_name,value:c.value})}return i}var $S=l.enum(Zt),_t=l.object({english:l.string().max(1e3),translations:l.partialRecord($S,l.string().max(1e3)).optional()}).strict(),YS=l.object({template_option_key:l.string().regex(Lc),label:_t}).strict(),XS=l.object({template_field_key:l.string().regex(hi),type:l.enum(_i),label:_t,required:l.boolean(),span:l.enum(["full","half"]),options:l.array(YS).max(100)}).strict(),QS=l.object({template_step_key:l.string().regex(hi),after_field_key:l.string().regex(hi)}).strict(),ev=["lead-generation","trial-and-samples","quote-and-commerce","appointments-and-visits","resources-and-subscriptions","service-and-channel"],tv=[1,1,1,1,1,1],qc=l.string().regex(Qs),ZS=l.object({schema_version:l.literal(1),slug:qc,name:_t,template_count:l.number().int().min(0).max(500)}).strict().superRefine((e,n)=>{e.name.english.trim()===""&&n.addIssue({code:"custom",path:["name","english"],message:"English category name is required"})}),JS=l.object({schema_version:l.literal(1),slug:l.string().regex(Qs),version:l.string().regex(Mc),category:qc,copy:l.object({title:_t,description:_t,submit_button:_t,success_message:_t,error_message:_t}).strict(),layout:l.object({columns:l.enum(["one","two"])}).strict(),fields:l.array(XS).min(1).max(200),step_breaks:l.array(QS).max(20).optional()}).strict().superRefine((e,n)=>{for(let r of["title","description","submit_button","success_message","error_message"])e.copy[r].english.trim()===""&&n.addIssue({code:"custom",path:["copy",r,"english"],message:"English baseline text is required"});ye(e.fields.map(r=>r.template_field_key),["fields"],"template_field_key must be unique",n);let i=new Map(e.fields.map((r,u)=>[r.template_field_key,u])),s=e.step_breaks??[];ye(s.map(r=>r.template_step_key),["step_breaks"],"template_step_key must be unique",n),ye(s.map(r=>r.after_field_key),["step_breaks"],"step breaks must not share an anchor field",n);let a=-1;for(let[r,u]of s.entries()){let c=i.get(u.after_field_key);c===void 0||c>=e.fields.length-1?n.addIssue({code:"custom",path:["step_breaks",r,"after_field_key"],message:"step break must follow an existing non-final field"}):c<=a&&n.addIssue({code:"custom",path:["step_breaks",r,"after_field_key"],message:"step breaks must follow field order"}),a=c??a}e.fields.length+s.length>200&&n.addIssue({code:"custom",path:["step_breaks"],message:"template fields and step breaks must not exceed 200 nodes"});for(let[r,u]of e.fields.entries()){u.label.english.trim()===""&&n.addIssue({code:"custom",path:["fields",r,"label","english"],message:"English field label is required"}),ea(u.type,u.options.length,["fields",r,"options"],n),ye(u.options.map(c=>c.template_option_key),["fields",r,"options"],"template_option_key must be unique within a field",n),ye(u.options.map(c=>c.label.english.trim().toLowerCase()),["fields",r,"options"],"English option labels must be unique within a field",n);for(let[c,g]of u.options.entries())g.label.english.trim()===""&&n.addIssue({code:"custom",path:["fields",r,"options",c,"label","english"],message:"English option label is required"})}}),nv=l.object({schema_version:l.literal(1),visibility:l.enum(["internal","public"]),categories:l.array(ZS).max(500),templates:l.array(JS).max(500)}).strict().superRefine((e,n)=>{let i=(a,r)=>{let u=Zt.filter(c=>!a.translations?.[c]?.trim());u.length>0&&n.addIssue({code:"custom",path:[...r,"translations"],message:`public template copy is missing locales: ${u.join(", ")}`})};ye(e.categories.map(a=>a.slug),["categories"],"template category slug must be unique",n);let s=new Set(e.categories.map(a=>a.slug));for(let[a,r]of e.categories.entries()){let u=e.templates.filter(c=>c.category===r.slug).length;r.template_count!==u&&n.addIssue({code:"custom",path:["categories",a,"template_count"],message:"template_count must match catalog templates"})}ye(e.templates.map(a=>a.slug),["templates"],"template slug must be unique",n);for(let[a,r]of e.templates.entries())s.has(r.category)||n.addIssue({code:"custom",path:["templates",a,"category"],message:"template category must exist in catalog categories"});if(e.visibility==="public"){for(let[a,r]of e.categories.entries())i(r.name,["categories",a,"name"]);for(let[a,r]of e.templates.entries()){for(let[u,c]of Object.entries(r.copy))i(c,["templates",a,"copy",u]);for(let[u,c]of r.fields.entries()){i(c.label,["templates",a,"fields",u,"label"]);for(let[g,k]of c.options.entries())i(k.label,["templates",a,"fields",u,"options",g,"label"])}}}});function iv(e,n){let i=to(n),s=i?e.translations?.[i]:void 0;return s!==void 0&&s.trim()!==""?s:e.english}var ef=["Text","Summary","Email","Phone","DropdownSelection","RadioButton","Checkbox","Boolean","Date","Num","MultipleFile","SpecificFile"],tf={text:"Text",textarea:"Summary",email:"Email",phone:"Phone",select:"DropdownSelection",radio:"RadioButton",multiselect:"Checkbox",boolean:"Boolean",date:"Date",number:"Num",file:"MultipleFile"},nf=l.object({value:Js,label:l.string().trim().min(1).max(255)}).strict(),sf=l.object({field_name:Tn,field_type:l.enum(ef),field_label:l.string().trim().min(1).max(255),is_required:l.boolean(),sort_order:l.number().int().nonnegative(),options:l.array(nf).max(100)}).strict(),Fc=l.object({version:l.literal(1),locale:he,fields:l.array(sf).min(1).max(200)}).strict().superRefine((e,n)=>{ye(e.fields.map(i=>He(i.field_name)),["fields"],"field_name must be unique",n);for(let[i,s]of e.fields.entries())ea(s.field_type,s.options.length,["fields",i,"options"],n),ye(s.options.map(a=>a.value),["fields",i,"options"],"option value must be unique within a field",n),ye(s.options.map(a=>Uc(a.label,e.locale)),["fields",i,"options"],"option label must be unique within a field",n)});function sv(e){let n=e.nodes.filter(i=>i.kind==="field").map((i,s)=>({field_name:i.field_name,field_type:i.type==="file"&&i.max_files===1?"SpecificFile":tf[i.type],field_label:i.label,is_required:i.required,sort_order:s,options:i.options.map(a=>({...a}))}));return Fc.parse({version:1,locale:e.content_locale,fields:n})}var ie=l.string().regex(/^sha256:[0-9a-f]{64}$/),af=l.union([_e,l.enum(["app/api/forms/[code]/route.ts","hooks/use-cms-form-submit.ts","lib/cms/forms.ts","lib/cms/client.ts"])]),of=l.object({path:af,content_hash:ie.nullable()}).strict(),rf=l.array(of).min(1).max(500).superRefine((e,n)=>{ye(e.map(i=>i.path),[],"affected file paths must be unique",n)}),na=l.object({grade:l.enum(["standard","A","B","C"]),required:l.boolean(),pending_confirmations:l.array(l.object({item_id:l.string().regex(Rn),field_name:Tn.optional(),kind:l.enum(["form_copy","layout","field_label","field_type","field_required","field_options"]),message:l.string().trim().min(1).max(500)}).strict().superRefine((e,n)=>{e.kind.startsWith("field_")&&!e.field_name&&n.addIssue({code:"custom",path:["field_name"],message:"field confirmation items require field_name"})})).max(200)}).strict().superRefine((e,n)=>{let i=e.grade==="standard";i===e.required&&n.addIssue({code:"custom",path:["required"],message:i?"standard forms do not require standardization confirmation":"legacy forms require standardization confirmation"}),e.grade==="C"&&e.pending_confirmations.length===0&&n.addIssue({code:"custom",path:["pending_confirmations"],message:"grade C requires at least one pending confirmation"}),e.grade!=="C"&&e.pending_confirmations.length>0&&n.addIssue({code:"custom",path:["pending_confirmations"],message:"only grade C can contain pending confirmations"})}),cf=l.object({site_id:R,form_definition_id:Si,base_snapshot_id:T,expected_form_spec_hash:ie,expected_cms_schema_hash:ie.nullable(),draft_form_spec_hash:ie,desired_cms_schema_hash:ie,affected_files_hash:ie,shared_reference_hash:ie,shared_reference_count:l.number().int().positive(),confirm_shared_update:l.boolean(),recreate_missing_binding:l.boolean(),standardization:na,confirm_standardization:l.boolean()}).strict(),Gc=l.object({reference_hash:ie,page_count:l.number().int().positive(),block_count:l.number().int().positive()}).strict().refine(e=>e.page_count<=e.block_count,{message:"page_count cannot exceed block_count"}),av=l.object({site_id:R,form_block_id:LS,base_snapshot_id:T,form_spec:ta,runtime_upgrade_required:l.boolean(),expected_form_spec_hash:ie,expected_cms_schema_hash:ie.nullable(),affected_files_hash:ie,shared_impact:Gc,standardization:na}).strict(),mf=l.object({operation_id:Zs,operation_fingerprint:ie,site_id:R,form_definition_id:Si,base_snapshot_id:T,expected_form_spec_hash:ie,expected_cms_schema_hash:ie.nullable(),draft_form_spec:ta,draft_form_spec_hash:ie,desired_cms_schema_hash:ie,affected_files_hash:ie,shared_impact:Gc,confirm_shared_update:l.boolean(),recreate_missing_binding:l.boolean(),standardization:na,confirm_standardization:l.boolean()}).strict().superRefine((e,n)=>{e.form_definition_id!==e.draft_form_spec.form_definition_id&&n.addIssue({code:"custom",path:["form_definition_id"],message:"form_definition_id must match draft_form_spec"}),e.shared_impact.block_count>1&&!e.confirm_shared_update&&n.addIssue({code:"custom",path:["confirm_shared_update"],message:"shared definition updates require explicit confirmation"});let i=e.draft_form_spec.binding.status==="missing";i!==e.recreate_missing_binding&&n.addIssue({code:"custom",path:["recreate_missing_binding"],message:i?"missing bindings require explicit recreation confirmation":"only missing bindings can be recreated"});let s=e.draft_form_spec.binding.status==="bound",a=s&&e.standardization.required&&(e.standardization.grade==="B"||e.standardization.grade==="C");(s&&!a&&e.expected_cms_schema_hash===null||!s&&e.expected_cms_schema_hash!==null)&&n.addIssue({code:"custom",path:["expected_cms_schema_hash"],message:s?"bound standard forms require the current CMS schema hash":"unbound or missing forms cannot claim a current CMS schema hash"}),e.confirm_standardization!==e.standardization.required&&n.addIssue({code:"custom",path:["confirm_standardization"],message:e.standardization.required?"legacy standardization requires explicit confirmation":"standard forms cannot claim legacy standardization confirmation"})}),lf=["created","validated","binding_reserved","candidate_ready","cms_applied","snapshot_promoted","committed","compensating","recovery_required","failed"],ia=l.enum(lf),pf=["pending","running","succeeded","failed","recovery_required"],Kc=l.enum(pf),df=["candidate_abandon","snapshot_reconcile","cms_restore"],zc=l.enum(df),uf=["FORM_DESIGN_INVALID","FORM_DESIGN_UNSUPPORTED","FORM_DESIGN_STANDARDIZATION_AGENT_REQUIRED","FORM_DESIGN_STANDARDIZATION_UNSUPPORTED","FORM_DESIGN_FEATURE_NOT_ENABLED","FORM_DESIGN_PERMISSION_DENIED","FORM_DESIGN_LOCKED","FORM_DESIGN_CODE_CONFLICT","FORM_DESIGN_CMS_CONFLICT","FORM_DESIGN_CMS_SCHEMA_MISMATCH","FORM_DESIGN_CMS_NOT_FOUND","FORM_DESIGN_BINDING_MISSING","FORM_DESIGN_OPERATION_CONFLICT","FORM_DESIGN_CMS_UNAVAILABLE","FORM_DESIGN_PATCH_FAILED","FORM_DESIGN_COMPENSATION_FAILED","FORM_DESIGN_RECOVERY_REQUIRED"],sa=l.enum(uf),Bc=l.enum(["wait","resume","retry_new_operation","manual_recovery","none"]),Wc=l.enum(["not_started","pending","succeeded","failed"]),Vc=l.object({operation_id:Zs,operation_fingerprint:ie,site_id:R,form_definition_id:Si,stage:ia,status:Kc,base_snapshot_id:T,candidate_snapshot_id:T.nullable(),before_form_code:l.string().regex(Gt).nullable(),materialized_form_code:l.string().regex(Gt).nullable(),expected_form_spec_hash:ie,draft_form_spec_hash:ie,materialized_form_spec_hash:ie.nullable(),expected_cms_schema_hash:ie.nullable(),desired_cms_schema_hash:ie,retry_count:l.number().int().nonnegative(),failure_stage:zc.nullable(),last_error_code:sa.nullable(),retryable:l.boolean(),next_action:Bc,preview_refresh_status:Wc,created_at:l.string().datetime({offset:!0}),updated_at:l.string().datetime({offset:!0})}).strict().superRefine((e,n)=>{if(!(e.stage!=="committed"&&e.status!=="succeeded")){(e.stage!=="committed"||e.status!=="succeeded")&&n.addIssue({code:"custom",path:["status"],message:"committed stage and succeeded status must be reported together"});for(let i of["candidate_snapshot_id","materialized_form_code","materialized_form_spec_hash"])e[i]===null&&n.addIssue({code:"custom",path:[i],message:`${i} is required for a committed success`});(e.failure_stage!==null||e.last_error_code!==null||e.retryable||e.next_action!=="none")&&n.addIssue({code:"custom",path:["next_action"],message:"a committed success cannot retain an error or retry action"})}}),aa=l.object({operation:Vc}).strict(),ov=aa,rv=aa,cv=l.object({operation_fingerprint:ie}).strict(),mv=aa,gf=l.preprocess(e=>!e||typeof e!="object"||Array.isArray(e)||"standardization"in e||"confirm_standardization"in e?e:{...e,standardization:{grade:"standard",required:!1,pending_confirmations:[]},confirm_standardization:!1},mf),lv=l.object({operation:Vc,request:gf,cms_replace_result:l.unknown().nullable()}).strict(),_f=l.object({stage:ia.optional(),status:Kc.optional(),candidate_snapshot_id:T.nullable().optional(),before_form_code:l.string().regex(Gt).nullable().optional(),materialized_form_code:l.string().regex(Gt).nullable().optional(),materialized_form_spec_hash:ie.nullable().optional(),retry_count:l.number().int().nonnegative().optional(),failure_stage:zc.nullable().optional(),last_error_code:sa.nullable().optional(),retryable:l.boolean().optional(),next_action:Bc.optional(),preview_refresh_status:Wc.optional()}).strict(),pv=l.object({expected_updated_at:l.string().datetime({offset:!0}),operation:_f,cms_replace_result:l.unknown().nullable().optional()}).strict().refine(e=>Object.keys(e.operation).length>0||Object.hasOwn(e,"cms_replace_result"),{message:"transition must change operation state or CMS result"}),dv=l.object({code:sa,message:l.string().trim().min(1).max(500),retryable:l.boolean(),operation_id:Zs.optional(),stage:ia.optional()}).strict();function hf(e){return cf.parse({site_id:e.site_id,form_definition_id:e.form_definition_id,base_snapshot_id:e.base_snapshot_id,expected_form_spec_hash:e.expected_form_spec_hash,expected_cms_schema_hash:e.expected_cms_schema_hash,draft_form_spec_hash:e.draft_form_spec_hash,desired_cms_schema_hash:e.desired_cms_schema_hash,affected_files_hash:e.affected_files_hash,shared_reference_hash:e.shared_impact.reference_hash,shared_reference_count:e.shared_impact.block_count,confirm_shared_update:e.confirm_shared_update,recreate_missing_binding:e.recreate_missing_binding,standardization:e.standardization,confirm_standardization:e.confirm_standardization})}function Nc(e){for(let n=0;n<e.length;n+=1){let i=e.charCodeAt(n);if(i>=55296&&i<=56319){let s=e.charCodeAt(n+1);if(n+1>=e.length||s<56320||s>57343)throw new TypeError("canonical JSON cannot contain a lone surrogate");n+=1}else if(i>=56320&&i<=57343)throw new TypeError("canonical JSON cannot contain a lone surrogate")}}function Xs(e,n){if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"){if(!Number.isFinite(e))throw new TypeError("canonical JSON numbers must be finite");return JSON.stringify(e)}if(typeof e=="string")return Nc(e),JSON.stringify(e);if(typeof e!="object")throw new TypeError("value is not valid JSON");if(n.has(e))throw new TypeError("canonical JSON cannot contain cycles");n.add(e);try{if(Array.isArray(e)){let r=[];for(let u=0;u<e.length;u+=1){if(!(u in e))throw new TypeError("canonical JSON cannot contain sparse arrays");r.push(Xs(e[u],n))}return`[${r.join(",")}]`}let i=Object.getPrototypeOf(e);if(i!==Object.prototype&&i!==null)throw new TypeError("canonical JSON objects must be plain records");let s=e;return`{${Object.keys(s).sort().map(r=>(Nc(r),`${JSON.stringify(r)}:${Xs(s[r],n)}`)).join(",")}}`}finally{n.delete(e)}}function oa(e){return Xs(e,new Set)}async function fi(e){let n=oa(e),i=new TextEncoder().encode(n),s=globalThis.crypto?.subtle?new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256",i)):(await import("@noble/hashes/sha256")).sha256(i);return`sha256:${Array.from(s,r=>r.toString(16).padStart(2,"0")).join("")}`}async function uv(e){return fi(ta.parse(e))}async function gv(e){return fi(Fc.parse(e))}async function _v(e){let n=rf.parse(e).map(i=>({...i})).sort((i,s)=>i.path<s.path?-1:i.path>s.path?1:0);return fi({version:1,files:n})}async function hv(e){return fi(hf(e))}import{z as v}from"zod";var bv=["page-seo","root-layout-metadata","nav-items"],yv=v.object({path:v.string(),title:v.string(),description:v.string().optional(),keywords:v.string().optional(),meta_tags_json:v.record(v.string(),v.record(v.string(),v.string())).nullish(),schema_json:v.union([v.record(v.string(),v.unknown()),v.array(v.record(v.string(),v.unknown())),v.string()]).nullish(),breadcrumbs_json:v.array(v.object({name:v.string().optional(),text:v.string().optional(),url:v.string().nullish()})).nullish()}),xv=v.object({metadataBase:v.string().optional(),title:v.union([v.string(),v.object({default:v.string().optional(),template:v.string().optional(),absolute:v.string().optional()})]).optional(),description:v.string().optional(),keywords:v.string().optional(),openGraph:v.object({title:v.string().optional(),description:v.string().optional(),type:v.string().optional(),siteName:v.string().optional(),url:v.string().optional(),locale:v.string().optional(),images:v.array(v.union([v.string(),v.object({url:v.string(),alt:v.string().optional()})])).optional()}).optional(),twitter:v.object({card:v.string().optional(),title:v.string().optional(),description:v.string().optional(),images:v.array(v.string()).optional()}).optional(),alternates:v.object({canonical:v.string().optional()}).optional()}),Hc=()=>v.object({label:v.string(),href:v.string().optional(),targetType:v.enum(["page","anchor","external","email","phone","file","group"]).optional(),role:v.enum(["link","cta"]).optional(),openInNewTab:v.boolean().optional(),nofollow:v.boolean().optional(),description:v.string().optional(),badge:v.string().optional(),iconKey:v.string().optional()}),Ev=Hc().extend({children:v.array(Hc()).optional()}),Sf=["title","description","keywords","breadcrumbs_json.*.name","breadcrumbs_json.*.text"],ff=["path","meta_tags_json.**","schema_json.**","breadcrumbs_json.*.url"],bf=["title","title.default","title.template","title.absolute","description","keywords","openGraph.title","openGraph.description","openGraph.siteName","openGraph.images.*.alt","twitter.title","twitter.description"],yf=["metadataBase","openGraph.type","openGraph.url","openGraph.locale","openGraph.images.*","openGraph.images.*.url","twitter.card","twitter.images.*","alternates.canonical"],xf=["label","description","badge"],Ef=["href","targetType","role","iconKey"],$c={"page-seo":{localizable:Sf,machine:ff},"root-layout-metadata":{localizable:bf,machine:yf},"nav-items":{localizable:xf,machine:Ef}},Yc="*",Xc="**",If="children";function Rf(e){return typeof e=="number"||/^\d+$/.test(e)?Yc:e}function Qc(e,n){let i=n.map(Rf);return e!=="nav-items"?i:i.filter(s=>s!==Yc&&s!==If)}function Zc(e,n){let i=e.split(".");for(let s=0;s<i.length;s+=1){if(i[s]===Xc)return!0;if(s>=n.length||i[s]!==n[s])return!1}return i.length===n.length}function Tf(e,n){let i=e.split(".");if(n.length>=i.length)return!1;for(let s=0;s<n.length;s+=1){if(i[s]===Xc)return!0;if(i[s]!==n[s])return!1}return!0}function Iv(e,n){let i=Qc(e,n);return i.length===0?!1:$c[e].localizable.some(s=>Zc(s,i))}function Rv(e,n){let i=Qc(e,n);if(i.length===0)return!0;let{localizable:s,machine:a}=$c[e];return[...s,...a].some(r=>Zc(r,i)||Tf(r,i))}var Av=["product-search","migration-products","standard-form","form-submission-infrastructure"],kf=[{path:"app/search/page.tsx",materializer:"product-search"},{path:"components/site/generated/product-search/entry.tsx",materializer:"product-search"},{path:"components/site/generated/product-search/results.tsx",materializer:"product-search"},{path:"app/api/product-search/facets/route.ts",materializer:"product-search"},{path:"lib/cms/product-search.ts",materializer:"product-search"},{path:"lib/generated/product-search-value-codec.ts",materializer:"product-search"},{path:"lib/generated/product-search-config.json",materializer:"product-search"},{path:`lib/cms/generated/${it}.ts`,materializer:"migration-products"},{path:`components/site/generated/${it}-list.tsx`,materializer:"migration-products"},{path:`components/site/generated/${it}-list-view.tsx`,materializer:"migration-products"},{path:`components/site/generated/${it}-detail-view.tsx`,materializer:"migration-products"},{path:`app/${it}/[slug]/page.tsx`,materializer:"migration-products"},{path:`components/site/generated/${it}-breadcrumb.tsx`,materializer:"migration-products"},{path:"components/site/generated/forms/vcp-form-runtime.tsx",materializer:"standard-form"},{path:"app/api/forms/[code]/route.ts",materializer:"form-submission-infrastructure"},{path:"hooks/use-cms-form-submit.ts",materializer:"form-submission-infrastructure"},{path:"lib/cms/forms.ts",materializer:"form-submission-infrastructure"}],Af=[{prefix:"components/site/generated/forms/form-",suffix:".tsx",materializer:"standard-form"}],wv=[{path:"lib/cms/client.ts",reason:"\u4E0D\u662F\u7269\u5316\u4EA7\u7269\uFF1A\u6A21\u677F\u81EA\u5E26\u7684 CMS \u4F20\u8F93\u5C42\uFF0C\u7269\u5316\u5668\u53EA\u5BF9\u5B83\u505A\u5B9A\u70B9\u5B57\u7B26\u4E32\u5347\u7EA7\uFF08\u591A\u90E8\u5206\u8868\u5355\u63D0\u4EA4\u3001no-store \u8BFB\uFF09\uFF0C\u6574\u4EFD\u8986\u5199\u53CD\u800C\u4F1A\u62B9\u6389\u7AD9\u70B9\u4FA7\u7684\u5176\u4ED6\u5347\u7EA7\u3002"},{path:"components/site/generated/forms/form-<id>.spec.ts",reason:"\u8DEF\u5F84\u5F52\u5E73\u53F0\u3001\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u8868\u5355\u8BBE\u8BA1\u5668\u5199\u7684\u5B57\u6BB5\u6587\u6848\uFF0C\u5F52 FORM_SPEC_LOCALIZABLE_FIELD_PATHS \u7684\u5B57\u6BB5\u7EA7\u6E05\u5355\u7BA1\u8F96\u3002"}];function wf(e){return e.length>0&&!e.includes("/")&&!e.includes(".")}function Pv(e){return kf.some(n=>n.path===e)?!0:Af.some(n=>!e.startsWith(n.prefix)||!e.endsWith(n.suffix)?!1:wf(e.slice(n.prefix.length,e.length-n.suffix.length)))}import{z as at}from"zod";var Pf=["provisioning","cms_app_created","seeded","ready","failed"],jv=at.object({tenant_id:at.string().min(1),site_id:R,collection_slug:at.string().min(1),cms_collection_id:at.string().min(1).nullable(),status:at.enum(Pf),owned_by_vcp:at.boolean(),run_id:H.nullable(),last_error:at.string().nullable(),created_at:at.string().datetime(),updated_at:at.string().datetime()});var Jc="/vibe/v1";function Nv(e){let n=e?.trim().replace(/\/+$/,"");if(!n)return null;try{let i=new URL(n),s=i.pathname.replace(/\/+$/,"");return i.search="",i.hash="",i.pathname=s.endsWith(Jc)?s:Jc,i.href.replace(/\/+$/,"")}catch{return n}}import{z as _}from"zod";var bi=_.string().url().refine(Yf,{message:"URL must use http or https"}),em=_.string().trim().pipe(bi),vf=_.object({task_type:_.literal("home_url"),task_url:em,planned_num:_.number().int().min(1).max(20).optional()}).strict(),Cf=_.object({task_type:_.literal("url_list"),urls:_.array(bi).min(1).max(1e4)}).strict(),qv=_.discriminatedUnion("task_type",[vf,Cf]),Fv=_.object({page:_.coerce.number().int().positive().default(1),page_size:_.coerce.number().int().min(1).max(20).default(20)}).strict(),Gv=_.object({home_url:em}).strict(),kt=_.string().uuid(),Kt=_.string().uuid(),Kv=_.object({task_uuid:kt}).strict(),tm=_.enum(["URL_DISCOVERY","PAGE_CRAWL","TASK_SCHEDULING","RESULT_PERSISTENCE"]),Df=_.object({task_uuid:kt,status:_.literal("NOT_STARTED"),total:_.literal(0)}).strict(),jf=_.object({task_uuid:kt,status:_.literal("PROCESSING"),total:_.literal(0)}).strict(),zv=_.enum(["no_suitable_page_candidate","page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"]),Of=_.discriminatedUnion("status",[_.object({role:pt,status:_.literal("selected"),reason_code:_.null()}).strict(),_.object({role:pt,status:_.literal("not_found"),reason_code:_.literal("no_suitable_page_candidate")}).strict(),_.object({role:pt,status:_.literal("unknown"),reason_code:_.enum(["page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"])}).strict()]),nm=_.array(Of).length(7).superRefine((e,n)=>{let i=new Set(e.map(s=>s.role));i.size!==e.length&&n.addIssue({code:"custom",message:"discovery coverage roles must be unique"});for(let s of pt.options)i.has(s)||n.addIssue({code:"custom",message:`discovery coverage is missing role ${s}`})}),Nf=_.object({task_uuid:kt,status:_.literal("SUCCEEDED"),total:_.number().int().positive(),discovery_coverage:nm.optional()}).strict(),Lf=_.enum(["TASK_FAILED","PROVIDER_CAPABILITY_LIMIT","WEBSITE_UNREACHABLE"]),Mf=_.object({task_uuid:kt,status:_.literal("FAILED"),total:_.literal(0),error_code:Lf,error_message:_.string().min(1),failure_stage:tm}).strict(),Bv=_.discriminatedUnion("status",[Df,jf,Nf,Mf]),Uf=_.object({url:bi,raw_html:_.string().min(1)}).strict(),Wv=_.object({task_uuid:kt,status:_.literal("SUCCEEDED"),page:_.number().int().positive(),page_size:_.number().int().min(1).max(20),total:_.number().int().positive(),total_pages:_.number().int().positive(),pages:_.array(Uf).max(20),discovery_coverage:nm.optional()}).strict().superRefine((e,n)=>{e.total_pages!==Math.ceil(e.total/e.page_size)&&n.addIssue({code:"custom",path:["total_pages"],message:"total_pages must equal ceil(total / page_size)"}),e.pages.length>e.page_size&&n.addIssue({code:"custom",path:["pages"],message:"pages must not exceed page_size"})}),Vv=_.object({task_code:Kt}).strict(),qf=_.object({task_code:Kt,status:_.literal("NOT_STARTED")}).strict(),Ff=_.object({task_code:Kt,status:_.literal("PROCESSING")}).strict(),Gf=_.object({task_code:Kt,status:_.literal("SUCCEEDED"),urls:_.array(bi)}).strict(),Kf=_.literal("SITEMAP_DISCOVERY_FAILED"),zf=_.object({task_code:Kt,status:_.literal("FAILED"),error_code:Kf,error_message:_.string().min(1)}).strict(),Hv=_.discriminatedUnion("status",[qf,Ff,Gf,zf]),$v=_.object({company_name:_.string().regex(/\S/u)}).strict(),Bf=_.object({company_name:_.string(),brand_name:_.string(),main_products:_.array(_.string()),industry:_.array(_.string()),subfields:_.array(_.string()),business_intro:_.string(),registered_capital:_.string(),legal_representative:_.string(),target_markets:_.array(_.string()),target_customer_industries:_.array(_.string()),target_customer_roles:_.array(_.string()),purchase_scenarios:_.string(),differentiators:_.array(_.string()),competitors:_.array(_.object({name:_.string(),official_url:_.string()}).strict()).max(3),qualifications:_.array(_.string()),representative_cases:_.array(_.string()),acquisition_channels:_.array(_.string()),desired_domain:_.string(),brand_tone:_.string(),timezone:_.string()}).strict(),yi=_.object({company_uuid:_.string().uuid(),company_info:Bf,created_at:_.string().datetime(),updated_at:_.string().datetime()}),Wf=yi.extend({status:_.literal("NOT_STARTED"),last_error_code:_.null(),last_error_message:_.null(),started_at:_.null(),completed_at:_.null()}).strict(),Vf=yi.extend({status:_.literal("PROCESSING"),last_error_code:_.null(),last_error_message:_.null(),started_at:_.string().datetime(),completed_at:_.null()}).strict(),im=yi.extend({status:_.literal("SUCCEEDED"),last_error_code:_.null(),last_error_message:_.null(),started_at:_.string().datetime(),completed_at:_.string().datetime()}).strict(),sm=yi.extend({status:_.literal("FAILED"),last_error_code:_.string().min(1),last_error_message:_.string().min(1),started_at:_.string().datetime(),completed_at:_.string().datetime()}).strict(),Yv=_.discriminatedUnion("status",[im,sm]),Xv=_.discriminatedUnion("status",[Wf,Vf,im,sm]),Hf=["BAD_REQUEST","NOT_FOUND","PAYLOAD_TOO_LARGE","INTERNAL_SERVER_ERROR","UNAUTHORIZED","FORBIDDEN","INVALID_TASK_TYPE","TASK_URL_REQUIRED","INVALID_PLANNED_NUM","URL_LIST_REQUIRED","URL_LIST_LIMIT_EXCEEDED","INVALID_URL_LIST","INVALID_PAGINATION","INVALID_TASK_CODE","INVALID_HOME_URL","TASK_CODE_HOME_URL_CONFLICT","SITEMAP_TASK_NOT_FOUND","SITEMAP_DISCOVERY_FAILED","TASK_NOT_FOUND","PROVIDER_CAPABILITY_LIMIT","TASK_FAILED","WEBSITE_UNREACHABLE"],$f=_.enum(Hf),Qv=_.object({error_code:$f,error_message:_.string().min(1),failure_stage:tm.optional(),task_uuid:kt.optional(),task_code:Kt.optional()}).strict();function Yf(e){try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}}import{z as L}from"zod";var Ue=L.string().url().refine(Zf,{message:"URL must use http or https"}),am=L.string().min(1).max(512),xi=L.string().datetime({offset:!0}),om=L.enum(["scraping","completed","failed","expired"]),eC=L.object({url:Ue,ignore_cache:L.boolean(),sitemap:L.enum(["include","skip"]),include_subdomains:L.boolean(),ignore_query_parameters:L.boolean(),limit:L.number().int().min(1).max(1e5)}).strict(),tC=L.object({links:L.array(Ue).max(1e5)}).strict(),nC=L.object({url:Ue,limit:L.number().int().min(1).max(1e5),max_discovery_depth:L.literal(1),crawl_entire_domain:L.literal(!1),allow_subdomains:L.literal(!0),sitemap:L.literal("skip")}).strict(),iC=L.object({crawl_id:am,expires_at:xi.optional()}).strict(),sC=L.object({status:om,urls:L.array(Ue).max(1e5),next:Ue.optional(),expires_at:xi}).strict(),aC=L.object({url:Ue,formats:L.tuple([L.literal("rawHtml")]),only_main_content:L.literal(!1),max_age:L.number().int().nonnegative()}).strict(),oC=L.object({url:Ue,raw_html:L.string().min(1),status_code:L.number().int().min(100).max(599).nullable()}).strict(),rC=L.object({urls:L.array(Ue).min(1).max(1e4),formats:L.tuple([L.literal("rawHtml")]),ignore_invalid_urls:L.literal(!1),max_age:L.number().int().nonnegative(),max_concurrency:L.number().int().positive().optional()}).strict(),cC=L.object({batch_id:am,expires_at:xi.optional()}).strict(),Xf=L.object({url:Ue,raw_html:L.string().min(1)}).strict(),mC=L.object({status:om,total:L.number().int().nonnegative(),completed:L.number().int().nonnegative(),pages:L.array(Xf).max(1e4),next:Ue.optional(),expires_at:xi}).strict().superRefine((e,n)=>{e.completed>e.total&&n.addIssue({code:"custom",path:["completed"],message:"completed must not exceed total"})}),Qf=L.object({url:Ue,error_message:L.string().min(1)}).strict(),lC=L.object({errors:L.array(Qf).max(1e4),robots_blocked:L.array(Ue).max(1e4)}).strict(),pC=L.object({active:L.number().int().nonnegative(),waiting:L.number().int().nonnegative(),max_concurrency:L.number().int().positive()}).strict();function Zf(e){try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}}import{z as b}from"zod";var cm=b.lazy(()=>An),Jf=b.enum(["page","block"]),Ii=b.enum(["component","page","pages"]),eb=b.enum(["en-US","zh-CN","zh-TW","fr-FR","de-DE","es-ES","ja-JP","ko-KR"]),At=eb,mm=b.object({requested_locale:At,resolved_locale:At,fallback_used:b.boolean()}).strict(),kn=b.object({id:b.string().uuid(),key:b.string().min(1),name:b.string().min(1)}).strict(),Ei=kn.extend({color:b.string().nullable()}).strict(),hC=b.object({kind:Jf,category_id:b.string().uuid().optional(),tag_id:b.string().uuid().optional(),search:b.string().trim().min(1).max(200).optional(),limit:b.coerce.number().int().min(1).max(50).default(20),cursor:b.string().min(1).optional()}).strict(),tb=b.object({stable_key:b.string().min(1),type:Ii,title:b.string().min(1).max(200),description:b.string().max(1e3),thumbnail_url:b.string().url().nullable(),resolved_version:b.number().int().positive(),content_schema_version:b.literal(3),category:kn.nullable(),tags:b.array(Ei),page_count:b.number().int().nonnegative(),component_count:b.number().int().nonnegative(),locale:mm}).strict(),SC=b.object({items:b.array(tb),facets:b.object({categories:b.array(kn),tags:b.array(Ei)}).strict(),next_cursor:b.string().nullable()}).strict(),fC=b.object({operation_id:b.string().uuidv7(),resolved_version:b.number().int().positive(),base_sitemap_id:b.string().uuid(),base_sitemap_version:b.number().int().positive(),sitemap:cm,target_page_id:b.string().min(1).optional()}).strict(),bC=b.object({next_sitemap:cm,applied:b.object({stable_key:b.string().min(1),resolved_version:b.number().int().positive(),template_type:Ii,page_ids:b.array(b.string().min(1)),block_ids:b.array(b.string().min(1))}).strict(),locale:mm,warnings:b.array(b.string())}).strict(),lm=b.object({nodeId:b.string().uuid(),type:b.string().trim().min(1).max(100),label:b.string().trim().min(1).max(200),variant:b.string().trim().min(1).max(100).optional(),order:b.number().int().nonnegative(),props:b.record(b.string(),b.unknown()),thumbnail:b.string().url().optional(),source:b.unknown().optional()}).strict(),rm=b.object({nodeId:b.string().uuid().optional(),slug:b.string().regex(/^\/$|^\/[a-z0-9]+(?:-[a-z0-9]+)*(?:\/[a-z0-9]+(?:-[a-z0-9]+)*)*$/u),navigation:b.object({showInHeader:b.boolean(),showInFooter:b.boolean(),order:b.number().int().nonnegative()}).strict(),components:b.array(lm).min(1).max(100),thumbnail:b.string().url().optional(),source:b.unknown().optional()}).strict(),nb=b.union([lm,rm,b.object({pages:b.array(rm).min(1).max(50),thumbnail:b.string().url().optional(),source:b.unknown().optional()}).strict()]),ib=b.object({title:b.string().min(1).max(200),description:b.string().min(1).max(1e3),prompt:b.string().min(1).max(8192)}).strict(),sb=b.object({locale:At,title:b.string().min(1).max(200),content:b.object({description:b.string().min(1).max(1e3),prompt:b.string().min(1).max(8192),nodes:b.record(b.string().uuid(),ib)}).strict()}).strict(),yC=b.object({templateId:b.string().uuid(),stableKey:b.string().min(1),type:Ii,resolvedVersion:b.number().int().positive(),contentSchemaVersion:b.literal(3),structure:nb,requestedLocale:At,resolvedLocale:At,fallbackUsed:b.boolean(),contents:b.array(sb).length(1)}).strict().superRefine((e,n)=>{(e.type==="component"&&!("type"in e.structure)||e.type==="page"&&!("components"in e.structure)||e.type==="pages"&&!("pages"in e.structure))&&n.addIssue({code:"custom",path:["structure"],message:"Template type and structure must match."});let i=ab(e.structure),s=new Set(Object.keys(e.contents[0]?.content.nodes??{}));(i.size!==s.size||[...i].some(a=>!s.has(a)))&&n.addIssue({code:"custom",path:["contents",0,"content","nodes"],message:"Localized nodes must exactly match the structure nodes."}),e.contents[0]?.locale!==e.resolvedLocale&&n.addIssue({code:"custom",path:["contents"],message:"Resolved locale must match returned content."}),e.fallbackUsed!==(e.requestedLocale!==e.resolvedLocale)&&n.addIssue({code:"custom",path:["fallbackUsed"],message:"fallbackUsed must match locale resolution."})}),xC=b.object({items:b.array(b.object({stableKey:b.string().min(1),type:Ii,title:b.string().min(1).max(200),description:b.string().max(1e3),thumbnailUrl:b.string().url().nullable(),resolvedVersion:b.number().int().positive(),contentSchemaVersion:b.literal(3),category:kn.nullable(),tags:b.array(Ei),pageCount:b.number().int().nonnegative(),componentCount:b.number().int().nonnegative(),requestedLocale:At,resolvedLocale:At,fallbackUsed:b.boolean()}).strict()),facets:b.object({categories:b.array(kn),tags:b.array(Ei)}).strict(),nextCursor:b.string().nullable()}).strict().superRefine((e,n)=>{e.items.forEach((i,s)=>{i.fallbackUsed!==(i.requestedLocale!==i.resolvedLocale)&&n.addIssue({code:"custom",path:["items",s,"fallbackUsed"],message:"fallbackUsed must match locale resolution."})})});function ab(e){if("type"in e)return new Set([e.nodeId]);let n="pages"in e?e.pages:[e];return new Set(n.flatMap(i=>[...i.nodeId?[i.nodeId]:[],...i.components.map(s=>s.nodeId)]))}function EC(e){return oa({tenant_id:e.tenant_id,site_id:e.site_id,stable_key:e.stable_key,resolved_version:e.request.resolved_version,base_sitemap_id:e.request.base_sitemap_id,base_sitemap_version:e.request.base_sitemap_version,sitemap:e.request.sitemap,target_page_id:e.request.target_page_id??null})}import{z as q}from"zod";var ob=["pending_dns","active","failed","removing"],rb=q.enum(ob),cb=["serve_site","redirect_301"],mb=q.enum(cb),lb=["traffic","ownership","certificate_delegation"],ra=q.enum(lb),pb=["pending","verified"],db=q.enum(pb),ub=["not_applicable","unavailable","not_needed","auto_applied","confirmation_required","blocked"],gb=q.enum(ub),ca=q.enum(["prepare_configuration","apply_configuration","verify_dns","remediate_dns","confirm_dns_remediation"]),_b=q.enum(["accepted","running","succeeded","failed"]),hb=q.object({code:q.string().min(1),message:q.string().min(1)}).strict(),Sb=q.object({purpose:ra,verified:q.boolean(),observedValues:q.array(q.string())}).strict(),pm=q.object({ready:q.boolean(),providerReady:q.boolean(),dnsVerified:q.boolean(),records:q.array(Sb)}).strict(),dm=q.object({type:q.string().min(1),name:q.string().min(1),value:q.string().min(1),ttl:q.number().nullable()}).strict(),fb=q.object({purpose:ra,action:q.enum(["none","create","update","blocked"]),before:dm.nullable(),after:dm.nullable()}).strict(),um=q.object({domainId:q.string().min(1),status:gb,changes:q.array(fb)}).strict(),bb=q.object({purpose:ra,type:q.string().min(1),name:q.string().min(1),value:q.string().min(1),verificationStatus:db}).strict(),gm=q.object({id:q.string().min(1),hostname:q.string().min(1),isPrimary:q.boolean(),routingMode:mb,observedStatus:rb,lastVerifiedAt:q.string().datetime().nullable(),dnsRecords:q.array(bb)}).strict().superRefine((e,n)=>{yb(e.hostname)||n.addIssue({code:"custom",path:["hostname"],message:"hostname must be a canonical ASCII hostname"}),e.isPrimary&&e.routingMode!=="serve_site"&&n.addIssue({code:"custom",path:["routingMode"],message:"a primary domain must serve the site"}),!e.isPrimary&&e.routingMode!=="redirect_301"&&n.addIssue({code:"custom",path:["routingMode"],message:"a non-primary domain must redirect with 301"})}),_m=q.object({primaryDomain:gm.nullable(),redirectDomains:q.array(gm)}).strict().superRefine((e,n)=>{e.primaryDomain!==null&&(!e.primaryDomain.isPrimary||e.primaryDomain.routingMode!=="serve_site")&&n.addIssue({code:"custom",path:["primaryDomain"],message:"primaryDomain must be primary and serve the site"});for(let[s,a]of e.redirectDomains.entries())(a.isPrimary||a.routingMode!=="redirect_301")&&n.addIssue({code:"custom",path:["redirectDomains",s],message:"redirectDomains must be non-primary 301 redirects"});e.primaryDomain!==null&&e.redirectDomains.some(a=>a.hostname===e.primaryDomain?.hostname)&&n.addIssue({code:"custom",path:["redirectDomains"],message:"primaryDomain must not also be a redirect"});let i=[...e.primaryDomain===null?[]:[e.primaryDomain.hostname],...e.redirectDomains.map(s=>s.hostname)];new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["redirectDomains"],message:"domain hostnames must be unique"})}),Ri=q.object({id:q.string().min(1),type:ca,status:_b,error:hb.nullable(),result:q.union([pm,um]).nullable().optional()}).strict().superRefine((e,n)=>{if(e.status==="failed"&&e.error===null&&n.addIssue({code:"custom",path:["error"],message:"failed operations must include a stable error"}),e.status!=="failed"&&e.error!==null&&n.addIssue({code:"custom",path:["error"],message:"non-failed operations must not include an error"}),!(e.result===void 0||e.result===null)){if(e.status!=="succeeded"){n.addIssue({code:"custom",path:["result"],message:"operation results only belong to succeeded operations"});return}if(e.type==="verify_dns"){pm.safeParse(e.result).success||n.addIssue({code:"custom",path:["result"],message:"verify_dns operations require a DNS verification result"});return}if(e.type==="remediate_dns"){um.safeParse(e.result).success||n.addIssue({code:"custom",path:["result"],message:"remediate_dns operations require a DNS remediation result"});return}n.addIssue({code:"custom",path:["result"],message:"only verify_dns and remediate_dns operations may carry a result"})}});function yb(e){if(e!==e.trim()||e!==e.toLowerCase()||e.length>253||e.endsWith("."))return!1;let n=e.split(".");return n.length>=2&&n[n.length-1].length>=2&&n.every(i=>i.length>=1&&i.length<=63&&/^[a-z0-9-]+$/.test(i)&&!i.startsWith("-")&&!i.endsWith("-"))}import{z as Ae}from"zod";import{z as f}from"zod";var xb=f.enum(["active","completed","canceled"]),Eb=f.enum(["quality","domain","gsc","publish"]),Ti=f.enum(["pending","running","succeeded","failed"]),Sm=Ti,fm=f.enum(["pending","running","completed"]),Ib=f.object({group_code:f.string().min(1),name:f.string().min(1),score:f.number().nonnegative(),total_score:f.number().nonnegative(),pass_score:f.number().nonnegative(),running_status:fm,result_text:f.string()}).strict(),Rb=f.object({id:f.number().int().positive().optional(),quality_task_id:f.number().int().positive(),item_code:f.string().min(1),status:Ti,is_repaired:f.boolean(),total_score:f.number().nonnegative(),score:f.number().nonnegative(),check_result:f.unknown().nullable(),remediation_items:f.unknown().nullable(),result_text:f.string(),created_at:f.string().min(1),updated_at:f.string().min(1),item_name:f.string().min(1),dimension_code:f.enum(["reach","trust","convert","safe"]),group_code:f.string().min(1),auto_fix:f.boolean()}).strict(),Tb=f.object({dimension_code:f.enum(["reach","trust","convert","safe"]),name:f.string().min(1),alias_en:f.string().min(1),description:f.string(),tips:f.string(),score:f.number().nonnegative(),repaired_score:f.number().nonnegative(),total_score:f.number().nonnegative(),pass_score:f.number().nonnegative(),running_status:fm,problem_group_count:f.number().int().nonnegative(),remediation_items:f.array(Rb),groups:f.array(Ib)}).strict(),kb=f.object({id:f.number().int().positive(),task_code:f.string().uuid(),scene_code:f.enum(["site_publish","vcp_published_pages","content_publish"]),tenant_id:f.string().min(1),vcp_site_id:R,cms_site_id:f.string().min(1),checked_url:f.string().url(),quality_params:f.record(f.string(),f.unknown()).nullable(),status:Ti,error_info:f.record(f.string(),f.unknown()).nullable(),created_at:f.string().min(1),updated_at:f.string().min(1)}).strict(),Ab=f.union([f.object({}).strict(),f.object({summary:f.object({final_score:f.number().nonnegative(),pass_score:f.number().nonnegative(),group_count:f.number().int().nonnegative(),problem_group_count:f.number().int().nonnegative()}).strict(),dimensions:f.array(Tb)}).strict()]),hm=f.object({quality_info:kb,quality_detail:Ab}).strict().superRefine((e,n)=>{let i="summary"in e.quality_detail;e.quality_info.status!=="failed"&&!i&&n.addIssue({code:"custom",message:"nonfailed quality tasks require complete detail",path:["quality_detail"]}),e.quality_info.status==="failed"&&i&&n.addIssue({code:"custom",message:"failed quality tasks require empty detail",path:["quality_detail"]})}),CC=f.object({item_code:f.string().min(1),remediation_items:f.unknown().nullable()}).strict(),wb=f.object({item_code:f.string().min(1),repair_status:f.enum(["succeeded","failed"]),message:f.string().min(1).optional(),error_code:f.string().min(1).optional(),metadata:f.record(f.string(),f.unknown()).optional()}).strict(),bm=f.object({items:f.array(wb)}).strict(),DC=f.object({task_code:f.string().min(1),status:Sm,result:bm.optional()}).strict().superRefine((e,n)=>{e.status==="succeeded"&&e.result===void 0&&n.addIssue({code:"custom",path:["result"],message:"succeeded repair tasks require a complete result"}),(e.status==="pending"||e.status==="running")&&e.result!==void 0&&n.addIssue({code:"custom",path:["result"],message:"nonterminal repair tasks cannot expose a result"})}),ht=f.object({id:Ua,tenant_id:f.string().min(1),site_id:R,status:xb,current_step:Eb,quality_task_code:f.string().uuid().nullable(),quality_task_status:Ti,repair_task_code:f.string().min(1).nullable(),repair_task_status:Sm,publish_deployment_id:Xe.nullable(),domain_hostname:f.string().min(1).nullable(),domain_operation_type:ca.nullable(),domain_operation_payload:f.record(f.string(),f.unknown()).nullable(),domain_preparation_operation_id:f.string().min(1).nullable(),domain_operation_id:f.string().min(1).nullable(),revision:f.number().int().positive(),created_at:f.string().min(1),updated_at:f.string().min(1),completed_at:f.string().min(1).nullable(),canceled_at:f.string().min(1).nullable()}).strict().superRefine((e,n)=>{if(e.domain_operation_type===null){e.domain_operation_payload!==null&&n.addIssue({code:"custom",path:["domain_operation_payload"],message:"domain_operation_payload must be null without an active domain operation"}),e.domain_operation_id!==null&&n.addIssue({code:"custom",path:["domain_operation_id"],message:"domain_operation_id must be null without an active domain operation"});return}e.domain_hostname===null&&n.addIssue({code:"custom",path:["domain_hostname"],message:"an active domain operation requires a hostname"}),e.domain_operation_payload===null&&n.addIssue({code:"custom",path:["domain_operation_payload"],message:"an active domain operation requires a payload"})}),jC=f.object({}).strict(),OC=f.object({expected_revision:f.number().int().nonnegative(),current_step:f.enum(["domain","gsc","publish"]),skip_domain_binding:f.boolean().optional()}).strict(),NC=f.object({expected_revision:f.number().int().nonnegative()}).strict(),Pb=f.object({workflow:ht.nullable(),can_cancel:f.boolean()}).strict(),LC=M(Pb).strict(),vb=f.object({workflow:ht,can_cancel:f.boolean()}).strict(),MC=M(vb).strict(),Cb=f.object({workflow:ht,deployment:f.lazy(()=>St)}).strict(),UC=M(Cb).strict(),Db=f.object({workflow:ht,can_cancel:f.boolean(),quality_result:hm.optional(),repair_result:bm.optional(),final_quality_result:hm.optional(),message:f.string().min(1).optional()}).strict(),qC=M(Db).strict();function jb(e){return"summary"in e.quality_detail?e.quality_detail.dimensions.flatMap(n=>n.remediation_items.filter(i=>i.status==="succeeded"&&i.score<i.total_score&&i.auto_fix).map(i=>({item_code:i.item_code,remediation_items:i.remediation_items}))):[]}function Ob(e,n){let i=e.map(r=>r.item_code),s=n.items.map(r=>r.item_code);if(new Set(i).size!==i.length||new Set(s).size!==s.length||i.length!==s.length)return!1;let a=new Set(i);return n.items.every(r=>a.has(r.item_code)&&r.repair_status==="succeeded")}function FC(e,n){if(!("summary"in e.quality_detail))return null;let i=jb(e);if(i.length===0)return e;if(n===void 0||!Ob(i,n))return null;let s=new Set(n.items.map(r=>r.item_code)),a=e.quality_detail.dimensions.map(r=>{let u=r.remediation_items.map(k=>s.has(k.item_code)?{...k,score:k.total_score,is_repaired:!0,result_text:""}:{...k}),c=r.groups.map(k=>{let I=u.filter(C=>C.group_code===k.group_code);return I.length===0?{...k}:{...k,score:I.reduce((C,F)=>C+F.score,0),result_text:I.map(C=>C.result_text).filter(Boolean).join("\u3001")}}),g=c.reduce((k,I)=>k+I.score,0);return{...r,score:g,repaired_score:g,problem_group_count:c.filter(k=>k.score!==k.total_score).length,remediation_items:u,groups:c}});return{quality_info:{...e.quality_info},quality_detail:{...e.quality_detail,summary:{...e.quality_detail.summary,final_score:Math.round(a.reduce((r,u)=>r+u.score,0)/a.length),problem_group_count:a.reduce((r,u)=>r+u.problem_group_count,0)},dimensions:a}}}var Nb=Ae.object({hostname:Ae.string().min(1),expected_revision:Ae.number().int().nonnegative()}).strict(),ym=Ae.object({workflow:ht,operation:Ri}).strict(),Lb=M(ym).strict(),Mb=Ae.object({expected_revision:Ae.number().int().nonnegative()}).strict(),Ub=Ae.object({workflow:ht,operation:Ri}).strict(),qb=M(Ub).strict(),ma=Ae.object({workflow:ht,operation:Ri.nullable()}).strict(),Fb=M(ma).strict(),Gb=ma,Kb=M(Gb).strict(),VC=M(_m).strict(),zb=Ae.object({published:Ae.boolean(),hostname:Ae.string(),url:Ae.string(),sandbox_url:Ae.union([Ae.string().url(),Ae.literal("")])}).strict().superRefine((e,n)=>{e.published||(e.hostname!==""&&n.addIssue({code:"custom",path:["hostname"],message:"unpublished sites must not include a hostname"}),e.url!==""&&n.addIssue({code:"custom",path:["url"],message:"unpublished sites must not include a URL"}))}),HC=M(zb).strict(),$C=Nb,YC=ym,XC=Lb,QC=ma,ZC=Fb,JC=Kb,eD=Mb,tD=qb;import{z as De}from"zod";var Bb=["started","success","failed","canceled"],la=De.enum(Bb),Wb=["inactive","pending_binding","active"],pa=De.enum(Wb),Vb=["domain","url_prefix"],da=De.enum(Vb),Hb=["not_connected","authorizing","matching_property","ready","failed","canceled","domain_mismatch"],ua=De.enum(Hb),$e=De.string().nullable(),xm=De.object({}).strict(),ga=De.object({authorize_url:De.string().url(),custom_domain:$e}).strict(),Em=M(ga),$b=De.object({auth_status:la,binding_status:pa,credential_connected:De.boolean(),custom_domain:$e,gsc_site_url:$e,property_type:da.nullable(),auth_error_code:$e,auth_error_message:$e}).strict(),Im=De.object({auth_status:la,binding_status:pa,credential_connected:De.boolean(),custom_domain:$e,gsc_site_url:$e,property_type:da.nullable(),auth_error_code:$e,auth_error_message:$e,current_domain:$e,state:ua,ready:De.boolean()}).strict().superRefine((e,n)=>{let i=Xb(e,e.current_domain),s=i==="ready";e.state!==i&&n.addIssue({code:"custom",path:["state"],message:`state must equal ${i} for the supplied GSC facts`}),e.ready!==s&&n.addIssue({code:"custom",path:["ready"],message:`ready must equal ${String(s)} for the supplied GSC facts`})}),Yb=M(Im);function wn(e){let n=e?.trim()??"";if(!n)return"";let i=/^[a-z][a-z0-9+.-]*:\/\//i.test(n)?n:`https://${n}`;try{return new URL(i).hostname.replace(/\.+$/,"").toLowerCase()}catch{return n.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0].replace(/\.+$/,"").toLowerCase()}}function Xb(e,n){let i=e.gsc_site_url?.trim()??"",s=wn(e.custom_domain),a=wn(n??("current_domain"in e?e.current_domain:void 0)),r=s.length>0&&a.length>0&&s===a,u=Qb(i,e.property_type,a);return e.auth_status==="canceled"?"canceled":e.auth_status==="failed"?"failed":e.auth_status==="started"?"authorizing":!e.credential_connected||e.binding_status==="inactive"?"not_connected":i.length===0||e.property_type===null?"matching_property":!r||!u?"domain_mismatch":e.binding_status==="pending_binding"?"matching_property":e.auth_status==="success"&&e.binding_status==="active"&&e.credential_connected&&i.length>0&&r&&u?"ready":"failed"}function Qb(e,n,i){let s=e?.trim()??"",a=wn(i);if(!s||!a||!n)return!1;if(n==="domain"){let r=/^sc-domain:(.+)$/i.exec(s);if(!r)return!1;let u=r[1].trim();if(!u||/[/:?#]/.test(u))return!1;let c=wn(u);return c?a===c||a.endsWith(`.${c}`):!1}try{let r=new URL(s);return r.protocol!=="https:"||r.username||r.password||r.port||r.pathname!=="/"||r.search||r.hash?!1:wn(r.hostname)===a}catch{return!1}}var aD=xm,oD=ga,rD=Em,cD=ua,mD=la,lD=pa,pD=da,dD=ua,uD=xm,gD=ga,_D=Em,hD=$b,SD=Im,fD=Yb;var Rm=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,Tm="VCP_E2B_PREVIEW_PROXY_DOMAIN must be a valid hostname.";function Zb(e){let n=e?.trim().toLowerCase()??"";if(!n)return null;if(n.length>253||!n.includes(".")||!n.split(".").every(i=>Rm.test(i)))throw new Error(Tm);return n}function yD(e){let n=Zb(e.proxyDomain);if(!n)return null;let i=e.sandboxId.trim();if(!Rm.test(i))throw new Error("sandboxId must be a valid DNS label.");if(`${i}.${n}`.length>253)throw new Error(Tm);return`https://${i}.${n}/`}function Jb(e,n,i=e){let s=new Map(e.map(c=>[c.slug,c])),a=new Map(i.map(c=>[c.id,c])),r=new Map(e.map(c=>{let g=a.get(c.id);return g&&g.slug!==null&&g.slug!==c.slug?[g.slug,c]:null}).filter(c=>c!==null)),u=new Set(i.map(c=>c.slug).filter(c=>c!==null&&!s.has(c)));return{primaryLinks:km(n.primaryLinks,e,s,r,u,a,"showInHeader"),footerLinks:km(n.footerLinks,e,s,r,u,a,"showInFooter")}}function km(e,n,i,s,a,r,u){let c=new Set,g=[];for(let[F,B]of e.entries()){let ne=ey(B.href),ce=ne===null?void 0:i.get(ne)??s.get(ne);if(ne!==null&&a.has(ne)&&!i.has(ne)&&!s.has(ne))continue;if(ce?.slug==="/"){g.push({kind:"independent",link:{...B,label:Am(B,ce,r)}});continue}if(!ce){g.push({kind:"independent",link:B});continue}if(!ce.navigation[u])continue;c.add(ce.slug);let Ht=ne===ce.slug?B.href:ty(B.href,ce.slug);g.push({kind:"page",page:ce,link:{...B,label:Am(B,ce,r),href:Ht},index:F})}let k=g.filter(F=>F.kind==="page").sort((F,B)=>F.page.navigation.order-B.page.navigation.order||F.index-B.index),I=0,C=g.map(F=>F.kind==="page"?k[I++].link:F.link);for(let F of[...n].filter(B=>B.slug!=="/"&&B.navigation[u]).sort((B,ne)=>B.navigation.order-ne.navigation.order))c.has(F.slug)||C.push({label:F.title,href:F.slug});return C}function Am(e,n,i){let s=i.get(n.id);return e.label===(s?.title??n.title)?n.title:e.label}function ey(e){if(!e.startsWith("/")||e.startsWith("//"))return null;let n=e.search(/[?#]/u);return n===-1?e:e.slice(0,n)}function ty(e,n){let i=e.search(/[?#]/u);return i===-1?n:`${n}${e.slice(i)}`}import{z as E}from"zod";var wm=20*1024*1024,ny=wm,Pm=["jpg","jpeg","png","gif","webp","bmp"],vm=["mp4","avi","mov","webm","mkv"],Cm=["mp3","wav","aac","flac","ogg","wma","m4a"],Dm=["pdf","doc","docx","xls","xlsx","ppt","pptx","txt","md","csv"],jm=[...Dm,"zip","rar","json","xmind","psd","ai","fig","sketch"],iy=[...Pm,...vm,...Cm,...jm],Om=["image/jpeg","image/png","image/gif","image/webp","image/bmp"],Nm=["video/mp4","video/x-msvideo","video/quicktime","video/webm","video/x-matroska"],Lm=["audio/mpeg","audio/wav","audio/x-wav","audio/vnd.wave","audio/aac","audio/flac","audio/x-flac","audio/ogg","audio/x-ms-wma","audio/mp4","audio/x-m4a"],sy=[...Om,...Nm,...Lm],Mm=E.enum(["image","video","audio","file"]),Um=E.enum(["external","ai_generated","unsplash"]),_a=E.object({resource_id:E.string().min(1),name:E.string().min(1).max(255),url:E.string().url(),thumbnail_url:E.union([E.string().url(),E.literal("")]),mime_type:E.string().trim().min(3).max(127),size:E.number().int().nonnegative(),width:E.number().int().positive().nullable(),height:E.number().int().positive().nullable(),source:Um,created_at:E.string().min(1).nullable()}),ay=E.object({page:E.coerce.number().int().min(1).default(1),page_size:E.coerce.number().int().min(1).max(100).default(24),keyword:E.string().trim().max(100).optional(),file_type:Mm.default("image")}),oy=E.object({code:E.literal(0),message:E.string(),data:E.object({items:E.array(_a),page:E.number().int().min(1),page_size:E.number().int().min(1),total:E.number().int().nonnegative()})}),ry=E.object({code:E.literal(0),message:E.string(),data:_a}),wt=4,cy="site.image_generation.max",my=E.object({quantity:E.number().int().min(1).max(wt)}),ha=E.object({available:E.boolean(),remaining:E.number().nonnegative().nullable(),unlimited:E.boolean(),max_quantity:E.number().int().min(0).max(wt)}),ly=E.object({code:E.literal(0),message:E.string(),data:ha}),py=E.object({prompt:E.string().trim().min(1).max(2e3),quantity:E.number().int().min(1).max(wt)}),qm=E.discriminatedUnion("ok",[E.object({index:E.number().int().min(0).max(wt-1),ok:E.literal(!0),url:E.httpUrl(),request_id:E.string().uuid()}),E.object({index:E.number().int().min(0).max(wt-1),ok:E.literal(!1),error:E.enum(["quota","generate","network"]),message:E.string().trim().min(1).max(500),request_id:E.string().uuid().nullable()})]),dy=E.object({code:E.literal(0),message:E.string(),data:E.object({quota:ha,items:E.array(qm).max(wt)})}),Fm=E.object({provider_id:E.string().min(1),url:E.string().url(),thumbnail_url:E.string().url(),width:E.number().int().positive(),height:E.number().int().positive(),alt:E.string(),photographer_name:E.string().min(1),photographer_url:E.string().url(),photo_url:E.string().url(),download_location:E.string().url(),dominant_color:E.string().nullable()}),uy=E.object({query:E.string().trim().min(1).max(100),page:E.coerce.number().int().min(1).default(1),page_size:E.coerce.number().int().min(1).max(30).default(18),orientation:E.enum(["landscape","portrait","squarish"]).optional()}),gy=E.object({code:E.literal(0),message:E.string(),data:E.object({items:E.array(Fm),page:E.number().int().min(1),page_size:E.number().int().min(1),total:E.number().int().nonnegative(),total_pages:E.number().int().nonnegative()})}),Gm=E.string().url().refine(by,{message:"download_location must be an official Unsplash download URL"}),_y=E.object({download_location:Gm}),hy=E.object({code:E.literal(0),message:E.string(),data:E.object({reported:E.boolean()})}),Sy=E.object({source_id:E.number().int().positive(),source_title:E.string().min(1).max(255),source_url:Qe,resource_id:E.number().int().positive()}),fy=E.object({code:E.literal(0),message:E.string(),data:E.object({reported:E.boolean()})});function by(e){if(!URL.canParse(e))return!1;let n=new URL(e);return n.protocol==="https:"&&n.hostname==="api.unsplash.com"&&n.username===""&&n.password===""&&n.port===""&&n.hash===""&&/^\/photos\/[^/]+\/download$/.test(n.pathname)}import{z as we}from"zod";var yy=we.object({colorSeeds:we.object({primary:we.string().min(1).max(40),accent:we.string().min(1).max(40),foreground:we.string().min(1).max(40).optional()}).strict().optional(),surfaceMode:we.enum(["light","dark"]).optional(),fonts:we.object({heading:we.string().min(1).max(60),body:we.string().min(1).max(60)}).strict().optional()}).strict().refine(e=>e.colorSeeds!==void 0||e.surfaceMode!==void 0||e.fonts!==void 0,{message:"colorSeeds, surfaceMode, or fonts is required"}),xy=we.object({ok:we.literal(!0),design_plan_version:we.number().int().positive(),snapshot_id:T,site_design_context:we.lazy(()=>ki).optional(),changed_files:we.array(we.string().min(1)).optional()});var ba=t.object({heading:t.string().min(1).max(160).optional(),body:t.string().min(1).max(160).optional(),paletteIntent:t.string().min(1).max(400).optional(),surfaceMode:t.enum(["light","dark"]).optional(),radius:t.enum(["none","sm","md","lg","xl"]).optional(),density:t.enum(["compact","comfortable","airy","editorial"]).optional(),motionPreset:t.enum(["subtle","moderate","expressive"]).optional(),colorSeeds:t.object({primary:t.string().min(1).max(40),accent:t.string().min(1).max(40),foreground:t.string().min(1).max(40).optional(),neutral:t.string().min(1).max(40).optional(),supporting:t.array(t.string().min(1).max(40)).max(4).optional()}).optional(),imagePalette:t.object({background:t.string().min(1).max(40).optional(),foreground:t.string().min(1).max(40).optional(),card:t.string().min(1).max(40).optional(),muted:t.string().min(1).max(40).optional(),border:t.string().min(1).max(40).optional()}).optional(),themeId:t.string().min(1).max(60).optional(),themeDescription:t.string().min(1).max(400).optional(),aestheticNote:t.string().min(1).max(300).optional()}),Sa=t.enum(["material","reference","brief","industry"]),Ey=t.object({market:t.object({value:t.string().min(1).max(200),source:Sa}),customer:t.object({value:t.string().min(1).max(200),source:Sa}),purpose:t.object({options:t.array(t.string().min(1).max(60)).min(2).max(4),selected:t.string().min(1).max(60),source:Sa})}),Iy=t.enum(["text-options","motion-slider","positioning"]),ya=t.enum(["none","subtle","moderate","expressive"]),Ry=t.enum(["compact","comfortable","airy","editorial"]),Ty=ya,Vm=t.object({skill_name:t.string().min(1),rationale:t.string().min(4).max(200),confidence:t.enum(["high","medium","low"]).optional(),displayName:t.object({zh:t.string().min(1),en:t.string().min(1)}).partial().optional()}),ky=t.object({value:t.string(),label:t.string(),desc:t.string().optional(),impact:t.string().optional(),isRecommended:t.boolean().optional(),preselect:t.boolean().optional(),visualHints:ba.optional(),conversionHints:xt.optional()}),Ay=t.object({id:t.string(),type:Iy,question:t.string(),tag:t.string(),aiThinking:t.string(),options:t.array(ky),source:t.enum(["ai-detected","always-ask"]),sourceDetail:t.string(),positioning:Ey.optional()}),xa=t.object({questions:t.array(Ay).min(1).max(6)}),ej=t.object({tenant_id:t.string().min(1),site_id:R,brief_id:vt,brief:t.string().min(20).max(1e3),site_default_locale:he.optional(),owner_locale:he.optional(),input_context:t.object({facts:t.array(Dn).max(120),conflicts:t.array(On).max(20),reference:jn.optional(),sources:t.array(t.object({type:Li,title:t.string().max(120).optional(),status:Mi})).max(16).optional()}).optional()}),Hm=t.enum(["model_schema_invalid","provider_rate_limited","provider_unavailable","aborted","unknown"]),tj=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:H,at:t.string().min(1)}),t.object({type:t.literal("skill.selecting"),category:t.literal("page-generation"),available:t.array(t.object({id:t.string().min(1),name:t.string().min(1)})).max(20),at:t.string().min(1)}),t.object({type:t.literal("skill.selected"),category:t.literal("page-generation"),selected:t.object({id:t.string().min(1),name:t.string().min(1),reason:t.string().min(1).max(200)}),at:t.string().min(1)}),t.object({type:t.literal("clarify.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("clarify.archetype_proposals"),proposals:t.array(Vm).min(1).max(5),at:t.string().min(1)}),t.object({type:t.literal("clarify.finished"),questions_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),error_category:Hm.optional(),retryable:t.boolean().optional(),attempts:t.number().int().positive().optional(),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),at:t.string().min(1)})]),nj="SITE_PLANNING_INPUT_FROZEN",ij="SITE_PLANNING_LOCKED",sj="SITE_STRUCTURE_CONFIRMATION_REQUIRED",aj="SITE_STRUCTURE_CONFIRMATION_STALE",oj=t.object({tenant_id:t.string().min(1),name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),rj=t.object({name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),cj=t.object({name:t.string().min(1).max(120)}),mj=t.object({name:t.string().min(1).max(120),default_locale:he.optional()}),lj=t.object({body:t.string().min(20).max(1e3)}),pj=t.object({body:t.string().min(20).max(1e3)}),Ea=t.string().url().refine(e=>{try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}},{message:"URL must use http or https protocol"}),dj=t.object({tenant_id:t.string().min(1),site_id:R.optional(),site_url:Ea,site_name:t.string().trim().min(1).max(255).optional()}),uj=M(Io),gj=M(Ro),_j=M(To),hj=M(qo),Sj=M(Fo),fj=M(Go),bj=M(zo),yj=M(Bo),xj=M(Wo),Ej=M(t.object({site_id:R,site_url:Ea})),bt=t.object({id:R,tenant_id:t.string().min(1),name:t.string().min(1),slug:t.string().min(1),status:gs,deployment_status:_s,archived_at:t.string().min(1).nullable(),current_sitemap_id:Ce.nullable(),confirmed_sitemap_id:Ce.nullable().optional(),confirmed_sitemap_version:t.number().int().positive().nullable().optional(),structure_confirmed_at:t.string().min(1).nullable().optional(),migration_content_requested:t.boolean().optional(),current_snapshot_id:T.nullable(),published_deployment_id:Xe.nullable().optional(),deployed_url:t.string().url().nullable(),default_locale:he,owner_locale:he.optional(),cms_site_id:no.nullable().optional(),cms_site_url:Ea.nullable().optional(),parent_site_id:R.nullable().optional(),mount_path:t.string().min(1).nullable().optional(),schema_version:t.literal(1),created_at:t.string().min(1),updated_at:t.string().min(1)}),Ia=t.object({id:vt,tenant_id:t.string().min(1),site_id:R,body:t.string().min(1),source:t.enum(["user","import","system"]),created_at:t.string().min(1),updated_at:t.string().min(1)}),Ij=t.object({site:bt,brief:Ia,next_step:t.literal("clarify")}),Rj=t.object({site:bt,brief:Ia}),Tj=t.object({brief:Ia}),wy=t.enum(["queued","running","succeeded","failed","cancelled"]),$m=t.enum(["clarify","sitemap","workspace"]),Ym=t.enum(["clarify","sitemap","initial_generation","iteration","landing_page"]),Xm=t.enum(["clarify","sitemap","workspace","summarize"]),Ye=t.object({id:H,tenant_id:t.string().min(1),site_id:R,agent_type:$m,run_kind:Ym,status:wy,model_route:Xm,started_at:t.string().min(1).nullable(),finished_at:t.string().min(1).nullable(),error_code:t.string().min(1).nullable(),created_at:t.string().min(1),thread_id:Ke.nullable().optional()}),Py=t.enum(["workspace","landing_page","external"]),vy=t.enum(["user","background"]),Qm=t.enum(["active","archived"]),vi=t.object({id:Ke,tenant_id:t.string().min(1),site_id:R,kind:Py,origin:vy,subject_key:t.string().min(1).max(200),title:t.string().min(1).max(200),status:Qm,external_thread_id:t.string().min(1).max(200).nullable(),last_run_id:H.nullable(),last_activity_at:t.string().min(1),created_at:t.string().min(1),updated_at:t.string().min(1)}),kj=t.object({agent_run:Ye,thread:vi.nullable()}),Aj=t.object({run_id:H.optional(),site_id:R,agent_type:$m,run_kind:Ym.optional(),model_route:Xm,input:t.record(t.string(),t.unknown()).optional()}).superRefine((e,n)=>{Pn(e.input)&&n.addIssue({code:"custom",path:["input"],message:"Agent run input must not contain secrets"})}),wj=t.object({agent_run:Ye,next_step:t.literal("stream_events")}),Zm=t.enum(["draft","candidate","deleting","current","failed"]),ot=t.object({id:T,tenant_id:t.string().min(1),site_id:R,version:t.number().int().positive(),manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:t.string().min(1),template_version:Fe.nullable().optional(),reason:t.enum(["initial_generation","workspace_edit","pre_deploy","manual_save","rollback","template_upgrade","subsite_clone"]),status:Zm,created_at:t.string().min(1)}),Pj=t.object({snapshot_id:T,creation_key:t.string().min(1),manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:t.string().min(1),template_version:Fe.optional(),reason:ot.shape.reason,status:t.enum(["draft","candidate","current","failed"]).default("candidate"),source_run_id:H.optional()}),vj=t.object({site:bt,snapshot:ot,next_step:t.literal("workspace")}),Cj=t.object({expected_manifest_hash:ot.shape.manifest_hash,manifest_hash:ot.shape.manifest_hash,object_key:ot.shape.object_key}).strict(),Dj=t.union([t.object({base_snapshot_id:T.nullable(),source_run_id:H.optional()}).strict(),t.object({skip_base_check:t.literal(!0)}).strict()]),Cy=t.object({site:bt,snapshot:ot,next_step:t.literal("workspace")}),jj=t.object({snapshot:ot}),Oj=t.object({status:t.literal("deleting"),snapshot_id:T,object_key:t.string().min(1)}),Nj=t.object({status:t.literal("deleted"),snapshot_id:T}),Ci=t.object({id:La,tenant_id:t.string().min(1),site_id:R,snapshot_id:T,version:t.number().int().positive(),accepted_commit:t.string().min(1),source_run_id:H.nullable(),created_at:t.string().min(1)}),Dy=Ci.extend({reason:ot.shape.reason,status:Zm}),Lj=t.object({accepted_commit:t.string().min(1),source_run_id:H.optional()}),Mj=t.object({site_version:Ci,next_step:t.literal("workspace")}),Uj=t.object({owner_id:t.string().min(1)}).strict(),qj=t.discriminatedUnion("acquired",[t.object({acquired:t.literal(!0)}).strict(),t.object({acquired:t.literal(!1)}).strict()]),Fj=t.object({owner_id:t.string().min(1)}).strict(),Gj=t.object({released:t.literal(!0)}).strict(),Kj="TEMPLATE_UPGRADE_LOCK_LOST",zj=t.object({base_snapshot_id:T,accepted_commit:Ci.shape.accepted_commit,owner_id:t.string().min(1)}).strict(),Bj=Cy.strict(),Wj=t.object({site_versions:t.array(Dy)}),Vj=t.object({site:bt,snapshot:ot,site_version:Ci,next_step:t.literal("workspace")}),Hj=t.object({snapshot_id:T,force_rehydrate:t.boolean().optional()}),jy=t.discriminatedUnion("status",[t.object({status:t.literal("ready"),snapshot_id:T,preview_url:t.string().min(1),launch_id:t.string().min(1).optional()}),t.object({status:t.literal("failed"),code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})]),$j=t.object({tenant_id:t.string().min(1),site_id:R,snapshot_id:T}).strict(),Yj=jy,Ra=t.enum(Dt),Jm=t.enum(["quality_check","publish"]),St=t.object({id:Xe,tenant_id:t.string().min(1),site_id:R,snapshot_id:T,type:Jm.default("publish"),version:t.number().int().positive(),status:Ra,provider:t.enum(["cloudflare"]),url:t.string().url().nullable(),error_code:t.string().min(1).nullable(),provider_deployment_id:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),Xj=t.object({tenant_id:t.string().min(1),site_id:R,expected_snapshot_id:T}).strict(),Qj=t.object({deployment:St}),Zj=t.object({tenant_id:t.string().min(1),site_id:R,deployment_id:Xe}).strict(),Jj=t.object({deployment:St}),eO=t.object({}).strict(),tO=t.object({snapshot_id:T.optional()}).strict(),Oy=t.object({deployment:St}),nO=M(Oy),iO=t.object({deployment:St.nullable()}),sO=t.object({deployment:St}),Km=t.object({id:Xe,type:Jm.default("publish"),status:Ra,url:t.string().url().nullable(),error_code:t.string().min(1).nullable(),provider_deployment_id:t.string().min(1).nullable()}),Ny=t.object({current:Km.nullable(),latest_released:Km.nullable()}),aO=M(Ny),Ly=t.enum(["deployment.snapshot","deployment.status.changed","deployment.finished","deployment.failed","deployment.realtime.recovered","server.error"]),zt=t.object({id:t.string().min(1),tenant_id:t.string().min(1),site_id:R,deployment_id:Xe,seq:t.number().int().positive(),sent_at:t.string().min(1)}),Ai=t.object({deployment:St,steps:Dr.default([])}),oO=t.discriminatedUnion("type",[zt.extend({type:t.literal("deployment.snapshot"),payload:Ai}),zt.extend({type:t.literal("deployment.status.changed"),payload:Ai}),zt.extend({type:t.literal("deployment.finished"),payload:Ai}),zt.extend({type:t.literal("deployment.failed"),payload:Ai}),zt.extend({type:t.literal("deployment.realtime.recovered"),payload:t.object({action:t.literal("refresh")})}),zt.extend({type:t.literal("server.error"),payload:t.object({code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})})]),rO=t.object({tenant_id:t.string().min(1),site_id:R,deployment_id:Xe,status:Ra,updated_at:t.string().min(1)}),My="vcp:deployments",cO={path:"/v1/sites/:site_id/deployments/:deployment_id/socket",redis_channel:My,outbound_message_schema:"DeploymentWsServerMessageSchema",message_types:[...Ly.options]},Uy=t.object({error:t.object({code:t.string().min(1),message:t.string().min(1),details:t.unknown().optional(),request_id:t.string().min(1).optional(),retryable:t.boolean().default(!1)})}),mO=t.object({error:Uy.shape.error.extend({code:t.literal("AGENT_RUN_IN_FLIGHT"),details:t.object({code:t.literal("AGENT_RUN_IN_FLIGHT"),message:t.string().min(1),agent_run:Ye})})}),lO=t.object({colors:t.record(t.string(),t.string()).default({}),typography:t.record(t.string(),t.string()).default({}),spacing:t.record(t.string(),t.string()).default({}),motion:t.record(t.string(),t.string()).default({})}),qy=t.object({theme_id:t.string().min(1),paletteIntent:t.string().min(1),tone:t.string().min(1),mediaMood:t.string().min(1),motionLevel:ya.optional(),userVisualHints:ba.optional()}),Fy=t.object({key:t.string().min(1).max(64).optional(),question:t.string().min(1),answer:t.string().min(1)}),pO=t.object({query:t.string().min(1),keywords:t.array(t.string()).default([]),orientation:t.enum(["landscape","portrait","square"]).optional(),role:t.enum(["hero","section","card","gallery","testimonial","decorative"]),altHint:t.string().min(1)}),dO=t.object({id:t.string().min(1),role:t.enum(["site_background","nav_background","footer_background"]),query:t.string().min(1),keywords:t.array(t.string()).default([]),treatment:t.enum(["cover","fixed-cover","subtle-texture"]),altHint:t.string().optional()}),Gy=t.object({provider:t.enum(["unsplash","pexels"]),providerLabel:t.enum(["Unsplash","Pexels"]),providerHref:t.string().url(),photoHref:t.string().url().optional(),photographerName:t.string().optional(),photographerHref:t.string().url().optional(),requiresAttribution:t.boolean()}),uO=t.object({src:t.string().min(1),alt:t.string().min(1),width:t.number().int().positive().optional(),height:t.number().int().positive().optional(),provider:t.enum(["unsplash","pexels","placeholder"]).optional(),providerId:t.string().optional(),photoUrl:t.string().url().optional(),photographer:t.string().optional(),photographerUrl:t.string().url().optional(),credit:t.string().optional(),dominantColor:t.string().optional(),attribution:Gy.optional()}),Ky=t.enum(["system_recommended","user_picked","user_picked_extended","deterministic_fallback"]),Bt=t.object({id:t.string().min(1),name:t.string().min(1),category:t.literal("page-generation"),version:t.string().min(1).optional(),reason:t.string().min(1).max(200),source:Ky.default("system_recommended")}),Z=t.string().min(1).max(2e3),zm=t.string().min(1).max(120),ki=t.object({visualDirection:Z,brandFeeling:Z,paletteIntent:Z,typographyIntent:Z,density:Ry,motionLevel:Ty,motionPreset:t.enum(["subtle","moderate","expressive"]).optional(),mediaStrategy:Z,compositionRules:t.array(Z).max(20),avoidPatterns:t.array(Z).max(20),fonts:t.object({heading:t.string().min(1),body:t.string().min(1)}).optional(),colorSeeds:t.object({primary:t.string().min(1).max(40),accent:t.string().min(1).max(40),foreground:t.string().min(1).max(40).optional(),neutral:t.string().min(1).max(40).optional(),supporting:t.array(t.string().min(1).max(40)).max(4).optional()}).optional(),surfaceMode:t.enum(["light","dark"]).optional(),radius:t.enum(["none","sm","md","lg","xl"]).optional(),imagePalette:t.object({background:t.string().min(1).max(40).optional(),foreground:t.string().min(1).max(40).optional(),card:t.string().min(1).max(40).optional(),muted:t.string().min(1).max(40).optional(),border:t.string().min(1).max(40).optional()}).optional()}),Ta=160,el=t.object({routeGoal:Z,narrativeArc:Z,firstViewportIntent:Z,visualContinuity:Z,sectionRhythm:Z,avoidPatterns:t.array(Z).max(20),displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(Ta).optional(),metaTitle:t.string().min(1).max(120).optional(),metaDescription:t.string().min(1).max(320).optional(),primaryKeyword:t.string().min(1).max(160).optional(),longTailKeywords:t.array(t.string().min(1).max(160)).max(3).optional()}),tl=t.enum(["model_call","validation","repair","preview","worker_group"]),ft=t.enum(["generating","generating_design_plan","checking_quality","updating_design_memory"]),nl=t.object({sectionRole:Z,contentIntent:Z,layoutIntent:Z,visualIntent:Z,mediaIntent:Z,motionIntent:Z,copyTone:Z,displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(Ta).optional(),ctaIntent:Z.optional(),continuityWithPrevious:Z.optional(),avoidRepeating:t.array(Z).max(20).optional(),industryRecipeRefs:t.array(zm).max(12).optional(),templateRecipeRefs:t.array(zm).max(12).optional()}),il=t.object({siteName:t.string().min(1).max(120),tagline:t.string().min(1).max(200).optional(),primaryCta:t.object({label:t.string().min(1).max(60),target:t.string().min(1).max(200)}).optional(),trustSignals:t.array(t.string().min(1).max(60)).max(6).optional(),industry:t.string().min(1).max(40).optional()}),zy=t.enum(["solid","floating"]),By=t.enum(["background","card","primary","frosted"]),Wy=t.enum(["sticky","hide-on-scroll","static"]),Vy=t.enum(["bar","island"]),Hy=t.object({variant:zy,surface:By.optional(),behavior:Wy.optional(),shape:Vy.optional()}),$y=t.object({form:Z,layoutIntent:Z,scrollBehavior:Z,shell:Hy.optional(),avoidPatterns:t.array(Z).max(10).optional()}),Yy=t.enum(["background","card","primary","inverse"]),Xy=t.object({surface:Yy}),Qy=t.object({form:Z,composition:Z,shell:Xy.optional(),avoidPatterns:t.array(Z).max(10).optional()}),Zy=t.object({pattern:Z,intent:Z}),sl=t.object({header:$y,footer:Qy,mobileNav:Zy}),al=t.object({schemaVersion:t.literal(1).default(1),siteDesignContext:ki,routeCards:t.record(t.string().min(1),el),blockContexts:t.record(t.string().min(1),nl),selectedSkillPacks:t.array(Bt).max(3).optional(),branding:il.optional(),chromeDesign:sl.optional()}),gO=t.object({siteDesignContext:ki.omit({imagePalette:!0}).optional(),routeCards:t.record(t.string().min(1),el).optional(),blockContexts:t.record(t.string().min(1),nl).optional(),branding:il.optional(),chromeDesign:sl.optional()}),Re=t.string().trim().min(1),ka=t.object({id:Re,label:t.string().trim().min(1),type:t.string(),variant:t.string().optional(),order:t.number(),props:t.record(t.string(),t.unknown()),meta:t.object({aiGenerated:t.boolean(),userEdited:t.boolean(),lastEditedAt:t.string(),lastEditedBy:t.enum(["ai","user"]),userInstruction:t.string().optional()}).optional()}).strict(),ol=t.string().regex(an,"Page slug must be '/' or a lowercase ASCII kebab-case absolute path."),Jy=new RegExp(`^/(?:${Ot}(?:/${Ot})*)?(?:\\?[^#\\s]*)?(?:#[^\\s]*)?$`),ex=/^(?:#[^\s]*|[a-z][a-z0-9+.-]*:[^\s]+|\/\/[^\s]+)$/i,tx=t.union([t.string().regex(Jy),t.string().regex(ex)]),Bm=t.object({label:t.string(),href:tx}).passthrough(),nx=t.object({primaryLinks:t.array(Bm),footerLinks:t.array(Bm)}),rl=t.object({showInHeader:t.boolean(),showInFooter:t.boolean(),order:t.number()}).strict(),Aa=t.object({id:Re,slug:ol,title:t.string().trim().min(1),blocks:t.array(ka).min(1),navigation:rl}).strict(),ix=ka.extend({type:t.string().nullable()}).strict(),sx=Aa.extend({slug:ol.nullable(),navigation:rl.extend({showInHeader:t.boolean().nullable(),showInFooter:t.boolean().nullable()}).strict(),blocks:t.array(ix).min(1)}).strict(),ax=ka.extend({id:t.string()}),ox=Aa.extend({id:t.string(),slug:t.string().min(1),blocks:t.array(ax).min(1)}),Wm=t.object({label:t.string(),href:t.string().min(1)}),rx=t.object({primaryLinks:t.array(Wm),footerLinks:t.array(Wm)}),cx=t.discriminatedUnion("kind",[t.object({kind:t.literal("brief_clarify"),brief_id:vt,answer_ids:t.array(t.string().min(1)).max(10)}).strict(),t.object({kind:t.literal("step5_strategy"),strategy_version_id:t.string().uuid(),strategy_version:t.number().int().positive(),strategy_checksum:t.string().regex(/^[a-f0-9]{64}$/)}).strict()]),wi=t.object({site_name:t.string().min(1).max(80).optional(),version:t.number().int().positive(),pages:t.array(Aa).min(1),navigation:nx,integrations:t.object({cms:t.unknown().optional(),analytics:t.unknown().optional()}).optional(),meta:t.object({generatedAt:t.string(),generatedBy:t.literal("sitemap-agent"),source_brief_id:t.string().optional(),source_answer_ids:t.array(t.string()).optional(),source:cx.optional()}),skillSelection:Bt,visualTheme:qy.optional(),userChoices:t.array(Fy).optional(),confirmedChoices:t.object({conversion:xt.optional()}).optional(),seoKeywords:t.union([t.array(Jt).min(1),t.array(zn).min(1).max(50)]).optional()}).strict(),Wt=wi.superRefine((e,n)=>{ll(e.pages,n)}),An=wi.extend({pages:t.array(sx).min(1)}).strict().superRefine((e,n)=>{ll(e.pages,n)}),mx=t.enum(["slug","showInHeader","showInFooter"]),lx=t.object({page_id:Re,fields:t.array(mx).min(1).max(3)}).strict(),px=t.object({page_id:Re,block_id:Re,fields:t.tuple([t.literal("type")])}).strict(),cl=100,ml=500,dx=t.object({pages:t.array(lx).max(cl),blocks:t.array(px).max(ml)}).strict().superRefine((e,n)=>{let i=new Set;e.pages.forEach((a,r)=>{i.has(a.page_id)&&n.addIssue({code:"custom",path:["pages",r,"page_id"],message:`Duplicate page target '${a.page_id}'.`}),i.add(a.page_id),new Set(a.fields).size!==a.fields.length&&n.addIssue({code:"custom",path:["pages",r,"fields"],message:"Page target fields must be unique."})});let s=new Set;e.blocks.forEach((a,r)=>{let u=`${a.page_id}\0${a.block_id}`;s.has(u)&&n.addIssue({code:"custom",path:["blocks",r],message:`Duplicate block target '${a.page_id}/${a.block_id}'.`}),s.add(u)})}),_O=t.object({sitemap:An,targets:dx}).strict(),hO=t.object({pages:t.array(t.object({page_id:Re,slug:t.string().min(1).optional(),show_in_header:t.boolean().optional(),show_in_footer:t.boolean().optional()}).strict()).max(cl),blocks:t.array(t.object({page_id:Re,block_id:Re,type:t.string().trim().min(1)}).strict()).max(ml)}).strict().superRefine((e,n)=>{let i=new Set;e.pages.forEach((a,r)=>{i.has(a.page_id)&&n.addIssue({code:"custom",path:["pages",r,"page_id"],message:`Duplicate page output '${a.page_id}'.`}),i.add(a.page_id)});let s=new Set;e.blocks.forEach((a,r)=>{let u=`${a.page_id}\0${a.block_id}`;s.has(u)&&n.addIssue({code:"custom",path:["blocks",r],message:`Duplicate block output '${a.page_id}/${a.block_id}'.`}),s.add(u)})}),SO=t.object({sitemap:Wt}).strict();function ll(e,n){let i=new Map,s=new Map,a=new Map,r=0;e.forEach((u,c)=>{let g=i.get(u.id);if(g!==void 0?n.addIssue({code:"custom",path:["pages",c,"id"],message:`Duplicate page id '${u.id}' (first used at pages.${g}.id).`}):i.set(u.id,c),u.blocks.forEach((I,C)=>{let F=s.get(I.id);F!==void 0?n.addIssue({code:"custom",path:["pages",c,"blocks",C,"id"],message:`Duplicate block id '${I.id}' (first used at pages.${F.pageIndex}.blocks.${F.blockIndex}.id).`}):s.set(I.id,{pageIndex:c,blockIndex:C})}),u.slug===null)return;u.slug==="/"&&(r+=1);let k=a.get(u.slug);k!==void 0?n.addIssue({code:"custom",path:["pages",c,"slug"],message:`Duplicate page slug '${u.slug}' (first used at pages.${k}.slug).`}):a.set(u.slug,c)}),(r!==1||e[0]?.slug!=="/")&&n.addIssue({code:"custom",path:["pages"],message:"Sitemap must contain exactly one home page at pages[0] with slug '/'."})}var fO=wi.omit({skillSelection:!0,visualTheme:!0,userChoices:!0,confirmedChoices:!0,seoKeywords:!0}).extend({meta:wi.shape.meta.omit({source:!0}),site_name:t.string().min(1).max(80),pages:t.array(ox).min(1),navigation:rx}),ux=t.enum(["ai","user"]),Vt=t.object({site_id:R,page_id:Re,edited_by:ux.default("ai"),source_agent_run_id:H.optional()}),bO=Vt.extend({block_id:Re,target_index:t.number().int().min(0)}),gx=Vt.extend({block_id:Re}),_x=Vt.extend({block_id:Re,instruction:t.string()}),yO=Vt.extend({block_id:Re,variant:t.string().min(1).nullable()}),xO=Vt.extend({block_id:Re,props:t.record(t.string(),t.unknown()),mode:t.enum(["replace","merge"]).default("replace")}),EO=Vt.extend({block:t.object({id:Re,label:t.string().trim().min(1),type:t.string().min(1),variant:t.string().min(1).optional(),props:t.record(t.string(),t.unknown()).default({}),insert_index:t.number().int().min(0).optional()})}),hx=t.enum(["move_block","delete_block","update_block_instruction","change_block_variant","update_block_props","add_block"]),IO=t.discriminatedUnion("operation",[t.object({operation:t.literal("delete_block"),input:gx}).strict(),t.object({operation:t.literal("update_block_instruction"),input:_x}).strict()]),Sx=t.enum(["SITEMAP_EDIT_INVALID","SITEMAP_API_NOT_CONFIGURED","SITEMAP_NOT_FOUND","SITEMAP_PAGE_NOT_FOUND","SITEMAP_BLOCK_NOT_FOUND","SITEMAP_BLOCK_ALREADY_EXISTS","SITEMAP_LAST_BLOCK_DELETE_FORBIDDEN","SITEMAP_EDIT_FAILED"]),fx=t.object({status:t.literal("updated"),operation:hx,site_id:R,sitemap_id:Ce,version:t.number().int().positive(),changed_pages:t.array(Re).min(1),requires_code_patch:t.literal(!0)}),bx=t.object({status:t.literal("failed"),code:Sx,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),RO=t.discriminatedUnion("status",[fx,bx]),wa=t.object({question_id:t.string().min(1),value:t.string().min(1),label:t.string().min(1).optional(),question:t.string().min(1).optional(),option_label:t.string().min(1).optional(),motion_level:ya.optional(),visual_tonality:ba.optional(),conversion:xt.optional(),positioning:t.object({market:t.string().min(1).max(200),customer:t.string().min(1).max(200),purpose:t.string().min(1).max(60)}).optional()}),yx=t.object({id:t.string().trim().min(1).max(128),type:t.literal(1),search_intent:t.string().trim().min(1).max(255),path:t.string().trim().regex(/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*)?$/),channel:t.string().trim().min(1).max(80),content_format:t.string().trim().min(1).max(80),priority:t.enum(["P0","P1","P2","P3"])}).strict(),TO=t.object({source:t.object({kind:t.literal("step5_strategy")}).strict()}).strict(),xx=t.object({item_key:Fn,title:t.string().trim().min(1).max(200),selected_option_id:tn,selected_label:t.string().trim().min(1).max(200),selected_value:t.string().trim().min(1).max(500),selected_description:t.string().trim().min(1).max(2e3),impact:t.string().trim().min(1).max(500).optional(),customer_note:t.string().trim().min(1).max(200).optional(),market_type:Gn.optional(),markets:t.array(Kn).max(32).optional(),sections:t.array(t.object({id:t.string().min(1),label:t.string().min(1)}).strict()).optional()}).strict(),Ex=t.object({kind:t.literal("step5_strategy"),site_name:t.string().trim().min(1).max(80).optional(),strategy_version_id:t.string().uuid(),strategy_version:t.number().int().positive(),strategy_checksum:t.string().regex(/^[a-f0-9]{64}$/),decisions:t.array(xx).length(Te),seo_keywords:t.array(zn).min(1).max(50).optional(),enterprise_keywords:t.array(Jt).min(1).optional()}).strict().superRefine((e,n)=>{e.decisions.forEach((i,s)=>{i.item_key!==mt[s]&&n.addIssue({code:"custom",path:["decisions",s,"item_key"],message:"Step5 sitemap decisions must use the canonical order."})})}),pl=t.object({tenant_id:t.string().min(1),site_id:R,brief_id:vt,brief:t.string().min(20).max(1e3),answers:t.array(wa).min(1).max(10),skillSelection:Bt,site_default_locale:he.optional(),owner_locale:he.optional(),cms_site_id:t.string().min(1).nullish(),intent_pages:t.array(yx).max(uo).optional(),reference:jn.optional(),input_context:t.object({facts:t.array(Dn).max(120),conflicts:t.array(On).max(20)}).optional(),business_facts:Ka.optional(),extra_requirement:t.string().trim().min(1).max(Ct).optional(),migration_products_enabled:t.boolean().optional()}),Ix=pl.pick({tenant_id:!0,site_id:!0,skillSelection:!0,site_default_locale:!0,owner_locale:!0,cms_site_id:!0,reference:!0,input_context:!0,business_facts:!0,extra_requirement:!0,migration_products_enabled:!0}).partial({skillSelection:!0}).extend({source:Ex}).strict(),kO=t.union([pl,Ix]),dl=t.enum(["planning","generating","validating","ready"]),Rx=t.enum(["salvaged","deterministic_fallback"]),Tx=t.enum(["model_exception_settled_prefix","model_exception_safe_root"]),ul={outcome:Rx.optional(),reason:Tx.optional(),attempts:t.number().int().positive().optional()};function gl(e,n){if(e.type!=="sitemap.generated")return;let i=e.outcome!==void 0,s=e.reason!==void 0;i!==s&&n.addIssue({code:"custom",path:[i?"reason":"outcome"],message:"sitemap.generated outcome and reason must be provided together"})}var kx=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:H,at:t.string().min(1)}),t.object({type:t.literal("sitemap.generating"),stage:dl,message:t.string().min(1).optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generated"),sitemap_id:Ce,sitemap:Wt,...ul,at:t.string().min(1)}),t.object({type:t.literal("sitemap.clamped"),reason:t.enum(["page_early_stop","finalize_best_effort"]),original_page_count:t.number().int().nonnegative().optional(),final_page_count:t.number().int().nonnegative().optional(),original_block_count:t.number().int().nonnegative().optional(),final_block_count:t.number().int().nonnegative().optional(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.started"),slot_count:t.number().int().nonnegative(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.finished"),slot_count:t.number().int().nonnegative(),provider_counts:t.object({unsplash:t.number().int().nonnegative(),pexels:t.number().int().nonnegative(),placeholder:t.number().int().nonnegative()}),fallback_count:t.number().int().nonnegative(),error_codes:t.array(t.string()),at:t.string().min(1)}),t.object({type:t.literal("snapshot.created"),snapshot_id:T,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),snapshot_id:T.optional(),at:t.string().min(1)})]),AO=kx.superRefine(gl),_l=t.object({id:Ce,tenant_id:t.string().min(1),site_id:R,version:t.number().int().positive(),source_agent_run_id:H.nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}).strict();function hl(e,n){e.version!==e.sitemap.version&&n.addIssue({code:"custom",path:["sitemap","version"],message:`Sitemap JSON version ${e.sitemap.version} must equal record version ${e.version}.`})}var Sl=_l.extend({sitemap:Wt}).superRefine(hl),Ax=_l.extend({sitemap:An}).superRefine(hl),wO=t.object({sitemap_id:Ce,creation_key:t.string().min(1),sitemap:Wt,source_agent_run_id:H.optional()}),PO=t.object({sitemap_id:Ce,creation_key:t.string().min(1),sitemap:An,expected_current_sitemap_id:Ce,expected_current_sitemap_version:t.number().int().positive(),migration_content_requested:t.boolean().optional()}),vO=t.object({sitemap_id:Ce,creation_key:t.string().min(1),sitemap:Wt,source_agent_run_id:H}),CO=t.object({site:bt,sitemap:Sl,next_step:t.literal("workspace")}).strict(),DO=t.object({site:bt,sitemap:Ax,next_step:t.literal("workspace")}).strict(),jO=t.object({site:bt,sitemap:Sl,next_step:t.literal("sitemap_review")}).strict(),wx=t.object({id:Na,tenant_id:t.string().min(1),site_id:R,brief_id:vt,questions:xa,answers:t.array(wa),selected_archetype:Bt.optional(),completed_at:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),OO=t.object({answers:t.array(wa).min(1),questions:xa,selected_archetype:Bt.optional()}),NO=t.object({clarify_session:wx}),LO=t.object({questions:xa,selected_archetype:Bt}),Px=t.object({id:ji,tenant_id:t.string().min(1),site_id:R,version:t.number().int().positive(),design_plan:al,source_agent_run_id:H.nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),MO=t.object({design_plan_id:ji.optional(),design_plan:al,source_agent_run_id:H.optional()}),UO=t.object({design_plan:Px}),Di=t.enum(["initial_generation","iteration","landing_page"]),vx=t.object({label:t.string().min(1).max(48),prompt:t.string().min(1).max(160)}).strict(),Cx=t.enum(["model","derived","mixed","advisor"]),fl=t.object({suggestions:t.array(vx).min(1).max(4),source:Cx}).strict(),Dx=t.enum(["clean","salvaged","deterministic_fallback","baseline_retained"]),jx=t.enum(["generation_succeeded","entry_slots_omitted","quality_gate_exhausted","schema_gate_exhausted","generation_timeout","stream_schema_mismatch","stream_generation_error","generation_error","fallback_compiler_error","legacy_result_missing_metadata"]),Ox=t.enum(["progress","assistant_final"]),bl=t.enum(["run.started","message.delta","user.message","plan.updated","clarify.partial","clarify.archetype_proposals","clarify.finished","sitemap.generating","sitemap.partial","sitemap.generated","sitemap.clamped","sitemap.updated","sitemap.resync.failed","sitemap.resync.warning","block.changed","tool.started","tool.finished","workspace.plan.created","workspace.worker.updated","workspace.task.updated","workspace.degraded","workspace.design_plan.outcome","workspace.suggestions","file.changed","snapshot.created","snapshot.finalized","preview.preparing","preview.ready","preview.build.started","preview.build.succeeded","preview.build.failed","run.failed","run.finished","media_resolution.started","media_resolution.finished","skill.selecting","skill.selected","activity.started","activity.updated","activity.finished","activity.failed"]),Nx=t.object({id:t.string().min(1),title:t.string().min(1),status:t.enum(["pending","running","completed","failed"])}),Pt=t.enum(["pending","running","completed","completed_with_skips","failed","skipped"]),Pa=t.enum(["style_media","chrome","sections","layout","pages","detect_typecheck","repair","finalize","sitemap_resync","preview"]),va=t.object({code:t.string().min(1),message:t.string().min(1),path:t.string().min(1).optional(),task_id:t.string().min(1).optional(),details:t.record(t.string(),t.unknown()).optional()}),xe=t.string().min(1).refine(e=>Cl(e),{message:"Snapshot file paths must be safe relative POSIX paths without traversal."}),Ca=t.object({deduped_paths:t.array(xe),skipped_tasks:t.array(t.string().min(1)),failed_tasks:t.array(t.string().min(1)),fallback_files:t.array(t.string().min(1)),applied_paths:t.array(xe)}),Da=t.object({group_id:t.string().min(1),phase:Pa,title:t.string().min(1),status:Pt,task_ids:t.array(t.string().min(1)),depends_on_groups:t.array(t.string().min(1)),target_paths:t.array(xe)}),Lx=t.enum(["style","media","chrome","section","layout","page"]),ja=t.object({task_id:t.string().min(1),group_id:t.string().min(1),kind:Lx,target_path:xe,block_id:t.string().min(1).optional(),block_type:t.string().min(1).optional(),block_variant:t.string().min(1).optional(),block_order:t.number().int().nonnegative().optional(),user_instruction:t.string().min(1).optional(),page_id:t.string().min(1).optional(),page_slug:t.string().min(1).optional(),page_title:t.string().min(1).optional(),title:t.string().min(1).max(60).optional(),description:t.string().min(1).max(Ta).optional(),status:Pt,required_reads:t.array(xe).optional(),search_params_sections:t.array(xe).optional(),standard_form_view:xe.optional()}),Oa=t.object({from_group_id:t.string().min(1),to_group_id:t.string().min(1),reason:t.enum(["style_media","chrome","sections","layout","page_composition","quality_gate"])}),qO=t.object({plan_id:t.string().min(1),run_kind:Di,model_route:t.object({planner:t.literal("workspace_planner"),worker:t.literal("workspace")}),groups:t.array(Da),tasks:t.array(ja),dependencies:t.array(Oa),expected_outputs:t.array(xe),diagnostics:Ca}),FO=t.object({task_id:t.string().min(1),patch:t.unknown().optional(),snapshot_id:T.optional(),read_files:t.array(xe),diagnostics:t.array(va),status:Pt}),yl=t.object({worker_count:t.number().int().nonnegative(),task_count:t.number().int().nonnegative(),group_count:t.number().int().nonnegative()}),xl=t.object({pending:t.number().int().nonnegative(),running:t.number().int().nonnegative(),completed:t.number().int().nonnegative(),completed_with_skips:t.number().int().nonnegative(),failed:t.number().int().nonnegative(),skipped:t.number().int().nonnegative()}),Mx=t.object({type:t.literal("text"),text:t.string(),state:t.enum(["streaming","done"]).optional()}),Ux=t.object({type:t.literal("reasoning"),text:t.string(),state:t.enum(["streaming","done"]).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),qx=t.object({type:t.literal("file"),mediaType:t.string().min(1),filename:t.string().min(1).optional(),url:t.string().min(1)}),Fx=t.object({type:t.literal("source-url"),sourceId:t.string().min(1),url:t.string().min(1),title:t.string().min(1).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),Gx=t.object({type:t.literal("source-document"),sourceId:t.string().min(1),mediaType:t.string().min(1),title:t.string().min(1),filename:t.string().min(1).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),Kx=t.object({type:t.string().regex(/^data-[a-zA-Z0-9_-]+$/),id:t.string().min(1).optional(),data:t.unknown()}),zx=t.object({type:t.string().regex(/^tool-[a-zA-Z0-9_-]+$/),toolCallId:t.string().min(1),state:t.enum(["input-streaming","input-available","output-available","output-error"]),input:t.unknown().optional(),output:t.unknown().optional(),errorText:t.string().min(1).optional()}),Bx=t.object({type:t.literal("error"),errorText:t.string().min(1)}),Wx=t.object({type:t.literal("step-start")}),Pi=t.union([Mx,Ux,qx,Fx,Gx,Kx,zx,Bx,Wx]),Vx=t.string().min(1).max(512).refine(e=>Cl(e)&&!/^[A-Za-z]:\//.test(e),{message:"Generated-code rescue paths must be safe relative POSIX paths without traversal."}),Hx=t.array(Vx).min(1).max(64),$x=t.array(t.string().min(1).max(120)).min(1).max(64),Yx=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:H,at:t.string().min(1)}),t.object({type:t.literal("message.delta"),text:t.string().min(1),history_purpose:Ox.optional(),at:t.string().min(1)}),t.object({type:t.literal("user.message"),client_message_id:t.string().min(1),message_id:t.string().min(1),parts:t.array(Pi).min(1),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:Xn.optional(),at:t.string().min(1)}),t.object({type:t.literal("plan.updated"),steps:t.array(Nx),at:t.string().min(1)}),t.object({type:t.literal("clarify.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("clarify.archetype_proposals"),proposals:t.array(Vm).min(1).max(5),at:t.string().min(1)}),t.object({type:t.literal("clarify.finished"),questions_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generating"),stage:dl,message:t.string().min(1).optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generated"),sitemap_id:Ce,sitemap:Wt,...ul,at:t.string().min(1)}),t.object({type:t.literal("sitemap.clamped"),reason:t.enum(["page_early_stop","finalize_best_effort"]),original_page_count:t.number().int().nonnegative().optional(),final_page_count:t.number().int().nonnegative().optional(),original_block_count:t.number().int().nonnegative().optional(),final_block_count:t.number().int().nonnegative().optional(),at:t.string().min(1)}).strict(),t.object({type:t.literal("sitemap.updated"),sitemap_id:Ce,version:t.number().int().positive(),reason:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("sitemap.resync.failed"),error_code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),diagnostics:t.unknown().optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.resync.warning"),code:t.string().min(1),message:t.string().min(1),diagnostics:t.unknown().optional(),at:t.string().min(1)}),t.object({type:t.literal("block.changed"),block_id:t.string().min(1),change_type:t.enum(["add","update","delete","move"]),at:t.string().min(1)}),t.object({type:t.literal("tool.started"),tool_call_id:t.string().min(1),name:t.string().min(1),summary:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("tool.finished"),tool_call_id:t.string().min(1),name:t.string().min(1),result_summary:t.string().min(1),interaction_request:bs.optional(),at:t.string().min(1)}),t.object({type:t.literal("workspace.plan.created"),plan_id:t.string().min(1),run_kind:Di,groups:t.array(Da),tasks:t.array(ja),dependencies:t.array(Oa),expected_outputs:t.array(xe),diagnostics:Ca,summary:yl,at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.worker.updated"),group_id:t.string().min(1),phase:Pa,status:Pt,task_counts:xl,target_paths:t.array(xe),diagnostics:t.array(t.string().min(1)),at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.task.updated"),task_id:t.string().min(1),group_id:t.string().min(1),status:Pt,target_path:xe,read_files_count:t.number().int().nonnegative(),diagnostics:t.array(t.string().min(1)),diagnostic_details:t.array(va).optional(),at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.degraded"),reason:t.enum(["block_placeholder","form_placeholder","patch_protected_dropped","preview_health_degraded","design_plan_fallback","generated_code_rescue","cms_page_directory_degraded","form_prebuild_skipped","form_section_fallback","first_settings_sync_failed"]),degraded_block_ids:t.array(t.string().min(1)).min(1).optional(),dropped_files:t.array(t.string().min(1)).min(1).optional(),degraded_file_paths:Hx.optional(),degraded_page_ids:$x.optional(),snapshot_id:T.optional(),code:t.string().min(1).optional(),message:t.string().min(1).optional(),diagnostics:t.string().min(1).optional(),retryable:t.boolean().optional(),at:t.string().min(1)}).strict().superRefine((e,n)=>{if(!(e.reason==="generated_code_rescue")){for(let s of["degraded_file_paths","degraded_page_ids"])e[s]!==void 0&&n.addIssue({code:"custom",path:[s],message:`${s} is only allowed for generated_code_rescue`});return}e.degraded_file_paths===void 0&&n.addIssue({code:"custom",path:["degraded_file_paths"],message:"generated_code_rescue requires degraded_file_paths"});for(let s of["degraded_block_ids","dropped_files","snapshot_id","code","message","diagnostics","retryable"])e[s]!==void 0&&n.addIssue({code:"custom",path:[s],message:`${s} is not allowed for generated_code_rescue`})}),t.object({type:t.literal("workspace.design_plan.outcome"),design_plan_outcome:Dx,reason:jx,gate_diagnostics:t.object({gate:t.enum(["quality","schema"]),issue_codes:t.array(t.string().min(1)).max(20),issue_paths:t.array(t.string()).max(20),finish_reason:t.string().min(1).optional()}).strict().optional(),media_floor:t.object({total_blocks:t.number().int().min(0),media_bearing_blocks:t.number().int().min(0),hero_total:t.number().int().min(0),hero_media_bearing:t.number().int().min(0),pages_without_media:t.array(t.string().min(1)).max(50),met:t.boolean()}).strict().optional(),at:t.string().min(1)}).strict(),fl.extend({type:t.literal("workspace.suggestions"),at:t.string().min(1)}).strict(),t.object({type:t.literal("file.changed"),path:t.string().min(1),change_type:t.enum(["create","update","delete"]),diff:t.string().optional(),at:t.string().min(1)}),t.object({type:t.literal("snapshot.created"),snapshot_id:T,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),at:t.string().min(1)}),t.object({type:t.literal("snapshot.finalized"),snapshot_id:T,at:t.string().min(1)}),t.object({type:t.literal("preview.preparing"),at:t.string().min(1)}),t.object({type:t.literal("preview.ready"),url:t.string().url(),at:t.string().min(1),launch_id:t.string().min(1).optional()}),t.object({type:t.literal("preview.build.started"),snapshot_id:T,at:t.string().min(1)}),t.object({type:t.literal("preview.build.succeeded"),snapshot_id:T,at:t.string().min(1)}),t.object({type:t.literal("preview.build.failed"),snapshot_id:T,message:t.string().min(1),diagnostics:t.string().min(1),retryable:t.boolean(),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),error_category:Hm.optional(),retryable:t.boolean().optional(),attempts:t.number().int().positive().optional(),outcome:t.literal("retained_previous").optional(),details:t.record(t.string(),t.unknown()).optional(),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),snapshot_id:T.optional(),degraded_reason:Qt.optional(),build_verified:t.boolean().optional(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.started"),slot_count:t.number().int().nonnegative(),at:t.string().datetime()}),t.object({type:t.literal("media_resolution.finished"),slot_count:t.number().int().nonnegative(),provider_counts:t.object({unsplash:t.number().int().nonnegative(),pexels:t.number().int().nonnegative(),placeholder:t.number().int().nonnegative()}),fallback_count:t.number().int().nonnegative(),error_codes:t.array(t.string()),at:t.string().datetime()}),t.object({type:t.literal("skill.selecting"),category:t.literal("page-generation"),available:t.array(t.object({id:t.string().min(1),name:t.string().min(1)})).max(20),at:t.string().min(1)}),t.object({type:t.literal("skill.selected"),category:t.literal("page-generation"),selected:t.object({id:t.string().min(1),name:t.string().min(1),reason:t.string().min(1).max(200)}),at:t.string().min(1)}),t.object({type:t.literal("activity.started"),activity_id:t.string().min(1),parent_activity_id:t.string().min(1).optional(),kind:tl,title:t.string().min(1).max(200),detail:t.string().max(360).optional(),title_code:ft.optional(),detail_code:ft.optional(),locks_input:t.boolean(),at:t.string().min(1)}),t.object({type:t.literal("activity.updated"),activity_id:t.string().min(1),title:t.string().min(1).max(200).optional(),detail:t.string().max(360).optional(),title_code:ft.optional(),detail_code:ft.optional(),at:t.string().min(1)}),t.object({type:t.literal("activity.finished"),activity_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("activity.failed"),activity_id:t.string().min(1),detail:t.string().max(360).optional(),at:t.string().min(1)})]),El=Yx.superRefine(gl).superRefine((e,n)=>{if(e.type==="user.message"&&e.interaction_response&&!e.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"}),e.type!=="tool.finished")return;let i=e.name==="prepare_product_search_entry";i!==!!e.interaction_request&&n.addIssue({code:"custom",path:["interaction_request"],message:i?"prepare_product_search_entry requires interaction_request":"interaction_request is only valid for prepare_product_search_entry"})}),fa=t.object({id:Ma,tenant_id:t.string().min(1),site_id:R,agent_run_id:H,sequence:t.number().int().positive(),event_type:bl,payload:El,created_at:t.string().min(1),thread_id:Ke.nullable().optional()}),GO=t.object({event_type:bl,payload:El}).superRefine((e,n)=>{e.event_type!==e.payload.type&&n.addIssue({code:"custom",path:["payload","type"],message:"payload.type must match event_type"}),Pn(e.payload)&&n.addIssue({code:"custom",path:["payload"],message:"AgentEvent payload must not contain secrets"})}),KO=t.discriminatedUnion("status",[t.object({status:t.literal("appended"),agent_run:Ye,event:fa,next_cursor:t.number().int().nonnegative()}),t.object({status:t.literal("duplicate_ignored"),agent_run:Ye,event:fa,next_cursor:t.number().int().nonnegative()})]),zO=t.object({events:t.array(fa),next_cursor:t.number().int().nonnegative().optional()}),BO=t.object({after_sequence:t.coerce.number().int().nonnegative().default(0)}),WO=t.object({run_id:H.optional(),thread_id:Ke.optional()}).superRefine((e,n)=>{e.run_id&&e.thread_id&&n.addIssue({code:"custom",path:["thread_id"],message:"run_id and thread_id are mutually exclusive"})}),VO=t.enum(["implemented","skeleton","planned"]),HO=t.enum(["GET","POST","PUT","PATCH","DELETE"]),$O=[{method:"PATCH",path:"/internal/sites/:site_id/snapshots/:snapshot_id/manifest",tag:"snapshots",summary:"Compare-and-set the manifest hash for the active current snapshot after an in-place object replacement.",status:"implemented",request_body_schema:"UpdateCurrentSnapshotManifestRequestSchema",response_schema:"SnapshotRecordSchema",notes:["Internal Agent authentication is required. The update succeeds only when site current_snapshot_id, snapshot status, object key, and expected manifest hash still match."]},{method:"GET",path:"/health",tag:"system",summary:"API health check.",status:"implemented",response_schema:"ApiHealth"},{method:"POST",path:"/sites",tag:"sites",summary:"Create a site and Step 1 brief in the current dev context.",status:"implemented",request_body_schema:"CreateSiteBriefRequestSchema",response_schema:"CreateSiteBriefResponseSchema"},{method:"POST",path:"/sites/drafts",tag:"sites",summary:"Create a draft site without a brief in the current tenant so /s/:site_id can collect Step 1 later.",status:"implemented",request_body_schema:"CreateSiteDraftRequestSchema",response_schema:"SiteRecordSchema"},{method:"GET",path:"/sites",tag:"sites",summary:"List current tenant sites.",status:"implemented",response_schema:"SiteRecordSchema[]"},{method:"GET",path:"/sites/by-cms/:cms_site_id",tag:"sites",summary:"Resolve an external CMS site id to one tenant-scoped VCP site.",status:"implemented",response_schema:"SiteRecordSchema",notes:["Used by the browser /d/:cms_site_id handoff route; lookup is scoped by current request tenant and returns 404 when the CMS site has not been synchronized."]},{method:"GET",path:"/sites/:site_id",tag:"sites",summary:"Get one tenant-scoped site.",status:"implemented",response_schema:"SiteRecordSchema"},{method:"POST",path:"/sites/:site_id/workflow",tag:"site-workflows",summary:"Create one version-bound site workflow from a published flow definition.",status:"implemented",request_body_schema:"CreateSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/workflow",tag:"site-workflows",summary:"Read the current site workflow snapshot and derived menu state.",status:"implemented",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"PUT",path:"/sites/:site_id/workflow/website",tag:"site-workflows",summary:"Update the source website while website_scan is current.",status:"implemented",request_body_schema:"UpdateSiteWorkflowWebsiteRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/advance",tag:"site-workflows",summary:"Advance one non-terminal workflow node with an expected-current-node guard.",status:"implemented",request_body_schema:"AdvanceSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/complete",tag:"site-workflows",summary:"Complete the workflow from its final publishing node after server-side release checks pass.",status:"implemented",request_body_schema:"CompleteSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema",notes:["The browser supplies only the expected current node; the server verifies persisted release facts before completing the workflow."]},{method:"POST",path:"/sites/:site_id/workflow/tasks/register",tag:"site-workflows",summary:"Register a business-owned external task id and its idempotency key.",status:"implemented",request_body_schema:"RegisterWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/step2-site-initialization/tasks",tag:"site-workflows/step2-site-initialization",summary:"Create or reuse the current workflow's Step2 website crawl task.",status:"implemented",response_schema:"Step2SiteInitializationTaskResponseSchema",notes:["The server derives tenantId, sessionId, and siteUrl from trusted request/workflow state; the browser cannot submit upstream scope fields."]},{method:"GET",path:"/sites/:site_id/workflow/step2-site-initialization/tasks/:task_id",tag:"site-workflows/step2-site-initialization",summary:"Poll the workflow-owned Step2 website crawl task.",status:"implemented",response_schema:"Step2SiteInitializationTaskResponseSchema",notes:["The task id must match the current non-superseded website_crawl task reference for the workflow."]},{method:"POST",path:"/sites/:site_id/workflow/tasks/:task_type/replace",tag:"site-workflows",summary:"Replace one task reference while retaining its superseded history.",status:"implemented",request_body_schema:"ReplaceWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/tasks/website_crawl/replace-and-invalidate-dependents",tag:"site-workflows",summary:"Replace website crawl and invalidate basic-info and metrics dependents atomically.",status:"implemented",request_body_schema:"ReplaceCrawlWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/build",tag:"site-workflows",summary:"Start the server-owned site build and workspace snapshot lifecycle.",status:"implemented",request_body_schema:"StartSiteBuildRequestSchema",response_schema:"StartSiteBuildResponseSchema",notes:["The browser may start or query the build, but cannot write site build or deployment summary status directly."]},{method:"GET",path:"/sites/:site_id/workflow/customer-materials",tag:"site-workflows",summary:"Read the persisted no-website customer materials draft.",status:"implemented",response_schema:"CustomerMaterialsNullableResponseSchema"},{method:"PUT",path:"/sites/:site_id/workflow/customer-materials",tag:"site-workflows",summary:"Save the no-website customer materials before submission.",status:"implemented",request_body_schema:"CustomerMaterialsDraftSchema",response_schema:"CustomerMaterialsResponseSchema",notes:["A submitted record is immutable and rejects later writes."]},{method:"POST",path:"/sites/:site_id/workflow/customer-materials/submit",tag:"site-workflows",summary:"Submit and freeze customer materials before analysis.",status:"implemented",request_body_schema:"CustomerMaterialsDraftSchema",response_schema:"CustomerMaterialsResponseSchema",notes:["Repeated submissions return 409; clients may retry only the separate workflow advance."]},{method:"GET",path:"/sites/:site_id/designer/component-library/categories",tag:"designer-component-library",summary:"List the fixed insert-new-component category tree for a site.",status:"implemented",response_schema:"ListDesignerComponentCategoriesResponseSchema",notes:["The server validates site ownership and fixes category_group_key to insertNewComponent."]},{method:"GET",path:"/sites/:site_id/designer/component-library/resources",tag:"designer-component-library",summary:"List component resources from the fixed designer catalog group.",status:"implemented",query_schema:"ListDesignerComponentsQuerySchema",response_schema:"ListDesignerComponentsResponseSchema",notes:["The server fixes resource type to component and does not expose resource-platform secrets, internal hosts, or product-line selection."]},{method:"POST",path:"/sites/:site_id/designer/component-library/resources/:resource_id/install",tag:"designer-component-library",summary:"Install one exact component version and return a strict SiteEditEngine materialization.",status:"implemented",request_body_schema:"InstallDesignerComponentBodySchema",response_schema:"InstallDesignerComponentResponseSchema",notes:["The server downloads the resource ZIP with the configured secret, validates main.json identity and compatibility, and returns only the strict materialization plus immutable revision metadata."]},{method:"GET",path:"/sites/:site_id/designer/page-library/categories",tag:"designer-page-library",summary:"List the fixed insert-new-page category tree for a site.",status:"implemented",response_schema:"ListDesignerPageCategoriesResponseSchema",notes:["The server validates site ownership and fixes category_group_key to insertNewPage."]},{method:"GET",path:"/sites/:site_id/designer/page-library/resources",tag:"designer-page-library",summary:"List page and pages resources from the fixed designer catalog.",status:"implemented",query_schema:"ListDesignerPagesQuerySchema",response_schema:"ListDesignerPagesResponseSchema",notes:["The server fixes resource types to page and pages and does not expose resource-platform credentials or internal routing."]},{method:"POST",path:"/sites/:site_id/designer/page-library/resources/:resource_id/prepare",tag:"designer-page-library",summary:"Resolve one exact page resource version for designer-side draft configuration.",status:"implemented",request_body_schema:"PrepareDesignerPageBodySchema",response_schema:"PrepareDesignerPageResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-library/resources/:resource_id/install",tag:"designer-page-library",summary:"Install one exact page resource version and return a strict PageResourceArtifact.",status:"implemented",request_body_schema:"InstallDesignerPageBodySchema",response_schema:"InstallDesignerPageResponseSchema",notes:["The server validates the explicit resource type, immutable package identity, page selections, materializations, and package-local references."]},{method:"GET",path:"/sites/:site_id/designer/pages",tag:"designer-page-library",summary:"List designer pages from the stable first-phase fixture source.",status:"implemented",response_schema:"ListDesignerSitePagesResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-resources/enhance",tag:"designer-page-library",summary:"Echo a designer page-resource candidate without model execution or normalization.",status:"implemented",request_body_schema:"EnhanceDesignerPageResourceBodySchema",response_schema:"EnhanceDesignerPageResourceResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-resources/compose",tag:"designer-page-library",summary:"Compose exact page and component resources into one strict page artifact.",status:"implemented",request_body_schema:"ComposeDesignerPageResourceBodySchema",response_schema:"InstallDesignerPageResponseSchema",notes:["The server installs every immutable source, validates ordered page blocks, scopes component materializations, and returns one artifact without exposing resource-platform credentials."]},{method:"POST",path:"/sites/:site_id/designer/page-resources/blank",tag:"designer-page-library",summary:"Create the deterministic built-in blank page artifact for one configured route.",status:"implemented",request_body_schema:"InstallDesignerPageBodySchema",response_schema:"InstallDesignerPageResponseSchema"},{method:"PATCH",path:"/sites/:site_id",tag:"sites",summary:"Update site display name and optional generated-site locale for the current tenant.",status:"implemented",request_body_schema:"UpdateSiteRequestSchema",response_schema:"SiteRecordSchema"},{method:"DELETE",path:"/sites/:site_id",tag:"sites",summary:"Archive a site so it no longer appears in the tenant site list.",status:"implemented",response_schema:"SiteRecordSchema"},{method:"GET",path:"/sites/:site_id/workspace/source-files",tag:"sites",summary:"List source files available in the ready preview sandbox.",status:"implemented",response_schema:"WorkspaceSourceFileListItemSchema[]"},{method:"GET",path:"/sites/:site_id/workspace/source-file",tag:"sites",summary:"Read a source file from the ready preview sandbox.",status:"implemented",query_schema:"WorkspaceSourceFilePathQuerySchema",response_schema:"WorkspaceSourceFileResponseSchema"},{method:"GET",path:"/sites/:site_id/media-assets",tag:"media-assets",summary:"List or search enterprise image assets through the CMS adapter.",status:"implemented",query_schema:"ListMediaLibraryAssetsQuerySchema",response_schema:"ListMediaLibraryAssetsResponseSchema"},{method:"POST",path:"/sites/:site_id/media-assets",tag:"media-assets",summary:"Upload one validated image and create its enterprise asset.",status:"implemented",response_schema:"UploadMediaLibraryAssetResponseSchema",notes:["Accepts one multipart field named file; only the image MIME allowlist is accepted and the maximum size is 20 MiB."]},{method:"GET",path:"/sites/:site_id/media-assets/unsplash/search",tag:"media-assets",summary:"Search Unsplash through the VCP server-side client.",status:"implemented",query_schema:"SearchUnsplashMediaQuerySchema",response_schema:"SearchUnsplashMediaResponseSchema",notes:["The browser never receives the Unsplash access key; CMS is not involved in search."]},{method:"POST",path:"/sites/:site_id/media-assets/unsplash/:provider_id/use",tag:"media-assets",summary:"Best-effort report that an Unsplash image was selected.",status:"implemented",request_body_schema:"UseUnsplashMediaRequestSchema",response_schema:"UseUnsplashMediaResponseSchema",notes:["CMS report failure returns reported=false and does not roll back the image replacement."]},{method:"POST",path:"/sites/:site_id/sitemap",tag:"sitemaps",summary:"Confirm the currently reviewed Sitemap Draft and advance the site to structure_saved.",status:"implemented",request_body_schema:"ConfirmSiteStructureRequestSchema",response_schema:"PersistSiteSitemapDraftResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/sitemap-draft",tag:"sitemaps",summary:"Persist an agent-generated sitemap draft without confirming the structure.",status:"implemented",request_body_schema:"PersistGeneratedSitemapDraftRequestSchema",response_schema:"PersistGeneratedSitemapDraftResponseSchema"},{method:"GET",path:"/sites/:site_id/sitemap",tag:"sitemaps",summary:"Read the current Sitemap Draft for a site.",status:"implemented",response_schema:"SitemapDraftRecordSchema"},{method:"POST",path:"/sites/:site_id/clarify/answers",tag:"clarify",summary:"Persist the Step 2 clarify answers (and the answered questions) into the site's clarify session.",status:"implemented",request_body_schema:"PersistClarifyAnswersRequestSchema",response_schema:"PersistClarifyAnswersResponseSchema"},{method:"PATCH",path:"/sites/:site_id/clarify/archetype",tag:"clarify",summary:"Switch the Step 2 industry archetype (user_picked) into the site's clarify session via an idempotent upsert.",status:"implemented",request_body_schema:"UpdateClarifyArchetypeRequestSchema",response_schema:"PersistClarifyAnswersResponseSchema",notes:["Independent of generate: materializes a clarify_sessions row when none exists (using the supplied questions) or updates only selected_archetype; never writes answers/completed_at. Forces source=user_picked."]},{method:"POST",path:"/internal/sites/:site_id/design-plan",tag:"design-plans",summary:"Persist a generated design plan version for a site (internal agent-only write).",status:"implemented",request_body_schema:"PersistSiteDesignPlanRequestSchema",response_schema:"PersistSiteDesignPlanResponseSchema",notes:["Guarded by the internal agent token; only the Workspace/Sitemap agent writes design plans."]},{method:"GET",path:"/internal/sites/:site_id/design-plan",tag:"design-plans",summary:"Read the current (latest version) design plan for a site (internal agent-only read).",status:"implemented",response_schema:"DesignPlanRecordSchema",notes:["Guarded by the internal agent token; only the Workspace/Sitemap agent reads design plans."]},{method:"GET",path:"/sites/:site_id/design-plan",tag:"design-plans",summary:"Read the current (latest version) design plan for a site so Workspace UI can inspect the generated design contract.",status:"implemented",response_schema:"DesignPlanRecordSchema"},{method:"GET",path:"/sites/:site_id/brief",tag:"briefs",summary:"Read the persisted Step 1 brief for a site so the Workspace Agent can seed first full-site generation without a new write surface.",status:"implemented",response_schema:"BriefRecordSchema"},{method:"PUT",path:"/sites/:site_id/brief/draft",tag:"briefs",summary:"Save a draft site's Step 1 brief without advancing the workflow.",status:"implemented",request_body_schema:"SaveBriefDraftRequestSchema",response_schema:"SaveBriefDraftResponseSchema",notes:["Only sites in the editable build phase are writable; the brief row is upserted idempotently while site status, locale, and workflow stage remain unchanged."]},{method:"PATCH",path:"/sites/:site_id/brief",tag:"briefs",summary:"Create or update a draft site's Step 1 brief and advance it to Clarify without allowing later workflow states to roll back.",status:"implemented",request_body_schema:"UpdateBriefRequestSchema",response_schema:"UpdateBriefResponseSchema",notes:["Only sites in the editable build phase are writable; missing brief rows are created on first save; identical retries are idempotent."]},{method:"POST",path:"/internal/sites/:cms_site_id/external-sync",tag:"sites",summary:"Synchronize a trusted external CMS site URL into VCP by tenant_id + cms_site_id, creating a draft VCP site on first sync.",status:"implemented",request_body_schema:"ExternalSyncSiteRequestSchema",response_schema:"ExternalSyncSiteResponseSchema",notes:["This trusted external entry does not require browser login or internal bearer auth; tenant_id is written directly to tenants.id and the response uses the internal { code, data, message } success envelope."]},{method:"POST",path:"/internal/sites/:site_id/page-templates",tag:"page-templates",summary:"Create a private page template through the authenticated VCP internal service surface.",status:"implemented",request_body_schema:"PageTemplateCreateRequestSchema",response_schema:"PageTemplateCreateResponseSchema",notes:["Internal service endpoint; callers use the API bearer token plus trusted tenant/user headers. API delegates to Agent with its own AGENT_INTERNAL_TOKEN and never forwards caller Authorization."]},{method:"POST",path:"/internal/sites/:site_id/page-templates/promote",tag:"page-templates",summary:"Promote a private page template through the authenticated VCP internal service surface.",status:"implemented",request_body_schema:"PageTemplatePromoteRequestSchema",response_schema:"PageTemplatePromoteResponseSchema",notes:["Internal service endpoint; uses the same bearer + tenant/user context as create and delegates to Agent with API-owned credentials."]},{method:"POST",path:"/internal/sites/:site_id/page-templates/cleanup",tag:"page-templates",summary:"Clean up private page templates through the authenticated VCP internal service surface.",status:"implemented",request_body_schema:"PageTemplateCleanupRequestSchema",response_schema:"PageTemplateCleanupResponseSchema",notes:["Internal service endpoint; cleanup remains explicit and default-template protection is enforced by the Agent lifecycle service."]},{method:"POST",path:"/sites/:site_id/snapshots",tag:"snapshots",summary:"Persist snapshot metadata without changing the current site snapshot.",status:"implemented",request_body_schema:"PersistSiteSnapshotRequestSchema",response_schema:"PersistSiteSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/promote",tag:"snapshots",summary:"Promote a site snapshot as the current workspace version.",status:"implemented",request_body_schema:"PromoteSiteSnapshotRequestSchema",response_schema:"PromoteSiteSnapshotResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/lock/try-acquire",tag:"snapshots",summary:"Try to acquire the short-lived template-upgrade site lock.",status:"implemented",request_body_schema:"TryAcquireTemplateUpgradeLockRequestSchema",response_schema:"TryAcquireTemplateUpgradeLockResponseSchema",notes:["Internal agent-only endpoint; lock contention returns acquired=false instead of a user-facing conflict."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/lock/release",tag:"snapshots",summary:"Release the calling template-upgrade attempt's site lock.",status:"implemented",request_body_schema:"ReleaseTemplateUpgradeLockRequestSchema",response_schema:"ReleaseTemplateUpgradeLockResponseSchema",notes:["Internal agent-only endpoint; release is scoped by tenant, site, operation type, and owner."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/snapshots/:snapshot_id/promote",tag:"snapshots",summary:"CAS-promote a validated template-upgrade candidate and bind its accepted commit atomically.",status:"implemented",request_body_schema:"PromoteTemplateUpgradeSnapshotRequestSchema",response_schema:"PromoteTemplateUpgradeSnapshotResponseSchema",notes:["Internal agent-only endpoint; accepted_commit is never part of the public promote request or response."]},{method:"GET",path:"/internal/sites/:site_id/template-upgrade/state",tag:"snapshots",summary:"Inspect the projected tenant-scoped template-upgrade state without mutation.",status:"implemented",query_schema:"InspectTemplateUpgradeStateRequestSchema",response_schema:"InspectTemplateUpgradeStateResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and the repository path is read-only."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/prepare",tag:"snapshots",summary:"Prepare the tenant-scoped template-upgrade retry state for a target version.",status:"implemented",request_body_schema:"PrepareTemplateUpgradeStateRequestSchema",response_schema:"PrepareTemplateUpgradeStateResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and is never accepted in the request body."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/failure",tag:"snapshots",summary:"Record a finite validation failure for the prepared template-upgrade target.",status:"implemented",request_body_schema:"RecordTemplateUpgradeFailureRequestSchema",response_schema:"RecordTemplateUpgradeFailureResponseSchema",notes:["Internal agent-only endpoint; accepts a finite error code and never raw validation output."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/success",tag:"snapshots",summary:"Reset retry state after the prepared template-upgrade target succeeds.",status:"implemented",request_body_schema:"RecordTemplateUpgradeSuccessRequestSchema",response_schema:"RecordTemplateUpgradeSuccessResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and is never accepted in the request body."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/events",tag:"snapshots",summary:"Record one bounded template-upgrade observability event.",status:"implemented",request_body_schema:"RecordTemplateUpgradeEventRequestSchema",response_schema:"RecordTemplateUpgradeEventResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and the strict request excludes raw errors, source content, and file paths."]},{method:"GET",path:"/internal/template-upgrades/report",tag:"snapshots",summary:"Read tenant-scoped template-upgrade outcome, state, and duration aggregates.",status:"implemented",query_schema:"GetTemplateUpgradeReportQuerySchema",response_schema:"GetTemplateUpgradeReportResponseSchema",notes:["Internal endpoint; tenant identity is derived from trusted request context and all aggregates are tenant-scoped."]},{method:"GET",path:"/internal/template-upgrades/snapshot-deletions/pending",tag:"snapshots",summary:"List tenant-scoped stale template-upgrade snapshot deletions for dry-run or reconciliation.",status:"implemented",query_schema:"ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema",response_schema:"ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema",notes:["Defaults to retrying deleting tombstones. Including candidate snapshots is an explicit maintenance action and should use a conservative age threshold."]},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/abandon",tag:"snapshots",summary:"Mark an unpromoted candidate snapshot as failed.",status:"implemented",response_schema:"AbandonSiteSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/snapshots/:snapshot_id",tag:"snapshots",summary:"Read one tenant-scoped snapshot metadata record for a site.",status:"implemented",response_schema:"SnapshotRecordSchema"},{method:"DELETE",path:"/sites/:site_id/snapshots/:snapshot_id",tag:"snapshots",summary:"Prepare two-phase deletion of a candidate snapshot and return its object key; refuses non-candidate/current/referenced snapshots.",status:"implemented",response_schema:"DeleteSiteSnapshotResponseSchema",notes:["Internal Agent authentication is required. This endpoint only creates a deleting tombstone; object removal and completion are separate steps."]},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/deletion/complete",tag:"snapshots",summary:"Complete deletion after the snapshot object has been removed; only accepts deleting snapshots.",status:"implemented",response_schema:"CompleteSiteSnapshotDeletionResponseSchema",notes:["Internal Agent authentication is required; callers must remove the object before completing the DB deletion."]},{method:"POST",path:"/agent-runs",tag:"agent-runs",summary:"Create an agent run for event persistence and replay.",status:"implemented",request_body_schema:"CreateAgentRunRequestSchema",response_schema:"CreateAgentRunResponseSchema"},{method:"POST",path:"/agent-runs/:run_id/events",tag:"agent-runs",summary:"Append one normalized AgentEvent to a run.",status:"implemented",request_body_schema:"AppendAgentEventRequestSchema",response_schema:"AppendAgentEventResponseSchema",notes:["Internal-only write surface: only internal-service callers may append, except browser (oidc) contexts may append run.failed (the WS connect-stage unlock path, equivalent to POST /agent-runs/workspace/cancel). All other oidc appends \u2014 run.finished, run.started, tool/system/progress, file/snapshot \u2014 are rejected with 403 FORBIDDEN. The browser sends user messages over the Workspace WebSocket (recorded server-side as user.message) and otherwise only reads the GET replay."]},{method:"GET",path:"/agent-runs/:run_id/events",tag:"agent-runs",summary:"Replay AgentEvents after a run-local sequence cursor.",status:"implemented",response_schema:"ListAgentEventsResponseSchema"},{method:"POST",path:"/internal/agent-runs/fail-stale-in-flight",tag:"agent-runs",summary:"Fail stale in-flight workspace runs (internal maintenance, cross-tenant sweep).",status:"implemented",response_schema:"FailStaleInFlightWorkspaceRunsResponseSchema",notes:["Internal maintenance endpoint guarded by InternalAgentAuthGuard (Bearer VCP_AGENT_INTERNAL_TOKEN, production fail-closed); the /internal/** prefix is exempt from browser auth middleware so the guard is the sole trust boundary. Not exposed to the browser via agent-proxy; called by an external admin cron / controlled ops script."]},{method:"GET",path:"/deployments",tag:"deployments",summary:"Deployment resource summary endpoint until publish APIs land.",status:"skeleton"},{method:"POST",path:"/sites/:site_id/workspace/runs",tag:"workspace",summary:"Start an asynchronous Workspace Agent run from the current snapshot.",status:"implemented",request_body_schema:"StartWorkspaceRunRequestSchema",response_schema:"StartWorkspaceRunResponseSchema",notes:["Long-running work must be event-driven and must not block API transactions."]},{method:"POST",path:"/sites/:site_id/workspace/attachments",tag:"workspace",summary:"Upload a chat image attachment for the Workspace conversation.",status:"implemented",response_schema:"WorkspaceAttachmentSchema",notes:["multipart/form-data with a single `file`; the response `image_url` is referenced by a `file` part of the next client message."]},{method:"GET",path:"/sites/:site_id/workspace/attachments/:attachment_id/image",tag:"workspace",summary:"Read the bytes of a chat image attachment (owner thumbnails and replay).",status:"implemented"},{method:"DELETE",path:"/sites/:site_id/workspace/attachments/:attachment_id",tag:"workspace",summary:"Delete an unsent chat image attachment.",status:"implemented",notes:["Attachments already sent with a message return 409 WORKSPACE_ATTACHMENT_BOUND."]},{method:"GET",path:"/internal/workspace-attachments/:site_id/:attachment_id",tag:"workspace",summary:"Internal side-channel for the Workspace Agent to read a chat image attachment.",status:"implemented"},{method:"GET",path:"/sites/:site_id/threads",tag:"workspace",summary:"List a site's named Agent threads (workspace conversations).",status:"implemented",response_schema:"SiteThreadListResponseSchema",notes:["The browser can only list threads that belong to the current site."]},{method:"POST",path:"/sites/:site_id/threads",tag:"workspace",summary:"Create a new named Agent thread for a site.",status:"implemented",request_body_schema:"CreateSiteThreadRequestSchema",response_schema:"SiteThreadResponseSchema",notes:["The created thread is scoped to the current site; the browser cannot create a thread for another site."]},{method:"PATCH",path:"/sites/:site_id/threads/:thread_id",tag:"workspace",summary:"Rename or archive an Agent thread.",status:"implemented",request_body_schema:"UpdateSiteThreadRequestSchema",response_schema:"SiteThreadResponseSchema",notes:["The server verifies the thread belongs to the current site and tenant before applying the update."]},{method:"GET",path:"/sites/:site_id/workspace/runs/active",tag:"workspace",summary:"Look up the site's current in-flight Workspace Agent run across all threads.",status:"implemented",response_schema:"ActiveWorkspaceRunResponseSchema",notes:["Scoped to the current site regardless of thread; the browser cannot query another site's active run."]},{method:"POST",path:"/v1/agent/workspace/:site_id/form-design-operations",tag:"agent/workspace",summary:"Create or replay a deterministic FORM_SPEC save operation.",status:"implemented",request_body_schema:"FormDesignSaveRequestSchema",response_schema:"FormDesignOperationResponseSchema"},{method:"GET",path:"/v1/agent/workspace/:site_id/form-design-operations/:operation_id",tag:"agent/workspace",summary:"Read a persisted FORM_SPEC save operation.",status:"implemented",response_schema:"FormDesignOperationResponseSchema"},{method:"POST",path:"/v1/agent/workspace/:site_id/form-design-operations/:operation_id/resume",tag:"agent/workspace",summary:"Resume a recoverable FORM_SPEC save with its original fingerprint.",status:"implemented",request_body_schema:"FormDesignResumeRequestSchema",response_schema:"FormDesignOperationResponseSchema"},{method:"GET",path:"/sites/:site_id/workspace/runs/latest",tag:"workspace",summary:"Look up the latest workspace Agent run for a site so Step 4 re-entry can replay persisted events without re-triggering the model.",status:"implemented",response_schema:"LatestWorkspaceRunResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/preview-sessions",tag:"sandbox-sessions",summary:"Persist or update an Agent-owned on-demand preview session; optional current/ready-session guards support current-snapshot CAS and guarded in-place snapshot advance.",status:"implemented",request_body_schema:"PersistPreviewSessionRequestSchema",response_schema:"PersistPreviewSessionResponseSchema"},{method:"GET",path:"/sites/:site_id/preview-sessions/current",tag:"sandbox-sessions",summary:"Read the latest tenant-scoped preview session for a site.",status:"implemented",response_schema:"SandboxSessionSchema"},{method:"POST",path:"/sites/:site_id/preview/activate",tag:"site-preview",summary:"Activate the existing preview sandbox for a site.",status:"implemented",response_schema:"SitePreviewActivateResponseSchema"},{method:"POST",path:"/v1/agent/site-preview/:site_id/activate",tag:"agent/site-preview",summary:"Activate the existing preview sandbox for a site through Agent.",status:"implemented",response_schema:"SitePreviewActivateResponseSchema"},{method:"POST",path:"/sites/:site_id/deployments",tag:"deployments",summary:"Queue an explicit user-confirmed publish from the latest current snapshot.",status:"implemented",request_body_schema:"CreateDeploymentRequestSchema",response_schema:"CreateDeploymentResponseSchema",notes:["The server resolves the latest current snapshot and validates site and snapshot existence, in-flight deployment state, and site operation lock before creating the deployment record and queue job.","The API returns after creating the deployment record and queue job; worker-service claims deployment_jobs for build and Cloudflare publish."]},{method:"POST",path:"/sites/:site_id/deployments/quality-check",tag:"deployments",summary:"Queue a quality-check deployment from a snapshot.",status:"implemented",request_body_schema:"CreateQualityCheckDeploymentRequestSchema",response_schema:"CreateDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/quality-check/status",tag:"deployments",summary:"Read the latest quality-check deployment status.",status:"implemented",response_schema:"GetDeploymentsStatusResponseSchema"},{method:"POST",path:"/internal/site-deployments/quality-check",tag:"deployments",summary:"Queue a quality-check deployment for the current site through the internal Agent API.",status:"implemented",response_schema:"InternalCreateDeploymentResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id.","POST accepts no request body; VCP resolves the current snapshot. Quality-check and publish deployments are independent."]},{method:"GET",path:"/internal/site-deployments/quality-check/status",tag:"deployments",summary:"Read the latest internal quality-check deployment status for the current site.",status:"implemented",response_schema:"InternalGetDeploymentsStatusResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id."]},{method:"POST",path:"/internal/site-deployments/publish",tag:"deployments",summary:"Queue a publish deployment for the current site through the internal Agent API.",status:"implemented",response_schema:"InternalCreateDeploymentResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id.","POST accepts no request body; VCP resolves the latest current snapshot. Quality-check and publish deployments are independent."]},{method:"GET",path:"/internal/site-deployments/publish/status",tag:"deployments",summary:"Read the latest internal publish deployment status for the current site.",status:"implemented",response_schema:"InternalGetDeploymentsStatusResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id."]},{method:"GET",path:"/sites/:site_id/deployments/current",tag:"deployments",summary:"Read the latest deployment for workspace refresh recovery.",status:"implemented",response_schema:"CurrentDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/status",tag:"deployments",summary:"Read current in-flight deployment and latest released deployment.",status:"implemented",response_schema:"GetDeploymentsStatusResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/:deployment_id",tag:"deployments",summary:"Read one tenant-scoped deployment for status polling.",status:"implemented",response_schema:"GetDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/cms/collections",tag:"cms",summary:"List CMS collections for a site.",status:"planned"},{method:"POST",path:"/sites/:site_id/cms/collections",tag:"cms",summary:"Create a CMS collection bound to generated content.",status:"planned"},{method:"GET",path:"/sites/:site_id/cms/collections/:collection_id/entries",tag:"cms",summary:"List CMS entries for a collection.",status:"planned"},{method:"POST",path:"/sites/:site_id/cms/collections/:collection_id/entries",tag:"cms",summary:"Create a CMS entry.",status:"planned"},{method:"PATCH",path:"/sites/:site_id/cms/collections/:collection_id/entries/:entry_id",tag:"cms",summary:"Update a CMS entry.",status:"planned"},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/version-record",tag:"versions",summary:"Record the sandbox accepted git commit for a promoted snapshot version.",status:"implemented",request_body_schema:"RecordSnapshotVersionRequestSchema",response_schema:"RecordSnapshotVersionResponseSchema"},{method:"GET",path:"/sites/:site_id/versions",tag:"versions",summary:"List snapshot-backed site versions.",status:"implemented",response_schema:"ListSiteVersionsResponseSchema"},{method:"POST",path:"/sites/:site_id/versions/:snapshot_id/restore",tag:"versions",summary:"Restore a site to an earlier snapshot version.",status:"implemented",response_schema:"RestoreSiteSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/domains/configuration",tag:"custom-domains",summary:"Read the authoritative site domain configuration.",status:"implemented",response_schema:"GetSiteDomainConfigurationResponseSchema"},{method:"GET",path:"/internal/sites/:site_id/active-domain",tag:"internal/active-domain",summary:"Read whether an internal site has an active primary domain.",status:"implemented",response_schema:"GetActiveSiteDomainResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/check",tag:"publish-workflow",summary:"Check a publish workflow domain and start its operation.",status:"implemented",request_body_schema:"CheckSitePublishDomainRequestSchema",response_schema:"CheckSitePublishDomainResponseSchema"},{method:"GET",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/operation",tag:"publish-workflow",summary:"Read the current publish workflow domain operation.",status:"implemented",response_schema:"GetSitePublishDomainOperationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/operation/reconcile",tag:"publish-workflow",summary:"Recover or reconcile the current publish workflow domain operation.",status:"implemented",response_schema:"ReconcileSitePublishDomainOperationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/remediation/confirm",tag:"publish-workflow",summary:"Confirm the current DNS remediation plan.",status:"implemented",request_body_schema:"ConfirmSitePublishDomainRemediationRequestSchema",response_schema:"ConfirmSitePublishDomainRemediationResponseSchema"},{method:"POST",path:"/sites/:site_id/integrations/gsc/auth/start",tag:"gsc",summary:"Start Google Search Console authorization for a site.",status:"implemented",request_body_schema:"StartGscAuthRequestSchema",response_schema:"StartGscAuthResponseSchema"},{method:"GET",path:"/sites/:site_id/integrations/gsc/status",tag:"gsc",summary:"Read Google Search Console authorization and property status.",status:"implemented",response_schema:"GscStatusResponseSchema"},{method:"GET",path:"/admin/tenants",tag:"admin",summary:"Admin tenant listing.",status:"planned"},{method:"GET",path:"/usage/summary",tag:"usage",summary:"Summarize tenant usage and cost controls.",status:"planned"},{method:"GET",path:"/sites/:site_id/publish-workflow/active",tag:"publish-workflow",summary:"Read the active site publish workflow.",status:"implemented",response_schema:"SitePublishWorkflowActiveResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/start",tag:"publish-workflow",summary:"Start or recover the site publish workflow.",status:"implemented",request_body_schema:"StartSitePublishWorkflowRequestSchema",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/repair-task",tag:"publish-workflow",summary:"Idempotently create the publish repair task.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"GET",path:"/sites/:site_id/publish-workflow/:workflow_id",tag:"publish-workflow",summary:"Read and reconcile a site publish workflow quality task.",status:"implemented",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"PATCH",path:"/sites/:site_id/publish-workflow/:workflow_id/step",tag:"publish-workflow",summary:"Move the site publish workflow to an allowed step.",status:"implemented",request_body_schema:"UpdateSitePublishWorkflowStepRequestSchema",response_schema:"SitePublishWorkflowMutationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/cancel",tag:"publish-workflow",summary:"Cancel a stable site publish workflow.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowMutationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/publish",tag:"publish-workflow",summary:"Start formal publishing for a site publish workflow.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowPublishResponseSchema"}],YO=[{method:"POST",path:"/v1/agent/clarify/:site_id",tag:"clarify",summary:"Stream Step 2 clarify questions as SSE; event_order includes optional skill.selecting, skill.selected, clarify.archetype_proposals, and run.failed on errors.",status:"implemented",request_body_schema:"ClarifyRunInputSchema without tenant_id/site_id",event_schema:"ClarifyStreamEventSchema",event_order:["run.started","skill.selecting","skill.selected","clarify.partial","clarify.archetype_proposals","clarify.finished","run.failed"]},{method:"POST",path:"/v1/agent/sitemap/:site_id",tag:"sitemap",summary:"Stream Step 3 sitemap generation as SSE; event_order includes sitemap.partial and run.failed on errors.",status:"implemented",request_body_schema:"Step5SitemapStartRequestSchema (browser marker only; API injects committed Step5 strategy)",event_schema:"SitemapStreamEventSchema",event_order:["run.started","sitemap.generating","sitemap.partial","sitemap.generated","sitemap.clamped","run.failed"]}],Xx=t.object({id:t.string().min(1),role:t.enum(["system","user","assistant"]),metadata:t.unknown().optional(),parts:t.array(Pi).min(1)}),Il=Xx.extend({role:t.literal("user")}).superRefine((e,n)=>{let i=0;for(let[s,a]of e.parts.entries()){if(a.type!=="file")continue;i+=1;let r=a;xs.safeParse(r.mediaType).success||n.addIssue({code:"custom",path:["parts",s,"mediaType"],message:"Attachment mediaType must be image/png, image/jpeg or image/webp"}),(typeof r.url!="string"||Es(r.url)===null)&&n.addIssue({code:"custom",path:["parts",s,"url"],message:"Attachment url must be a workspace attachment image path"})}i>ys&&n.addIssue({code:"custom",path:["parts"],message:`A message may carry at most ${ys} attachments`})}),XO=t.object({base_snapshot_id:T.optional(),message:Il.optional(),thread_id:Ke.optional(),client_run_key:t.string().min(1).max(200).optional()}).superRefine((e,n)=>{Pn(e.message)&&n.addIssue({code:"custom",path:["message"],message:"Workspace startup message must not contain secrets",params:{errorCode:"WORKSPACE_MESSAGE_CONTAINS_SECRET"}})}),Qx=t.object({path:t.string().regex(/^\/v1\/workspace\/sites\/[^/]+\/socket$/),run_id:H,base_snapshot_id:T,run_kind:Di}),QO=t.object({agent_run:Ye,websocket:Qx,next_step:t.literal("workspace_socket")}),ZO=t.object({agent_run:Ye}),JO=t.object({thread_id:Ke.optional()}),eN=t.object({agent_run:Ye.nullable(),thread:vi.nullable()}),tN=t.object({status:Qm.default("active")}),nN=t.object({threads:t.array(vi)}),iN=t.object({title:t.string().trim().min(1).max(200)}).strict(),sN=t.object({title:t.string().trim().min(1).max(200).optional(),status:t.literal("archived").optional()}).strict().refine(e=>e.title!==void 0||e.status!==void 0,{message:"title or status is required"}),aN=t.object({thread:vi}),oN=t.object({agent_type:t.enum(["clarify","sitemap","workspace"]),thread_id:Ke.optional()}),rN=t.object({agent_run:Ye}),cN=t.enum(["client.message.create","client.resource.operation.create","client.run.cancel","client.tool.approve","server.run.started","server.user.message","server.assistant.delta","server.tool.started","server.tool.completed","server.workspace.suggestions","workspace.plan.created","workspace.worker.updated","workspace.task.updated","server.patch.applied","server.sitemap.updated","server.snapshot.created","server.snapshot.finalized","server.preview.invalidated","preview.build.started","preview.build.succeeded","preview.build.failed","server.run.finished","server.run.failed","server.error","server.activity.started","server.activity.updated","server.activity.finished","server.activity.failed"]),te=t.object({id:t.string().min(1),tenant_id:t.string().min(1),site_id:R,run_id:H.optional(),correlation_id:t.string().min(1).optional(),seq:t.number().int().positive().optional(),sent_at:t.string().min(1)}),Zx=t.object({key:t.string().min(1),label:t.string().min(1),source_file:t.string().min(1).optional(),component_name:t.string().min(1).optional(),opening_element_range:t.object({start_line:t.number().int().positive(),start_column:t.number().int().nonnegative(),end_line:t.number().int().positive(),end_column:t.number().int().nonnegative()}).optional(),structural_path:t.string().min(1).optional(),text_preview:t.string().min(1).optional()}),Jx=t.discriminatedUnion("type",[te.extend({type:t.literal("client.message.create"),payload:t.object({client_message_id:t.string().min(1),in_reply_to_tool_call_id:t.string().min(1).optional(),current_route_id:pn.optional(),interaction_response:Xn.optional(),selected_component:Zx.optional(),message:Il,base_snapshot_id:T.optional()}).superRefine((e,n)=>{e.interaction_response&&!e.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"})})}),te.extend({type:t.literal("client.run.cancel"),payload:t.object({run_id:H,reason:t.string().min(1).optional()})}),te.extend({type:t.literal("client.tool.approve"),payload:t.object({tool_call_id:t.string().min(1),decision:t.enum(["approve","reject"]),reason:t.string().min(1).optional()})}),fr]),eE=t.discriminatedUnion("type",[te.extend({type:t.literal("server.run.started"),payload:t.object({run_id:H,agent_type:t.literal("workspace")})}),te.extend({type:t.literal("server.user.message"),payload:t.object({client_message_id:t.string().min(1),message_id:t.string().min(1),parts:t.array(Pi).min(1),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:Xn.optional()})}),te.extend({type:t.literal("server.assistant.delta"),payload:t.object({message_id:t.string().min(1),parts:t.array(Pi).min(1),status:t.enum(["streaming","ready"])})}),te.extend({type:t.literal("server.tool.started"),payload:t.object({tool_call_id:t.string().min(1),name:t.string().min(1),summary:t.string().min(1)})}),te.extend({type:t.literal("server.tool.completed"),payload:t.object({tool_call_id:t.string().min(1),name:t.string().min(1),result_summary:t.string().min(1),interaction_request:bs.optional()})}),te.extend({type:t.literal("server.workspace.suggestions"),payload:fl.extend({run_id:H}).strict()}),te.extend({type:t.literal("workspace.plan.created"),payload:t.object({plan_id:t.string().min(1),run_kind:Di,groups:t.array(Da),tasks:t.array(ja),dependencies:t.array(Oa),expected_outputs:t.array(xe),diagnostics:Ca,summary:yl})}),te.extend({type:t.literal("workspace.worker.updated"),payload:t.object({group_id:t.string().min(1),phase:Pa,status:Pt,task_counts:xl,target_paths:t.array(xe),diagnostics:t.array(t.string().min(1))})}),te.extend({type:t.literal("workspace.task.updated"),payload:t.object({task_id:t.string().min(1),group_id:t.string().min(1),status:Pt,target_path:xe,read_files_count:t.number().int().nonnegative(),diagnostics:t.array(t.string().min(1)),diagnostic_details:t.array(va).optional()})}),te.extend({type:t.literal("server.patch.applied"),payload:t.object({patch_batch_id:t.string().min(1),changed_files:t.array(t.string().min(1)),sitemap_resync_queued:t.boolean()})}),te.extend({type:t.literal("server.sitemap.updated"),payload:t.object({sitemap_id:Ce,version:t.number().int().positive(),reason:t.string().min(1)})}),te.extend({type:t.literal("server.snapshot.created"),payload:t.object({snapshot_id:T,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/)})}),te.extend({type:t.literal("server.snapshot.finalized"),payload:t.object({snapshot_id:T})}),te.extend({type:t.literal("server.preview.invalidated"),payload:t.object({reason:t.string().min(1),next_preview_url:t.string().url().optional(),launch_id:t.string().min(1).optional()})}),te.extend({type:t.literal("preview.build.started"),payload:t.object({snapshot_id:T})}),te.extend({type:t.literal("preview.build.succeeded"),payload:t.object({snapshot_id:T})}),te.extend({type:t.literal("preview.build.failed"),payload:t.object({snapshot_id:T,message:t.string().min(1),diagnostics:t.string().min(1),retryable:t.boolean()})}),te.extend({type:t.literal("server.run.finished"),payload:t.object({run_id:H,snapshot_id:T,degraded_reason:Qt.optional(),build_verified:t.boolean().optional()})}),te.extend({type:t.literal("server.run.failed"),payload:t.object({run_id:H,error_code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),outcome:t.literal("retained_previous").optional(),details:t.record(t.string(),t.unknown()).optional()})}),te.extend({type:t.literal("server.error"),payload:t.object({code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})}),te.extend({type:t.literal("server.activity.started"),payload:t.object({activity_id:t.string().min(1),parent_activity_id:t.string().min(1).optional(),kind:tl,title:t.string().min(1).max(200),title_code:ft.optional(),detail:t.string().max(360).optional(),detail_code:ft.optional(),locks_input:t.boolean()})}),te.extend({type:t.literal("server.activity.updated"),payload:t.object({activity_id:t.string().min(1),title:t.string().min(1).max(200).optional(),title_code:ft.optional(),detail:t.string().max(360).optional(),detail_code:ft.optional()})}),te.extend({type:t.literal("server.activity.finished"),payload:t.object({activity_id:t.string().min(1)})}),te.extend({type:t.literal("server.activity.failed"),payload:t.object({activity_id:t.string().min(1),detail:t.string().max(360).optional()})})]),tE=eE.superRefine((e,n)=>{if(e.type==="server.user.message"&&e.payload.interaction_response&&!e.payload.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["payload","in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"}),e.type!=="server.tool.completed")return;let i=e.payload.name==="prepare_product_search_entry";i!==!!e.payload.interaction_request&&n.addIssue({code:"custom",path:["payload","interaction_request"],message:i?"prepare_product_search_entry requires interaction_request":"interaction_request is only valid for prepare_product_search_entry"})}),mN=t.union([Jx,tE]),lN={path:"/v1/workspace/sites/:site_id/socket",protocol:"ws",status:"implemented",inbound_message_schema:"WorkspaceClientMessageSchema",outbound_message_schema:"WorkspaceServerMessageSchema",query_parameters:[{name:"run_id",required:!1,schema:"string",summary:"Workspace run id returned by the API run-start response."},{name:"run_kind",required:!1,schema:"WorkspaceRunKindSchema",summary:"Workspace run mode; initial_generation can auto-start when base_snapshot_id is present."},{name:"base_snapshot_id",required:!1,schema:"string",summary:"Authoritative base snapshot id for this workspace run."},{name:"unattended",required:!1,schema:'"1"',summary:"Unattended mode for machine-driven runs: interactive tools are withheld so the run cannot stall waiting for a human answer. Server-to-server only; the browser proxy strips it."}],ai_sdk_ui_compatible:!0,notes:["Assistant UI output is carried as AI SDK UIMessage parts, including text, data-*, and tool-* parts.","Operational AgentEvents remain persisted separately for replay and audit."]},Rl=t.string().regex(/^sha256:[a-f0-9]{64}$/),nE=t.enum(["create","update","delete","str_replace"]),Tl=t.enum(["sitemap_resync","smoke_test","prepare_preview"]),iE=t.object({old_string:t.string().min(1).describe("Exact text to find in the current file. Must match the file uniquely; include enough surrounding context (usually 2-4 adjacent lines)."),new_string:t.string().describe("Replacement text. May be empty to delete the matched text."),replace_all:t.boolean().optional()}).strict(),sE=t.object({path:xe,operation:nE,expected_hash:Rl.optional(),full_content:t.string().describe("Complete file content for create/update patches. Only this single field is a string value: every double quote inside the source code must be escaped so the field stays valid JSON. Avoid ASCII double quotes inside JSX attribute values and use corner quotes like \u300C\u751F\u65E5\u5FEB\u4E50\u300D for visitor-facing quoted examples. The surrounding patch object and the patches array are ordinary JSON structures, not strings.").optional(),edits:t.array(iE).min(1).max(20).optional()}).strict().superRefine((e,n)=>{let i=e.full_content!==void 0;if(e.operation==="delete"){i&&n.addIssue({code:"custom",path:["full_content"],message:"delete patches must not include full_content"}),e.edits!==void 0&&n.addIssue({code:"custom",path:["edits"],message:"edits is only allowed for str_replace patches"});return}if(hE(e.path)||n.addIssue({code:"custom",path:["path"],message:"Static App Router page paths must use lowercase ASCII kebab-case public segments."}),e.operation==="str_replace"){e.full_content!==void 0&&n.addIssue({code:"custom",path:["full_content"],message:"str_replace patches must not include full_content"}),(!e.edits||e.edits.length===0)&&n.addIssue({code:"custom",path:["edits"],message:"str_replace patches must include a non-empty edits array"});return}i||n.addIssue({code:"custom",path:["full_content"],message:"create/update patches must include full_content"}),e.edits!==void 0&&n.addIssue({code:"custom",path:["edits"],message:"edits is only allowed for str_replace patches"})}),aE=t.object({kind:t.enum(["block","page","site","chrome"]),id:t.string().min(1).max(120)}),oE=t.object({base_key:t.string().min(1).max(120).regex(/^[A-Za-z0-9._:-]+$/).refine(e=>!e.includes(".."),{message:"base_key must not contain '..'"}),owner:aE,count:t.number().int().min(1).max(12),query:t.string().min(1).max(400),role:t.enum(["hero","section","card","gallery","testimonial","decorative","site_background","nav_background","footer_background"]),orientation:t.enum(["landscape","portrait","square"]).optional(),altHint:t.string().min(1).max(300)}),kl=t.object({site_id:R,base_snapshot_id:T,reason:t.string().min(1),patches:t.array(sE).min(1).describe("A real JSON array of patch objects. Never JSON.stringify this array, and never put an encoded JSON array inside a string \u2014 emit the array itself. Only full_content within a patch object is a string field."),media_requests:t.array(oE).max(24).optional(),post_actions:t.array(Tl).optional()});function Al(e,n){let i=new Set;for(let[s,a]of e.patches.entries())i.has(a.path)&&n.addIssue({code:"custom",path:["patches",s,"path"],message:`Duplicate patch path: ${a.path}`}),i.add(a.path)}var pN=kl.superRefine(Al),dN=kl.omit({base_snapshot_id:!0}).extend({site_id:R.optional()}).superRefine(Al),rE=_e,cE=t.object({path:rE,operation:t.enum(["upsert","delete"]).optional()}),wl=t.enum(["sync_cms_pages","sync_cms_navigation"]),uN=t.object({files:t.array(cE).min(1),post_actions:t.array(wl).optional()}).strict().overwrite(e=>e.post_actions?{...e,post_actions:[...new Set(e.post_actions)]}:e),mE=t.enum(["BASE_SNAPSHOT_NOT_FOUND","PATCH_TARGET_NOT_FOUND","PATCH_TARGET_ALREADY_EXISTS","PATCH_EXPECTED_HASH_MISMATCH","PATCH_DIFF_UNSUPPORTED","PATCH_PROTECTED_FILE","PATCH_VALIDATION_FAILED","PATCH_MEDIA_REFERENCE_NOT_DECLARED","PATCH_BATCH_INVALID","PATCH_BATCH_FAILED","PATCH_BATCH_TOO_LARGE","STR_REPLACE_NOT_FOUND","STR_REPLACE_NOT_UNIQUE","STR_REPLACE_BINARY_FILE","STR_REPLACE_REQUIRES_READ"]),lE=t.object({status:t.literal("applied"),patch_batch_id:t.string().min(1),site_id:R,base_snapshot_id:T,snapshot_id:T,manifest_hash:Rl,object_key:t.string().min(1),changed_files:t.array(xe).min(1),post_actions_queued:t.array(Tl),dropped_protected_files:t.array(t.string().min(1)).min(1).optional()}),pE=t.object({status:t.literal("failed"),code:mE,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),gN=t.discriminatedUnion("status",[lE,pE]),_N=t.object({ok:t.literal(!0),post_actions:t.array(t.object({action:wl,status:t.enum(["succeeded","failed"])}).strict()).default([])}),Pl=_e,dE=t.enum(["text","binary"]),vl=t.object({path:Pl,kind:dE,language:t.string().min(1).nullable(),size_bytes:t.number().int().nonnegative()}),hN=t.object({path:Pl}),uE=vl.extend({kind:t.literal("text"),language:t.string().min(1),content:t.string()}),gE=vl.extend({kind:t.literal("binary"),language:t.null(),mime_type:t.string().min(1),content_base64:t.string().min(1)}),SN=t.union([uE,gE]);function Pn(e){return typeof e=="string"?/authorization\s*:|bearer\s+|token\s*=|secret\s*=|api[_-]?key\s*=|access[_\s-]?key\s*=|\bsk-[a-z0-9_-]{20,}|eyJ[a-z0-9_-]{10,}\.[a-z0-9_-]{10,}\.[a-z0-9_-]{10,}/i.test(e):!e||typeof e!="object"?!1:Array.isArray(e)?e.some(n=>Pn(n)):Object.entries(e).some(([n,i])=>_E(n)||Pn(i))}function _E(e){let n=e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/\s+/g,"_").toLowerCase();return/(^|[_-])(authorization|token|secret|api[_-]?key|apikey|access[_-]?key|accesskey)([_-]|$)/.test(n)}function Cl(e){let n=e.split("/");return e.length>0&&!e.startsWith("/")&&!e.includes("\\")&&n.every(i=>i!==""&&i!=="."&&i!=="..")}function hE(e){if(/^(?:src\/)?app\/\.vcp\//.test(e))return Fa(e);let n=/^app\/(?:(.*)\/)?page\.(?:tsx|jsx)$/.exec(e);if(!n)return!0;let s=(n[1]??"").split("/").filter(r=>r.length>0);return s.some(r=>r.startsWith("_"))?!0:s.filter(r=>!r.startsWith("@")&&!/^\(.+\)$/.test(r)).map(r=>r.replace(/^\((?:\.|\.\.|\.\.\.)\)/,"")).filter(r=>r.length>0).every(r=>/^\[.*\]$/.test(r)||an.test(`/${r}`))}var Dl=t.enum(["idle","creating","restoring_snapshot","installing_dependencies","starting_preview","ready","active","stopping","stopped","failed"]),SE=t.object({id:vn,tenant_id:t.string().min(1),site_id:R,sandbox_id:t.string().min(1).nullable(),status:Dl,source_snapshot_id:T.nullable(),last_snapshot_id:T.nullable(),preview_url:t.string().url().nullable(),browser_preview_url:t.string().url().nullable().optional(),launch_id:t.string().min(1).nullable().optional(),last_activity_at:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),fN=t.object({session_id:vn.optional(),sandbox_id:t.string().min(1).optional(),source_snapshot_id:T.optional(),last_snapshot_id:T,expected_current_snapshot_id:T.optional(),expected_ready_session_id:vn.optional(),expected_ready_session_last_snapshot_id:T.optional(),status:Dl,preview_url:t.string().url().optional(),launch_id:t.string().min(1).optional()}),bN=t.object({preview_session:SE,next_step:t.literal("preview")}),yN=t.object({failed_count:t.number().int().nonnegative()}),xN=t.object({site_id:R}),EN=t.object({status:t.enum(["cancelled","no_active_run"]),agent_run:Ye.nullable()});export{xc as AESTHETIC_NOTE_MAX_LENGTH,cy as AI_IMAGE_GENERATION_ENTITLEMENT,wt as AI_IMAGE_GENERATION_MAX_QUANTITY,IS as APPLICATION_LIBRARY_ERROR_CODES,jj as AbandonSiteSnapshotResponseSchema,zb as ActiveSiteDomainDataSchema,eN as ActiveWorkspaceRunResponseSchema,tl as ActivityKindSchema,ft as ActivityTitleCodeSchema,Tk as AdvanceSiteWorkflowRequestSchema,Hm as AgentErrorCategorySchema,Ma as AgentEventIdSchema,fa as AgentEventRecordSchema,El as AgentEventSchema,bl as AgentEventTypeSchema,Ox as AgentMessageHistoryPurposeSchema,Xm as AgentModelRouteSchema,Nx as AgentPlanStepSchema,kj as AgentRunContextResponseSchema,H as AgentRunIdSchema,Ym as AgentRunKindSchema,Ye as AgentRunRecordSchema,wy as AgentRunStatusSchema,$m as AgentRunTypeSchema,Ke as AgentThreadIdSchema,Py as AgentThreadKindSchema,vy as AgentThreadOriginSchema,vi as AgentThreadRecordSchema,Qm as AgentThreadStatusSchema,my as AiImageGenerationPrecheckRequestSchema,ly as AiImageGenerationPrecheckResponseSchema,ha as AiImageGenerationQuotaSchema,Kx as AiSdkUiDataPartSchema,Bx as AiSdkUiErrorPartSchema,qx as AiSdkUiFilePartSchema,Pi as AiSdkUiMessagePartSchema,Xx as AiSdkUiMessageSchema,Ux as AiSdkUiReasoningPartSchema,Gx as AiSdkUiSourceDocumentPartSchema,Fx as AiSdkUiSourceUrlPartSchema,Wx as AiSdkUiStepStartPartSchema,Mx as AiSdkUiTextPartSchema,zx as AiSdkUiToolPartSchema,VO as ApiContractStatusSchema,Uy as ApiErrorEnvelopeSchema,M as ApiResponseSchema,GO as AppendAgentEventRequestSchema,KO as AppendAgentEventResponseSchema,AP as ApplicationCreateResponseSchema,wS as ApplicationLibraryApplicationSchema,wP as ApplicationLibraryApplicationsDataSchema,Ac as ApplicationLibraryErrorCodeSchema,vP as ApplicationLibraryErrorResponseSchema,PP as ApplicationLibraryTemplatesDataSchema,Pc as ApplicationTemplateCatalogDataSchema,RS as ApplicationTemplateCatalogItemSchema,ES as ApplicationTemplateConsumeDataSchema,kP as ApplicationTemplateCreateRequestSchema,kS as ApplicationTemplateCreateResponseSchema,TS as ApplicationTemplateCreatedApplicationSchema,di as ApplicationTemplateDigestSchema,SS as ApplicationTemplateFieldSchema,xS as ApplicationTemplateReferenceSchema,AS as ApplicationTemplateSourceSchema,ui as ApplicationTemplateStableKeySchema,$s as ApplicationTemplateV1Schema,mE as ApplyPatchBatchErrorCodeSchema,pE as ApplyPatchBatchFailureSchema,pN as ApplyPatchBatchInputSchema,sE as ApplyPatchBatchPatchSchema,Tl as ApplyPatchBatchPostActionSchema,gN as ApplyPatchBatchResultSchema,lE as ApplyPatchBatchSuccessSchema,dN as ApplyPatchBatchToolInputSchema,iE as ApplyPatchEditSchema,nE as ApplyPatchOperationSchema,Vm as ArchetypeProposalSchema,DE as AuditLogIdSchema,yE as AuthIdentityIdSchema,RE as AuthLoginCodeIdSchema,IE as AuthOidcStateIdSchema,xE as AuthSessionIdSchema,EE as AuthTokenIdSchema,TE as AuthWsTicketIdSchema,Pf as BINDING_STATUSES,nl as BlockGenerationContextSchema,pO as BlockMediaIntentSchema,ka as BlockSchema,g_ as BlockingSubsiteSchema,il as BrandingSchema,vt as BriefIdSchema,Ia as BriefRecordSchema,Ka as BusinessFactsSchema,uA as CHAT_COPY,dA as CLARIFICATION_COPY,ef as CMS_FORM_FIELD_TYPES,nc as CMS_MAIN_PRODUCTS_MAX_LENGTH,Sd as CMS_PAGE_DIRECTORY_MAX_DEPTH,hd as CMS_PAGE_DIRECTORY_MAX_NODES,vo as CMS_PAGE_URL_PATH_MAX_LENGTH,L1 as COMPONENT_I18N_FILE_SUFFIX,Jn as COMPONENT_I18N_NAMESPACE,Nl as CONVERSION_CTA_LABEL_MAX_LENGTH,Hf as CRAWLER_INTERNAL_ERROR_CODES,Qr as CURRENT_EDIT_ENGINE_VERSION,xN as CancelActiveWorkspaceRunRequestSchema,EN as CancelActiveWorkspaceRunResponseSchema,ym as CheckSitePublishDomainDataSchema,Nb as CheckSitePublishDomainRequestSchema,Lb as CheckSitePublishDomainResponseSchema,sl as ChromeDesignSchema,Qy as ChromeFooterDesignSchema,Xy as ChromeFooterShellSchema,$y as ChromeHeaderDesignSchema,Hy as ChromeHeaderShellSchema,Zy as ChromeMobileNavDesignSchema,ky as ClarifyQuestionOptionSchema,Ay as ClarifyQuestionSchema,Iy as ClarifyQuestionTypeSchema,xa as ClarifyQuestionsSchema,ej as ClarifyRunInputSchema,Na as ClarifySessionIdSchema,wx as ClarifySessionRecordSchema,tj as ClarifyStreamEventSchema,MP as CmsApplicationCoreInputSchema,UP as CmsApplicationCoreResultSchema,qP as CmsApplicationSeedInputSchema,FP as CmsApplicationSeedResultSchema,jE as CmsCollectionBindingIdSchema,jv as CmsCollectionBindingSchema,Fc as CmsFormSchemaProjectionSchema,ns as CmsManagedPageTypeSchema,yd as CmsPageDirectoryGroupSchema,Co as CmsPageDirectoryNodeSchema,wo as CmsPageDirectorySchema,is as CmsPageTypeSchema,Qe as CmsPageUrlPathSchema,no as CmsSiteIdSchema,Bf as CompanyInfoSchema,$v as CompanyInfoTaskCreateRequestSchema,Yv as CompanyInfoTaskCreateResponseSchema,Xv as CompanyInfoTaskResponseSchema,qw as CompleteCustomerMaterialsRequestSchema,Fw as CompleteDiagnosisRequestSchema,Nj as CompleteSiteSnapshotDeletionResponseSchema,kk as CompleteSiteWorkflowRequestSchema,Gw as CompleteStrategyRequestSchema,Uw as CompleteWebsiteScanRequestSchema,U1 as ComponentI18nResourcesSchema,sT as ComposeDesignerPageResourceBodySchema,Ub as ConfirmSitePublishDomainRemediationDataSchema,Mb as ConfirmSitePublishDomainRemediationRequestSchema,qb as ConfirmSitePublishDomainRemediationResponseSchema,PO as ConfirmSiteStructureRequestSchema,EP as ConnectDynamicCollectionInputSchema,BP as ConnectFormInputSchema,xt as ConversionHintsSchema,$f as CrawlerInternalErrorCodeSchema,Qv as CrawlerInternalErrorSchema,Kt as CrawlerTaskCodeSchema,qv as CrawlerTaskCreateRequestSchema,Kv as CrawlerTaskCreateResponseSchema,Lf as CrawlerTaskFailureErrorCodeSchema,tm as CrawlerTaskFailureStageSchema,Uf as CrawlerTaskPageSchema,Fv as CrawlerTaskPagesQuerySchema,Wv as CrawlerTaskPagesResponseSchema,Bv as CrawlerTaskStatusResponseSchema,kt as CrawlerTaskUuidSchema,mO as CreateAgentRunConflictResponseSchema,Aj as CreateAgentRunRequestSchema,wj as CreateAgentRunResponseSchema,eO as CreateDeploymentRequestSchema,Oy as CreateDeploymentResponseSchema,xI as CreateDocumentUploadRequestSchema,cI as CreateExternalSiteEditRequestSchema,mI as CreateExternalSiteEditResponseSchema,AI as CreateImageUploadRequestSchema,hI as CreateInputSourceRequestSchema,tO as CreateQualityCheckDeploymentRequestSchema,rj as CreateSiteBriefRequestSchema,Ij as CreateSiteBriefResponseSchema,cj as CreateSiteDraftRequestSchema,oj as CreateSiteInputSchema,iN as CreateSiteThreadRequestSchema,Ik as CreateSiteWorkflowRequestSchema,Wl as CreateTextInputSourceRequestSchema,Vl as CreateUrlInputSourceRequestSchema,iO as CurrentDeploymentResponseSchema,Dw as CustomerMaterialsDraftResponseSchema,Ls as CustomerMaterialsDraftSchema,jw as CustomerMaterialsNullableResponseSchema,Ms as CustomerMaterialsRecordSchema,Cw as CustomerMaterialsResponseSchema,Vh as CustomerMaterialsStatusSchema,Hh as DEFAULT_FONTS,gc as DEFAULT_SITE_DESIGN_RADIUS_ID,_p as DEFAULT_SITE_LOCALE,RA as DEFAULT_SUBSITE_PALETTE,A1 as DEPLOYMENT_ACTIVE_STATUSES,dt as DEPLOYMENT_LIFECYCLE_TRANSITIONS,Rg as DEPLOYMENT_PROGRESS_STEP_CODES,My as DEPLOYMENT_REALTIME_CHANNEL,Dt as DEPLOYMENT_STATUSES,w1 as DEPLOYMENT_TERMINAL_STATUSES,r_ as DEPLOYMENT_TRANSITION_ERROR_CODE,cO as DEPLOYMENT_WEBSOCKET_CONTRACT,PR as DESIGNER_COMPONENT_LIBRARY_ERROR_CODES,JR as DESIGNER_PAGE_LIBRARY_ERROR_CODES,SI as DOCUMENT_EXTENSION_WHITELIST,fI as DOCUMENT_MIME_WHITELIST,lb as DOMAIN_DNS_PURPOSES,ub as DOMAIN_DNS_REMEDIATION_STATUSES,pb as DOMAIN_DNS_VERIFICATION_STATUSES,ob as DOMAIN_OBSERVED_STATUSES,cb as DOMAIN_ROUTING_MODES,BR as DeleteDesignerPageErrorDetailsSchema,FR as DeleteDesignerPageRequestSchema,GR as DeleteDesignerPageResponseSchema,wd as DeleteDesignerPageResultSchema,Oj as DeleteSiteSnapshotResponseSchema,Xe as DeploymentIdSchema,kE as DeploymentJobIdSchema,Tg as DeploymentProgressStepCodeSchema,Ag as DeploymentProgressStepSchema,kg as DeploymentProgressStepStatusSchema,Dr as DeploymentProgressStepsSchema,St as DeploymentRecordSchema,rO as DeploymentRedisPubSubEventSchema,Ra as DeploymentStatusSchema,Km as DeploymentStatusSummarySchema,ws as DeploymentTransitionError,Jm as DeploymentTypeSchema,Ai as DeploymentWsDeploymentPayloadSchema,oO as DeploymentWsServerMessageSchema,Ly as DeploymentWsServerMessageTypeSchema,Dx as DesignPlanGenerationOutcomeSchema,jx as DesignPlanGenerationReasonSchema,ji as DesignPlanIdSchema,gO as DesignPlanPatchSchema,Px as DesignPlanRecordSchema,al as DesignPlanSchema,lO as DesignTokensSchema,_d as DesignerComponentCatalogItemSchema,Io as DesignerComponentCategoriesDataSchema,Eo as DesignerComponentCategoryNodeSchema,It as DesignerComponentExactVersionSchema,To as DesignerComponentInstallDataSchema,Ro as DesignerComponentsDataSchema,Od as DesignerPageCatalogItemSchema,qo as DesignerPageCategoriesDataSchema,Uo as DesignerPageCategoryNodeSchema,Td as DesignerPageDeleteBlockReasonSchema,Rd as DesignerPageDisabledReasonSchema,sn as DesignerPageExactVersionSchema,No as DesignerPageGroupSchema,Go as DesignerPageInstallDataSchema,Oo as DesignerPageNodeSchema,zo as DesignerPageResourcePreparationDataSchema,jd as DesignerPageResourceSourceSchema,Gd as DesignerPageResourceTemplateSchema,Rt as DesignerPageResourceTypeSchema,Fo as DesignerPagesDataSchema,Zi as DesignerResourceVersionSchema,Bo as DesignerSitePagesDataSchema,tT as DesignerSiteRouteIdSchema,_m as DomainConfigurationSchema,ra as DomainDnsPurposeSchema,bb as DomainDnsRecordSchema,fb as DomainDnsRemediationChangeSchema,dm as DomainDnsRemediationRecordSchema,um as DomainDnsRemediationResultSchema,gb as DomainDnsRemediationStatusSchema,Sb as DomainDnsVerificationObservationSchema,pm as DomainDnsVerificationResultSchema,db as DomainDnsVerificationStatusSchema,rb as DomainObservedStatusSchema,hb as DomainOperationErrorSchema,Ri as DomainOperationSchema,_b as DomainOperationStatusSchema,ca as DomainOperationTypeSchema,gm as DomainRecordSchema,mb as DomainRoutingModeSchema,_A as EDIT_ENGINE_VERSION_HEADER,hA as EDIT_ENGINE_VERSION_SOURCE_HEADER,lA as ERROR_COPY,Ul as EXTERNAL_SITE_EDIT_INFRASTRUCTURE_REASONS,Ml as EXTERNAL_SITE_EDIT_PROMPT_MAX_LENGTH,Ns as EditEngineVersionParseError,Wo as EnhanceDesignerPageResourceBodySchema,xj as EnhanceDesignerPageResourceResponseSchema,dI as ExternalSiteEditCallbackAckSchema,pI as ExternalSiteEditCallbackPayloadSchema,ql as ExternalSiteEditCallbackStatusSchema,Qt as ExternalSiteEditDegradedReasonSchema,Wa as ExternalSiteEditOutcomeSchema,Ba as ExternalSiteEditTaskIdSchema,Va as ExternalSiteEditTaskSchema,Fl as ExternalSiteEditTaskStatusSchema,dj as ExternalSyncSiteRequestSchema,Ej as ExternalSyncSiteResponseSchema,Kl as ExtractedFactKindSchema,Dn as ExtractedFactSchema,Hs as FIELD_TYPES,pc as FONT_PAIRINGS,qs as FONT_PAIRING_IDS,uf as FORM_DESIGN_ERROR_CODES,df as FORM_DESIGN_FAILURE_STAGES,lf as FORM_DESIGN_OPERATION_STAGES,pf as FORM_DESIGN_OPERATION_STATUSES,_i as FORM_FIELD_TYPES,tf as FORM_SPEC_FIELD_TYPE_TO_CMS,Oc as FORM_SPEC_FILE_MIN_RUNTIME_VERSION,VS as FORM_SPEC_LOCALIZABLE_FIELD_PATHS,jc as FORM_SPEC_MULTISTEP_MIN_RUNTIME_VERSION,tv as FORM_TEMPLATE_CATEGORY_COUNTS,ev as FORM_TEMPLATE_CATEGORY_SLUGS,yN as FailStaleInFlightWorkspaceRunsResponseSchema,pi as FieldDeclSchema,rC as FirecrawlBatchCreateRequestSchema,cC as FirecrawlBatchCreatedResponseSchema,Qf as FirecrawlBatchErrorSchema,lC as FirecrawlBatchErrorsResponseSchema,Xf as FirecrawlBatchPageSchema,mC as FirecrawlBatchStatusResponseSchema,nC as FirecrawlCrawlCreateRequestSchema,iC as FirecrawlCrawlCreatedResponseSchema,sC as FirecrawlCrawlStatusResponseSchema,om as FirecrawlJobStatusSchema,eC as FirecrawlMapRequestSchema,tC as FirecrawlMapResponseSchema,pC as FirecrawlQueueStatusResponseSchema,aC as FirecrawlScrapeRequestSchema,oC as FirecrawlScrapeResponseSchema,Yy as FooterShellSurfaceSchema,LS as FormBlockIdSchema,Si as FormDefinitionIdSchema,rf as FormDesignAffectedFilesSchema,sa as FormDesignErrorCodeSchema,dv as FormDesignErrorSchema,zc as FormDesignFailureStageSchema,ie as FormDesignHashSchema,av as FormDesignOpenResponseSchema,cf as FormDesignOperationFingerprintInputSchema,Zs as FormDesignOperationIdSchema,Bc as FormDesignOperationNextActionSchema,wE as FormDesignOperationRecordIdSchema,lv as FormDesignOperationRecordSchema,aa as FormDesignOperationResponseSchema,Vc as FormDesignOperationSchema,ia as FormDesignOperationStageSchema,Kc as FormDesignOperationStatusSchema,pv as FormDesignOperationTransitionRequestSchema,Wc as FormDesignPreviewRefreshStatusSchema,rv as FormDesignQueryResponseSchema,cv as FormDesignResumeRequestSchema,mv as FormDesignResumeResponseSchema,mf as FormDesignSaveRequestSchema,ov as FormDesignSaveResponseSchema,Gc as FormDesignSharedImpactSchema,na as FormDesignStandardizationSchema,OS as FormFieldDeclSchema,Tn as FormFieldNameSchema,Js as FormOptionValueSchema,MS as FormSpecBindingSchema,qS as FormSpecFieldNodeSchema,GS as FormSpecNodeSchema,US as FormSpecOptionSchema,FS as FormSpecStepBreakNodeSchema,ta as FormSpecV1Schema,nv as FormTemplateCatalogResponseSchema,qc as FormTemplateCategorySlugSchema,ZS as FormTemplateCategoryV1Schema,_t as FormTemplateTextSchema,JS as FormTemplateV1Schema,Bb as GSC_AUTH_STATUSES,Wb as GSC_BINDING_STATUSES,Vb as GSC_PROPERTY_TYPES,py as GenerateAiImagesRequestSchema,dy as GenerateAiImagesResponseSchema,qm as GeneratedAiImageResultSchema,HC as GetActiveSiteDomainResponseSchema,sO as GetDeploymentResponseSchema,Ny as GetDeploymentsStatusResponseSchema,lI as GetExternalSiteEditResponseSchema,VC as GetSiteDomainConfigurationResponseSchema,ma as GetSitePublishDomainOperationDataSchema,Fb as GetSitePublishDomainOperationResponseSchema,tw as GetTemplateUpgradeReportQuerySchema,nw as GetTemplateUpgradeReportResponseSchema,gD as GoogleSearchConsoleAuthStartDataSchema,uD as GoogleSearchConsoleAuthStartRequestSchema,_D as GoogleSearchConsoleAuthStartResponseSchema,mD as GoogleSearchConsoleAuthStatusSchema,lD as GoogleSearchConsoleBindingStatusSchema,pD as GoogleSearchConsolePropertyTypeSchema,dD as GoogleSearchConsoleStateSchema,SD as GoogleSearchConsoleStatusDataSchema,hD as GoogleSearchConsoleStatusInputSchema,fD as GoogleSearchConsoleStatusResponseSchema,oD as GscAuthStartDataSchema,aD as GscAuthStartRequestSchema,rD as GscAuthStartResponseSchema,la as GscAuthStatusSchema,pa as GscBindingStatusSchema,da as GscPropertyTypeSchema,$b as GscStateInputSchema,cD as GscStateSchema,Im as GscStatusDataSchema,Yb as GscStatusResponseSchema,Po as HOME_PAGE_URL_PATH,Wy as HeaderShellBehaviorSchema,Vy as HeaderShellShapeSchema,By as HeaderShellSurfaceSchema,zy as HeaderShellVariantSchema,vf as HomeUrlCrawlerTaskCreateRequestSchema,us as HttpUrlSchema,II as IMAGE_EXTENSION_WHITELIST,RI as IMAGE_MIME_WHITELIST,xo as INSERT_NEW_COMPONENT_CATEGORY_GROUP_KEY,Mo as INSERT_NEW_PAGE_CATEGORY_GROUP_KEY,hp as ISO_639_3_TO_SITE_LOCALE,Hl as ImageRoleSchema,Il as InboundUserMessageSchema,SP as IndustryClassificationRequestSchema,fP as IndustryClassificationResultSchema,uS as IndustryConfidenceSchema,wc as InitializationResultSchema,Gl as InputBundleStatusSchema,On as InputConflictSchema,wI as InputContextBundleSchema,yt as InputContextSourceIdSchema,Bl as InputSourceSchema,Mi as InputSourceStatusSchema,Li as InputSourceTypeSchema,zA as InspectTemplateUpgradeStateRequestSchema,BA as InspectTemplateUpgradeStateResponseSchema,jR as InstallDesignerComponentBodySchema,_j as InstallDesignerComponentResponseSchema,nT as InstallDesignerPageBodySchema,fj as InstallDesignerPageResponseSchema,nO as InternalCreateDeploymentResponseSchema,Xj as InternalEnsureSubsitePublishRequestSchema,Qj as InternalEnsureSubsitePublishResponseSchema,W as InternalEntityIdSchema,aO as InternalGetDeploymentsStatusResponseSchema,Zj as InternalGetSubsitePublishStatusRequestSchema,Jj as InternalGetSubsitePublishStatusResponseSchema,$j as InternalPrepareSubsitePreviewRequestSchema,Yj as InternalPrepareSubsitePreviewResponseSchema,zh as KNOWLEDGE_CATEGORY_CODES,ic as KnowledgeCategoryCodeSchema,Tw as KnowledgeContextReadinessSchema,Wh as KnowledgeSourceReadinessSchema,sc as KnowledgeSourceReadinessStatusSchema,Iw as KnowledgeTaskStatusBatchSchema,Bh as KnowledgeTaskStatusSchema,lp as LEGACY_SITE_LOCALE_CODES,oN as LatestAgentRunQuerySchema,rN as LatestAgentRunResponseSchema,JO as LatestWorkspaceRunQuerySchema,ZO as LatestWorkspaceRunResponseSchema,fC as LauncherPromptTemplateApplyRequestSchema,bC as LauncherPromptTemplateApplyResponseSchema,tb as LauncherPromptTemplateCatalogItemSchema,hC as LauncherPromptTemplateCatalogQuerySchema,SC as LauncherPromptTemplateCatalogSchema,Jf as LauncherPromptTemplateKindSchema,eb as LauncherPromptTemplateLocaleSchema,Ii as LauncherPromptTemplateTypeSchema,BO as ListAgentEventsQuerySchema,zO as ListAgentEventsResponseSchema,uj as ListDesignerComponentCategoriesResponseSchema,DR as ListDesignerComponentsQuerySchema,gj as ListDesignerComponentsResponseSchema,hj as ListDesignerPageCategoriesResponseSchema,eT as ListDesignerPagesQuerySchema,Sj as ListDesignerPagesResponseSchema,yj as ListDesignerSitePagesResponseSchema,ay as ListMediaLibraryAssetsQuerySchema,oy as ListMediaLibraryAssetsResponseSchema,WO as ListSiteAgentEventsQuerySchema,Wj as ListSiteVersionsResponseSchema,iw as ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema,sw as ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema,yI as MAX_DOCUMENT_SOURCES_PER_SITE,bI as MAX_DOCUMENT_UPLOAD_BYTES,kI as MAX_IMAGE_SOURCES_PER_SITE,TI as MAX_IMAGE_UPLOAD_BYTES,Bk as MAX_UNBOUND_WORKSPACE_ATTACHMENTS_PER_SITE,ys as MAX_WORKSPACE_ATTACHMENTS_PER_MESSAGE,Cm as MEDIA_LIBRARY_AUDIO_EXTENSIONS,Lm as MEDIA_LIBRARY_AUDIO_MIME_TYPES,Dm as MEDIA_LIBRARY_DOCUMENT_EXTENSIONS,iy as MEDIA_LIBRARY_EXTENSIONS,jm as MEDIA_LIBRARY_FILE_EXTENSIONS,Pm as MEDIA_LIBRARY_IMAGE_EXTENSIONS,ny as MEDIA_LIBRARY_IMAGE_MAX_BYTES,Om as MEDIA_LIBRARY_IMAGE_MIME_TYPES,wm as MEDIA_LIBRARY_MAX_BYTES,sy as MEDIA_LIBRARY_MIME_TYPES,vm as MEDIA_LIBRARY_VIDEO_EXTENSIONS,Nm as MEDIA_LIBRARY_VIDEO_MIME_TYPES,G1 as MIGRATION_PRODUCTS_CMS_DETAIL_PAGE_TITLE,F1 as MIGRATION_PRODUCTS_DETAIL_PREFIX,B1 as MIGRATION_PRODUCTS_DETAIL_VIEW_VARIANT,z1 as MIGRATION_PRODUCTS_LIST_VIEW_VARIANT,p_ as MIGRATION_PRODUCTS_ROUTE,it as MIGRATION_PRODUCTS_SLUG,K1 as MIGRATION_PRODUCTS_VIEW_BLOCK_TYPE,jS as MODEL_DECLARABLE_FORM_FIELD_TYPES,iS as MOTION_PRESETS,Gs as MOTION_PRESET_IDS,uO as MediaAssetSchema,Gy as MediaAttributionSchema,_a as MediaLibraryAssetSchema,Mm as MediaLibraryFileTypeSchema,Um as MediaLibrarySourceSchema,aE as MediaRequestOwnerSchema,CE as MediaResolutionCacheIdSchema,CR as MockDesignerComponentInsertDataSchema,vR as MockDesignerComponentInsertRequestSchema,ya as MotionLevelSchema,xf as NAV_ITEMS_LOCALIZABLE_FIELD_PATHS,Ef as NAV_ITEMS_MACHINE_FIELD_PATHS,Qh as NEXT_FONT_DISPLAY_NAMES,Sn as NEXT_FONT_REGISTRY,Sp as NON_LATIN_SITE_LOCALE_CODES,Ev as NavItemSchema,Sf as PAGE_SEO_LOCALIZABLE_FIELD_PATHS,ff as PAGE_SEO_MACHINE_FIELD_PATHS,an as PAGE_SLUG_PATTERN,Ot as PAGE_SLUG_SEGMENT_PATTERN_SOURCE,wv as PLATFORM_MATERIALIZED_EXEMPTIONS,kf as PLATFORM_MATERIALIZED_FILES,Af as PLATFORM_MATERIALIZED_FILE_PATTERNS,Av as PLATFORM_MATERIALIZERS,Vo as PLATFORM_OWNED_PAGE_SLUGS,Kd as PLATFORM_OWNED_ROUTE_FILE_PATHS,Ad as PageDirectoryReconcileFailedPageSchema,ss as PageDirectoryReconcileResultSchema,VR as PageDirectoryReconcileStateSchema,kd as PageDirectoryReconcileStatusSchema,Of as PageDiscoveryCoverageEntrySchema,zv as PageDiscoveryCoverageReasonSchema,nm as PageDiscoveryCoverageSchema,rl as PageNavigationSchema,os as PageResourceArtifactSchema,Ud as PageResourceComponentReferenceSchema,qd as PageResourceComponentSchema,Ld as PageResourceDraftPageSchema,Md as PageResourceDraftSchema,Wn as PageResourceFinalRouteSchema,Fd as PageResourcePageSchema,Nd as PageResourcePageSelectionSchema,Ko as PageResourceRouteMappingSchema,Aa as PageSchema,yv as PageSeoDeclSchema,ol as PageSlugSchema,vd as PageTargetKindSchema,es as PageTargetProjectionHashSchema,Lo as PageTargetSchema,Cd as PageTargetSeoSchema,WR as PageTargetSetSchema,qE as PageTemplateCleanupRequestSchema,KE as PageTemplateCleanupResponseSchema,ME as PageTemplateCreateRequestSchema,FE as PageTemplateCreateResponseSchema,zE as PageTemplateErrorCodeSchema,je as PageTemplateIdSchema,$t as PageTemplatePagePathSchema,UE as PageTemplatePromoteRequestSchema,GE as PageTemplatePromoteResponseSchema,OO as PersistClarifyAnswersRequestSchema,NO as PersistClarifyAnswersResponseSchema,vO as PersistGeneratedSitemapDraftRequestSchema,jO as PersistGeneratedSitemapDraftResponseSchema,fN as PersistPreviewSessionRequestSchema,bN as PersistPreviewSessionResponseSchema,MO as PersistSiteDesignPlanRequestSchema,UO as PersistSiteDesignPlanResponseSchema,DO as PersistSiteSitemapDraftResponseSchema,wO as PersistSiteSitemapRequestSchema,CO as PersistSiteSitemapResponseSchema,Pj as PersistSiteSnapshotRequestSchema,vj as PersistSiteSnapshotResponseSchema,Ey as PositioningPrefillSchema,Sa as PositioningSourceSchema,iT as PrepareDesignerPageBodySchema,bj as PrepareDesignerPageResponseSchema,_w as PrepareSiteBuildInitialGenerationBaseRequestSchema,hw as PrepareSiteBuildInitialGenerationBaseResultSchema,KA as PrepareTemplateUpgradeStateRequestSchema,kh as PrepareTemplateUpgradeStateResponseSchema,Hj as PrepareVersionPreviewRequestSchema,jy as PrepareVersionPreviewResponseSchema,vr as ProductSearchAppConfigDraftSchema,fs as ProductSearchAppSlugSchema,Gk as ProductSearchContractFixtureSchema,_g as ProductSearchDraftConfigSchema,Pe as ProductSearchFieldNameSchema,ug as ProductSearchFilterMetaSchema,bs as ProductSearchInteractionRequestSchema,Xn as ProductSearchInteractionResponseSchema,Fk as ProductSearchPopularTermsReadSchema,Pr as ProductSearchPopularTermsSchema,bg as ProductSearchRequestSchema,xg as ProductSearchResponseSchema,pn as ProductSearchRouteIdSchema,dg as ProductSearchValueShapeSchema,Dj as PromoteSiteSnapshotRequestSchema,Cy as PromoteSiteSnapshotResponseSchema,zj as PromoteTemplateUpgradeSnapshotRequestSchema,Bj as PromoteTemplateUpgradeSnapshotResponseSchema,fm as QualityRunningStatusSchema,pA as REFUSAL_COPY,$O as REST_API_ENDPOINTS,bf as ROOT_LAYOUT_METADATA_LOCALIZABLE_FIELD_PATHS,yf as ROOT_LAYOUT_METADATA_MACHINE_FIELD_PATHS,Gb as ReconcileSitePublishDomainOperationDataSchema,Kb as ReconcileSitePublishDomainOperationResponseSchema,Lj as RecordSnapshotVersionRequestSchema,Mj as RecordSnapshotVersionResponseSchema,JA as RecordTemplateUpgradeEventRequestSchema,ew as RecordTemplateUpgradeEventResponseSchema,WA as RecordTemplateUpgradeFailureRequestSchema,VA as RecordTemplateUpgradeFailureResponseSchema,HA as RecordTemplateUpgradeSuccessRequestSchema,$A as RecordTemplateUpgradeSuccessResponseSchema,KR as RecoverDesignerPageProjectionRequestSchema,zR as RecoverDesignerPageProjectionResponseSchema,Pd as RecoverDesignerPageProjectionResultSchema,zl as ReferencePagePatternSchema,jn as ReferenceSignalsSchema,Sy as RegisterMediaResourceReferenceRequestSchema,fy as RegisterMediaResourceReferenceResponseSchema,Ak as RegisterWorkflowTaskCommandRequestSchema,ag as RegisterWorkflowTaskRequestSchema,Fj as ReleaseTemplateUpgradeLockRequestSchema,Gj as ReleaseTemplateUpgradeLockResponseSchema,vk as ReplaceCrawlWorkflowTaskCommandRequestSchema,rg as ReplaceCrawlWorkflowTaskRequestSchema,Pk as ReplaceWorkflowTaskCommandRequestSchema,og as ReplaceWorkflowTaskRequestSchema,xP as ResolvedFieldSchema,WP as ResolvedFormFieldSchema,HO as RestApiMethodSchema,Vj as RestoreSiteSnapshotResponseSchema,xv as RootLayoutMetadataSchema,el as RouteGenerationCardSchema,e_ as RuleEngineInputSchema,s_ as RuleEngineScoreRecordSchema,As as RuleScoreDimensionKeySchema,i_ as RuleScoreDimensionSchema,Zt as SELECTABLE_SITE_LOCALE_CODES,ml as SITEMAP_RESOLVER_MAX_BLOCK_TARGETS,cl as SITEMAP_RESOLVER_MAX_PAGE_TARGETS,uw as SITE_BUILD_CONTEXT_FILE_PATH,gw as SITE_BUILD_CONTEXT_MAX_BYTES,Hu as SITE_BUILD_STATUSES,Er as SITE_BUILD_STATUS_CODES,$u as SITE_DEPLOYMENT_STATUSES,Ir as SITE_DEPLOYMENT_STATUS_CODES,Fs as SITE_DESIGN_DENSITY_IDS,uc as SITE_DESIGN_RADIUS_IDS,g0 as SITE_EDIT_DURABLE_HISTORY_CAPABILITY,cd as SITE_EDIT_MATERIALIZATION_MAX_FILE_CONTENT_BYTES,Xi as SITE_EDIT_MATERIALIZATION_MAX_FILE_COUNT,Qi as SITE_EDIT_MATERIALIZATION_MAX_TOTAL_CONTENT_BYTES,rr as SITE_EDIT_PAGE_COMPOSITION_SCHEMA_VERSION,qT as SITE_EDIT_PAGE_COMPOSITION_V2_CAPABILITY,Q_ as SITE_EDIT_RUNTIME_CONTAINER_TAGS,Z_ as SITE_EDIT_RUNTIME_TEXT_TAGS,X_ as SITE_EDIT_RUNTIME_VOID_ELEMENT_TAGS,vT as SITE_EDIT_SIGNED_MUTATION_CAPABILITY,Yl as SITE_EDIT_SOURCE_ALLOWED_APP_FILES,Ha as SITE_EDIT_SOURCE_ALLOWED_DIRS,$l as SITE_EDIT_SOURCE_ALLOWED_ROOT_FILES,qi as SITE_EDIT_SOURCE_DELETE_CAPABILITY,Xl as SITE_EDIT_TEXT_SOURCE_EXTENSIONS,Ct as SITE_EXTRA_REQUIREMENT_MAX_LENGTH,Q1 as SITE_HAS_ACTIVE_SUBSITES_ERROR_CODE,Z1 as SITE_HAS_SUBSITES_ERROR_CODE,pp as SITE_LOCALE_CODES,bv as SITE_LOCALIZATION_STRUCTURES,nj as SITE_PLANNING_FROZEN_ERROR_CODE,ij as SITE_PLANNING_LOCKED_ERROR_CODE,sj as SITE_STRUCTURE_CONFIRMATION_REQUIRED_ERROR_CODE,aj as SITE_STRUCTURE_CONFIRMATION_STALE_ERROR_CODE,Yu as SITE_WORKFLOW_STATUSES,Rr as SITE_WORKFLOW_STATUS_CODES,YO as SSE_STREAMS,Gp as STEP5_GEO_QUESTION_TYPES,yp as STEP5_KEYWORD_CATEGORIES,uo as STEP5_PRIMARY_INTENT_PAGE_LIMIT,lo as STEP5_SEMRUSH_MIN_RELEVANCE_SCORE,Ap as STEP5_SEMRUSH_SEARCH_INTENTS,wp as STEP5_SEO_ALLOWED_INTENT_CODES,oR as STEP5_SEO_ALLOWED_SEARCH_INTENTS,pR as STEP5_SEO_KEYWORD_DEFAULT,Wp as STEP5_SEO_KEYWORD_MAX,Bp as STEP5_SEO_KEYWORD_MIN,qn as STEP5_SEO_MAX_KEYWORD_DIFFICULTY,so as STEP5_SEO_MIN_FIT,Un as STEP5_SEO_MIN_SEARCH_VOLUME,zp as STEP5_SEO_PAYLOAD_SCHEMA_VERSION,sd as STEP5_SSE_EVENT_NAMES,Te as STEP5_STRATEGY_COUNT,mt as STEP5_STRATEGY_KEYS,oo as STEP5_STRATEGY_OPTION_IDS,Sc as STEP6_AI_THEME_IDS,Ks as STEP6_AI_THEME_PRESETS,fc as STEP6_GENERATED_THEME_ID_PATTERN,mh as SUBSITE_GLOSSARY_ENTRY_MAX_CHARS,lh as SUBSITE_GLOSSARY_MAX_ENTRIES,yh as SUBSITE_MOUNT_PATH_PATTERN,_h as SUBSITE_PALETTE_NOTE_MAX_CHARS,xh as SUBSITE_RESERVED_MOUNT_SEGMENTS,HI as SUPPORTED_SITE_LOCALES,vn as SandboxSessionIdSchema,SE as SandboxSessionSchema,Dl as SandboxSessionStatusSchema,pj as SaveBriefDraftRequestSchema,Tj as SaveBriefDraftResponseSchema,ZE as SaveSiteExtraRequirementRequestSchema,uy as SearchUnsplashMediaQuerySchema,gy as SearchUnsplashMediaResponseSchema,Fh as SiteBuildContextFileSchema,qh as SiteBuildContextPayloadSchema,Uh as SiteBuildContextProvenanceSchema,Mh as SiteBuildContextProvenanceSourceSchema,gs as SiteBuildStatusSchema,J1 as SiteDeletionBlockedDetailsSchema,_s as SiteDeploymentStatusSchema,ki as SiteDesignContextSchema,Ry as SiteDesignDensitySchema,Ty as SiteDesignMotionLevelSchema,ni as SiteEditBoundaryKindSchema,S_ as SiteEditCapabilityConstraintSchema,__ as SiteEditCapabilityModeSchema,ti as SiteEditCapabilityModeViewSchema,i0 as SiteEditCapabilityReadRequestSchema,Hd as SiteEditClassNameSourceDiagnosticSchema,Ze as SiteEditClassNameSourceRangeSchema,Zo as SiteEditClassNameSourceSchema,gT as SiteEditClassNameSourceStyleContextSchema,Qo as SiteEditClassNameSourceStylesheetSchema,cs as SiteEditClassNameSourceWriteIntentSchema,mT as SiteEditCommandDiagnosticSchema,Wd as SiteEditCommandErrorSchema,U as SiteEditCompositionContextSchema,ae as SiteEditCompositionSelectorSchema,h_ as SiteEditConstraintKindSchema,Nu as SiteEditDeletePageSourceOutputSchema,K_ as SiteEditDynamicConfidenceSchema,B_ as SiteEditDynamicDataBindingSchema,Vr as SiteEditDynamicDataDetailSchema,Hr as SiteEditDynamicDataSummarySchema,z_ as SiteEditDynamicEvidenceSchema,Wr as SiteEditDynamicSourceKindSchema,F_ as SiteEditDynamicSourceTypeSchema,G_ as SiteEditDynamicTargetKindSchema,Ps as SiteEditEffectiveWriteTargetSchema,l0 as SiteEditEventSchema,ai as SiteEditExternalSourceKindSchema,fT as SiteEditGetClassNameSourceCommandResultSchema,hT as SiteEditGetClassNameSourceInputSchema,ST as SiteEditGetClassNameSourceResultSchema,V0 as SiteEditGetDocumentInputSchema,H0 as SiteEditGetObjectEditContextInputSchema,FI as SiteEditGetSourceFileInputSchema,qI as SiteEditGetSourceTreeInputSchema,_T as SiteEditGetStyleContextInputSchema,si as SiteEditHistoryProvenanceSchema,E_ as SiteEditHistoryReadOnlyRecoveryStatusSchema,f_ as SiteEditHistoryRecoveryCodeSchema,b_ as SiteEditHistoryRecoveryDiagnosticSchema,h0 as SiteEditHistoryResultSchema,_0 as SiteEditHistoryStatusModeSchema,R_ as SiteEditHistoryStatusSchema,y_ as SiteEditHistoryUnavailableReasonSchema,I_ as SiteEditHistoryUnavailableStatusSchema,x_ as SiteEditHistoryWritableStatusSchema,cA as SiteEditInitializeSessionInputSchema,Du as SiteEditInsertNodeSpecSchema,Ou as SiteEditInsertPageResourceOutputSchema,gd as SiteEditMaterializationDataRequirementsSchema,ud as SiteEditMaterializationEntrySchema,dd as SiteEditMaterializationExportSchema,pd as SiteEditMaterializationFileSchema,yo as SiteEditMaterializationPathTemplateSchema,Et as SiteEditMaterializationSchema,gr as SiteEditMaterializedComponentNodeSpecSchema,lr as SiteEditMoveTargetSchema,on as SiteEditMutationContextSchema,ii as SiteEditNodeCapabilitySnapshotSchema,Y0 as SiteEditObjectCapabilitiesSchema,Q0 as SiteEditObjectDetailSchema,J0 as SiteEditObjectEditContextSchema,eA as SiteEditObjectStyleDetailSchema,Z0 as SiteEditObjectSummarySchema,tk as SiteEditOperationCommandResultSchema,_r as SiteEditOperationErrorCodeSchema,hr as SiteEditOperationErrorSchema,Lu as SiteEditOperationOutputSchema,ju as SiteEditOperationParamsSchema,ds as SiteEditOperationPayloadSchema,ps as SiteEditOperationRequestSchema,Cu as SiteEditOperationResultTargetSchema,Lt as SiteEditOperationSelectionRefSchema,q_ as SiteEditOperationSummarySchema,vu as SiteEditOperationTargetSchema,mn as SiteEditOperationTypeSchema,Tt as SiteEditOperationValueSchema,FT as SiteEditPageCompositionAnyVersionSchema,gu as SiteEditPageCompositionAtomicKindSchema,fu as SiteEditPageCompositionBoundaryModeSchema,ou as SiteEditPageCompositionBusinessMemberSchema,su as SiteEditPageCompositionContainerSchema,cn as SiteEditPageCompositionDiagnosticSchema,Hn as SiteEditPageCompositionErrorCodeSchema,sr as SiteEditPageCompositionPlacementTargetSchema,ru as SiteEditPageCompositionPlacementUnitSchema,du as SiteEditPageCompositionRuntimeRefSchema,pu as SiteEditPageCompositionSchema,uu as SiteEditPageCompositionSourceMemberKindSchema,au as SiteEditPageCompositionSourceMemberSchema,cr as SiteEditPageCompositionSourceRangeSchema,mu as SiteEditPageCompositionSupportedSchema,lu as SiteEditPageCompositionUnsupportedSchema,Su as SiteEditPageCompositionV2BusinessMemberSchema,_u as SiteEditPageCompositionV2ContainerSchema,yu as SiteEditPageCompositionV2PlacementRelationSchema,Eu as SiteEditPageCompositionV2PlacementSchema,bu as SiteEditPageCompositionV2PlacementUnitSchema,ku as SiteEditPageCompositionV2Schema,hu as SiteEditPageCompositionV2SourceMemberSchema,Ru as SiteEditPageCompositionV2SupportedSchema,Tu as SiteEditPageCompositionV2UnsupportedSchema,xu as SiteEditPageCompositionV2WriteModeSchema,Iu as SiteEditPageCompositionVisualAnchorSchema,cu as SiteEditPagePlacementOptionSchema,ir as SiteEditPagePlacementSchema,or as SiteEditPageUnitResultTargetSchema,ar as SiteEditPageUnitTargetSchema,D_ as SiteEditPatchPlanPatchSchema,k0 as SiteEditPatchPlanSchema,vs as SiteEditPropertiesSchema,eu as SiteEditPropertyChangeSchema,P_ as SiteEditPropertyCreationSchema,A_ as SiteEditPropertyItemSchema,T_ as SiteEditPropertyResolutionSchema,k_ as SiteEditPropertySourceSchema,w_ as SiteEditPropertySpreadSchema,_n as SiteEditProvenanceChainSchema,H_ as SiteEditProvenanceHopSchema,$0 as SiteEditRenderDocumentSchema,gn as SiteEditRenderEntryRefSchema,W_ as SiteEditRenderEntrySchema,Br as SiteEditRenderPageCompositionSchema,M_ as SiteEditRenderPageCompositionSupportedSchema,U_ as SiteEditRenderPageCompositionUnsupportedSchema,L_ as SiteEditRenderPagePlacementSchema,CT as SiteEditRequiredMutationContextEnvelopeSchema,KI as SiteEditResolveSourceLocationInputSchema,Yr as SiteEditSemanticSourceSchema,er as SiteEditSetPropsParamsSchema,ek as SiteEditSignedOperationRequestSchema,$a as SiteEditSourceDeleteCapabilitySchema,Zl as SiteEditSourceDirectoryPathSchema,ip as SiteEditSourceFileBinaryPreviewUnavailableReasonSchema,sp as SiteEditSourceFileBinaryResponseSchema,MI as SiteEditSourceFileKindSchema,Jl as SiteEditSourceFileListItemSchema,GI as SiteEditSourceFileResponseSchema,np as SiteEditSourceFileTextResponseSchema,ls as SiteEditSourceIdentitySchema,ap as SiteEditSourceLocationRangeSchema,zI as SiteEditSourceLocationSchema,Y_ as SiteEditSourceLocatorRangeSchema,js as SiteEditSourceLocatorSchema,_e as SiteEditSourcePathSchema,Ya as SiteEditSourceTreeNodeSchema,UI as SiteEditSourceTreeResponseSchema,ep as SiteEditSourceTreeTruncationReasonSchema,tp as SiteEditSourceTreeTruncationSchema,ur as SiteEditStyleBreakpointSchema,tr as SiteEditStyleDraftPropertySchema,X0 as SiteEditStyleModelSchema,pr as SiteEditStylePropertySchema,Xr as SiteEditStyleSourceSchema,dr as SiteEditStyleStateModeSchema,Ds as SiteEditTextSegmentSchema,$r as SiteEditTextSourceSchema,V_ as SiteEditWriteTargetSchema,JE as SiteExtraRequirementResponseSchema,Ol as SiteExtraRequirementSchema,R as SiteIdSchema,he as SiteLocaleSchema,dO as SiteMediaIntentSchema,AE as SiteOperationLockIdSchema,jh as SitePreviewActivateErrorCodeSchema,Nh as SitePreviewActivateFailedSchema,Oh as SitePreviewActivateReadySchema,rw as SitePreviewActivateResponseSchema,YC as SitePublishDomainCheckDataSchema,$C as SitePublishDomainCheckRequestSchema,XC as SitePublishDomainCheckResponseSchema,QC as SitePublishDomainOperationDataSchema,ZC as SitePublishDomainOperationResponseSchema,JC as SitePublishDomainReconcileOperationResponseSchema,eD as SitePublishDomainRemediationConfirmRequestSchema,tD as SitePublishDomainRemediationConfirmResponseSchema,Ti as SitePublishQualityTaskStatusSchema,CC as SitePublishRepairInputItemSchema,wb as SitePublishRepairResultItemSchema,bm as SitePublishRepairResultSchema,DC as SitePublishRepairTaskSnapshotSchema,Sm as SitePublishRepairTaskStatusSchema,LC as SitePublishWorkflowActiveResponseSchema,Ua as SitePublishWorkflowIdSchema,vb as SitePublishWorkflowMutationDataSchema,MC as SitePublishWorkflowMutationResponseSchema,Cb as SitePublishWorkflowPublishDataSchema,UC as SitePublishWorkflowPublishResponseSchema,Db as SitePublishWorkflowQualityDataSchema,qC as SitePublishWorkflowQualityResponseSchema,ht as SitePublishWorkflowRecordSchema,NC as SitePublishWorkflowRevisionRequestSchema,xb as SitePublishWorkflowStatusSchema,Eb as SitePublishWorkflowStepSchema,bt as SiteRecordSchema,PE as SiteTemplateUpgradeStateIdSchema,tN as SiteThreadListQuerySchema,nN as SiteThreadListResponseSchema,aN as SiteThreadResponseSchema,La as SiteVersionIdSchema,Dy as SiteVersionListItemSchema,Ci as SiteVersionRecordSchema,ze as SiteWorkflowIdSchema,sg as SiteWorkflowRecordSchema,xk as SiteWorkflowSnapshotResponseSchema,Ss as SiteWorkflowSnapshotSchema,Xu as SiteWorkflowStatusSchema,qa as SiteWorkflowTaskRefIdSchema,Ek as SiteWorkflowTaskRefResponseSchema,Ar as SiteWorkflowTaskRefSchema,EO as SitemapAddBlockInputSchema,wa as SitemapAnswerSchema,yO as SitemapChangeBlockVariantInputSchema,gx as SitemapDeleteBlockInputSchema,ix as SitemapDraftBlockSchema,sx as SitemapDraftPageSchema,Ax as SitemapDraftRecordSchema,An as SitemapDraftSchema,ux as SitemapEditActorSchema,Sx as SitemapEditErrorCodeSchema,bx as SitemapEditFailureSchema,hx as SitemapEditOperationSchema,RO as SitemapEditResultSchema,fx as SitemapEditSuccessSchema,kO as SitemapGenerationInputSchema,Rx as SitemapGenerationOutcomeSchema,Tx as SitemapGenerationReasonSchema,dl as SitemapGenerationStageSchema,Ce as SitemapIdSchema,yx as SitemapIntentPageSchema,fO as SitemapModelOutputSchema,ox as SitemapModelPageSchema,bO as SitemapMoveBlockInputSchema,tx as SitemapNavigationHrefSchema,Re as SitemapNodeIdSchema,Sl as SitemapRecordSchema,hO as SitemapResolverModelOutputSchema,_O as SitemapResolverRequestSchema,SO as SitemapResolverResponseSchema,dx as SitemapResolverTargetsSchema,pl as SitemapRunInputSchema,Wt as SitemapSchema,cx as SitemapSourceProvenanceSchema,AO as SitemapStreamEventSchema,Gv as SitemapTaskCreateRequestSchema,Vv as SitemapTaskCreateResponseSchema,Kf as SitemapTaskFailureErrorCodeSchema,Hv as SitemapTaskResponseSchema,_x as SitemapUpdateBlockInstructionInputSchema,xO as SitemapUpdateBlockPropsInputSchema,Fy as SitemapUserChoiceSchema,Bt as SkillSelectionSchema,Ky as SkillSelectionSourceSchema,Rl as SnapshotContentHashSchema,xe as SnapshotFilePathSchema,T as SnapshotIdSchema,ot as SnapshotRecordSchema,Zm as SnapshotStatusSchema,ga as StartGscAuthDataSchema,xm as StartGscAuthRequestSchema,Em as StartGscAuthResponseSchema,Ck as StartSiteBuildRequestSchema,Sw as StartSiteBuildResponseSchema,Gh as StartSiteBuildResultSchema,jC as StartSitePublishWorkflowRequestSchema,XO as StartWorkspaceRunRequestSchema,QO as StartWorkspaceRunResponseSchema,Nr as Step2AiCrawlabilityAssessmentSchema,Og as Step2FinalResultDataSourceSchema,Zn as Step2FinalResultRequestSchema,r1 as Step2FinalResultResponseSchema,o1 as Step2FinalResultSaveResponseSchema,jg as Step2FinalResultSaveResultSchema,Is as Step2FinalResultTypeSchema,Lg as Step2FinalResultViewSchema,Or as Step2FinalScanCardKeySchema,Rs as Step2FinalScanCardSchema,Dg as Step2FinalScanResultSchema,hn as Step2KnowledgeOpaqueIdSchema,Rw as Step2KnowledgeScopeSchema,pt as Step2PageRoleSchema,l1 as Step2PageSelectionRequestSchema,p1 as Step2PageSelectionResponseSchema,Pg as Step2SiteInitializationCrawlerErrorCodeSchema,wg as Step2SiteInitializationStatusSchema,a1 as Step2SiteInitializationTaskResponseSchema,vg as Step2SiteInitializationTaskSchema,Ts as Step3AgentAnalysisSchema,zg as Step3AnalysisFindingSchema,f1 as Step3AnalysisJobResponseSchema,qr as Step3AnalysisJobSchema,Mr as Step3AnalysisJobStatusSchema,b1 as Step3AnalysisLatestResponseSchema,Lr as Step3AnalysisProgressSchema,Vg as Step3AnalysisResultSchema,S1 as Step3AnalysisScheduleResponseSchema,Kg as Step3AnalysisScheduleSchema,y1 as Step3AnalysisSseFrameSchema,_1 as Step3AnalysisStartRequestSchema,Ur as Step3AnalysisSummarySchema,Gg as Step3AnalystSchema,h1 as Step3AnalystsResponseSchema,R1 as Step4DiagnosisResponseSchema,Vi as Step5ActiveStrategyKeySchema,SR as Step5CommitStrategyRequestSchema,fR as Step5CommitStrategyResponseSchema,nd as Step5CommittedVersionSchema,Zp as Step5DecisionCustomPayloadInputSchema,Qp as Step5DecisionCustomPayloadSchema,tn as Step5DecisionSelectionIdSchema,Tp as Step5EvidenceReferenceSchema,Fp as Step5GenerationStatusSchema,po as Step5GeoQuestionSchema,ed as Step5JobStatusSchema,xp as Step5KeywordCategorySchema,Jt as Step5KeywordEntrySchema,zi as Step5KeywordLibrarySchema,tR as Step5KeywordSearchBodySchema,Mn as Step5KeywordSelectionSchema,Xp as Step5LegacyDecisionCustomPayloadInputSchema,Yp as Step5LegacyDecisionCustomPayloadSchema,Vp as Step5LegacySeoKeywordInputSchema,_o as Step5LegacySeoKeywordSchema,Kn as Step5MarketCountrySchema,Gn as Step5MarketTypeSchema,io as Step5OptionPresentationSchema,Wi as Step5OutputLocaleSchema,gR as Step5RegenerateItemRequestSchema,_R as Step5SaveDecisionRequestSchema,hR as Step5SaveDecisionResponseSchema,Dp as Step5SemrushEmptyReasonCodeSchema,Cp as Step5SemrushIntentGroupSchema,Lp as Step5SemrushKeywordCandidateSchema,Mp as Step5SemrushKeywordCandidateSearchDataSchema,rR as Step5SemrushKeywordCandidateSearchRequestSchema,cR as Step5SemrushKeywordCandidateSearchResponseSchema,vp as Step5SemrushKeywordRecommendationSchema,qp as Step5SemrushKeywordSelectionDataSchema,Up as Step5SemrushKeywordSelectionItemSchema,mR as Step5SemrushKeywordSelectionRequestSchema,lR as Step5SemrushKeywordSelectionResponseSchema,Pp as Step5SemrushRecommendationSeedSchema,Op as Step5SemrushRecommendationSnapshotSchema,kp as Step5SemrushRecommendationStatusSchema,co as Step5SemrushSearchIntentSchema,jp as Step5SemrushSelectionSummarySchema,Hp as Step5SemrushSnapshotRefSchema,go as Step5SeoGeoPlanRowSchema,zn as Step5SeoKeywordSchema,$p as Step5SeoPayloadV2InputSchema,$i as Step5SeoPayloadV2Schema,xx as Step5SitemapDecisionSchema,Ix as Step5SitemapRunInputSchema,Ex as Step5SitemapSourceSchema,TO as Step5SitemapStartRequestSchema,dR as Step5StartStrategyRequestSchema,uR as Step5StartStrategyResponseSchema,Jp as Step5StrategyDecisionInputSchema,Yi as Step5StrategyDecisionSchema,Hi as Step5StrategyItemSchema,ho as Step5StrategyJobSchema,Fn as Step5StrategyKeySchema,ro as Step5StrategyOptionIdSchema,Ep as Step5StrategyOptionSchema,Ip as Step5StrategyPlanSchema,id as Step5StrategySnapshotDataSchema,yR as Step5StrategySseFrameSchema,td as Step5StrategyVersionSnapshotSchema,Rp as Step5StructureDetailSchema,cS as Step6AiThemeCandidateSchema,li as Step6ColorSeedsSchema,uP as Step6DesignAgentRecommendationsResponseSchema,oP as Step6DesignRecommendationGenerationInputSchema,Ws as Step6DesignRecommendationModelOutputSchema,mS as Step6DesignRecommendationSchema,nP as Step6DesignRecommendationsRequestSchema,iP as Step6DesignRecommendationsResponseSchema,Ic as Step6DesignSelectionSchema,Ec as Step6GeneratedThemeCardSchema,dS as Step6GptDesignRecommendationModelOutputSchema,xA as SubsiteGlossariesSchema,dh as SubsiteGlossaryEntrySchema,oi as SubsiteHexColorSchema,UA as SubsiteMountPathSchema,IA as SubsitePaletteLocalizationSchema,uh as SubsitePaletteModeSchema,gh as SubsitePaletteSeedsSchema,EA as SubsiteSiteInfoSchema,wA as SubsiteSyncDiffComputeRequestSchema,PA as SubsiteSyncDiffComputeResponseSchema,fh as SubsiteSyncDiffErrorCodeSchema,vA as SubsiteSyncDiffErrorResponseSchema,OA as SubsiteVisibleTextExportRequestSchema,NA as SubsiteVisibleTextExportResponseSchema,Vu as TASK_EXECUTION_STATUSES,Tr as TASK_EXECUTION_STATUS_CODES,Kj as TEMPLATE_UPGRADE_LOCK_LOST_ERROR_CODE,zs as THEME_PRESETS,hc as THEME_PRESET_IDS,xr as TaskExecutionStatusSchema,vh as TemplateUpgradeCasOutcomeSchema,Jr as TemplateUpgradeErrorCodeSchema,Ch as TemplateUpgradeOutcomeCountsSchema,wh as TemplateUpgradeOutcomeSchema,Dh as TemplateUpgradeSnapshotDeletionCandidateSchema,qt as TemplateUpgradeStateSchema,Rh as TemplateUpgradeStatusSchema,Ph as TemplateUpgradeValidationStageSchema,Fe as TemplateVersionSchema,Uj as TryAcquireTemplateUpgradeLockRequestSchema,qj as TryAcquireTemplateUpgradeLockResponseSchema,Gm as UnsplashDownloadLocationSchema,Fm as UnsplashMediaAssetSchema,lj as UpdateBriefRequestSchema,Rj as UpdateBriefResponseSchema,LO as UpdateClarifyArchetypeRequestSchema,Cj as UpdateCurrentSnapshotManifestRequestSchema,HR as UpdatePageDirectoryReconcileStateRequestSchema,OC as UpdateSitePublishWorkflowStepRequestSchema,mj as UpdateSiteRequestSchema,sN as UpdateSiteThreadRequestSchema,Rk as UpdateSiteWorkflowWebsiteRequestSchema,sP as UpdateStep6DesignSelectionRequestSchema,aP as UpdateStep6DesignSelectionResponseSchema,wk as UpdateWorkflowTaskStatusRequestSchema,ry as UploadMediaLibraryAssetResponseSchema,xC as UpstreamPromptTemplateCatalogDataSchema,yC as UpstreamPromptTemplateConsumeDataSchema,Cf as UrlListCrawlerTaskCreateRequestSchema,vE as UsageRecordIdSchema,_y as UseUnsplashMediaRequestSchema,hy as UseUnsplashMediaResponseSchema,bE as UserIdSchema,Hb as VCP_GSC_STATES,ua as VcpGscStateSchema,Rb as VcpQualityRemediationItemSchema,hm as VcpQualityResultSchema,ba as VisualHintsSchema,qy as VisualThemeSchema,yk as WORKFLOW_DEFINITIONS_V1,hs as WORKFLOW_DEFINITION_REGISTRY,zu as WORKFLOW_FLOW_TYPES,Qu as WORKFLOW_MENU_STATES,Bu as WORKFLOW_NODE_CODES,Wu as WORKFLOW_TASK_TYPES,Xk as WORKSPACE_ATTACHMENT_BOUND_ERROR_CODE,Yk as WORKSPACE_ATTACHMENT_LIMIT_ERROR_CODE,Eg as WORKSPACE_ATTACHMENT_MEDIA_TYPES,Vk as WORKSPACE_ATTACHMENT_TARGET_BASE64_BYTES,$k as WORKSPACE_ATTACHMENT_TOO_LARGE_ERROR_CODE,Wk as WORKSPACE_ATTACHMENT_UNBOUND_TTL_MS,Hk as WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT_ERROR_CODE,lN as WORKSPACE_WEBSOCKET_CONTRACT,br as WorkflowClientCapabilitiesSchema,kr as WorkflowDefinitionVersionSchema,$n as WorkflowFlowTypeSchema,ig as WorkflowMenuItemSchema,Zu as WorkflowMenuStateSchema,ln as WorkflowNodeCodeSchema,yr as WorkflowTaskTypeSchema,xs as WorkspaceAttachmentMediaTypeSchema,Qk as WorkspaceAttachmentSchema,Jx as WorkspaceClientMessageSchema,yy as WorkspaceDesignApplyRequestSchema,xy as WorkspaceDesignApplyResponseSchema,va as WorkspaceDiagnosticSchema,cE as WorkspaceDirectEditFileSchema,rE as WorkspaceDirectEditPathSchema,wl as WorkspaceDirectEditPostActionSchema,uN as WorkspaceDirectEditRequestSchema,_N as WorkspaceDirectEditResponseSchema,Ca as WorkspaceExecutionDiagnosticsSchema,qO as WorkspaceExecutionPlanSchema,oE as WorkspaceMediaRequestSchema,Oa as WorkspacePlanDependencySchema,yl as WorkspacePlanSummarySchema,Lx as WorkspacePlanTaskKindSchema,ja as WorkspacePlanTaskSchema,Uu as WorkspaceResourceKindSchema,Fu as WorkspaceResourceNavigationSelectionSchema,fr as WorkspaceResourceOperationClientMessageSchema,qu as WorkspaceResourceOperationSummarySchema,Gu as WorkspaceResourceOperationTransientInputSchema,Di as WorkspaceRunKindSchema,Zx as WorkspaceSelectedComponentSchema,tE as WorkspaceServerMessageSchema,IO as WorkspaceSitemapEditRequestSchema,Qx as WorkspaceSocketDescriptorSchema,gE as WorkspaceSourceFileBinaryResponseSchema,dE as WorkspaceSourceFileKindSchema,vl as WorkspaceSourceFileListItemSchema,hN as WorkspaceSourceFilePathQuerySchema,SN as WorkspaceSourceFileResponseSchema,uE as WorkspaceSourceFileTextResponseSchema,Pl as WorkspaceSourcePathSchema,vx as WorkspaceSuggestionSchema,fl as WorkspaceSuggestionsSchema,Cx as WorkspaceSuggestionsSourceSchema,xl as WorkspaceTaskCountsSchema,mN as WorkspaceWebSocketMessageSchema,cN as WorkspaceWebSocketMessageTypeSchema,Da as WorkspaceWorkerGroupSchema,Pa as WorkspaceWorkerPhaseSchema,FO as WorkspaceWorkerResultSchema,Pt as WorkspaceWorkerStatusSchema,jP as applicationTemplateCatalogDataSchema,DP as applicationTemplateConsumeDataSchema,CP as applicationTemplateV1Schema,D1 as assertDeploymentTransition,Lk as assertSiteBuildStatusTransition,Nk as assertTaskExecutionStatusTransition,yD as buildE2bBrowserPreviewUrl,FC as buildFinalSitePublishQualityResult,rP as buildStep6FallbackThemeCards,oa as canonicalizeFormDesignJson,EC as canonicalizeLauncherPromptTemplateOperation,Yo as canonicalizePageSlug,ms as classifySiteEditPropertyName,UR as cmsPagePreviewUrlPath,IR as compareTemplateVersions,w0 as composeSiteEditRepeatInstanceKey,hv as computeFormDesignOperationFingerprint,Ui as computeSiteEditCompositionKey,iu as computeSiteEditSourceIdentityKey,Pn as containsSensitiveData,Vd as createSiteEditCommandFailureSchema,Xo as createSiteEditCommandResultSchema,rs as createSiteEditCommandSuccessSchema,mP as defaultStep6Selection,Xb as deriveVcpGscState,Qb as doesGscPropertyMatchDomain,mg as findWorkflowDefinition,cg as findWorkflowDefinitionInRegistry,Us as fontStack,hf as formDesignOperationFingerprintInput,j1 as getDeploymentHappyPathTransitions,v1 as getDeploymentTransitionPredecessors,P1 as getDeploymentTransitionTargets,dc as getFontPairing,_c as getMotionPreset,bc as getSiteDesignThemeRadius,Gi as getSiteEditSourceDeleteProtectionReason,jb as getSitePublishRepairItems,Ww as getThemePreset,lg as getWorkflowDefinition,jk as getWorkflowNodeIndex,VE as hasAnyBusinessFact,TA as hasLockedSeeds,_v as hashAffectedFormDesignFiles,gv as hashCmsFormSchemaProjection,fi as hashFormDesignJson,uv as hashFormSpec,Ho as isCanonicalPageSlug,Lh as isCmsMainProductsWithinLimit,MR as isCmsPageSelectable,ko as isCmsTemplateUrlPath,EI as isConsentGranted,c_ as isDeploymentActiveStatus,C1 as isDeploymentTerminalStatus,rh as isExactEditEngineVersion,rI as isExternalSiteEditInfrastructureReason,ZP as isFormSpecLocalizableFieldPath,bR as isKnownStep5SseEventName,H1 as isMigrationProductsPresetBlockLabel,V1 as isMigrationProductsPresetPageTitle,XI as isNonLatinSiteLocale,Fa as isPageTemplateCandidateEntryPath,Pv as isPlatformMaterializedFile,Ih as isReservedSubsiteMountSegment,rp as isSiteEditDesignDocumentPath,ld as isSiteEditMaterializationPathTemplate,ih as isSiteEditRuntimeContainerTag,sh as isSiteEditRuntimeTextTag,nA as isSiteEditRuntimeVoidElementTag,BI as isSiteEditSourceDeleteProtectedPath,op as isSiteEditSourceDirectoryPath,Xa as isSiteEditSourcePath,Fi as isSiteEditTextSourcePath,Ob as isSitePublishRepairResultSuccessful,Rv as isSiteStructureKnownFieldPath,Iv as isSiteStructureLocalizableFieldPath,mo as isStep5SeoAllowedIntentCode,Ok as isWorkflowTaskTypeForNode,O_ as makeSiteEditRepeatInstanceKey,W1 as migrationProductsCopyForLocale,GP as normalizeCmsApplicationSlug,Nv as normalizeCmsPublicApiBase,Uc as normalizeFormOptionLabelIdentity,wn as normalizeGscDomain,So as normalizeStep5SeoKeyword,Bd as pageSlugToRouteFilePath,qR as parseCmsPageDirectory,M1 as parseComponentI18nResourcesJson,Zb as parseE2bPreviewProxyDomain,ch as parseExactEditEngineVersion,jI as parseSiteEditCompositionKey,N_ as parseSiteEditRepeatInstanceKey,OT as parseSiteEditSourceIdentityKey,Es as parseWorkspaceAttachmentImagePath,sv as projectFormSpecToCmsSchema,Jk as readWorkspaceAttachmentReferences,Jb as reconcileSitemapNavigation,$h as resolveFont,Xh as resolveFontDisplayName,iv as resolveFormTemplateText,Dk as resolvePublishedWorkflowDefinition,iI as resolveRedisConnectionConfig,SA as resolveRequestedEditEngineVersion,to as resolveSelectableSiteLocale,iA as resolveSiteEditRuntimeOperationSummary,YI as resolveSiteLocaleFromIso6393,$I as resolveSiteTextDirection,lS as resolveStep6RadiusId,fA as resolveSystemCurrentEditEngineVersion,pg as selectPublishedWorkflowDefinition,PI as selectReferenceVisualImage,dk as siteBuildStatusFromCode,hk as siteBuildStatusToCode,uk as siteDeploymentStatusFromCode,Sk as siteDeploymentStatusToCode,nS as siteFontVariables,gk as siteWorkflowStatusFromCode,fk as siteWorkflowStatusToCode,ph as splitSubsiteGlossaryEntry,pS as step6GptVisualIdentity,P0 as stripSiteEditRepeatInstanceKeys,_k as taskExecutionStatusFromCode,bk as taskExecutionStatusToCode,cP as toStep6GenerationVisualHints,$o as tryCanonicalizeAsciiPageSlug,Kr as validateComponentI18nResources,JP as validateFormSpecIdentityTransition,Zk as workspaceAttachmentImagePath};