@uniformdev/uniform-mcp 20.50.2-alpha.1 → 20.50.2

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.mjs CHANGED
@@ -94,11 +94,11 @@ See https://reactjs.org/docs/forms.html#controlled-components`),K=R.initialPage?
94
94
  `),r=[];for(let o of n)r.push("> "+o);return r.join(`
95
95
  `)},regExp:$ne,replace:(t,e,n,r)=>{if(r){let i=t.getPreviousSibling();if(Au(i))return i.splice(i.getChildrenSize(),0,[Kn(),...e]),void t.remove()}let o=F4();o.append(...e),t.replace(o),r||o.select(0,0)},type:"element"},Mne={dependencies:[Fl],export:t=>{if(!Gm(t))return null;let e=t.getTextContent();return"```"+(t.getLanguage()||"")+(e?`
96
96
  `+e:"")+"\n```"},regExpEnd:{optional:!0,regExp:fO},regExpStart:Nne,replace:(t,e,n,r,o,i)=>{let s,a;if(!e&&o){if(o.length===1)r?(s=Is(),a=n[1]+o[0]):(s=Is(n[1]),a=o[0].startsWith(" ")?o[0].slice(1):o[0]);else{if(s=Is(n[1]),o[0].trim().length===0)for(;o.length>0&&!o[0].length;)o.shift();else o[0]=o[0].startsWith(" ")?o[0].slice(1):o[0];for(;o.length>0&&!o[o.length-1].length;)o.pop();a=o.join(`
97
- `)}let l=mt(a);s.append(l),t.append(s)}else e&&Dne(l=>Is(l?l[1]:void 0))(t,e,n,i)},type:"multiline-element"},One={dependencies:[_a,wa],export:(t,e)=>Gr(t)?$E(t,e,0):null,regExp:_ne,replace:mO("bullet"),type:"element"},dTe={dependencies:[_a,wa],export:(t,e)=>Gr(t)?$E(t,e,0):null,regExp:Tne,replace:mO("check"),type:"element"},Ine={dependencies:[_a,wa],export:(t,e)=>Gr(t)?$E(t,e,0):null,regExp:wne,replace:mO("number"),type:"element"},kne={format:["code"],tag:"`",type:"text-format"},Rne={format:["highlight"],tag:"==",type:"text-format"},Pne={format:["bold","italic"],tag:"***",type:"text-format"},Fne={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},Bne={format:["bold"],tag:"**",type:"text-format"},zne={format:["bold"],intraword:!1,tag:"__",type:"text-format"},jne={format:["strikethrough"],tag:"~~",type:"text-format"},Vne={format:["italic"],tag:"*",type:"text-format"},Une={format:["italic"],intraword:!1,tag:"_",type:"text-format"},Hne={dependencies:[yE],export:(t,e,n)=>{if(!vE(t)||hE(t))return null;let r=t.getTitle(),o=e(t);return r?`[${o}](${t.getURL()} "${r}")`:`[${o}](${t.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(t,e)=>{let[,n,r,o]=e,i=gE(r,{title:o}),s=n.split("[").length-1,a=n.split("]").length-1,l=n,c="";if(s<a)return;if(s>a){let d=n.split("[");c="["+d[0],l=d.slice(1).join("[")}let u=mt(l);return u.setFormat(t.getFormat()),i.append(u),t.replace(i),c&&i.insertBefore(mt(c)),u},trigger:")",type:"text-match"},Kne=[Lne,Ane,One,Ine],Wne=[Mne],Gne=[kne,Pne,Fne,Bne,zne,Rne,Vne,Une,jne],Yne=[Hne],NE=[...Kne,...Wne,...Gne,...Yne]});var Vn,Kpt,Wpt,Gpt,Ypt,Zpt,qpt,Jpt,Xne,Xpt,Qne,Qpt,emt,tmt,nmt,ere,rmt,tre,nre,omt,rre,imt,smt,ore,amt,ire=ue(async()=>{"use strict";Vn=await(process.env.NODE_ENV!=="production"?vne().then(()=>hne):Jne().then(()=>qne)),Kpt=Vn.$convertFromMarkdownString,Wpt=Vn.$convertToMarkdownString,Gpt=Vn.BOLD_ITALIC_STAR,Ypt=Vn.BOLD_ITALIC_UNDERSCORE,Zpt=Vn.BOLD_STAR,qpt=Vn.BOLD_UNDERSCORE,Jpt=Vn.CHECK_LIST,Xne=Vn.CODE,Xpt=Vn.ELEMENT_TRANSFORMERS,Qne=Vn.HEADING,Qpt=Vn.HIGHLIGHT,emt=Vn.INLINE_CODE,tmt=Vn.ITALIC_STAR,nmt=Vn.ITALIC_UNDERSCORE,ere=Vn.LINK,rmt=Vn.MULTILINE_ELEMENT_TRANSFORMERS,tre=Vn.ORDERED_LIST,nre=Vn.QUOTE,omt=Vn.STRIKETHROUGH,rre=Vn.TEXT_FORMAT_TRANSFORMERS,imt=Vn.TEXT_MATCH_TRANSFORMERS,smt=Vn.TRANSFORMERS,ore=Vn.UNORDERED_LIST,amt=Vn.registerMarkdownShortcuts});var gie=_e((z3t,mie)=>{"use strict";var hDe=Object.prototype.hasOwnProperty,vDe=Object.prototype.toString;mie.exports=function(e,n,r){if(vDe.call(n)!=="[object Function]")throw new TypeError("iterator must be a function");var o=e.length;if(o===+o)for(var i=0;i<o;i++)n.call(r,e[i],i,e);else for(var s in e)hDe.call(e,s)&&n.call(r,e[s],s,e)}});var HO=_e((j3t,hie)=>{"use strict";var yDe=gie();hie.exports=_n;function _n(t,e,n){if(arguments.length===3)return _n.set(t,e,n);if(arguments.length===2)return _n.get(t,e);var r=_n.bind(_n,t);for(var o in _n)_n.hasOwnProperty(o)&&(r[o]=_n[o].bind(r,t));return r}_n.get=function(e,n){for(var r=Array.isArray(n)?n:_n.parse(n),o=0;o<r.length;++o){var i=r[o];if(!(typeof e=="object"&&i in e))throw new Error("Invalid reference token: "+i);e=e[i]}return e};_n.set=function(e,n,r){var o=Array.isArray(n)?n:_n.parse(n),i=o[0];if(o.length===0)throw Error("Can not set the root object");for(var s=0;s<o.length-1;++s){var a=o[s];typeof a!="string"&&typeof a!="number"&&(a=String(a)),!(a==="__proto__"||a==="constructor"||a==="prototype")&&(a==="-"&&Array.isArray(e)&&(a=e.length),i=o[s+1],a in e||(i.match(/^(\d+|-)$/)?e[a]=[]:e[a]={}),e=e[a])}return i==="-"&&Array.isArray(e)&&(i=e.length),e[i]=r,this};_n.remove=function(t,e){var n=Array.isArray(e)?e:_n.parse(e),r=n[n.length-1];if(r===void 0)throw new Error('Invalid JSON pointer for remove: "'+e+'"');var o=_n.get(t,n.slice(0,-1));if(Array.isArray(o)){var i=+r;if(r===""&&isNaN(i))throw new Error('Invalid array index: "'+r+'"');Array.prototype.splice.call(o,i,1)}else delete o[r]};_n.dict=function(e,n){var r={};return _n.walk(e,function(o,i){r[i]=o},n),r};_n.walk=function(e,n,r){var o=[];r=r||function(i){var s=Object.prototype.toString.call(i);return s==="[object Object]"||s==="[object Array]"},function i(s){yDe(s,function(a,l){o.push(String(l)),r(a)?i(a):n(a,_n.compile(o)),o.pop()})}(e)};_n.has=function(e,n){try{_n.get(e,n)}catch{return!1}return!0};_n.escape=function(e){return e.toString().replace(/~/g,"~0").replace(/\//g,"~1")};_n.unescape=function(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")};_n.parse=function(e){if(e==="")return[];if(e.charAt(0)!=="/")throw new Error("Invalid JSON pointer: "+e);return e.substring(1).split(/\//).map(_n.unescape)};_n.compile=function(e){return e.length===0?"":"/"+e.map(_n.escape).join("/")}});import{McpServer as lMe}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as cMe}from"@modelcontextprotocol/sdk/server/stdio.js";var cx={name:"@uniformdev/uniform-mcp",version:"20.50.1",description:"Uniform MCP Server",license:"SEE LICENSE IN LICENSE.txt",bin:{"uniform-mcp":"./dist/index.mjs"},exports:{".":{types:"./dist/index.d.mts",import:"./dist/index.mjs"},"./server":{types:"./dist/server.d.mts",import:"./dist/server.mjs"}},sideEffects:!1,scripts:{build:"run-p build:stdio build:server","build:stdio":"tsup --config tsup.stdio.config.ts","build:server":"tsup --config tsup.server.config.ts",dev:"tsup --watch --config tsup.stdio.config.ts",clean:"rimraf dist",lint:'eslint "src/**/*.{js,ts,tsx}"',format:'prettier --write "src/**/*.{js,ts,tsx}"',mcp:"node dist/index.mjs"},dependencies:{"@modelcontextprotocol/sdk":"1.25.2","@types/uuid":"9.0.4","@uniformdev/canvas":"workspace:*","@uniformdev/project-map":"workspace:*","fast-json-patch":"3.1.1",immer:"10.1.3",linkedom:"0.18.12",uuid:"9.0.1",zod:"3.25.76"},files:["/dist"],publishConfig:{access:"public"},devDependencies:{"@uniformdev/design-system":"workspace:*","@uniformdev/files":"workspace:*","@uniformdev/mesh-edgehancer-sdk":"workspace:*","@uniformdev/richtext":"workspace:*"}};var ZI=I(YI());var qI=(0,ZI.default)(6),ux=class t extends Error{constructor(n,r,o,i,s,a){super(`${n}
97
+ `)}let l=mt(a);s.append(l),t.append(s)}else e&&Dne(l=>Is(l?l[1]:void 0))(t,e,n,i)},type:"multiline-element"},One={dependencies:[_a,wa],export:(t,e)=>Gr(t)?$E(t,e,0):null,regExp:_ne,replace:mO("bullet"),type:"element"},dTe={dependencies:[_a,wa],export:(t,e)=>Gr(t)?$E(t,e,0):null,regExp:Tne,replace:mO("check"),type:"element"},Ine={dependencies:[_a,wa],export:(t,e)=>Gr(t)?$E(t,e,0):null,regExp:wne,replace:mO("number"),type:"element"},kne={format:["code"],tag:"`",type:"text-format"},Rne={format:["highlight"],tag:"==",type:"text-format"},Pne={format:["bold","italic"],tag:"***",type:"text-format"},Fne={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},Bne={format:["bold"],tag:"**",type:"text-format"},zne={format:["bold"],intraword:!1,tag:"__",type:"text-format"},jne={format:["strikethrough"],tag:"~~",type:"text-format"},Vne={format:["italic"],tag:"*",type:"text-format"},Une={format:["italic"],intraword:!1,tag:"_",type:"text-format"},Hne={dependencies:[yE],export:(t,e,n)=>{if(!vE(t)||hE(t))return null;let r=t.getTitle(),o=e(t);return r?`[${o}](${t.getURL()} "${r}")`:`[${o}](${t.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(t,e)=>{let[,n,r,o]=e,i=gE(r,{title:o}),s=n.split("[").length-1,a=n.split("]").length-1,l=n,c="";if(s<a)return;if(s>a){let d=n.split("[");c="["+d[0],l=d.slice(1).join("[")}let u=mt(l);return u.setFormat(t.getFormat()),i.append(u),t.replace(i),c&&i.insertBefore(mt(c)),u},trigger:")",type:"text-match"},Kne=[Lne,Ane,One,Ine],Wne=[Mne],Gne=[kne,Pne,Fne,Bne,zne,Rne,Vne,Une,jne],Yne=[Hne],NE=[...Kne,...Wne,...Gne,...Yne]});var Vn,Kpt,Wpt,Gpt,Ypt,Zpt,qpt,Jpt,Xne,Xpt,Qne,Qpt,emt,tmt,nmt,ere,rmt,tre,nre,omt,rre,imt,smt,ore,amt,ire=ue(async()=>{"use strict";Vn=await(process.env.NODE_ENV!=="production"?vne().then(()=>hne):Jne().then(()=>qne)),Kpt=Vn.$convertFromMarkdownString,Wpt=Vn.$convertToMarkdownString,Gpt=Vn.BOLD_ITALIC_STAR,Ypt=Vn.BOLD_ITALIC_UNDERSCORE,Zpt=Vn.BOLD_STAR,qpt=Vn.BOLD_UNDERSCORE,Jpt=Vn.CHECK_LIST,Xne=Vn.CODE,Xpt=Vn.ELEMENT_TRANSFORMERS,Qne=Vn.HEADING,Qpt=Vn.HIGHLIGHT,emt=Vn.INLINE_CODE,tmt=Vn.ITALIC_STAR,nmt=Vn.ITALIC_UNDERSCORE,ere=Vn.LINK,rmt=Vn.MULTILINE_ELEMENT_TRANSFORMERS,tre=Vn.ORDERED_LIST,nre=Vn.QUOTE,omt=Vn.STRIKETHROUGH,rre=Vn.TEXT_FORMAT_TRANSFORMERS,imt=Vn.TEXT_MATCH_TRANSFORMERS,smt=Vn.TRANSFORMERS,ore=Vn.UNORDERED_LIST,amt=Vn.registerMarkdownShortcuts});var gie=_e((z3t,mie)=>{"use strict";var hDe=Object.prototype.hasOwnProperty,vDe=Object.prototype.toString;mie.exports=function(e,n,r){if(vDe.call(n)!=="[object Function]")throw new TypeError("iterator must be a function");var o=e.length;if(o===+o)for(var i=0;i<o;i++)n.call(r,e[i],i,e);else for(var s in e)hDe.call(e,s)&&n.call(r,e[s],s,e)}});var HO=_e((j3t,hie)=>{"use strict";var yDe=gie();hie.exports=_n;function _n(t,e,n){if(arguments.length===3)return _n.set(t,e,n);if(arguments.length===2)return _n.get(t,e);var r=_n.bind(_n,t);for(var o in _n)_n.hasOwnProperty(o)&&(r[o]=_n[o].bind(r,t));return r}_n.get=function(e,n){for(var r=Array.isArray(n)?n:_n.parse(n),o=0;o<r.length;++o){var i=r[o];if(!(typeof e=="object"&&i in e))throw new Error("Invalid reference token: "+i);e=e[i]}return e};_n.set=function(e,n,r){var o=Array.isArray(n)?n:_n.parse(n),i=o[0];if(o.length===0)throw Error("Can not set the root object");for(var s=0;s<o.length-1;++s){var a=o[s];typeof a!="string"&&typeof a!="number"&&(a=String(a)),!(a==="__proto__"||a==="constructor"||a==="prototype")&&(a==="-"&&Array.isArray(e)&&(a=e.length),i=o[s+1],a in e||(i.match(/^(\d+|-)$/)?e[a]=[]:e[a]={}),e=e[a])}return i==="-"&&Array.isArray(e)&&(i=e.length),e[i]=r,this};_n.remove=function(t,e){var n=Array.isArray(e)?e:_n.parse(e),r=n[n.length-1];if(r===void 0)throw new Error('Invalid JSON pointer for remove: "'+e+'"');var o=_n.get(t,n.slice(0,-1));if(Array.isArray(o)){var i=+r;if(r===""&&isNaN(i))throw new Error('Invalid array index: "'+r+'"');Array.prototype.splice.call(o,i,1)}else delete o[r]};_n.dict=function(e,n){var r={};return _n.walk(e,function(o,i){r[i]=o},n),r};_n.walk=function(e,n,r){var o=[];r=r||function(i){var s=Object.prototype.toString.call(i);return s==="[object Object]"||s==="[object Array]"},function i(s){yDe(s,function(a,l){o.push(String(l)),r(a)?i(a):n(a,_n.compile(o)),o.pop()})}(e)};_n.has=function(e,n){try{_n.get(e,n)}catch{return!1}return!0};_n.escape=function(e){return e.toString().replace(/~/g,"~0").replace(/\//g,"~1")};_n.unescape=function(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")};_n.parse=function(e){if(e==="")return[];if(e.charAt(0)!=="/")throw new Error("Invalid JSON pointer: "+e);return e.substring(1).split(/\//).map(_n.unescape)};_n.compile=function(e){return e.length===0?"":"/"+e.map(_n.escape).join("/")}});import{McpServer as lMe}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as cMe}from"@modelcontextprotocol/sdk/server/stdio.js";var cx={name:"@uniformdev/uniform-mcp",version:"20.50.2",description:"Uniform MCP Server",license:"SEE LICENSE IN LICENSE.txt",bin:{"uniform-mcp":"./dist/index.mjs"},exports:{".":{types:"./dist/index.d.mts",import:"./dist/index.mjs"},"./server":{types:"./dist/server.d.mts",import:"./dist/server.mjs"}},sideEffects:!1,scripts:{build:"run-p build:stdio build:server","build:stdio":"tsup --config tsup.stdio.config.ts","build:server":"tsup --config tsup.server.config.ts",dev:"tsup --watch --config tsup.stdio.config.ts",clean:"rimraf dist",lint:'eslint "src/**/*.{js,ts,tsx}"',format:'prettier --write "src/**/*.{js,ts,tsx}"',mcp:"node dist/index.mjs"},dependencies:{"@modelcontextprotocol/sdk":"1.25.2","@types/uuid":"9.0.4","@uniformdev/canvas":"workspace:*","@uniformdev/project-map":"workspace:*","fast-json-patch":"3.1.1",immer:"10.1.3",linkedom:"0.18.12",uuid:"9.0.1",zod:"3.25.76"},files:["/dist"],publishConfig:{access:"public"},devDependencies:{"@uniformdev/design-system":"workspace:*","@uniformdev/files":"workspace:*","@uniformdev/mesh-edgehancer-sdk":"workspace:*","@uniformdev/richtext":"workspace:*"}};var ZI=I(YI());var qI=(0,ZI.default)(6),ux=class t extends Error{constructor(n,r,o,i,s,a){super(`${n}
98
98
  ${i}${s?" "+s:""} (${r} ${o}${a?` Request ID: ${a}`:""})`);this.errorMessage=n;this.fetchMethod=r;this.fetchUri=o;this.statusCode=i;this.statusText=s;this.requestId=a;Object.setPrototypeOf(this,t.prototype)}};var dx=class t{options;constructor(e){if(!e.apiKey&&!e.bearerToken)throw new Error("You must provide an API key or a bearer token");let n=e.fetch;if(!n)if(typeof window<"u")n=window.fetch.bind(window);else if(typeof fetch<"u")n=fetch;else throw new Error("You must provide or polyfill a fetch implementation when not in a browser");this.options={...e,fetch:n,apiHost:this.ensureApiHost(e.apiHost),apiKey:e.apiKey??null,projectId:e.projectId??null,bearerToken:e.bearerToken??null,limitPolicy:e.limitPolicy??qI,bypassCache:e.bypassCache??!1}}async apiClient(e,n){return(await this.apiClientWithResponse(e,n)).body}async apiClientWithResponse(e,n){return this.options.limitPolicy(async()=>{let r=this.options.apiKey?{"x-api-key":this.options.apiKey}:{Authorization:`Bearer ${this.options.bearerToken}`};this.options.bypassCache&&(r["x-bypass-cache"]="true");let{fetch:o,signal:i}=this.options,a=await Xae(()=>o(e.toString(),{...n,signal:i,headers:{...n?.headers,...r}}));if(!a.ok){let l="";try{let c=await a.text();try{let u=JSON.parse(c);u.errorMessage?l=Array.isArray(u.errorMessage)?u.errorMessage.join(", "):u.errorMessage:l=c}catch{l=c}}catch{l="General error"}throw new ux(l,n?.method??"GET",e.toString(),a.status,a.statusText,t.getRequestId(a))}return n?.expectNoContent?{response:a,body:null}:{response:a,body:await a.json()}})}createUrl(e,n,r){let o=new URL(`${r??this.options.apiHost}${e}`);return Object.entries(n??{}).forEach(([i,s])=>{typeof s<"u"&&s!==null&&o.searchParams.append(i,Array.isArray(s)?s.join(","):s?.toString()??"")}),o}ensureApiHost(e){if(!e)return"https://uniform.app";if(!e?.startsWith("http"))throw new Error('Your apiHost must start with "http"');if(e.indexOf("/",8)>-1)throw new Error("Your apiHost must not contain a path element after the domain");if(e.indexOf("?")>-1)throw new Error("Your apiHost must not contain a query string");return e?.endsWith("/")&&(e=e.substring(0,e.length-1)),e}static getRequestId(e){let n=e.headers.get("apigw-requestid");if(n)return n}};async function Xae(t){let n=5,r;for(;n>0&&(r=await t(),r.status===429);){let o=0;try{let a=r.clone(),l=a.headers.get("date"),c=l?new Date(l).getTime():void 0,d=(await a.json())?.info?.reset;typeof c=="number"&&typeof d=="number"&&(o=Math.max(0,Math.min(Math.round(1.1*(d-c)),1e4)))}catch{}let i=Math.pow(2,5-n)*333,s=i+Math.round(Math.random()*(i/2))*(Math.random()>.5?1:-1);await new Promise(a=>setTimeout(a,Math.max(0,o+s))),n-=1}return r}var fx=class extends dx{telemetryContext;constructor(e){e.apiHost||(e.apiHost="https://ai.uniform.global"),super(e),this.telemetryContext=e.telemetryContext}async invoke(e,n){let r={};if(this.telemetryContext){let{threadId:i,uniformClient:s,userAgent:a}=this.telemetryContext;i&&(r["x-thread-id"]=i),s&&(r["x-uniform-client"]=s),a&&(r["user-agent"]=a)}return(await this.apiClientWithResponse(new URL(`/projects/${this.options.projectId}/tools/${e}`,this.options.apiHost),{method:"POST",body:n?JSON.stringify(n):void 0,headers:Object.keys(r).length>0?r:void 0})).body}};var QI=process.env.UNIFORM_API_KEY,Vw=process.env.UNIFORM_PROJECT_ID,JI=process.env.UNIFORM_API_HOST??"https://uniform.app",Qae=process.env.UNIFORM_AI_API_HOST??"https://ai.uniform.global";if(!QI&&process.env.NODE_ENV!=="test")throw new Error("UNIFORM_API_KEY is not set");if(!Vw&&process.env.NODE_ENV!=="test")throw new Error("UNIFORM_PROJECT_ID is not set");var XI={apiHost:JI,apiKey:QI,projectId:Vw,baseWebUrl:`${JI}/projects/${Vw}`},ek={...XI,toolInvoker:new fx({...XI,apiHost:Qae,telemetryContext:{userAgent:`uniform-mcp/${cx.version}`,uniformClient:"mcp"}})};import{z as kp}from"zod";var tk={displayName:"Ask Una",description:"Ask the Uniform Docs assistant, Una, questions about Uniform features, usage, and best practices.",inputSchema:kp.object({question:kp.string().describe(`Prompt for the uniform docs AI assistant.
99
99
  The prompt should describe the information you are looking for.
100
100
  You may be detailed but do not use more than 100 words.
101
- When answering a user question, your prompt should be exactly that question.`)}),outputSchema:kp.object({success:kp.boolean(),error:kp.string().optional().describe("The error message if the question was not answered successfully"),answerMarkdown:kp.string().describe("The answer, in markdown format, from the Uniform docs chatbot")}),runsAt:"server",timeout:60,callable:!0};function nk(t,e){t.tool("askQuestion","Ask the Uniform Docs assistant, Una, questions about Uniform features, usage, and best practices",tk.inputSchema.shape,async n=>{let r=await e.toolInvoker.invoke("askQuestion",n);return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}})}import{autoFixParameterGroups as ak,CanvasClient as vle}from"@uniformdev/canvas";import*as yx from"zod/v3";import ele from"fast-json-patch";function px(t,e){return ele.applyPatch(t,e).newDocument}import*as Xs from"zod/v3";var mx=Xs.array(Xs.object({op:Xs.enum(["add","remove","replace"]),path:Xs.string().describe("The JSON path to patch"),value:Xs.unknown().describe("The value to patch - for remove, leave this blank")}));function tle(t){return Array.isArray(t)&&t.length>0}function rk(t){return!!t&&typeof t=="object"&&"type"in t}function ok(t){return typeof t=="object"&&t!==null&&"root"in t&&rk(t.root)}function Dd(t){return"children"in t&&tle(t.children)}var nle=({context:t,renderChildren:e})=>Dd(t.currentNode)?`${e(t.currentNode.children)} `:"";var rle=({context:t,renderChildren:e})=>{if(!Dd(t.currentNode))return"";let n=e(t.currentNode.children);return n.endsWith(" ")?n:`${n} `};var ole=({context:t,renderChildren:e})=>Dd(t.currentNode)?`${e(t.currentNode.children)} `:"";var ile=({context:t,renderChildren:e})=>Dd(t.currentNode)?`${e(t.currentNode.children)} `:"";var sle=({context:t,renderChildren:e})=>Dd(t.currentNode)?`${e(t.currentNode.children)} `:"";var ale=({context:t,renderChildren:e})=>Dd(t.currentNode)?`${e(t.currentNode.children)} `:"";var lle=({context:t})=>t.currentNode.text;var cle=()=>" ";var ule=()=>" ",dle=new Map([["text",lle],["tab",cle],["linebreak",ule],["paragraph",ole],["listitem",rle],["heading",nle],["table",ile],["tablecell",sle],["tablerow",ale]]),fle=t=>{let e=dle.get(t.currentNode.type);return e||(({context:n,renderChildren:r})=>Dd(n.currentNode)?r(n.currentNode.children):"")};function ple(t,e){let n=[];return e?.ancestorNodes&&(n=n.concat(e.ancestorNodes)),e?.currentNode&&n.unshift(e.currentNode),{...e??{},currentNode:t,ancestorNodes:n}}function Uw(t,e){var n;if(!rk(t))return"";let r=ple(t,e),o=(n=r.resolveRenderer)==null?void 0:n.call(r,r);if(typeof o>"u")o=fle(r);else if(o===null)return"";let i=s=>mle(s,r);if(o){let s=o({context:r,renderChildren:i});return r.ancestorNodes.length>0?s:s.trim()}else throw new Error(`There is no renderer for node type: ${r.currentNode.type}`)}function mle(t,e){return Array.isArray(t)?t.map(n=>Uw(n,e)).join(""):""}var gle=[{label:"Heading 1",type:"h1"},{label:"Heading 2",type:"h2"},{label:"Heading 3",type:"h3"},{label:"Heading 4",type:"h4"},{label:"Heading 5",type:"h5"},{label:"Heading 6",type:"h6"},{label:"Bullet List",type:"unorderedList"},{label:"Ordered List",type:"orderedList"},{label:"Link",type:"link"},{label:"Blockquote",type:"quote"},{label:"Code Block",type:"code"},{label:"Table",type:"table"},{label:"Asset",type:"asset"},{label:"Dynamic Token",type:"variable"}],hle=[{label:"Bold",type:"bold"},{label:"Italic",type:"italic"},{label:"Underline",type:"underline"},{label:"Strikethrough",type:"strikethrough"},{label:"Code",type:"code"},{label:"Superscript",type:"superscript"},{label:"Subscript",type:"subscript"}];var gx={required:!1,formatting:{builtIn:hle.map(t=>t.type)},elements:{builtIn:gle.map(t=>t.type)},elementsConfig:{asset:{allowedTypes:["image"]}}};import*as fr from"zod/v3";import*as Kt from"zod/v3";var hx=Kt.object({name:Kt.string().describe('Title-cased display name. Ex: "Headline"'),id:Kt.string().describe("The public ID. Must be unique within the current entity fields/parameters."),type:Kt.enum(["text","richText","select","multi-select","number","date","dateTime","checkbox","link","asset","json","contentReference","$enr","group"]).describe("The data type of the property. The group type defines a grouping of other properties."),guidance:Kt.string().describe('Describe what kind of content should be populated, for a LLM to use as a guide. 1-2 sentences max. Ex: "Meta tags based on the content", "2-3 word headline"'),localizable:Kt.boolean().describe("Whether values are stored as locale-specific"),typeConfig:Kt.object({allowedTypes:Kt.array(Kt.enum(["image","video","audio","other"])).optional().describe("The types of asset allowed. ONLY applies when type=asset, omit for other types"),options:Kt.array(Kt.object({text:Kt.string().describe("The text to display to the author"),value:Kt.string().describe("The value to store for the option")})).optional().describe("The author-selectable options for the select property. ONLY applies when type=select or multi-select, omit for other types"),required:Kt.boolean().optional().describe("Whether an author must enter a value for this property"),min:Kt.number().optional().describe("When type=number, this is the smallest allowed value (omit for no minimum). When type=multi-select, this is the minimum number of selections the author must make (omit for no minimum). When type=reference and isMulti=true, this is the minimum number of references the author must select (omit for no minimum). Omit for all other types."),max:Kt.number().optional().describe("When type=number, this is the largest allowed value (omit for no maximum). When type=multi-select, this is the maximum number of selections the author can make (omit for no maximum). When type=reference and isMulti=true, this is the maximum number of references the author can select (omit for no maximum). Omit for all other types."),allowedContentTypes:Kt.array(Kt.string()).optional().describe("When type=reference, this is a list of content type public IDs the author can reference. The content type ID must already exist. Omit for all other types."),isMulti:Kt.boolean().optional().describe("When type=reference, this is whether the author can select multiple referenced entries. When false, only one reference is allowed. Omit for all other types."),childrenParams:Kt.array(Kt.string()).optional().describe("When type=group, this is a list of public IDs of the properties to group. The property ID must be defined within this definition. Omit for all other types."),collapsed:Kt.boolean().optional().describe("When type=group, this is whether the group is collapsed by default."),schema:Kt.any().describe("When type=json, this is an optional JSON schema the property value must follow. Omit for all other types.")}).optional()});var ik=fr.object({name:fr.string().describe('Title-cased display name of the component. Ex: "Hero"'),id:fr.string().describe("Public ID of the component, the camelCase version of name, using only alphanumeric characters"),description:fr.string().describe('Describe the purpose of the component in 1-2 sentences. If the component seems generic, such as "Promo" or "Hero", this should be blank.'),canBeComposition:fr.boolean().describe("True if the component can have pages/compositions created from it. False if it is a part of a page."),parameters:fr.array(hx).describe("The properties of the component. The key is the publicId of the property.").optional(),slots:fr.array(fr.object({name:fr.string().describe('Title-cased display name of the slot. Ex: "Content"'),id:fr.string().describe("The public id of the slot. Must be unique within this component's slots."),allowedComponents:fr.array(fr.string()).describe("The components public IDs allowed in the slot."),minComponents:fr.number().describe("The minimum number of components allowed in the slot. Omit for no minimum.").min(0).optional(),maxComponents:fr.number().describe("The maximum number of components allowed in the slot. Omit for no maximum.").min(1).optional(),inheritAllowedComponents:fr.boolean().describe("Set to false")})).describe("The slots of the component. The key is the publicId of the slot.").optional()});function sk(t){let e=t.slots?.map(o=>({...o,patternsInAllowedComponents:!0,inheritAllowedComponents:!1,maxComponents:o.maxComponents===0?void 0:o.maxComponents,minComponents:o.minComponents===0?void 0:o.minComponents})),n=t.parameters?.find(o=>o.type==="asset"&&typeof o.typeConfig=="object"&&o.typeConfig!==null&&"allowedTypes"in o.typeConfig&&Array.isArray(o.typeConfig.allowedTypes)&&o.typeConfig.allowedTypes?.includes("image"))?.id,r=t.parameters?.find(o=>o.type==="text")?.id;return{...t,slots:e,titleParameter:r,thumbnailParameter:n}}function vx(t,e){return`${e.baseWebUrl}/dashboards/canvas/components/${t}`}function Rp(t,e){let n=t.filter(r=>e===void 0&&r.type==="richText"||e!==void 0&&e.includes(r.id));if(n.length!==0)for(let r of n){if(r.typeConfig===void 0){r.typeConfig=gx;continue}r.typeConfig={...gx,required:r.typeConfig.required??gx.required}}}var yle={action:yx.enum(["create","update","delete"]).describe("The action to perform"),publicId:yx.string().describe("Public ID of the component, the camelCase version of name, using only alphanumeric characters"),component:ik.describe("Full component definition to create. Omit for update or delete.").optional(),patches:mx.describe("JSON patch to apply to the existing component definition. Omit for create or delete.").optional()};function lk(t,e){t.tool("componentAction","Creates, updates, or deletes a Uniform Component definition (or Composition definition)",yle,async({publicId:n,action:r,component:o,patches:i})=>{let s=new vle(e),a=!1;if(r==="create"){if(!o)throw new Error("Component definition is required for create");let l=sk(o);l.parameters&&(a=ak(l.parameters),Rp(l.parameters)),await s.updateComponentDefinition({componentDefinition:l})}if(r==="update"){if(!i)throw new Error("Patches are required for update");let l=await s.getComponentDefinitions({componentId:n});if(!l.componentDefinitions.length)throw new Error(`Component with public ID ${n} does not exist, try creating it instead`);let c=l.componentDefinitions[0],u=c.parameters?.filter(f=>f.type==="richText").map(f=>f.id),d=px(c,i);if(d.parameters){a=ak(d.parameters);let f=d.parameters?.filter(p=>p.type==="richText").map(p=>p.id).filter(p=>!u?.includes(p));Rp(d.parameters,f)}await s.updateComponentDefinition({componentDefinition:d})}return r==="delete"&&await s.removeComponentDefinition({componentId:n}),{content:[{type:"text",text:JSON.stringify({success:!0,editUrl:vx(n,e),warning:a?"Issues with parameter group order were fixed. Ensure definition data is re-fetched before any future updates.":void 0},null,2)}]}})}import{CanvasClient as ck}from"@uniformdev/canvas";import*as uk from"zod/v3";var ble={id:uk.string()};function dk(t,e){t.tool("componentList","Lists all Uniform Component definitions",async()=>{let o=(await new ck(e).getComponentDefinitions({includeSystem:!0})).componentDefinitions.map(i=>({id:i.id,name:i.name,type:i.canBeComposition?"composition":"component",description:i.description,editUrl:vx(i.id,e)}));return{content:[{type:"text",text:JSON.stringify(o,null,2)}]}}),t.tool("componentGet","Gets a Uniform Component definition details (slots, parameters, etc.)",ble,async({id:n})=>{let o=await new ck(e).getComponentDefinitions({componentId:n,includeSystem:!0});return{content:[{type:"text",text:JSON.stringify(o.componentDefinitions[0],null,2)}]}})}import*as Je from"zod/v3";import*as Pp from"zod/v3";var wc=Pp.object({componentId:Pp.string().describe("ID of the component pattern instance the data resource belongs to - can be created in the same call to this tool"),dataResourceName:Pp.string().describe("Name of the data resource to update. Must be defined as a pattern data resource on the pattern, new names cannot be created"),editInstructions:Pp.string().describe('Prompt that will be used to generate the data resource value. Omission will leave the value unchanged. To reset an overridden value to pattern default, say "reset override".').optional()}).describe("A value change to a pattern data resource. Omit unchanged data resources.");var xle=Je.object({parentComponentId:Je.string().describe("ID of the component the slot belongs to"),slotName:Je.string().describe("Public ID of the target slot"),slotIndex:Je.number().describe("Index to insert the new component at. Omit for append.").optional(),newComponentInstanceUuid:Je.string().uuid().describe("UUID of the new component to create. You MUST generate a valid unique UUID using the `createUuid` tool."),instanceType:Je.enum(["component","componentPattern"]),componentType:Je.string().describe("Public ID of the component definition to insert. Component definition must be registered with Uniform. Omit when inserting a component pattern instance.").optional(),componentPatternId:Je.string().describe("UUID of the component pattern definition to insert. Component pattern must be registered with Uniform. Omit when inserting a component instance.").optional()}),bx=Je.object({componentId:Je.string().describe("ID of the component the parameter belongs to - can be created in the same call to this tool"),parameterId:Je.string().describe("Public ID of the parameter to update. Must be defined in the component type of the parent componentId"),parameterType:Je.string().describe("The type of the parameterId as defined on the component definition"),fromLocale:Je.string().describe("When translating from a different locale, use the locale you are translating from. Omit for non-localized values.").optional(),locale:Je.string().describe("Locale of the parameter value. Omit for non-localized values.").optional(),editInstructions:Je.string().describe('Prompt that will be used to generate the parameter value. Omission will leave the value unchanged. To reset an overridden value to pattern default, say "reset override".').optional()}).describe("A value change to a parameter. Omit unchanged parameters."),xx=Je.object({createComponentInstances:Je.array(xle).describe("New components to insert in slots. Do not use for moves or duplications. Omit for delete. These actions are performed before moving, duplicating, or deleting components, and parameter updates.").optional(),moveComponentInstances:Je.array(Je.object({componentId:Je.string().describe("Existing component ID to move. Cannot be root component."),newParentComponentId:Je.string(),newSlotName:Je.string().describe("Destination slot to move to"),newSlotIndex:Je.number().describe("Destination index in the parent slot to move to")})).describe("Moves existing component instances to a new location in a composition. The destination can be the same slot to cause a reorder. Omit for create or delete, or if nothing needs moving. These actions are performed before duplicating or deleting components, and parameter updates.").optional(),duplicateComponentInstances:Je.array(Je.string().describe("Component ID to duplicate. Cannot be root component. All descendants of the duplicated component will be duplicated as well. Duplicates are placed in the same slot as the original component, at the end.")).describe("Component instances to duplicate/copy. Omit when empty. These actions are performed before deleting components and parameter updates.").optional(),deleteComponentInstances:Je.array(Je.string().describe("Component ID to remove. Cannot be the pattern root component.")).describe("Component instances to delete from slots during an update. Omit for create or delete, or if nothing needs deleting. These actions are performed after moving and duplicating components, and before parameter updates.").optional(),dataResourceUpdates:Je.array(wc).describe("Updates to pattern data resources. Use empty array if no changes are needed.").optional()}),_c=Je.object({enableLocales:Je.array(Je.string()).describe("Locales to enable. Omit for no change.").optional(),disableLocales:Je.array(Je.string()).describe("Locales to disable. Existing data in disabled locales will be lost. Omit for no change.").optional()}),Cle=Je.object({summary:Je.string().describe("Short summary of the edit that was made.").optional(),success:Je.boolean()}),GMe=Je.object({success:Je.boolean().describe("Whether all actions were successful"),actionsTaken:Je.array(Cle).describe("Array of individual actions that were taken")});import*as il from"zod/v3";var Sle=bx.extend({overridable:il.enum(["yes","no"]).describe("Whether the parameter value set on the pattern definition is overridable by pattern consumers. Omit when no change is needed.").optional()}),fk=xx.extend({name:il.string().describe("Name of the pattern. If the name does not need to be changed, omit this field. Always include for creates.").optional(),type:il.string().describe("Component definition type of the pattern. Must be registered with Uniform. Always include for creates. Omit otherwise.").optional(),description:il.string().describe("Description of the pattern for authors. If the description does not need to be changed, omit this field.").optional(),parameterUpdates:il.array(Sle).describe("Updates to the parameters of the pattern. Use empty array if no changes are needed.").optional(),dataResourceUpdates:il.array(wc).describe("Updates to the pattern instance data resources. Use empty array if no changes are needed.").optional(),localeUpdates:_c.optional()}).describe("Modification instructions for the pattern");import*as Tc from"zod/v3";var pk=Tc.object({...xx.shape,name:Tc.string().describe("Name of the composition. If the name does not need to be changed, omit this field. Always include for creates.").optional(),type:Tc.string().describe("Component definition type of the composition. Must be registered with Uniform and have canBeComposition=true in the component definition. Always include for creates. Omit otherwise.").optional(),parameterUpdates:Tc.array(bx).describe("Updates to the parameters of the pattern. Use empty array if no changes are needed.").optional(),localeUpdates:_c.optional(),dataResourceUpdates:Tc.array(wc).describe("Updates to pattern instance data resources. Use empty array if no changes are needed.").optional()}).describe("Modification instructions for the composition");import*as Qs from"zod/v3";import*as Ko from"zod/v3";var Hw=Ko.object({fieldId:Ko.string().describe("Public ID of the field to update. Must be defined in the content type of the parent entry."),fieldType:Ko.string().describe("The type of the fieldId as defined on the content type"),fromLocale:Ko.string().describe("When translating from a different locale, use the locale you are translating from. Omit for non-localized values.").optional(),locale:Ko.string().describe("Locale of the field value. Omit for non-localized values.").optional(),editInstructions:Ko.string().describe('Prompt that will be used to generate the field value. Omission will leave the value unchanged. To reset an overridden value to pattern default, say "reset override".').optional()}).describe("A value change to a field. Omit unchanged fields."),mk=Ko.object({type:Ko.string().describe("Content type of the entry. Must be registered with Uniform. Always include for creates. Omit otherwise.").optional(),slug:Ko.string().describe("Slug (human-readable identifier) of the entry. If the slug does not need to be changed, omit this field.").optional(),fieldUpdates:Ko.array(Hw).describe("Updates to the fields of the entry. Use empty array if no changes are needed.").optional(),localeUpdates:_c.optional(),dataResourceUpdates:Ko.array(wc).describe("Updates to the data resources of the entry. Use empty array if no changes are needed.").optional()}).describe("Modification instructions for the entry");var Ele=Hw.extend({overridable:Qs.enum(["yes","no"]).describe("Whether the parameter value set on the pattern definition is overridable by pattern consumers. Omit when no change is needed.").optional()}),gk=Qs.object({name:Qs.string().describe("Name of the entry pattern. If the name does not need to be changed, omit this field. Always include for creates.").optional(),type:Qs.string().describe("Content type of the entry pattern. Must be registered with Uniform. Always include for creates. Omit otherwise.").optional(),description:Qs.string().describe("Description of the entry pattern for authors. If the description does not need to be changed, omit this field.").optional(),fieldUpdates:Qs.array(Ele).describe("Updates to the fields of the entry pattern. Use empty array if no changes are needed.").optional(),localeUpdates:_c.optional()}).describe("Modification instructions for the entry pattern");import*as ro from"zod/v3";import{CANVAS_BLOCK_PARAM_TYPE as cDe}from"@uniformdev/canvas";import{getEffectivePropertyValue as uDe}from"@uniformdev/canvas";import{CANVAS_PERSONALIZATION_PARAM as dDe}from"@uniformdev/canvas";var Ld="uniformContentInternalReference";var wle="$p:";function Cx(t){return`${wle}${t}`}function hk({slotDefinition:t,slotSectionDefinition:e}){return{slotDefinition:{...t,allowedComponentsIndex:new Set(t?.allowedComponents??[]),maxComponents:t?.maxComponents??Number.MAX_VALUE,minComponents:t?.minComponents??0,allowAllPatternsOfAllowedTypes:!t?.patternsInAllowedComponents},slotSectionDefinition:e?{...e,specificTypesIndex:new Set(e?.specificTypes??[])}:void 0}}import{CANVAS_HYPOTHESIS_PARAM as dOe,CANVAS_LOCALIZATION_SLOT as fOe,CANVAS_LOCALIZATION_TYPE as pOe,CANVAS_PERSONALIZATION_ALGORITHM_PARAM as mOe,CANVAS_PERSONALIZATION_ALGORITHM_TYPE as gOe,CANVAS_PERSONALIZATION_EVENT_NAME_PARAM as hOe,CANVAS_PERSONALIZATION_TAKE_PARAM as vOe,CANVAS_PERSONALIZE_SLOT as yOe,CANVAS_PERSONALIZE_TYPE as bOe,CANVAS_SLOT_SECTION_GROUP_TYPE_PARAM as xOe,CANVAS_SLOT_SECTION_MAX_PARAM as COe,CANVAS_SLOT_SECTION_MIN_PARAM as SOe,CANVAS_SLOT_SECTION_NAME_PARAM as EOe,CANVAS_SLOT_SECTION_SLOT as wOe,CANVAS_SLOT_SECTION_SPECIFIC_PARAM as _Oe,CANVAS_SLOT_SECTION_TYPE as TOe,CANVAS_TEST_SLOT as $Oe,CANVAS_TEST_TYPE as NOe}from"@uniformdev/canvas";var _le={$personalization:{isNestableIntoItself:!0},$test:void 0,$localization:void 0,$loop:void 0,$slotSection:{isAutoAllowed:!0,isNestableIntoItself:!0,isOnlyAllowedInPatternEditor:!0}},vk=t=>_le[t];function Sx(t,{slotDefinition:e,slotSectionDefinition:n},r=!1){let o=Tle(t,e,r);return n?o?$le(t,n):!1:o}function Tle(t,e,n=!1){let r=vk(t.type);if(r?.isOnlyAllowedInPatternEditor&&!n)return!1;if(r?.isAutoAllowed||e.allowAllComponents)return!0;let o=e.allowedComponentsIndex.has(t.type);return e.allowAllPatternsOfAllowedTypes||!t._pattern?o:e.allowedComponentsIndex.has(Cx(t._pattern))||!1}function $le(t,e){return e.groupType==="inherit"||!e.groupType?!0:e.groupType==="specific"?t._pattern?e.specificTypesIndex.has(Cx(t._pattern)):e.specificTypesIndex.has(t.type):e.groupType==="except"?t._pattern?!e.specificTypesIndex.has(Cx(t._pattern)):!e.specificTypesIndex.has(t.type):!1}function Ex(t,e,n,r){return`ref-${t}-${e}`+(n?`-${n}`:"")+(r!==void 0&&r>-1?`(${r})`:"")}function yk(t,e={}){let{targetLocale:n,enabledLocales:r=[],isPatternParameter:o=!1}=e,i=n??(r.length>0?"${locale}":void 0);return{type:Ld,...o?{isPatternParameter:!0}:{},variables:{entryIds:t,...i?{locale:i}:{}}}}import{CANVAS_SLOT_SECTION_GROUP_TYPE_PARAM as Nle,CANVAS_SLOT_SECTION_MAX_PARAM as Dle,CANVAS_SLOT_SECTION_MIN_PARAM as Lle,CANVAS_SLOT_SECTION_NAME_PARAM as Ale,CANVAS_SLOT_SECTION_SLOT as Mle,CANVAS_SLOT_SECTION_SPECIFIC_PARAM as Ole,CANVAS_SLOT_SECTION_TYPE as Ile}from"@uniformdev/canvas";var Ww=({twee:t,parentNodeId:e,slotName:n,componentDefinitionsIndex:r})=>{let o=Kw({twee:t,parentNodeId:e,slotName:n,componentDefinitionsIndex:r});if(o)return hk(o)};function Kw({twee:t,parentNodeId:e,slotName:n,componentDefinitionsIndex:r}){let o=t.getNodeById(e);if(!o)return;if(n===Mle){let c=kle({node:o,twee:t}),u=t.getParentInfo(e);if(!u)return;let d=Kw({parentNodeId:u.parentId,slotName:u.parentName,twee:t,componentDefinitionsIndex:r});return d?{slotDefinition:d.slotDefinition,slotSectionDefinition:c}:void 0}let s=r[o.value.type]?.slots?.find(c=>c.id===n);if(!s)return;if(!s.inheritAllowedComponents)return{slotDefinition:s,slotSectionDefinition:void 0};let a=t.getParentInfo(e);if(!a)return{slotDefinition:s,slotSectionDefinition:void 0};let l=Kw({parentNodeId:a.parentId,slotName:a.parentName,twee:t,componentDefinitionsIndex:r});return l?{slotDefinition:l.slotDefinition,slotSectionDefinition:void 0}:{slotDefinition:s,slotSectionDefinition:void 0}}function kle({node:t,twee:e}){if(t.value.type!==Ile)return;let n=e.getNodeProperty(t.nodeId,Nle)?.value??"inherit",r=e.getNodeProperty(t.nodeId,Ale)?.value??"Slot Section",o=Number(e.getNodeProperty(t.nodeId,Lle)?.value),i=Number(e.getNodeProperty(t.nodeId,Dle)?.value),s=e.getNodeProperty(t.nodeId,Ole)?.value??[];return{groupType:n,name:r,specificTypes:s,min:o,max:i}}function _x({definition:t,lastUserChoice:e,currentValue:n}){if(t&&!t.localizable)return!1;if(n){if(n.locales&&wx(n.locales)||n.localesConditions&&wx(n.localesConditions))return!0;if(n.value!==void 0||n.conditions!==void 0)return!1}if(e!==void 0)return e;if(t)return!t.notLocalizedByDefault}function wx(t){return Array.isArray(t)?t.some(e=>wx(e)):t===void 0?!1:t===null||typeof t!="object"?!0:Object.values(t).some(e=>wx(e))}function Gw({twee:t,nodeId:e,currentEditorLocale:n,definition:r}){let o=t.getNodeById(e),i=o?.propertyValueLocalizability?.[r.id],s=t.getNodeProperty(e,r?.id),a=_x({lastUserChoice:i,currentValue:s,definition:r});if(o&&a!==void 0&&a!==(i??!1)&&t.updateNode({nodeId:e,updateMetadata:l=>{l.propertyValueLocalizability[r.id]=a},doNotSetDirty:!0}),a)return n}function bk({twee:t,nodeId:e,dataType:n,dataResourceName:r,dataResourceEdit:o}){if(!t.getNodeById(e))throw new Error(`Node with ID ${e} not found`);o.action==="resetOverride"?t.updateNode({nodeId:e,updateDataResources:[{type:"reset",name:r}]}):o.action==="setValue"&&t.updateNode({nodeId:e,updateDataResources:[{type:"set",name:r,value:{type:n,variables:o.newValue}}]})}import{CANVAS_ENRICHMENT_TAG_PARAM as Q8e,CANVAS_PERSONALIZATION_ALGORITHM_PARAM as eDe,CANVAS_PERSONALIZATION_PARAM as tDe,CANVAS_PERSONALIZE_SLOT as nDe,convertToBindExpression as rDe,createVariableReference as oDe,isSystemComponentDefinition as iDe}from"@uniformdev/canvas";var xk=Object.prototype.hasOwnProperty;function $r(t,e){var n,r;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&$r(t[r],e[r]););return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(xk.call(t,n)&&++r&&!xk.call(e,n)||!(n in e)||!$r(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}function Tx(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}var Rle={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Yw(t,e){function n(o,i,s){if(!(typeof document>"u")){s=Tx({},e,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in s)s[l]&&(a+="; "+l,s[l]!==!0&&(a+="="+s[l].split(";")[0]));return document.cookie=o+"="+t.write(i,o)+a}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],s={},a=0;a<i.length;a++){var l=i[a].split("="),c=l.slice(1).join("=");try{var u=decodeURIComponent(l[0]);if(s[u]=t.read(c,u),o===u)break}catch{}}return o?s[o]:s}}return Object.create({set:n,get:r,remove:function(o,i){n(o,"",Tx({},i,{expires:-1}))},withAttributes:function(o){return Yw(this.converter,Tx({},this.attributes,o))},withConverter:function(o){return Yw(Tx({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var Ple=Yw(Rle,{path:"/"});function x0(t){return{all:t=t||new Map,on:function(e,n){var r=t.get(e);r?r.push(n):t.set(e,[n])},off:function(e,n){var r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var r=t.get(e);r&&r.slice().map(function(o){o(n)}),(r=t.get("*"))&&r.slice().map(function(o){o(e,n)})}}}var wk=I(C0(),1);var Lk=I(C0(),1),Ak=I(C0(),1);var zle=t=>{throw TypeError(t)};var Qw=(t,e,n)=>e.has(t)||zle("Cannot "+n),fn=(t,e,n)=>(Qw(t,e,"read from private field"),n?n.call(t):e.get(t));var Sk=(t,e,n,r)=>(Qw(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),E0=(t,e,n)=>(Qw(t,e,"access private method"),n);var jle="_",Vle;Vle=new WeakMap;var Ule,Hle;Ule=new WeakMap;Hle=new WeakMap;var Kle,Wle,Gle,Yle;Kle=new WeakMap;Wle=new WeakMap;Gle=new WeakMap;Yle=new WeakMap;function Zle(t,e){return`${t}${jle}${e}`}function qle(t,e){var n;if(typeof t>"u"||t===null)return!1;let r=Number(t);if(isNaN(r))return!1;switch((n=e?.op)!=null?n:"="){case"=":return r===e.rhs;case"!=":return r!==e.rhs;case">":return r>e.rhs;case"<":return r<e.rhs;default:return console.warn(`Unknown match type ${e.op} is false.`),!1}}function Jle(t,e){return`${t} ${Xle(e)}`}function Xle(t){return`${t.op} ${t.rhs}`}var Zw=Zle("$pvc","v"),Qle=({update:t,criteria:e,commands:n,onLogMessage:r})=>{var o,i;if(e.type!=="PVC")return{result:!1,changed:!1};let s=!!(t.state.url&&(!t.previousState||((o=t.state.url)==null?void 0:o.toString())!==((i=t.previousState.url)==null?void 0:i.toString()))),l=(t.visitor.sessionScores[Zw]||0)+1,c={result:!1,changed:s},u=n.some(d=>d.type==="modscoreS"&&d.data.dimension===Zw);return s&&!u&&n.push({type:"modscoreS",data:{dimension:Zw,delta:1}}),qle(l,e.match)&&(c.result=!0),r?.(["debug",203,{criteria:e,result:c,explanation:Jle(l,e.match)}]),c};Qle.alwaysExecute=!0;var ece;ece=new WeakMap;var Ek="ssc";var tce,nce,rce;tce=new WeakMap;nce=new WeakMap;rce=new WeakMap;var qw="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",QOe=qw.split(""),oce=new Array(123);for(let t=0;t<qw.length;t++)oce[qw.charCodeAt(t)]=t;var ice,sce,ace,lce;ice=new WeakMap;sce=new WeakMap;ace=new WeakMap;lce=new WeakMap;var cce,uce;cce=new WeakSet;uce=async function(){let t=await new Promise(e=>{setTimeout(()=>{e(void 0)},2e3)});t&&this.signalAsyncDataUpdate(t)};var dce=()=>({quirks:{},scores:{},sessionScores:{},tests:{},goals:{},consent:!1,controlGroup:!1,personalizeVariants:{}}),nIe=(0,wk.default)();var fce,pce;fce=new WeakSet;pce=function(t){return this.partitionKey?`${this.partitionKey}.${t}`:t};var _k="ufvisitor",Ad,e_,$x,yi,S0,Tk,mce,$k,gce,Jw,hce;Ad=new WeakMap;e_=new WeakMap;$x=new WeakMap;yi=new WeakMap;S0=new WeakSet;Tk=function(){return fn(this,e_).get(_k)};mce=function(t,e=!1){var n,r,o,i,s,a,l,c,u,d,f;let p=fn(this,S0,Tk),m=Date.now();E0(this,S0,Jw).call(this,t.scores),E0(this,S0,Jw).call(this,t.sessionScores),(r=(n=fn(this,yi)).decay)==null||r.call(n,{now:m,lastUpd:p?.updated,scores:t.scores,sessionScores:t.sessionScores,onLogMessage:fn(this,yi).onLogMessage});let g=!$r(p?.visitorData.scores,t.scores),h=!$r(p?.visitorData.sessionScores,t.sessionScores),v=!$r(p?.visitorData.quirks,t.quirks),y=!$r(p?.visitorData.tests,t.tests),b=!$r(p?.visitorData.goals,t.goals),S={updated:m,visitorData:t};if(E0(this,S0,$k).call(this),fn(this,e_).set(_k,S,!!t.consent),(i=(o=fn(this,yi)).onLogMessage)==null||i.call(o,["debug",102,t]),!e&&((g||h)&&fn(this,Ad).emit("scoresUpdated",t),v&&fn(this,Ad).emit("quirksUpdated",t),y&&fn(this,Ad).emit("testsUpdated",t),((s=p?.visitorData)==null?void 0:s.consent)!==t.consent&&fn(this,Ad).emit("consentUpdated",t),((a=p?.visitorData)==null?void 0:a.controlGroup)!==t.controlGroup&&(fn(this,Ad).emit("controlGroupUpdated",t),(u=(c=fn(this,yi)).onLogMessage)==null||u.call(c,["debug",104,(l=t.controlGroup)!=null?l:!1])),b)){let x=Object.keys((d=t.goals)!=null?d:{});for(let E=0;E<x.length;E++){let w=x[E];(f=p?.visitorData.goals)!=null&&f[w]||fn(this,Ad).emit("goalConverted",{goalId:w})}}};$k=function(){typeof document>"u"||!fn(this,yi).visitLifespan||(fn(this,$x)&&window.clearTimeout(fn(this,$x)),Sk(this,$x,window.setTimeout(()=>{this.data},fn(this,yi).visitLifespan+50)))};gce=function(t){let e=fn(this,yi).visitLifespan;return e?t.updated+e<Date.now():!1};Jw=function(t){var e,n;if(fn(this,yi).manifest)for(let r in t){let o=t[r],i=fn(this,yi).manifest.getDimensionByKey(r);i&&o>i.cap&&((n=(e=fn(this,yi)).onLogMessage)==null||n.call(e,["debug",110,{dim:r,score:o,cap:i.cap}]),t[r]=i.cap)}};hce=function(){var t,e,n;return{...dce(),consent:(t=fn(this,yi).defaultConsent)!=null?t:!1,controlGroup:(n=(e=fn(this,yi).manifest)==null?void 0:e.rollForControlGroup())!=null?n:!1}};var vce,yce,Nx,bce,xce,Cce,Sce,Ece,Dx,Xw,wce,Nk,_ce,Dk;vce=new WeakMap;yce=new WeakMap;Nx=new WeakMap;bce=new WeakMap;xce=new WeakMap;Cce=new WeakMap;Sce=new WeakMap;Ece=new WeakMap;Dx=new WeakMap;Xw=new WeakSet;wce=function(t){fn(this,Dx).emit("testResult",t)};Nk=async function(t){let e=this.manifest.computeGoals(t);e.length!==0&&await this.storage.updateData(e)};_ce=function(t){let e=E0(this,Xw,Dk).call(this,t);!$r(e,fn(this,Nx))&&(Sk(this,Nx,e),E0(this,Xw,Nk).call(this,{scores:fn(this,Nx),quirks:void 0}),fn(this,Dx).emit("scoresUpdated",e),fn(this,Dx).emit("log",["info",3,e]))};Dk=function(t){var e;let n={...t.scores};for(let r in t.sessionScores)n[r]=((e=n[r])!=null?e:0)+t.sessionScores[r];return n=this.manifest.computeAggregateDimensions(n),n};var iIe=(0,Lk.default)();var sIe=(0,Ak.default)();await Ym();var S1e=await(process.env.NODE_ENV!=="production"?jV().then(()=>zV):UV().then(()=>VV)),HV=S1e.createHeadlessEditor;await p4();await M4();await z4();await FW();await a3();await uG();await Ji();await rr();import{createVariableReference as K8e}from"@uniformdev/canvas";var Pu=I(Jn());dN();var gVe=I(H());Bg();var vVe=I(pN());Y1();var bVe=I(oN());jg();Vg();D3();var li=Pu.Fragment,O=function(e,n,r){return $f.call(n,"css")?Pu.jsx(ev,Q1(e,n),r):Pu.jsx(e,n,r)},ie=function(e,n,r){return $f.call(n,"css")?Pu.jsxs(ev,Q1(e,n),r):Pu.jsxs(e,n,r)};ne();ne();ne();ne();ne();function aY(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];t&&t.addEventListener&&t.addEventListener.apply(t,e)}function lY(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];t&&t.removeEventListener&&t.removeEventListener.apply(t,e)}var cY=typeof window<"u";var uY=I(H());var ks=I(H());function gN(t,e){e===void 0&&(e=0);var n=(0,ks.useRef)(!1),r=(0,ks.useRef)(),o=(0,ks.useRef)(t),i=(0,ks.useCallback)(function(){return n.current},[]),s=(0,ks.useCallback)(function(){n.current=!1,r.current&&clearTimeout(r.current),r.current=setTimeout(function(){n.current=!0,o.current()},e)},[e]),a=(0,ks.useCallback)(function(){n.current=null,r.current&&clearTimeout(r.current)},[]);return(0,ks.useEffect)(function(){o.current=t},[t]),(0,ks.useEffect)(function(){return s(),a},[e]),[i,a,s]}function O3(t,e,n){e===void 0&&(e=0),n===void 0&&(n=[]);var r=gN(t,e),o=r[0],i=r[1],s=r[2];return(0,uY.useEffect)(s,n),[o,i]}var Hg=I(H());var oCe=function(t){return t===void 0&&(t={laptopL:1440,laptop:1024,tablet:768}),function(){var e=(0,Hg.useState)(cY?window.innerWidth:0),n=e[0],r=e[1];(0,Hg.useEffect)(function(){var s=function(){r(window.innerWidth)};return s(),aY(window,"resize",s),function(){lY(window,"resize",s)}});var o=(0,Hg.useMemo)(function(){return Object.entries(t).sort(function(s,a){return s[1]>=a[1]?1:-1})},[t]),i=o.reduce(function(s,a){var l=a[0],c=a[1];return n>=c?l:s},o[0][0]);return i}},hN=oCe;ne();ne();ne();var a6e=I(H());ne();ne();function Nf(...t){}function tv(t,e){if(iCe(t)){let n=sCe(e)?e():e;return t(n)}return t}function iCe(t){return typeof t=="function"}function sCe(t){return typeof t=="function"}function ko(t,e){return typeof Object.hasOwn=="function"?Object.hasOwn(t,e):Object.prototype.hasOwnProperty.call(t,e)}function Ln(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}function vN(t){return t.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function yN(t,e){let n={...t};for(let r of e)ko(n,r)&&delete n[r];return n}function bN(t,e){let n={};for(let r of e)ko(t,r)&&(n[r]=t[r]);return n}function nv(t){return t}function dt(t,e){if(!t)throw typeof e!="string"?new Error("Invariant failed"):new Error(e)}function xN(t){return Object.keys(t)}function Ra(t,...e){let n=typeof t=="function"?t(...e):t;return n==null?!1:!n}function Rs(t){return t.disabled||t["aria-disabled"]===!0||t["aria-disabled"]==="true"}function Ro(t){let e={};for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}function et(...t){for(let e of t)if(e!==void 0)return e}var dY=I(H(),1);function rv(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function aCe(t){return!t||!(0,dY.isValidElement)(t)?!1:"ref"in t.props||"ref"in t}function fY(t){return aCe(t)?{...t.props}.ref||t.ref:null}function pY(t,e){let n={...t};for(let r in e){if(!ko(e,r))continue;if(r==="className"){let i="className";n[i]=t[i]?`${t[i]} ${e[i]}`:e[i];continue}if(r==="style"){let i="style";n[i]=t[i]?{...t[i],...e[i]}:e[i];continue}let o=e[r];if(typeof o=="function"&&r.startsWith("on")){let i=t[r];if(typeof i=="function"){n[r]=(...s)=>{o(...s),i(...s)};continue}}n[r]=o}return n}var Wl=lCe();function lCe(){var t;return typeof window<"u"&&!!((t=window.document)!=null&&t.createElement)}function wt(t){return t?"self"in t?t.document:t.ownerDocument||document:document}function Df(t){return t?"self"in t?t.self:wt(t).defaultView||window:self}function _i(t,e=!1){let{activeElement:n}=wt(t);if(!n?.nodeName)return null;if(ov(n)&&n.contentDocument)return _i(n.contentDocument.body,e);if(e){let r=n.getAttribute("aria-activedescendant");if(r){let o=wt(n).getElementById(r);if(o)return o}}return n}function Vt(t,e){return t===e||t.contains(e)}function ov(t){return t.tagName==="IFRAME"}function ci(t){let e=t.tagName.toLowerCase();return e==="button"?!0:e==="input"&&t.type?cCe.indexOf(t.type)!==-1:!1}var cCe=["button","color","file","image","reset","submit"];function iv(t){if(typeof t.checkVisibility=="function")return t.checkVisibility();let e=t;return e.offsetWidth>0||e.offsetHeight>0||t.getClientRects().length>0}function Po(t){try{let e=t instanceof HTMLInputElement&&t.selectionStart!==null,n=t.tagName==="TEXTAREA";return e||n||!1}catch{return!1}}function sv(t){return t.isContentEditable||Po(t)}function CN(t){if(Po(t))return t.value;if(t.isContentEditable){let e=wt(t).createRange();return e.selectNodeContents(t),e.toString()}return""}function SN(t){let e=0,n=0;if(Po(t))e=t.selectionStart||0,n=t.selectionEnd||0;else if(t.isContentEditable){let r=wt(t).getSelection();if(r?.rangeCount&&r.anchorNode&&Vt(t,r.anchorNode)&&r.focusNode&&Vt(t,r.focusNode)){let o=r.getRangeAt(0),i=o.cloneRange();i.selectNodeContents(t),i.setEnd(o.startContainer,o.startOffset),e=i.toString().length,i.setEnd(o.endContainer,o.endOffset),n=i.toString().length}}return{start:e,end:n}}function Kg(t,e){let n=["dialog","menu","listbox","tree","grid"],r=t?.getAttribute("role");return r&&n.indexOf(r)!==-1?r:e}function av(t,e){var n;let r={menu:"menuitem",listbox:"option",tree:"treeitem"},o=Kg(t);return o&&(n=r[o])!=null?n:e}function I3(t){if(!t)return null;let e=n=>n==="auto"||n==="scroll";if(t.clientHeight&&t.scrollHeight>t.clientHeight){let{overflowY:n}=getComputedStyle(t);if(e(n))return t}else if(t.clientWidth&&t.scrollWidth>t.clientWidth){let{overflowX:n}=getComputedStyle(t);if(e(n))return t}return I3(t.parentElement)||document.scrollingElement||document.body}function lv(t,e){let n=t.map((o,i)=>[i,o]),r=!1;return n.sort(([o,i],[s,a])=>{let l=e(i),c=e(a);return l===c||!l||!c?0:uCe(l,c)?(o>s&&(r=!0),-1):(o<s&&(r=!0),1)}),r?n.map(([o,i])=>i):t}function uCe(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}function mY(){return Wl&&!!navigator.maxTouchPoints}function Wg(){return Wl?/mac|iphone|ipad|ipod/i.test(navigator.platform):!1}function Lf(){return Wl&&Wg()&&/apple/i.test(navigator.vendor)}function EN(){return Wl&&/firefox\//i.test(navigator.userAgent)}function wN(){return Wl&&navigator.platform.startsWith("Mac")&&!mY()}function k3(t){return!!(t.currentTarget&&!Vt(t.currentTarget,t.target))}function Zr(t){return t.target===t.currentTarget}function gY(t){let e=t.currentTarget;if(!e)return!1;let n=Wg();if(n&&!t.metaKey||!n&&!t.ctrlKey)return!1;let r=e.tagName.toLowerCase();return r==="a"||r==="button"&&e.type==="submit"||r==="input"&&e.type==="submit"}function hY(t){let e=t.currentTarget;if(!e)return!1;let n=e.tagName.toLowerCase();return t.altKey?n==="a"||n==="button"&&e.type==="submit"||n==="input"&&e.type==="submit":!1}function vY(t,e,n){let r=new Event(e,n);return t.dispatchEvent(r)}function Af(t,e){let n=new FocusEvent("blur",e),r=t.dispatchEvent(n),o={...e,bubbles:!0};return t.dispatchEvent(new FocusEvent("focusout",o)),r}function yY(t,e,n){let r=new KeyboardEvent(e,n);return t.dispatchEvent(r)}function _N(t,e){let n=new MouseEvent("click",e);return t.dispatchEvent(n)}function Fu(t,e){let n=e||t.currentTarget,r=t.relatedTarget;return!r||!Vt(n,r)}function Bu(t,e,n,r){let i=(a=>{if(r){let c=setTimeout(a,r);return()=>clearTimeout(c)}let l=requestAnimationFrame(a);return()=>cancelAnimationFrame(l)})(()=>{t.removeEventListener(e,s,!0),n()}),s=()=>{i(),n()};return t.addEventListener(e,s,{once:!0,capture:!0}),i}function Bn(t,e,n,r=window){let o=[];try{r.document.addEventListener(t,e,n);for(let s of Array.from(r.frames))o.push(Bn(t,e,n,s))}catch{}return()=>{try{r.document.removeEventListener(t,e,n)}catch{}for(let s of o)s()}}var dCe=I(H(),1),zn=I(H(),1),TN={...dCe},bY=TN.useId,iUe=TN.useDeferredValue,xY=TN.useInsertionEffect,ht=Wl?zn.useLayoutEffect:zn.useEffect;function P3(t){let e=(0,zn.useRef)(t);return ht(()=>{e.current=t}),e}function Oe(t){let e=(0,zn.useRef)(()=>{throw new Error("Cannot call an event handler while rendering.")});return xY?xY(()=>{e.current=t}):e.current=t,(0,zn.useCallback)((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function wY(t){let[e,n]=(0,zn.useState)(null);return ht(()=>{if(e==null||!t)return;let r=null;return t(o=>(r=o,e)),()=>{t(r)}},[e,t]),[e,n]}function gt(...t){return(0,zn.useMemo)(()=>{if(t.some(Boolean))return e=>{for(let n of t)rv(n,e)}},t)}function ui(t){if(bY){let r=bY();return t||r}let[e,n]=(0,zn.useState)(t);return ht(()=>{if(t||e)return;let r=Math.random().toString(36).slice(2,8);n(`id-${r}`)},[t,e]),t||e}function F3(t,e){let n=i=>{if(typeof i=="string")return i},[r,o]=(0,zn.useState)(()=>n(e));return ht(()=>{let i=t&&"current"in t?t.current:t;o(i?.tagName.toLowerCase()||n(e))},[t,e]),r}function zu(t,e){let n=(0,zn.useRef)(!1);(0,zn.useEffect)(()=>{if(n.current)return t();n.current=!0},e),(0,zn.useEffect)(()=>()=>{n.current=!1},[])}function _Y(){return(0,zn.useReducer)(()=>[],[])}function ar(t){return Oe(typeof t=="function"?t:()=>t)}function bn(t,e,n=[]){let r=(0,zn.useCallback)(o=>(t.wrapElement&&(o=t.wrapElement(o)),e(o)),[...n,t.wrapElement]);return{...t,wrapElement:r}}function Gg(t=!1,e){let[n,r]=(0,zn.useState)(null);return{portalRef:gt(r,e),portalNode:n,domReady:!t||n}}function B3(t,e,n){let r=t.onLoadedMetadataCapture,o=(0,zn.useMemo)(()=>Object.assign(()=>{},{...r,[e]:n}),[r,e,n]);return[r?.[e],{onLoadedMetadataCapture:o}]}var CY=!1;function Yg(){return(0,zn.useEffect)(()=>{CY||(Bn("mousemove",pCe,!0),Bn("mousedown",R3,!0),Bn("mouseup",R3,!0),Bn("keydown",R3,!0),Bn("scroll",R3,!0),CY=!0)},[]),Oe(()=>$N)}var $N=!1,SY=0,EY=0;function fCe(t){let e=t.movementX||t.screenX-SY,n=t.movementY||t.screenY-EY;return SY=t.screenX,EY=t.screenY,e||n||process.env.NODE_ENV==="test"}function pCe(t){fCe(t)&&($N=!0)}function R3(){$N=!1}var Fo=I(H(),1),Mf=I(Jn(),1);function Ee(t){let e=Fo.forwardRef((n,r)=>t({...n,ref:r}));return e.displayName=t.displayName||t.name,e}function ju(t,e){return Fo.memo(t,e)}function Te(t,e){let{wrapElement:n,render:r,...o}=e,i=gt(e.ref,fY(r)),s;if(Fo.isValidElement(r)){let a={...r.props,ref:i};s=Fo.cloneElement(r,pY(o,a))}else r?s=r(o):s=(0,Mf.jsx)(t,{...o});return n?n(s):s}function Ne(t){let e=(n={})=>t(n);return e.displayName=t.name,e}function yr(t=[],e=[]){let n=Fo.createContext(void 0),r=Fo.createContext(void 0),o=()=>Fo.useContext(n),i=(c=!1)=>{let u=Fo.useContext(r),d=o();return c?u:u||d},s=()=>{let c=Fo.useContext(r),u=o();if(!(c&&c===u))return u},a=c=>t.reduceRight((u,d)=>(0,Mf.jsx)(d,{...c,children:u}),(0,Mf.jsx)(n.Provider,{...c}));return{context:n,scopedContext:r,useContext:o,useScopedContext:i,useProviderContext:s,ContextProvider:a,ScopedContextProvider:c=>(0,Mf.jsx)(a,{...c,children:e.reduceRight((u,d)=>(0,Mf.jsx)(d,{...c,children:u}),(0,Mf.jsx)(r.Provider,{...c}))})}}var cv=yr(),TY=cv.useContext,dUe=cv.useScopedContext,fUe=cv.useProviderContext,$Y=cv.ContextProvider,NY=cv.ScopedContextProvider;var NN=I(H(),1),uv=yr([$Y],[NY]),Zg=uv.useContext,hUe=uv.useScopedContext,DY=uv.useProviderContext,Vu=uv.ContextProvider,qg=uv.ScopedContextProvider,LY=(0,NN.createContext)(void 0),AY=(0,NN.createContext)(void 0);var mCe={id:null};function MY(t,e,n=!1){let r=t.findIndex(o=>o.id===e);return[...t.slice(r+1),...n?[mCe]:[],...t.slice(0,r)]}function OY(t,e){return t.find(n=>e?!n.disabled&&n.id!==e:!n.disabled)}function Pa(t,e){return e&&t.item(e)||null}function IY(t){let e=[];for(let n of t){let r=e.find(o=>{var i;return((i=o[0])==null?void 0:i.rowId)===n.rowId});r?r.push(n):e.push([n])}return e}function kY(t,e=!1){if(Po(t))t.setSelectionRange(e?t.value.length:0,t.value.length);else if(t.isContentEditable){let n=wt(t).getSelection();n?.selectAllChildren(t),e&&n?.collapseToEnd()}}var DN=Symbol("FOCUS_SILENTLY");function RY(t){t[DN]=!0,t.focus({preventScroll:!0})}function PY(t){let e=t[DN];return delete t[DN],e}function Of(t,e,n){if(!e||e===n)return!1;let r=t.item(e.id);return!(!r||n&&r.element===n)}var z3=I(H(),1),gCe="div",LN=Ne(function({store:e,shouldRegisterItem:n=!0,getItem:r=nv,element:o,...i}){let s=TY();e=e||s;let a=ui(i.id),l=(0,z3.useRef)(o);return(0,z3.useEffect)(()=>{let c=l.current;if(!a||!c||!n)return;let u=r({id:a,element:c});return e?.renderItem(u)},[a,n,r,e]),i={...i,ref:gt(l,i.ref)},Ro(i)}),wUe=Ee(function(e){let n=LN(e);return Te(gCe,n)});var FY=I(H(),1),j3=(0,FY.createContext)(!0);var V3="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function hCe(t){return Number.parseInt(t.getAttribute("tabindex")||"0",10)<0}function Ti(t){return!(!t.matches(V3)||!iv(t)||t.closest("[inert]"))}function Jg(t){if(!Ti(t)||hCe(t))return!1;if(!("form"in t)||!t.form||t.checked||t.type!=="radio")return!0;let e=t.form.elements.namedItem(t.name);if(!e||!("length"in e))return!0;let n=_i(t);return!n||n===t||!("form"in n)||n.form!==t.form||n.name!==t.name}function AN(t,e){let n=Array.from(t.querySelectorAll(V3));e&&n.unshift(t);let r=n.filter(Ti);return r.forEach((o,i)=>{if(ov(o)&&o.contentDocument){let s=o.contentDocument.body;r.splice(i,1,...AN(s))}}),r}function dv(t,e,n){let r=Array.from(t.querySelectorAll(V3)),o=r.filter(Jg);return e&&Jg(t)&&o.unshift(t),o.forEach((i,s)=>{if(ov(i)&&i.contentDocument){let a=i.contentDocument.body,l=dv(a,!1,n);o.splice(s,1,...l)}}),!o.length&&n?r:o}function BY(t,e,n){let[r]=dv(t,e,n);return r||null}function vCe(t,e,n,r){let o=_i(t),i=AN(t,e),s=i.indexOf(o),a=i.slice(s+1);return a.find(Jg)||(n?i.find(Jg):null)||(r?a[0]:null)||null}function U3(t,e){return vCe(document.body,!1,t,e)}function yCe(t,e,n,r){let o=_i(t),i=AN(t,e).reverse(),s=i.indexOf(o),a=i.slice(s+1);return a.find(Jg)||(n?i.find(Jg):null)||(r?a[0]:null)||null}function MN(t,e){return yCe(document.body,!1,t,e)}function zY(t){for(;t&&!Ti(t);)t=t.closest(V3);return t||null}function If(t){let e=_i(t);if(!e)return!1;if(e===t)return!0;let n=e.getAttribute("aria-activedescendant");return n?n===t.id:!1}function ts(t){let e=_i(t);if(!e)return!1;if(Vt(t,e))return!0;let n=e.getAttribute("aria-activedescendant");return!n||!("id"in t)?!1:n===t.id?!0:!!t.querySelector(`#${CSS.escape(n)}`)}function H3(t){!ts(t)&&Ti(t)&&t.focus()}function bCe(t){var e;let n=(e=t.getAttribute("tabindex"))!=null?e:"";t.setAttribute("data-tabindex",n),t.setAttribute("tabindex","-1")}function jY(t,e){let n=dv(t,e);for(let r of n)bCe(r)}function VY(t){let e=t.querySelectorAll("[data-tabindex]"),n=r=>{let o=r.getAttribute("data-tabindex");r.removeAttribute("data-tabindex"),o?r.setAttribute("tabindex",o):r.removeAttribute("tabindex")};t.hasAttribute("data-tabindex")&&n(t);for(let r of e)n(r)}function UY(t,e){"scrollIntoView"in t?(t.focus({preventScroll:!0}),t.scrollIntoView({block:"nearest",inline:"nearest",...e})):t.focus()}var $i=I(H(),1),xCe="div",HY=Lf(),CCe=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],YY=Symbol("safariFocusAncestor");function ZY(t){return t?!!t[YY]:!1}function KY(t,e){t&&(t[YY]=e)}function SCe(t){let{tagName:e,readOnly:n,type:r}=t;return e==="TEXTAREA"&&!n||e==="SELECT"&&!n?!0:e==="INPUT"&&!n?CCe.includes(r):!!(t.isContentEditable||t.getAttribute("role")==="combobox"&&t.dataset.name)}function ECe(t){return"labels"in t?t.labels:null}function WY(t){return t.tagName.toLowerCase()==="input"&&t.type?t.type==="radio"||t.type==="checkbox":!1}function wCe(t){return t?t==="button"||t==="summary"||t==="input"||t==="select"||t==="textarea"||t==="a":!0}function _Ce(t){return t?t==="button"||t==="input"||t==="select"||t==="textarea":!0}function TCe(t,e,n,r,o){return t?e?n&&!r?-1:void 0:n?o:o||0:o}function ON(t,e){return Oe(n=>{t?.(n),!n.defaultPrevented&&e&&(n.stopPropagation(),n.preventDefault())})}var GY=!1,IN=!0;function $Ce(t){let e=t.target;e&&"hasAttribute"in e&&(e.hasAttribute("data-focus-visible")||(IN=!1))}function NCe(t){t.metaKey||t.ctrlKey||t.altKey||(IN=!0)}var Gl=Ne(function({focusable:e=!0,accessibleWhenDisabled:n,autoFocus:r,onFocusVisible:o,...i}){let s=(0,$i.useRef)(null);(0,$i.useEffect)(()=>{e&&(GY||(Bn("mousedown",$Ce,!0),Bn("keydown",NCe,!0),GY=!0))},[e]),HY&&(0,$i.useEffect)(()=>{if(!e)return;let k=s.current;if(!k||!WY(k))return;let z=ECe(k);if(!z)return;let W=()=>queueMicrotask(()=>k.focus());for(let R of z)R.addEventListener("mouseup",W);return()=>{for(let R of z)R.removeEventListener("mouseup",W)}},[e]);let a=e&&Rs(i),l=!!a&&!n,[c,u]=(0,$i.useState)(!1);(0,$i.useEffect)(()=>{e&&l&&c&&u(!1)},[e,l,c]),(0,$i.useEffect)(()=>{if(!e||!c)return;let k=s.current;if(!k||typeof IntersectionObserver>"u")return;let z=new IntersectionObserver(()=>{Ti(k)||u(!1)});return z.observe(k),()=>z.disconnect()},[e,c]);let d=ON(i.onKeyPressCapture,a),f=ON(i.onMouseDownCapture,a),p=ON(i.onClickCapture,a),m=i.onMouseDown,g=Oe(k=>{if(m?.(k),k.defaultPrevented||!e)return;let z=k.currentTarget;if(!HY||k3(k)||!ci(z)&&!WY(z))return;let W=!1,R=()=>{W=!0},F={capture:!0,once:!0};z.addEventListener("focusin",R,F);let K=zY(z.parentElement);KY(K,!0),Bu(z,"mouseup",()=>{z.removeEventListener("focusin",R,!0),KY(K,!1),!W&&H3(z)})}),h=(k,z)=>{if(z&&(k.currentTarget=z),!e)return;let W=k.currentTarget;W&&If(W)&&(o?.(k),!k.defaultPrevented&&(W.dataset.focusVisible="true",u(!0)))},v=i.onKeyDownCapture,y=Oe(k=>{if(v?.(k),k.defaultPrevented||!e||c||k.metaKey||k.altKey||k.ctrlKey||!Zr(k))return;let z=k.currentTarget;Bu(z,"focusout",()=>h(k,z))}),b=i.onFocusCapture,S=Oe(k=>{if(b?.(k),k.defaultPrevented||!e)return;if(!Zr(k)){u(!1);return}let z=k.currentTarget,W=()=>h(k,z);IN||SCe(k.target)?Bu(k.target,"focusout",W):u(!1)}),x=i.onBlur,E=Oe(k=>{x?.(k),e&&Fu(k)&&(k.currentTarget.removeAttribute("data-focus-visible"),u(!1))}),w=(0,$i.useContext)(j3),_=Oe(k=>{e&&r&&k&&w&&queueMicrotask(()=>{If(k)||Ti(k)&&k.focus()})}),$=F3(s),T=e&&wCe($),N=e&&_Ce($),P=i.style,B=(0,$i.useMemo)(()=>l?{pointerEvents:"none",...P}:P,[l,P]);return i={"data-focus-visible":e&&c||void 0,"data-autofocus":r||void 0,"aria-disabled":a||void 0,...i,ref:gt(s,_,i.ref),style:B,tabIndex:TCe(e,l,T,N,i.tabIndex),disabled:N&&l?!0:void 0,contentEditable:a?void 0:i.contentEditable,onKeyPressCapture:d,onClickCapture:p,onMouseDownCapture:f,onMouseDown:g,onKeyDownCapture:y,onFocusCapture:S,onBlur:E},Ro(i)}),BUe=Ee(function(e){let n=Gl(e);return Te(xCe,n)});var Uu=I(H(),1),DCe="button";function qY(t){if(!t.isTrusted)return!1;let e=t.currentTarget;return t.key==="Enter"?ci(e)||e.tagName==="SUMMARY"||e.tagName==="A":t.key===" "?ci(e)||e.tagName==="SUMMARY"||e.tagName==="INPUT"||e.tagName==="SELECT":!1}var LCe=Symbol("command"),fv=Ne(function({clickOnEnter:e=!0,clickOnSpace:n=!0,...r}){let o=(0,Uu.useRef)(null),[i,s]=(0,Uu.useState)(!1);(0,Uu.useEffect)(()=>{o.current&&s(ci(o.current))},[]);let[a,l]=(0,Uu.useState)(!1),c=(0,Uu.useRef)(!1),u=Rs(r),[d,f]=B3(r,LCe,!0),p=r.onKeyDown,m=Oe(v=>{p?.(v);let y=v.currentTarget;if(v.defaultPrevented||d||u||!Zr(v)||Po(y)||y.isContentEditable)return;let b=e&&v.key==="Enter",S=n&&v.key===" ",x=v.key==="Enter"&&!e,E=v.key===" "&&!n;if(x||E){v.preventDefault();return}if(b||S){let w=qY(v);if(b){if(!w){v.preventDefault();let{view:_,...$}=v,T=()=>_N(y,$);EN()?Bu(y,"keyup",T):queueMicrotask(T)}}else S&&(c.current=!0,w||(v.preventDefault(),l(!0)))}}),g=r.onKeyUp,h=Oe(v=>{if(g?.(v),v.defaultPrevented||d||u||v.metaKey)return;let y=n&&v.key===" ";if(c.current&&y&&(c.current=!1,!qY(v))){v.preventDefault(),l(!1);let b=v.currentTarget,{view:S,...x}=v;queueMicrotask(()=>_N(b,x))}});return r={"data-active":a||void 0,type:i?"button":void 0,...f,...r,ref:gt(o,r.ref),onKeyDown:m,onKeyUp:h},r=Gl(r),r}),YUe=Ee(function(e){let n=fv(e);return Te(DCe,n)});function kf(t,e){let n=t.__unstableInternals;return dt(n,"Invalid store"),n[e]}function lr(t,...e){let n=t,r=n,o=Symbol(),i=Nf,s=new Set,a=new Set,l=new Set,c=new Set,u=new Set,d=new WeakMap,f=new WeakMap,p=_=>(l.add(_),()=>l.delete(_)),m=()=>{let _=s.size,$=Symbol();s.add($);let T=()=>{s.delete($),!s.size&&i()};if(_)return T;let N=xN(n).map(k=>Ln(...e.map(z=>{var W;let R=(W=z?.getState)==null?void 0:W.call(z);if(R&&ko(R,k))return Tr(z,[k],F=>{E(k,F[k],!0)})}))),P=[];for(let k of l)P.push(k());let B=e.map(Xg);return i=Ln(...N,...P,...B),T},g=(_,$,T=c)=>(T.add($),f.set($,_),()=>{var N;(N=d.get($))==null||N(),d.delete($),f.delete($),T.delete($)}),h=(_,$)=>g(_,$),v=(_,$)=>(d.set($,$(n,n)),g(_,$)),y=(_,$)=>(d.set($,$(n,r)),g(_,$,u)),b=_=>lr(bN(n,_),w),S=_=>lr(yN(n,_),w),x=()=>n,E=(_,$,T=!1)=>{var N;if(!ko(n,_))return;let P=tv($,n[_]);if(P===n[_])return;if(!T)for(let W of e)(N=W?.setState)==null||N.call(W,_,P);let B=n;n={...n,[_]:P};let k=Symbol();o=k,a.add(_);let z=(W,R,F)=>{var K;let L=f.get(W),M=A=>F?F.has(A):A===_;(!L||L.some(M))&&((K=d.get(W))==null||K(),d.set(W,W(n,R)))};for(let W of c)z(W,B);queueMicrotask(()=>{if(o!==k)return;let W=n;for(let R of u)z(R,r,a);r=W,a.clear()})},w={getState:x,setState:E,__unstableInternals:{setup:p,init:m,subscribe:h,sync:v,batch:y,pick:b,omit:S}};return w}function di(t,...e){if(t)return kf(t,"setup")(...e)}function Xg(t,...e){if(t)return kf(t,"init")(...e)}function Qg(t,...e){if(t)return kf(t,"subscribe")(...e)}function Tr(t,...e){if(t)return kf(t,"sync")(...e)}function eh(t,...e){if(t)return kf(t,"batch")(...e)}function Rf(t,...e){if(t)return kf(t,"omit")(...e)}function kN(t,...e){if(t)return kf(t,"pick")(...e)}function Pf(...t){var e;let n={};for(let o of t){let i=(e=o?.getState)==null?void 0:e.call(o);i&&Object.assign(n,i)}let r=lr(n,...t);return Object.assign({},...t,r)}function Yl(t,e){if(process.env.NODE_ENV==="production"||!e)return;let n=Object.entries(t).filter(([i,s])=>i.startsWith("default")&&s!==void 0).map(([i])=>{var s;let a=i.replace("default","");return`${((s=a[0])==null?void 0:s.toLowerCase())||""}${a.slice(1)}`});if(!n.length)return;let r=e.getState();if(n.filter(i=>ko(r,i)).length)throw new Error(`Passing a store prop in conjunction with a default state is not supported.
101
+ When answering a user question, your prompt should be exactly that question.`)}),outputSchema:kp.object({success:kp.boolean(),error:kp.string().optional().describe("The error message if the question was not answered successfully"),answerMarkdown:kp.string().describe("The answer, in markdown format, from the Uniform docs chatbot")}),runsAt:"server",timeout:60,callable:!0};function nk(t,e){t.tool("askQuestion","Ask the Uniform Docs assistant, Una, questions about Uniform features, usage, and best practices",tk.inputSchema.shape,async n=>{let r=await e.toolInvoker.invoke("askQuestion",n);return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}})}import{autoFixParameterGroups as ak,CanvasClient as vle}from"@uniformdev/canvas";import*as yx from"zod/v3";import ele from"fast-json-patch";function px(t,e){return ele.applyPatch(t,e).newDocument}import*as Xs from"zod/v3";var mx=Xs.array(Xs.object({op:Xs.enum(["add","remove","replace"]),path:Xs.string().describe("The JSON path to patch"),value:Xs.unknown().describe("The value to patch - for remove, leave this blank")}));function tle(t){return Array.isArray(t)&&t.length>0}function rk(t){return!!t&&typeof t=="object"&&"type"in t}function ok(t){return typeof t=="object"&&t!==null&&"root"in t&&rk(t.root)}function Dd(t){return"children"in t&&tle(t.children)}var nle=({context:t,renderChildren:e})=>Dd(t.currentNode)?`${e(t.currentNode.children)} `:"";var rle=({context:t,renderChildren:e})=>{if(!Dd(t.currentNode))return"";let n=e(t.currentNode.children);return n.endsWith(" ")?n:`${n} `};var ole=({context:t,renderChildren:e})=>Dd(t.currentNode)?`${e(t.currentNode.children)} `:"";var ile=({context:t,renderChildren:e})=>Dd(t.currentNode)?`${e(t.currentNode.children)} `:"";var sle=({context:t,renderChildren:e})=>Dd(t.currentNode)?`${e(t.currentNode.children)} `:"";var ale=({context:t,renderChildren:e})=>Dd(t.currentNode)?`${e(t.currentNode.children)} `:"";var lle=({context:t})=>t.currentNode.text;var cle=()=>" ";var ule=()=>" ",dle=new Map([["text",lle],["tab",cle],["linebreak",ule],["paragraph",ole],["listitem",rle],["heading",nle],["table",ile],["tablecell",sle],["tablerow",ale]]),fle=t=>{let e=dle.get(t.currentNode.type);return e||(({context:n,renderChildren:r})=>Dd(n.currentNode)?r(n.currentNode.children):"")};function ple(t,e){let n=[];return e?.ancestorNodes&&(n=n.concat(e.ancestorNodes)),e?.currentNode&&n.unshift(e.currentNode),{...e??{},currentNode:t,ancestorNodes:n}}function Uw(t,e){var n;if(!rk(t))return"";let r=ple(t,e),o=(n=r.resolveRenderer)==null?void 0:n.call(r,r);if(typeof o>"u")o=fle(r);else if(o===null)return"";let i=s=>mle(s,r);if(o){let s=o({context:r,renderChildren:i});return r.ancestorNodes.length>0?s:s.trim()}else throw new Error(`There is no renderer for node type: ${r.currentNode.type}`)}function mle(t,e){return Array.isArray(t)?t.map(n=>Uw(n,e)).join(""):""}var gle=[{label:"Heading 1",type:"h1"},{label:"Heading 2",type:"h2"},{label:"Heading 3",type:"h3"},{label:"Heading 4",type:"h4"},{label:"Heading 5",type:"h5"},{label:"Heading 6",type:"h6"},{label:"Bullet List",type:"unorderedList"},{label:"Ordered List",type:"orderedList"},{label:"Link",type:"link"},{label:"Blockquote",type:"quote"},{label:"Code Block",type:"code"},{label:"Table",type:"table"},{label:"Asset",type:"asset"},{label:"Dynamic Token",type:"variable"}],hle=[{label:"Bold",type:"bold"},{label:"Italic",type:"italic"},{label:"Underline",type:"underline"},{label:"Strikethrough",type:"strikethrough"},{label:"Code",type:"code"},{label:"Superscript",type:"superscript"},{label:"Subscript",type:"subscript"}];var gx={required:!1,formatting:{builtIn:hle.map(t=>t.type)},elements:{builtIn:gle.map(t=>t.type)},elementsConfig:{asset:{allowedTypes:["image"]}}};import*as fr from"zod/v3";import*as Kt from"zod/v3";var hx=Kt.object({name:Kt.string().describe('Title-cased display name. Ex: "Headline"'),id:Kt.string().describe("The public ID. Must be unique within the current entity fields/parameters."),type:Kt.enum(["text","richText","select","multi-select","number","date","dateTime","checkbox","link","asset","json","contentReference","$enr","group"]).describe("The data type of the property. The group type defines a grouping of other properties."),guidance:Kt.string().describe('Describe what kind of content should be populated, for a LLM to use as a guide. 1-2 sentences max. Ex: "Meta tags based on the content", "2-3 word headline"'),localizable:Kt.boolean().describe("Whether values are stored as locale-specific"),typeConfig:Kt.object({allowedTypes:Kt.array(Kt.enum(["image","video","audio","other"])).optional().describe("The types of asset allowed. ONLY applies when type=asset, omit for other types"),options:Kt.array(Kt.object({text:Kt.string().describe("The text to display to the author"),value:Kt.string().describe("The value to store for the option")})).optional().describe("The author-selectable options for the select property. ONLY applies when type=select or multi-select, omit for other types"),required:Kt.boolean().optional().describe("Whether an author must enter a value for this property"),min:Kt.number().optional().describe("When type=number, this is the smallest allowed value (omit for no minimum). When type=multi-select, this is the minimum number of selections the author must make (omit for no minimum). When type=reference and isMulti=true, this is the minimum number of references the author must select (omit for no minimum). Omit for all other types."),max:Kt.number().optional().describe("When type=number, this is the largest allowed value (omit for no maximum). When type=multi-select, this is the maximum number of selections the author can make (omit for no maximum). When type=reference and isMulti=true, this is the maximum number of references the author can select (omit for no maximum). Omit for all other types."),allowedContentTypes:Kt.array(Kt.string()).optional().describe("When type=reference, this is a list of content type public IDs the author can reference. The content type ID must already exist. Omit for all other types."),isMulti:Kt.boolean().optional().describe("When type=reference, this is whether the author can select multiple referenced entries. When false, only one reference is allowed. Omit for all other types."),childrenParams:Kt.array(Kt.string()).optional().describe("When type=group, this is a list of public IDs of the properties to group. The property ID must be defined within this definition. Omit for all other types."),collapsed:Kt.boolean().optional().describe("When type=group, this is whether the group is collapsed by default."),schema:Kt.any().describe("When type=json, this is an optional JSON schema the property value must follow. Omit for all other types.")}).optional()});var ik=fr.object({name:fr.string().describe('Title-cased display name of the component. Ex: "Hero"'),id:fr.string().describe("Public ID of the component, the camelCase version of name, using only alphanumeric characters"),description:fr.string().describe('Describe the purpose of the component in 1-2 sentences. If the component seems generic, such as "Promo" or "Hero", this should be blank.'),canBeComposition:fr.boolean().describe("True if the component can have pages/compositions created from it. False if it is a part of a page."),parameters:fr.array(hx).describe("The properties of the component. The key is the publicId of the property.").optional(),slots:fr.array(fr.object({name:fr.string().describe('Title-cased display name of the slot. Ex: "Content"'),id:fr.string().describe("The public id of the slot. Must be unique within this component's slots."),allowedComponents:fr.array(fr.string()).describe("The components public IDs allowed in the slot."),minComponents:fr.number().describe("The minimum number of components allowed in the slot. Omit for no minimum.").min(0).optional(),maxComponents:fr.number().describe("The maximum number of components allowed in the slot. Omit for no maximum.").min(1).optional(),inheritAllowedComponents:fr.boolean().describe("Set to false")})).describe("The slots of the component. The key is the publicId of the slot.").optional()});function sk(t){let e=t.slots?.map(o=>({...o,patternsInAllowedComponents:!0,inheritAllowedComponents:!1,maxComponents:o.maxComponents===0?void 0:o.maxComponents,minComponents:o.minComponents===0?void 0:o.minComponents})),n=t.parameters?.find(o=>o.type==="asset"&&typeof o.typeConfig=="object"&&o.typeConfig!==null&&"allowedTypes"in o.typeConfig&&Array.isArray(o.typeConfig.allowedTypes)&&o.typeConfig.allowedTypes?.includes("image"))?.id,r=t.parameters?.find(o=>o.type==="text")?.id;return{...t,slots:e,titleParameter:r,thumbnailParameter:n}}function vx(t,e){return`${e.baseWebUrl}/dashboards/canvas/components/${t}`}function Rp(t,e){let n=t.filter(r=>e===void 0&&r.type==="richText"||e!==void 0&&e.includes(r.id));if(n.length!==0)for(let r of n){if(r.typeConfig===void 0){r.typeConfig=gx;continue}r.typeConfig={...gx,required:r.typeConfig.required??gx.required}}}var yle={action:yx.enum(["create","update","delete"]).describe("The action to perform"),publicId:yx.string().describe("Public ID of the component, the camelCase version of name, using only alphanumeric characters"),component:ik.describe("Full component definition to create. Omit for update or delete.").optional(),patches:mx.describe("JSON patch to apply to the existing component definition. Omit for create or delete.").optional()};function lk(t,e){t.tool("componentAction","Creates, updates, or deletes a Uniform Component definition (or Composition definition)",yle,async({publicId:n,action:r,component:o,patches:i})=>{let s=new vle(e),a=!1;if(r==="create"){if(!o)throw new Error("Component definition is required for create");let l=sk(o);l.parameters&&(a=ak(l.parameters),Rp(l.parameters)),await s.updateComponentDefinition({componentDefinition:l})}if(r==="update"){if(!i)throw new Error("Patches are required for update");let l=await s.getComponentDefinitions({componentId:n});if(!l.componentDefinitions.length)throw new Error(`Component with public ID ${n} does not exist, try creating it instead`);let c=l.componentDefinitions[0],u=c.parameters?.filter(f=>f.type==="richText").map(f=>f.id),d=px(c,i);if(d.parameters){a=ak(d.parameters);let f=d.parameters?.filter(p=>p.type==="richText").map(p=>p.id).filter(p=>!u?.includes(p));Rp(d.parameters,f)}await s.updateComponentDefinition({componentDefinition:d})}return r==="delete"&&await s.removeComponentDefinition({componentId:n}),{content:[{type:"text",text:JSON.stringify({success:!0,editUrl:vx(n,e),warning:a?"Issues with parameter group order were fixed. Ensure definition data is re-fetched before any future updates.":void 0},null,2)}]}})}import{CanvasClient as ck}from"@uniformdev/canvas";import*as uk from"zod/v3";var ble={id:uk.string()};function dk(t,e){t.tool("componentList","Lists all Uniform Component definitions",async()=>{let o=(await new ck(e).getComponentDefinitions({includeSystem:!0})).componentDefinitions.map(i=>({id:i.id,name:i.name,type:i.canBeComposition?"composition":"component",description:i.description,editUrl:vx(i.id,e)}));return{content:[{type:"text",text:JSON.stringify(o,null,2)}]}}),t.tool("componentGet","Gets a Uniform Component definition details (slots, parameters, etc.)",ble,async({id:n})=>{let o=await new ck(e).getComponentDefinitions({componentId:n,includeSystem:!0});return{content:[{type:"text",text:JSON.stringify(o.componentDefinitions[0],null,2)}]}})}import*as Je from"zod/v3";import*as Pp from"zod/v3";var wc=Pp.object({componentId:Pp.string().describe("ID of the component pattern instance the data resource belongs to - can be created in the same call to this tool"),dataResourceName:Pp.string().describe("Name of the data resource to update. Must be defined as a pattern data resource on the pattern, new names cannot be created"),editInstructions:Pp.string().describe('Prompt that will be used to generate the data resource value. Omission will leave the value unchanged. To reset an overridden value to pattern default, say "reset override".').optional()}).describe("A value change to a pattern data resource. Omit unchanged data resources.");var xle=Je.object({parentComponentId:Je.string().describe("ID of the component the slot belongs to"),slotName:Je.string().describe("Public ID of the target slot"),slotIndex:Je.number().describe("Index to insert the new component at. Omit for append.").optional(),newComponentInstanceUuid:Je.string().uuid().describe("UUID of the new component to create. You MUST generate a valid unique UUID using the `createUuid` tool."),instanceType:Je.enum(["component","componentPattern"]),componentType:Je.string().describe("Public ID of the component definition to insert. Component definition must be registered with Uniform. Omit when inserting a component pattern instance.").optional(),componentPatternId:Je.string().describe("UUID of the component pattern definition to insert. Component pattern must be registered with Uniform. Omit when inserting a component instance.").optional()}),bx=Je.object({componentId:Je.string().describe("ID of the component the parameter belongs to - can be created in the same call to this tool"),parameterId:Je.string().describe("Public ID of the parameter to update. Must be defined in the component type of the parent componentId"),parameterType:Je.string().describe("The type of the parameterId as defined on the component definition"),fromLocale:Je.string().describe("When translating from a different locale, use the locale you are translating from. Omit for non-localized values.").optional(),locale:Je.string().describe("Locale of the parameter value. Omit for non-localized values.").optional(),editInstructions:Je.string().describe('Prompt that will be used to generate the parameter value. Omission will leave the value unchanged. To reset an overridden value to pattern default, say "reset override".').optional()}).describe("A value change to a parameter. Omit unchanged parameters."),xx=Je.object({createComponentInstances:Je.array(xle).describe("New components to insert in slots. Do not use for moves or duplications. Omit for delete. These actions are performed before moving, duplicating, or deleting components, and parameter updates.").optional(),moveComponentInstances:Je.array(Je.object({componentId:Je.string().describe("Existing component ID to move. Cannot be root component."),newParentComponentId:Je.string(),newSlotName:Je.string().describe("Destination slot to move to"),newSlotIndex:Je.number().describe("Destination index in the parent slot to move to")})).describe("Moves existing component instances to a new location in a composition. The destination can be the same slot to cause a reorder. Omit for create or delete, or if nothing needs moving. These actions are performed before duplicating or deleting components, and parameter updates.").optional(),duplicateComponentInstances:Je.array(Je.string().describe("Component ID to duplicate. Cannot be root component. All descendants of the duplicated component will be duplicated as well. Duplicates are placed in the same slot as the original component, at the end.")).describe("Component instances to duplicate/copy. Omit when empty. These actions are performed before deleting components and parameter updates.").optional(),deleteComponentInstances:Je.array(Je.string().describe("Component ID to remove. Cannot be the pattern root component.")).describe("Component instances to delete from slots during an update. Omit for create or delete, or if nothing needs deleting. These actions are performed after moving and duplicating components, and before parameter updates.").optional(),dataResourceUpdates:Je.array(wc).describe("Updates to pattern data resources. Use empty array if no changes are needed.").optional()}),_c=Je.object({enableLocales:Je.array(Je.string()).describe("Locales to enable. Omit for no change.").optional(),disableLocales:Je.array(Je.string()).describe("Locales to disable. Existing data in disabled locales will be lost. Omit for no change.").optional()}),Cle=Je.object({summary:Je.string().describe("Short summary of the edit that was made.").optional(),success:Je.boolean()}),GMe=Je.object({success:Je.boolean().describe("Whether all actions were successful"),actionsTaken:Je.array(Cle).describe("Array of individual actions that were taken")});import*as il from"zod/v3";var Sle=bx.extend({overridable:il.enum(["yes","no"]).describe("Whether the parameter value set on the pattern definition is overridable by pattern consumers. Omit when no change is needed.").optional()}),fk=xx.extend({name:il.string().describe("Name of the pattern. If the name does not need to be changed, omit this field. Always include for creates.").optional(),type:il.string().describe("Component definition type of the pattern. Must be registered with Uniform. Always include for creates. Omit otherwise.").optional(),description:il.string().describe("Description of the pattern for authors. If the description does not need to be changed, omit this field.").optional(),parameterUpdates:il.array(Sle).describe("Updates to the parameters of the pattern. Use empty array if no changes are needed.").optional(),dataResourceUpdates:il.array(wc).describe("Updates to the pattern instance data resources. Use empty array if no changes are needed.").optional(),localeUpdates:_c.optional()}).describe("Modification instructions for the pattern");import*as Tc from"zod/v3";var pk=Tc.object({...xx.shape,name:Tc.string().describe("Name of the composition. If the name does not need to be changed, omit this field. Always include for creates.").optional(),type:Tc.string().describe("Component definition type of the composition. Must be registered with Uniform and have canBeComposition=true in the component definition. Always include for creates. Omit otherwise.").optional(),parameterUpdates:Tc.array(bx).describe("Updates to the parameters of the pattern. Use empty array if no changes are needed.").optional(),localeUpdates:_c.optional(),dataResourceUpdates:Tc.array(wc).describe("Updates to pattern instance data resources. Use empty array if no changes are needed.").optional()}).describe("Modification instructions for the composition");import*as Qs from"zod/v3";import*as Ko from"zod/v3";var Hw=Ko.object({fieldId:Ko.string().describe("Public ID of the field to update. Must be defined in the content type of the parent entry."),fieldType:Ko.string().describe("The type of the fieldId as defined on the content type"),fromLocale:Ko.string().describe("When translating from a different locale, use the locale you are translating from. Omit for non-localized values.").optional(),locale:Ko.string().describe("Locale of the field value. Omit for non-localized values.").optional(),editInstructions:Ko.string().describe('Prompt that will be used to generate the field value. Omission will leave the value unchanged. To reset an overridden value to pattern default, say "reset override".').optional()}).describe("A value change to a field. Omit unchanged fields."),mk=Ko.object({type:Ko.string().describe("Content type of the entry. Must be registered with Uniform. Always include for creates. Omit otherwise.").optional(),slug:Ko.string().describe("Slug (human-readable identifier) of the entry. If the slug does not need to be changed, omit this field.").optional(),fieldUpdates:Ko.array(Hw).describe("Updates to the fields of the entry. Use empty array if no changes are needed.").optional(),localeUpdates:_c.optional(),dataResourceUpdates:Ko.array(wc).describe("Updates to the data resources of the entry. Use empty array if no changes are needed.").optional()}).describe("Modification instructions for the entry");var Ele=Hw.extend({overridable:Qs.enum(["yes","no"]).describe("Whether the parameter value set on the pattern definition is overridable by pattern consumers. Omit when no change is needed.").optional()}),gk=Qs.object({name:Qs.string().describe("Name of the entry pattern. If the name does not need to be changed, omit this field. Always include for creates.").optional(),type:Qs.string().describe("Content type of the entry pattern. Must be registered with Uniform. Always include for creates. Omit otherwise.").optional(),description:Qs.string().describe("Description of the entry pattern for authors. If the description does not need to be changed, omit this field.").optional(),fieldUpdates:Qs.array(Ele).describe("Updates to the fields of the entry pattern. Use empty array if no changes are needed.").optional(),localeUpdates:_c.optional()}).describe("Modification instructions for the entry pattern");import*as ro from"zod/v3";import{CANVAS_BLOCK_PARAM_TYPE as cDe}from"@uniformdev/canvas";import{getEffectivePropertyValue as uDe}from"@uniformdev/canvas";import{CANVAS_PERSONALIZATION_PARAM as dDe}from"@uniformdev/canvas";var Ld="uniformContentInternalReference";var wle="$p:";function Cx(t){return`${wle}${t}`}function hk({slotDefinition:t,slotSectionDefinition:e}){return{slotDefinition:{...t,allowedComponentsIndex:new Set(t?.allowedComponents??[]),maxComponents:t?.maxComponents??Number.MAX_VALUE,minComponents:t?.minComponents??0,allowAllPatternsOfAllowedTypes:!t?.patternsInAllowedComponents},slotSectionDefinition:e?{...e,specificTypesIndex:new Set(e?.specificTypes??[])}:void 0}}import{CANVAS_HYPOTHESIS_PARAM as dOe,CANVAS_LOCALIZATION_SLOT as fOe,CANVAS_LOCALIZATION_TYPE as pOe,CANVAS_PERSONALIZATION_ALGORITHM_PARAM as mOe,CANVAS_PERSONALIZATION_ALGORITHM_TYPE as gOe,CANVAS_PERSONALIZATION_EVENT_NAME_PARAM as hOe,CANVAS_PERSONALIZATION_TAKE_PARAM as vOe,CANVAS_PERSONALIZE_SLOT as yOe,CANVAS_PERSONALIZE_TYPE as bOe,CANVAS_SLOT_SECTION_GROUP_TYPE_PARAM as xOe,CANVAS_SLOT_SECTION_MAX_PARAM as COe,CANVAS_SLOT_SECTION_MIN_PARAM as SOe,CANVAS_SLOT_SECTION_NAME_PARAM as EOe,CANVAS_SLOT_SECTION_SLOT as wOe,CANVAS_SLOT_SECTION_SPECIFIC_PARAM as _Oe,CANVAS_SLOT_SECTION_TYPE as TOe,CANVAS_TEST_SLOT as $Oe,CANVAS_TEST_TYPE as NOe}from"@uniformdev/canvas";var _le={$personalization:{isNestableIntoItself:!0},$test:void 0,$localization:void 0,$loop:void 0,$slotSection:{isAutoAllowed:!0,isNestableIntoItself:!0,isOnlyAllowedInPatternEditor:!0}},vk=t=>_le[t];function Sx(t,{slotDefinition:e,slotSectionDefinition:n},r=!1){let o=Tle(t,e,r);return n?o?$le(t,n):!1:o}function Tle(t,e,n=!1){let r=vk(t.type);if(r?.isOnlyAllowedInPatternEditor&&!n)return!1;if(r?.isAutoAllowed||e.allowAllComponents)return!0;let o=e.allowedComponentsIndex.has(t.type);return e.allowAllPatternsOfAllowedTypes||!t._pattern?o:e.allowedComponentsIndex.has(Cx(t._pattern))||!1}function $le(t,e){return e.groupType==="inherit"||!e.groupType?!0:e.groupType==="specific"?t._pattern?e.specificTypesIndex.has(Cx(t._pattern)):e.specificTypesIndex.has(t.type):e.groupType==="except"?t._pattern?!e.specificTypesIndex.has(Cx(t._pattern)):!e.specificTypesIndex.has(t.type):!1}function Ex(t,e,n,r){return`ref-${t}-${e}`+(n?`-${n}`:"")+(r!==void 0&&r>-1?`(${r})`:"")}function yk(t,e={}){let{targetLocale:n,enabledLocales:r=[],isPatternParameter:o=!1}=e,i=n??(r.length>0?"${locale}":void 0);return{type:Ld,...o?{isPatternParameter:!0}:{},variables:{entryIds:t,...i?{locale:i}:{}}}}import{CANVAS_SLOT_SECTION_GROUP_TYPE_PARAM as Nle,CANVAS_SLOT_SECTION_MAX_PARAM as Dle,CANVAS_SLOT_SECTION_MIN_PARAM as Lle,CANVAS_SLOT_SECTION_NAME_PARAM as Ale,CANVAS_SLOT_SECTION_SLOT as Mle,CANVAS_SLOT_SECTION_SPECIFIC_PARAM as Ole,CANVAS_SLOT_SECTION_TYPE as Ile}from"@uniformdev/canvas";var Ww=({twee:t,parentNodeId:e,slotName:n,componentDefinitionsIndex:r})=>{let o=Kw({twee:t,parentNodeId:e,slotName:n,componentDefinitionsIndex:r});if(o)return hk(o)};function Kw({twee:t,parentNodeId:e,slotName:n,componentDefinitionsIndex:r}){let o=t.getNodeById(e);if(!o)return;if(n===Mle){let c=kle({node:o,twee:t}),u=t.getParentInfo(e);if(!u)return;let d=Kw({parentNodeId:u.parentId,slotName:u.parentName,twee:t,componentDefinitionsIndex:r});return d?{slotDefinition:d.slotDefinition,slotSectionDefinition:c}:void 0}let s=r[o.value.type]?.slots?.find(c=>c.id===n);if(!s)return;if(!s.inheritAllowedComponents)return{slotDefinition:s,slotSectionDefinition:void 0};let a=t.getParentInfo(e);if(!a)return{slotDefinition:s,slotSectionDefinition:void 0};let l=Kw({parentNodeId:a.parentId,slotName:a.parentName,twee:t,componentDefinitionsIndex:r});return l?{slotDefinition:l.slotDefinition,slotSectionDefinition:l.slotSectionDefinition}:{slotDefinition:s,slotSectionDefinition:void 0}}function kle({node:t,twee:e}){if(t.value.type!==Ile)return;let n=e.getNodeProperty(t.nodeId,Nle)?.value??"inherit",r=e.getNodeProperty(t.nodeId,Ale)?.value??"Slot Section",o=Number(e.getNodeProperty(t.nodeId,Lle)?.value),i=Number(e.getNodeProperty(t.nodeId,Dle)?.value),s=e.getNodeProperty(t.nodeId,Ole)?.value??[];return{groupType:n,name:r,specificTypes:s,min:o,max:i}}function _x({definition:t,lastUserChoice:e,currentValue:n}){if(t&&!t.localizable)return!1;if(n){if(n.locales&&wx(n.locales)||n.localesConditions&&wx(n.localesConditions))return!0;if(n.value!==void 0||n.conditions!==void 0)return!1}if(e!==void 0)return e;if(t)return!t.notLocalizedByDefault}function wx(t){return Array.isArray(t)?t.some(e=>wx(e)):t===void 0?!1:t===null||typeof t!="object"?!0:Object.values(t).some(e=>wx(e))}function Gw({twee:t,nodeId:e,currentEditorLocale:n,definition:r}){let o=t.getNodeById(e),i=o?.propertyValueLocalizability?.[r.id],s=t.getNodeProperty(e,r?.id),a=_x({lastUserChoice:i,currentValue:s,definition:r});if(o&&a!==void 0&&a!==(i??!1)&&t.updateNode({nodeId:e,updateMetadata:l=>{l.propertyValueLocalizability[r.id]=a},doNotSetDirty:!0}),a)return n}function bk({twee:t,nodeId:e,dataType:n,dataResourceName:r,dataResourceEdit:o}){if(!t.getNodeById(e))throw new Error(`Node with ID ${e} not found`);o.action==="resetOverride"?t.updateNode({nodeId:e,updateDataResources:[{type:"reset",name:r}]}):o.action==="setValue"&&t.updateNode({nodeId:e,updateDataResources:[{type:"set",name:r,value:{type:n,variables:o.newValue}}]})}import{CANVAS_ENRICHMENT_TAG_PARAM as Q8e,CANVAS_PERSONALIZATION_ALGORITHM_PARAM as eDe,CANVAS_PERSONALIZATION_PARAM as tDe,CANVAS_PERSONALIZE_SLOT as nDe,convertToBindExpression as rDe,createVariableReference as oDe,isSystemComponentDefinition as iDe}from"@uniformdev/canvas";var xk=Object.prototype.hasOwnProperty;function $r(t,e){var n,r;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&$r(t[r],e[r]););return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(xk.call(t,n)&&++r&&!xk.call(e,n)||!(n in e)||!$r(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}function Tx(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}var Rle={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Yw(t,e){function n(o,i,s){if(!(typeof document>"u")){s=Tx({},e,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in s)s[l]&&(a+="; "+l,s[l]!==!0&&(a+="="+s[l].split(";")[0]));return document.cookie=o+"="+t.write(i,o)+a}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],s={},a=0;a<i.length;a++){var l=i[a].split("="),c=l.slice(1).join("=");try{var u=decodeURIComponent(l[0]);if(s[u]=t.read(c,u),o===u)break}catch{}}return o?s[o]:s}}return Object.create({set:n,get:r,remove:function(o,i){n(o,"",Tx({},i,{expires:-1}))},withAttributes:function(o){return Yw(this.converter,Tx({},this.attributes,o))},withConverter:function(o){return Yw(Tx({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var Ple=Yw(Rle,{path:"/"});function x0(t){return{all:t=t||new Map,on:function(e,n){var r=t.get(e);r?r.push(n):t.set(e,[n])},off:function(e,n){var r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var r=t.get(e);r&&r.slice().map(function(o){o(n)}),(r=t.get("*"))&&r.slice().map(function(o){o(e,n)})}}}var wk=I(C0(),1);var Lk=I(C0(),1),Ak=I(C0(),1);var zle=t=>{throw TypeError(t)};var Qw=(t,e,n)=>e.has(t)||zle("Cannot "+n),fn=(t,e,n)=>(Qw(t,e,"read from private field"),n?n.call(t):e.get(t));var Sk=(t,e,n,r)=>(Qw(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),E0=(t,e,n)=>(Qw(t,e,"access private method"),n);var jle="_",Vle;Vle=new WeakMap;var Ule,Hle;Ule=new WeakMap;Hle=new WeakMap;var Kle,Wle,Gle,Yle;Kle=new WeakMap;Wle=new WeakMap;Gle=new WeakMap;Yle=new WeakMap;function Zle(t,e){return`${t}${jle}${e}`}function qle(t,e){var n;if(typeof t>"u"||t===null)return!1;let r=Number(t);if(isNaN(r))return!1;switch((n=e?.op)!=null?n:"="){case"=":return r===e.rhs;case"!=":return r!==e.rhs;case">":return r>e.rhs;case"<":return r<e.rhs;default:return console.warn(`Unknown match type ${e.op} is false.`),!1}}function Jle(t,e){return`${t} ${Xle(e)}`}function Xle(t){return`${t.op} ${t.rhs}`}var Zw=Zle("$pvc","v"),Qle=({update:t,criteria:e,commands:n,onLogMessage:r})=>{var o,i;if(e.type!=="PVC")return{result:!1,changed:!1};let s=!!(t.state.url&&(!t.previousState||((o=t.state.url)==null?void 0:o.toString())!==((i=t.previousState.url)==null?void 0:i.toString()))),l=(t.visitor.sessionScores[Zw]||0)+1,c={result:!1,changed:s},u=n.some(d=>d.type==="modscoreS"&&d.data.dimension===Zw);return s&&!u&&n.push({type:"modscoreS",data:{dimension:Zw,delta:1}}),qle(l,e.match)&&(c.result=!0),r?.(["debug",203,{criteria:e,result:c,explanation:Jle(l,e.match)}]),c};Qle.alwaysExecute=!0;var ece;ece=new WeakMap;var Ek="ssc";var tce,nce,rce;tce=new WeakMap;nce=new WeakMap;rce=new WeakMap;var qw="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",QOe=qw.split(""),oce=new Array(123);for(let t=0;t<qw.length;t++)oce[qw.charCodeAt(t)]=t;var ice,sce,ace,lce;ice=new WeakMap;sce=new WeakMap;ace=new WeakMap;lce=new WeakMap;var cce,uce;cce=new WeakSet;uce=async function(){let t=await new Promise(e=>{setTimeout(()=>{e(void 0)},2e3)});t&&this.signalAsyncDataUpdate(t)};var dce=()=>({quirks:{},scores:{},sessionScores:{},tests:{},goals:{},consent:!1,controlGroup:!1,personalizeVariants:{}}),nIe=(0,wk.default)();var fce,pce;fce=new WeakSet;pce=function(t){return this.partitionKey?`${this.partitionKey}.${t}`:t};var _k="ufvisitor",Ad,e_,$x,yi,S0,Tk,mce,$k,gce,Jw,hce;Ad=new WeakMap;e_=new WeakMap;$x=new WeakMap;yi=new WeakMap;S0=new WeakSet;Tk=function(){return fn(this,e_).get(_k)};mce=function(t,e=!1){var n,r,o,i,s,a,l,c,u,d,f;let p=fn(this,S0,Tk),m=Date.now();E0(this,S0,Jw).call(this,t.scores),E0(this,S0,Jw).call(this,t.sessionScores),(r=(n=fn(this,yi)).decay)==null||r.call(n,{now:m,lastUpd:p?.updated,scores:t.scores,sessionScores:t.sessionScores,onLogMessage:fn(this,yi).onLogMessage});let g=!$r(p?.visitorData.scores,t.scores),h=!$r(p?.visitorData.sessionScores,t.sessionScores),v=!$r(p?.visitorData.quirks,t.quirks),y=!$r(p?.visitorData.tests,t.tests),b=!$r(p?.visitorData.goals,t.goals),S={updated:m,visitorData:t};if(E0(this,S0,$k).call(this),fn(this,e_).set(_k,S,!!t.consent),(i=(o=fn(this,yi)).onLogMessage)==null||i.call(o,["debug",102,t]),!e&&((g||h)&&fn(this,Ad).emit("scoresUpdated",t),v&&fn(this,Ad).emit("quirksUpdated",t),y&&fn(this,Ad).emit("testsUpdated",t),((s=p?.visitorData)==null?void 0:s.consent)!==t.consent&&fn(this,Ad).emit("consentUpdated",t),((a=p?.visitorData)==null?void 0:a.controlGroup)!==t.controlGroup&&(fn(this,Ad).emit("controlGroupUpdated",t),(u=(c=fn(this,yi)).onLogMessage)==null||u.call(c,["debug",104,(l=t.controlGroup)!=null?l:!1])),b)){let x=Object.keys((d=t.goals)!=null?d:{});for(let E=0;E<x.length;E++){let w=x[E];(f=p?.visitorData.goals)!=null&&f[w]||fn(this,Ad).emit("goalConverted",{goalId:w})}}};$k=function(){typeof document>"u"||!fn(this,yi).visitLifespan||(fn(this,$x)&&window.clearTimeout(fn(this,$x)),Sk(this,$x,window.setTimeout(()=>{this.data},fn(this,yi).visitLifespan+50)))};gce=function(t){let e=fn(this,yi).visitLifespan;return e?t.updated+e<Date.now():!1};Jw=function(t){var e,n;if(fn(this,yi).manifest)for(let r in t){let o=t[r],i=fn(this,yi).manifest.getDimensionByKey(r);i&&o>i.cap&&((n=(e=fn(this,yi)).onLogMessage)==null||n.call(e,["debug",110,{dim:r,score:o,cap:i.cap}]),t[r]=i.cap)}};hce=function(){var t,e,n;return{...dce(),consent:(t=fn(this,yi).defaultConsent)!=null?t:!1,controlGroup:(n=(e=fn(this,yi).manifest)==null?void 0:e.rollForControlGroup())!=null?n:!1}};var vce,yce,Nx,bce,xce,Cce,Sce,Ece,Dx,Xw,wce,Nk,_ce,Dk;vce=new WeakMap;yce=new WeakMap;Nx=new WeakMap;bce=new WeakMap;xce=new WeakMap;Cce=new WeakMap;Sce=new WeakMap;Ece=new WeakMap;Dx=new WeakMap;Xw=new WeakSet;wce=function(t){fn(this,Dx).emit("testResult",t)};Nk=async function(t){let e=this.manifest.computeGoals(t);e.length!==0&&await this.storage.updateData(e)};_ce=function(t){let e=E0(this,Xw,Dk).call(this,t);!$r(e,fn(this,Nx))&&(Sk(this,Nx,e),E0(this,Xw,Nk).call(this,{scores:fn(this,Nx),quirks:void 0}),fn(this,Dx).emit("scoresUpdated",e),fn(this,Dx).emit("log",["info",3,e]))};Dk=function(t){var e;let n={...t.scores};for(let r in t.sessionScores)n[r]=((e=n[r])!=null?e:0)+t.sessionScores[r];return n=this.manifest.computeAggregateDimensions(n),n};var iIe=(0,Lk.default)();var sIe=(0,Ak.default)();await Ym();var S1e=await(process.env.NODE_ENV!=="production"?jV().then(()=>zV):UV().then(()=>VV)),HV=S1e.createHeadlessEditor;await p4();await M4();await z4();await FW();await a3();await uG();await Ji();await rr();import{createVariableReference as K8e}from"@uniformdev/canvas";var Pu=I(Jn());dN();var gVe=I(H());Bg();var vVe=I(pN());Y1();var bVe=I(oN());jg();Vg();D3();var li=Pu.Fragment,O=function(e,n,r){return $f.call(n,"css")?Pu.jsx(ev,Q1(e,n),r):Pu.jsx(e,n,r)},ie=function(e,n,r){return $f.call(n,"css")?Pu.jsxs(ev,Q1(e,n),r):Pu.jsxs(e,n,r)};ne();ne();ne();ne();ne();function aY(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];t&&t.addEventListener&&t.addEventListener.apply(t,e)}function lY(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];t&&t.removeEventListener&&t.removeEventListener.apply(t,e)}var cY=typeof window<"u";var uY=I(H());var ks=I(H());function gN(t,e){e===void 0&&(e=0);var n=(0,ks.useRef)(!1),r=(0,ks.useRef)(),o=(0,ks.useRef)(t),i=(0,ks.useCallback)(function(){return n.current},[]),s=(0,ks.useCallback)(function(){n.current=!1,r.current&&clearTimeout(r.current),r.current=setTimeout(function(){n.current=!0,o.current()},e)},[e]),a=(0,ks.useCallback)(function(){n.current=null,r.current&&clearTimeout(r.current)},[]);return(0,ks.useEffect)(function(){o.current=t},[t]),(0,ks.useEffect)(function(){return s(),a},[e]),[i,a,s]}function O3(t,e,n){e===void 0&&(e=0),n===void 0&&(n=[]);var r=gN(t,e),o=r[0],i=r[1],s=r[2];return(0,uY.useEffect)(s,n),[o,i]}var Hg=I(H());var oCe=function(t){return t===void 0&&(t={laptopL:1440,laptop:1024,tablet:768}),function(){var e=(0,Hg.useState)(cY?window.innerWidth:0),n=e[0],r=e[1];(0,Hg.useEffect)(function(){var s=function(){r(window.innerWidth)};return s(),aY(window,"resize",s),function(){lY(window,"resize",s)}});var o=(0,Hg.useMemo)(function(){return Object.entries(t).sort(function(s,a){return s[1]>=a[1]?1:-1})},[t]),i=o.reduce(function(s,a){var l=a[0],c=a[1];return n>=c?l:s},o[0][0]);return i}},hN=oCe;ne();ne();ne();var a6e=I(H());ne();ne();function Nf(...t){}function tv(t,e){if(iCe(t)){let n=sCe(e)?e():e;return t(n)}return t}function iCe(t){return typeof t=="function"}function sCe(t){return typeof t=="function"}function ko(t,e){return typeof Object.hasOwn=="function"?Object.hasOwn(t,e):Object.prototype.hasOwnProperty.call(t,e)}function Ln(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}function vN(t){return t.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function yN(t,e){let n={...t};for(let r of e)ko(n,r)&&delete n[r];return n}function bN(t,e){let n={};for(let r of e)ko(t,r)&&(n[r]=t[r]);return n}function nv(t){return t}function dt(t,e){if(!t)throw typeof e!="string"?new Error("Invariant failed"):new Error(e)}function xN(t){return Object.keys(t)}function Ra(t,...e){let n=typeof t=="function"?t(...e):t;return n==null?!1:!n}function Rs(t){return t.disabled||t["aria-disabled"]===!0||t["aria-disabled"]==="true"}function Ro(t){let e={};for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}function et(...t){for(let e of t)if(e!==void 0)return e}var dY=I(H(),1);function rv(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function aCe(t){return!t||!(0,dY.isValidElement)(t)?!1:"ref"in t.props||"ref"in t}function fY(t){return aCe(t)?{...t.props}.ref||t.ref:null}function pY(t,e){let n={...t};for(let r in e){if(!ko(e,r))continue;if(r==="className"){let i="className";n[i]=t[i]?`${t[i]} ${e[i]}`:e[i];continue}if(r==="style"){let i="style";n[i]=t[i]?{...t[i],...e[i]}:e[i];continue}let o=e[r];if(typeof o=="function"&&r.startsWith("on")){let i=t[r];if(typeof i=="function"){n[r]=(...s)=>{o(...s),i(...s)};continue}}n[r]=o}return n}var Wl=lCe();function lCe(){var t;return typeof window<"u"&&!!((t=window.document)!=null&&t.createElement)}function wt(t){return t?"self"in t?t.document:t.ownerDocument||document:document}function Df(t){return t?"self"in t?t.self:wt(t).defaultView||window:self}function _i(t,e=!1){let{activeElement:n}=wt(t);if(!n?.nodeName)return null;if(ov(n)&&n.contentDocument)return _i(n.contentDocument.body,e);if(e){let r=n.getAttribute("aria-activedescendant");if(r){let o=wt(n).getElementById(r);if(o)return o}}return n}function Vt(t,e){return t===e||t.contains(e)}function ov(t){return t.tagName==="IFRAME"}function ci(t){let e=t.tagName.toLowerCase();return e==="button"?!0:e==="input"&&t.type?cCe.indexOf(t.type)!==-1:!1}var cCe=["button","color","file","image","reset","submit"];function iv(t){if(typeof t.checkVisibility=="function")return t.checkVisibility();let e=t;return e.offsetWidth>0||e.offsetHeight>0||t.getClientRects().length>0}function Po(t){try{let e=t instanceof HTMLInputElement&&t.selectionStart!==null,n=t.tagName==="TEXTAREA";return e||n||!1}catch{return!1}}function sv(t){return t.isContentEditable||Po(t)}function CN(t){if(Po(t))return t.value;if(t.isContentEditable){let e=wt(t).createRange();return e.selectNodeContents(t),e.toString()}return""}function SN(t){let e=0,n=0;if(Po(t))e=t.selectionStart||0,n=t.selectionEnd||0;else if(t.isContentEditable){let r=wt(t).getSelection();if(r?.rangeCount&&r.anchorNode&&Vt(t,r.anchorNode)&&r.focusNode&&Vt(t,r.focusNode)){let o=r.getRangeAt(0),i=o.cloneRange();i.selectNodeContents(t),i.setEnd(o.startContainer,o.startOffset),e=i.toString().length,i.setEnd(o.endContainer,o.endOffset),n=i.toString().length}}return{start:e,end:n}}function Kg(t,e){let n=["dialog","menu","listbox","tree","grid"],r=t?.getAttribute("role");return r&&n.indexOf(r)!==-1?r:e}function av(t,e){var n;let r={menu:"menuitem",listbox:"option",tree:"treeitem"},o=Kg(t);return o&&(n=r[o])!=null?n:e}function I3(t){if(!t)return null;let e=n=>n==="auto"||n==="scroll";if(t.clientHeight&&t.scrollHeight>t.clientHeight){let{overflowY:n}=getComputedStyle(t);if(e(n))return t}else if(t.clientWidth&&t.scrollWidth>t.clientWidth){let{overflowX:n}=getComputedStyle(t);if(e(n))return t}return I3(t.parentElement)||document.scrollingElement||document.body}function lv(t,e){let n=t.map((o,i)=>[i,o]),r=!1;return n.sort(([o,i],[s,a])=>{let l=e(i),c=e(a);return l===c||!l||!c?0:uCe(l,c)?(o>s&&(r=!0),-1):(o<s&&(r=!0),1)}),r?n.map(([o,i])=>i):t}function uCe(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}function mY(){return Wl&&!!navigator.maxTouchPoints}function Wg(){return Wl?/mac|iphone|ipad|ipod/i.test(navigator.platform):!1}function Lf(){return Wl&&Wg()&&/apple/i.test(navigator.vendor)}function EN(){return Wl&&/firefox\//i.test(navigator.userAgent)}function wN(){return Wl&&navigator.platform.startsWith("Mac")&&!mY()}function k3(t){return!!(t.currentTarget&&!Vt(t.currentTarget,t.target))}function Zr(t){return t.target===t.currentTarget}function gY(t){let e=t.currentTarget;if(!e)return!1;let n=Wg();if(n&&!t.metaKey||!n&&!t.ctrlKey)return!1;let r=e.tagName.toLowerCase();return r==="a"||r==="button"&&e.type==="submit"||r==="input"&&e.type==="submit"}function hY(t){let e=t.currentTarget;if(!e)return!1;let n=e.tagName.toLowerCase();return t.altKey?n==="a"||n==="button"&&e.type==="submit"||n==="input"&&e.type==="submit":!1}function vY(t,e,n){let r=new Event(e,n);return t.dispatchEvent(r)}function Af(t,e){let n=new FocusEvent("blur",e),r=t.dispatchEvent(n),o={...e,bubbles:!0};return t.dispatchEvent(new FocusEvent("focusout",o)),r}function yY(t,e,n){let r=new KeyboardEvent(e,n);return t.dispatchEvent(r)}function _N(t,e){let n=new MouseEvent("click",e);return t.dispatchEvent(n)}function Fu(t,e){let n=e||t.currentTarget,r=t.relatedTarget;return!r||!Vt(n,r)}function Bu(t,e,n,r){let i=(a=>{if(r){let c=setTimeout(a,r);return()=>clearTimeout(c)}let l=requestAnimationFrame(a);return()=>cancelAnimationFrame(l)})(()=>{t.removeEventListener(e,s,!0),n()}),s=()=>{i(),n()};return t.addEventListener(e,s,{once:!0,capture:!0}),i}function Bn(t,e,n,r=window){let o=[];try{r.document.addEventListener(t,e,n);for(let s of Array.from(r.frames))o.push(Bn(t,e,n,s))}catch{}return()=>{try{r.document.removeEventListener(t,e,n)}catch{}for(let s of o)s()}}var dCe=I(H(),1),zn=I(H(),1),TN={...dCe},bY=TN.useId,iUe=TN.useDeferredValue,xY=TN.useInsertionEffect,ht=Wl?zn.useLayoutEffect:zn.useEffect;function P3(t){let e=(0,zn.useRef)(t);return ht(()=>{e.current=t}),e}function Oe(t){let e=(0,zn.useRef)(()=>{throw new Error("Cannot call an event handler while rendering.")});return xY?xY(()=>{e.current=t}):e.current=t,(0,zn.useCallback)((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function wY(t){let[e,n]=(0,zn.useState)(null);return ht(()=>{if(e==null||!t)return;let r=null;return t(o=>(r=o,e)),()=>{t(r)}},[e,t]),[e,n]}function gt(...t){return(0,zn.useMemo)(()=>{if(t.some(Boolean))return e=>{for(let n of t)rv(n,e)}},t)}function ui(t){if(bY){let r=bY();return t||r}let[e,n]=(0,zn.useState)(t);return ht(()=>{if(t||e)return;let r=Math.random().toString(36).slice(2,8);n(`id-${r}`)},[t,e]),t||e}function F3(t,e){let n=i=>{if(typeof i=="string")return i},[r,o]=(0,zn.useState)(()=>n(e));return ht(()=>{let i=t&&"current"in t?t.current:t;o(i?.tagName.toLowerCase()||n(e))},[t,e]),r}function zu(t,e){let n=(0,zn.useRef)(!1);(0,zn.useEffect)(()=>{if(n.current)return t();n.current=!0},e),(0,zn.useEffect)(()=>()=>{n.current=!1},[])}function _Y(){return(0,zn.useReducer)(()=>[],[])}function ar(t){return Oe(typeof t=="function"?t:()=>t)}function bn(t,e,n=[]){let r=(0,zn.useCallback)(o=>(t.wrapElement&&(o=t.wrapElement(o)),e(o)),[...n,t.wrapElement]);return{...t,wrapElement:r}}function Gg(t=!1,e){let[n,r]=(0,zn.useState)(null);return{portalRef:gt(r,e),portalNode:n,domReady:!t||n}}function B3(t,e,n){let r=t.onLoadedMetadataCapture,o=(0,zn.useMemo)(()=>Object.assign(()=>{},{...r,[e]:n}),[r,e,n]);return[r?.[e],{onLoadedMetadataCapture:o}]}var CY=!1;function Yg(){return(0,zn.useEffect)(()=>{CY||(Bn("mousemove",pCe,!0),Bn("mousedown",R3,!0),Bn("mouseup",R3,!0),Bn("keydown",R3,!0),Bn("scroll",R3,!0),CY=!0)},[]),Oe(()=>$N)}var $N=!1,SY=0,EY=0;function fCe(t){let e=t.movementX||t.screenX-SY,n=t.movementY||t.screenY-EY;return SY=t.screenX,EY=t.screenY,e||n||process.env.NODE_ENV==="test"}function pCe(t){fCe(t)&&($N=!0)}function R3(){$N=!1}var Fo=I(H(),1),Mf=I(Jn(),1);function Ee(t){let e=Fo.forwardRef((n,r)=>t({...n,ref:r}));return e.displayName=t.displayName||t.name,e}function ju(t,e){return Fo.memo(t,e)}function Te(t,e){let{wrapElement:n,render:r,...o}=e,i=gt(e.ref,fY(r)),s;if(Fo.isValidElement(r)){let a={...r.props,ref:i};s=Fo.cloneElement(r,pY(o,a))}else r?s=r(o):s=(0,Mf.jsx)(t,{...o});return n?n(s):s}function Ne(t){let e=(n={})=>t(n);return e.displayName=t.name,e}function yr(t=[],e=[]){let n=Fo.createContext(void 0),r=Fo.createContext(void 0),o=()=>Fo.useContext(n),i=(c=!1)=>{let u=Fo.useContext(r),d=o();return c?u:u||d},s=()=>{let c=Fo.useContext(r),u=o();if(!(c&&c===u))return u},a=c=>t.reduceRight((u,d)=>(0,Mf.jsx)(d,{...c,children:u}),(0,Mf.jsx)(n.Provider,{...c}));return{context:n,scopedContext:r,useContext:o,useScopedContext:i,useProviderContext:s,ContextProvider:a,ScopedContextProvider:c=>(0,Mf.jsx)(a,{...c,children:e.reduceRight((u,d)=>(0,Mf.jsx)(d,{...c,children:u}),(0,Mf.jsx)(r.Provider,{...c}))})}}var cv=yr(),TY=cv.useContext,dUe=cv.useScopedContext,fUe=cv.useProviderContext,$Y=cv.ContextProvider,NY=cv.ScopedContextProvider;var NN=I(H(),1),uv=yr([$Y],[NY]),Zg=uv.useContext,hUe=uv.useScopedContext,DY=uv.useProviderContext,Vu=uv.ContextProvider,qg=uv.ScopedContextProvider,LY=(0,NN.createContext)(void 0),AY=(0,NN.createContext)(void 0);var mCe={id:null};function MY(t,e,n=!1){let r=t.findIndex(o=>o.id===e);return[...t.slice(r+1),...n?[mCe]:[],...t.slice(0,r)]}function OY(t,e){return t.find(n=>e?!n.disabled&&n.id!==e:!n.disabled)}function Pa(t,e){return e&&t.item(e)||null}function IY(t){let e=[];for(let n of t){let r=e.find(o=>{var i;return((i=o[0])==null?void 0:i.rowId)===n.rowId});r?r.push(n):e.push([n])}return e}function kY(t,e=!1){if(Po(t))t.setSelectionRange(e?t.value.length:0,t.value.length);else if(t.isContentEditable){let n=wt(t).getSelection();n?.selectAllChildren(t),e&&n?.collapseToEnd()}}var DN=Symbol("FOCUS_SILENTLY");function RY(t){t[DN]=!0,t.focus({preventScroll:!0})}function PY(t){let e=t[DN];return delete t[DN],e}function Of(t,e,n){if(!e||e===n)return!1;let r=t.item(e.id);return!(!r||n&&r.element===n)}var z3=I(H(),1),gCe="div",LN=Ne(function({store:e,shouldRegisterItem:n=!0,getItem:r=nv,element:o,...i}){let s=TY();e=e||s;let a=ui(i.id),l=(0,z3.useRef)(o);return(0,z3.useEffect)(()=>{let c=l.current;if(!a||!c||!n)return;let u=r({id:a,element:c});return e?.renderItem(u)},[a,n,r,e]),i={...i,ref:gt(l,i.ref)},Ro(i)}),wUe=Ee(function(e){let n=LN(e);return Te(gCe,n)});var FY=I(H(),1),j3=(0,FY.createContext)(!0);var V3="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function hCe(t){return Number.parseInt(t.getAttribute("tabindex")||"0",10)<0}function Ti(t){return!(!t.matches(V3)||!iv(t)||t.closest("[inert]"))}function Jg(t){if(!Ti(t)||hCe(t))return!1;if(!("form"in t)||!t.form||t.checked||t.type!=="radio")return!0;let e=t.form.elements.namedItem(t.name);if(!e||!("length"in e))return!0;let n=_i(t);return!n||n===t||!("form"in n)||n.form!==t.form||n.name!==t.name}function AN(t,e){let n=Array.from(t.querySelectorAll(V3));e&&n.unshift(t);let r=n.filter(Ti);return r.forEach((o,i)=>{if(ov(o)&&o.contentDocument){let s=o.contentDocument.body;r.splice(i,1,...AN(s))}}),r}function dv(t,e,n){let r=Array.from(t.querySelectorAll(V3)),o=r.filter(Jg);return e&&Jg(t)&&o.unshift(t),o.forEach((i,s)=>{if(ov(i)&&i.contentDocument){let a=i.contentDocument.body,l=dv(a,!1,n);o.splice(s,1,...l)}}),!o.length&&n?r:o}function BY(t,e,n){let[r]=dv(t,e,n);return r||null}function vCe(t,e,n,r){let o=_i(t),i=AN(t,e),s=i.indexOf(o),a=i.slice(s+1);return a.find(Jg)||(n?i.find(Jg):null)||(r?a[0]:null)||null}function U3(t,e){return vCe(document.body,!1,t,e)}function yCe(t,e,n,r){let o=_i(t),i=AN(t,e).reverse(),s=i.indexOf(o),a=i.slice(s+1);return a.find(Jg)||(n?i.find(Jg):null)||(r?a[0]:null)||null}function MN(t,e){return yCe(document.body,!1,t,e)}function zY(t){for(;t&&!Ti(t);)t=t.closest(V3);return t||null}function If(t){let e=_i(t);if(!e)return!1;if(e===t)return!0;let n=e.getAttribute("aria-activedescendant");return n?n===t.id:!1}function ts(t){let e=_i(t);if(!e)return!1;if(Vt(t,e))return!0;let n=e.getAttribute("aria-activedescendant");return!n||!("id"in t)?!1:n===t.id?!0:!!t.querySelector(`#${CSS.escape(n)}`)}function H3(t){!ts(t)&&Ti(t)&&t.focus()}function bCe(t){var e;let n=(e=t.getAttribute("tabindex"))!=null?e:"";t.setAttribute("data-tabindex",n),t.setAttribute("tabindex","-1")}function jY(t,e){let n=dv(t,e);for(let r of n)bCe(r)}function VY(t){let e=t.querySelectorAll("[data-tabindex]"),n=r=>{let o=r.getAttribute("data-tabindex");r.removeAttribute("data-tabindex"),o?r.setAttribute("tabindex",o):r.removeAttribute("tabindex")};t.hasAttribute("data-tabindex")&&n(t);for(let r of e)n(r)}function UY(t,e){"scrollIntoView"in t?(t.focus({preventScroll:!0}),t.scrollIntoView({block:"nearest",inline:"nearest",...e})):t.focus()}var $i=I(H(),1),xCe="div",HY=Lf(),CCe=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],YY=Symbol("safariFocusAncestor");function ZY(t){return t?!!t[YY]:!1}function KY(t,e){t&&(t[YY]=e)}function SCe(t){let{tagName:e,readOnly:n,type:r}=t;return e==="TEXTAREA"&&!n||e==="SELECT"&&!n?!0:e==="INPUT"&&!n?CCe.includes(r):!!(t.isContentEditable||t.getAttribute("role")==="combobox"&&t.dataset.name)}function ECe(t){return"labels"in t?t.labels:null}function WY(t){return t.tagName.toLowerCase()==="input"&&t.type?t.type==="radio"||t.type==="checkbox":!1}function wCe(t){return t?t==="button"||t==="summary"||t==="input"||t==="select"||t==="textarea"||t==="a":!0}function _Ce(t){return t?t==="button"||t==="input"||t==="select"||t==="textarea":!0}function TCe(t,e,n,r,o){return t?e?n&&!r?-1:void 0:n?o:o||0:o}function ON(t,e){return Oe(n=>{t?.(n),!n.defaultPrevented&&e&&(n.stopPropagation(),n.preventDefault())})}var GY=!1,IN=!0;function $Ce(t){let e=t.target;e&&"hasAttribute"in e&&(e.hasAttribute("data-focus-visible")||(IN=!1))}function NCe(t){t.metaKey||t.ctrlKey||t.altKey||(IN=!0)}var Gl=Ne(function({focusable:e=!0,accessibleWhenDisabled:n,autoFocus:r,onFocusVisible:o,...i}){let s=(0,$i.useRef)(null);(0,$i.useEffect)(()=>{e&&(GY||(Bn("mousedown",$Ce,!0),Bn("keydown",NCe,!0),GY=!0))},[e]),HY&&(0,$i.useEffect)(()=>{if(!e)return;let k=s.current;if(!k||!WY(k))return;let z=ECe(k);if(!z)return;let W=()=>queueMicrotask(()=>k.focus());for(let R of z)R.addEventListener("mouseup",W);return()=>{for(let R of z)R.removeEventListener("mouseup",W)}},[e]);let a=e&&Rs(i),l=!!a&&!n,[c,u]=(0,$i.useState)(!1);(0,$i.useEffect)(()=>{e&&l&&c&&u(!1)},[e,l,c]),(0,$i.useEffect)(()=>{if(!e||!c)return;let k=s.current;if(!k||typeof IntersectionObserver>"u")return;let z=new IntersectionObserver(()=>{Ti(k)||u(!1)});return z.observe(k),()=>z.disconnect()},[e,c]);let d=ON(i.onKeyPressCapture,a),f=ON(i.onMouseDownCapture,a),p=ON(i.onClickCapture,a),m=i.onMouseDown,g=Oe(k=>{if(m?.(k),k.defaultPrevented||!e)return;let z=k.currentTarget;if(!HY||k3(k)||!ci(z)&&!WY(z))return;let W=!1,R=()=>{W=!0},F={capture:!0,once:!0};z.addEventListener("focusin",R,F);let K=zY(z.parentElement);KY(K,!0),Bu(z,"mouseup",()=>{z.removeEventListener("focusin",R,!0),KY(K,!1),!W&&H3(z)})}),h=(k,z)=>{if(z&&(k.currentTarget=z),!e)return;let W=k.currentTarget;W&&If(W)&&(o?.(k),!k.defaultPrevented&&(W.dataset.focusVisible="true",u(!0)))},v=i.onKeyDownCapture,y=Oe(k=>{if(v?.(k),k.defaultPrevented||!e||c||k.metaKey||k.altKey||k.ctrlKey||!Zr(k))return;let z=k.currentTarget;Bu(z,"focusout",()=>h(k,z))}),b=i.onFocusCapture,S=Oe(k=>{if(b?.(k),k.defaultPrevented||!e)return;if(!Zr(k)){u(!1);return}let z=k.currentTarget,W=()=>h(k,z);IN||SCe(k.target)?Bu(k.target,"focusout",W):u(!1)}),x=i.onBlur,E=Oe(k=>{x?.(k),e&&Fu(k)&&(k.currentTarget.removeAttribute("data-focus-visible"),u(!1))}),w=(0,$i.useContext)(j3),_=Oe(k=>{e&&r&&k&&w&&queueMicrotask(()=>{If(k)||Ti(k)&&k.focus()})}),$=F3(s),T=e&&wCe($),N=e&&_Ce($),P=i.style,B=(0,$i.useMemo)(()=>l?{pointerEvents:"none",...P}:P,[l,P]);return i={"data-focus-visible":e&&c||void 0,"data-autofocus":r||void 0,"aria-disabled":a||void 0,...i,ref:gt(s,_,i.ref),style:B,tabIndex:TCe(e,l,T,N,i.tabIndex),disabled:N&&l?!0:void 0,contentEditable:a?void 0:i.contentEditable,onKeyPressCapture:d,onClickCapture:p,onMouseDownCapture:f,onMouseDown:g,onKeyDownCapture:y,onFocusCapture:S,onBlur:E},Ro(i)}),BUe=Ee(function(e){let n=Gl(e);return Te(xCe,n)});var Uu=I(H(),1),DCe="button";function qY(t){if(!t.isTrusted)return!1;let e=t.currentTarget;return t.key==="Enter"?ci(e)||e.tagName==="SUMMARY"||e.tagName==="A":t.key===" "?ci(e)||e.tagName==="SUMMARY"||e.tagName==="INPUT"||e.tagName==="SELECT":!1}var LCe=Symbol("command"),fv=Ne(function({clickOnEnter:e=!0,clickOnSpace:n=!0,...r}){let o=(0,Uu.useRef)(null),[i,s]=(0,Uu.useState)(!1);(0,Uu.useEffect)(()=>{o.current&&s(ci(o.current))},[]);let[a,l]=(0,Uu.useState)(!1),c=(0,Uu.useRef)(!1),u=Rs(r),[d,f]=B3(r,LCe,!0),p=r.onKeyDown,m=Oe(v=>{p?.(v);let y=v.currentTarget;if(v.defaultPrevented||d||u||!Zr(v)||Po(y)||y.isContentEditable)return;let b=e&&v.key==="Enter",S=n&&v.key===" ",x=v.key==="Enter"&&!e,E=v.key===" "&&!n;if(x||E){v.preventDefault();return}if(b||S){let w=qY(v);if(b){if(!w){v.preventDefault();let{view:_,...$}=v,T=()=>_N(y,$);EN()?Bu(y,"keyup",T):queueMicrotask(T)}}else S&&(c.current=!0,w||(v.preventDefault(),l(!0)))}}),g=r.onKeyUp,h=Oe(v=>{if(g?.(v),v.defaultPrevented||d||u||v.metaKey)return;let y=n&&v.key===" ";if(c.current&&y&&(c.current=!1,!qY(v))){v.preventDefault(),l(!1);let b=v.currentTarget,{view:S,...x}=v;queueMicrotask(()=>_N(b,x))}});return r={"data-active":a||void 0,type:i?"button":void 0,...f,...r,ref:gt(o,r.ref),onKeyDown:m,onKeyUp:h},r=Gl(r),r}),YUe=Ee(function(e){let n=fv(e);return Te(DCe,n)});function kf(t,e){let n=t.__unstableInternals;return dt(n,"Invalid store"),n[e]}function lr(t,...e){let n=t,r=n,o=Symbol(),i=Nf,s=new Set,a=new Set,l=new Set,c=new Set,u=new Set,d=new WeakMap,f=new WeakMap,p=_=>(l.add(_),()=>l.delete(_)),m=()=>{let _=s.size,$=Symbol();s.add($);let T=()=>{s.delete($),!s.size&&i()};if(_)return T;let N=xN(n).map(k=>Ln(...e.map(z=>{var W;let R=(W=z?.getState)==null?void 0:W.call(z);if(R&&ko(R,k))return Tr(z,[k],F=>{E(k,F[k],!0)})}))),P=[];for(let k of l)P.push(k());let B=e.map(Xg);return i=Ln(...N,...P,...B),T},g=(_,$,T=c)=>(T.add($),f.set($,_),()=>{var N;(N=d.get($))==null||N(),d.delete($),f.delete($),T.delete($)}),h=(_,$)=>g(_,$),v=(_,$)=>(d.set($,$(n,n)),g(_,$)),y=(_,$)=>(d.set($,$(n,r)),g(_,$,u)),b=_=>lr(bN(n,_),w),S=_=>lr(yN(n,_),w),x=()=>n,E=(_,$,T=!1)=>{var N;if(!ko(n,_))return;let P=tv($,n[_]);if(P===n[_])return;if(!T)for(let W of e)(N=W?.setState)==null||N.call(W,_,P);let B=n;n={...n,[_]:P};let k=Symbol();o=k,a.add(_);let z=(W,R,F)=>{var K;let L=f.get(W),M=A=>F?F.has(A):A===_;(!L||L.some(M))&&((K=d.get(W))==null||K(),d.set(W,W(n,R)))};for(let W of c)z(W,B);queueMicrotask(()=>{if(o!==k)return;let W=n;for(let R of u)z(R,r,a);r=W,a.clear()})},w={getState:x,setState:E,__unstableInternals:{setup:p,init:m,subscribe:h,sync:v,batch:y,pick:b,omit:S}};return w}function di(t,...e){if(t)return kf(t,"setup")(...e)}function Xg(t,...e){if(t)return kf(t,"init")(...e)}function Qg(t,...e){if(t)return kf(t,"subscribe")(...e)}function Tr(t,...e){if(t)return kf(t,"sync")(...e)}function eh(t,...e){if(t)return kf(t,"batch")(...e)}function Rf(t,...e){if(t)return kf(t,"omit")(...e)}function kN(t,...e){if(t)return kf(t,"pick")(...e)}function Pf(...t){var e;let n={};for(let o of t){let i=(e=o?.getState)==null?void 0:e.call(o);i&&Object.assign(n,i)}let r=lr(n,...t);return Object.assign({},...t,r)}function Yl(t,e){if(process.env.NODE_ENV==="production"||!e)return;let n=Object.entries(t).filter(([i,s])=>i.startsWith("default")&&s!==void 0).map(([i])=>{var s;let a=i.replace("default","");return`${((s=a[0])==null?void 0:s.toLowerCase())||""}${a.slice(1)}`});if(!n.length)return;let r=e.getState();if(n.filter(i=>ko(r,i)).length)throw new Error(`Passing a store prop in conjunction with a default state is not supported.
102
102
 
103
103
  const store = useSelectStore();
104
104
  <SelectProvider store={store} defaultValue="Apple" />
package/dist/server.mjs CHANGED
@@ -20,7 +20,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
20
20
  See https://reactjs.org/docs/forms.html#controlled-components`),W=R.initialPage?R.initialPage:R.forcePage?R.forcePage:0,k.state={selected:W},k}return L=j,(P=[{key:"componentDidMount",value:function(){var R=this.props,k=R.initialPage,W=R.disableInitialCallback,A=R.extraAriaContext,M=R.pageCount,_=R.forcePage;k===void 0||W||this.callCallback(k),A&&console.warn("DEPRECATED (react-paginate): The extraAriaContext prop is deprecated. You should now use the ariaLabelBuilder instead."),Number.isInteger(M)||console.warn("(react-paginate): The pageCount prop value provided is not an integer (".concat(M,"). Did you forget a Math.ceil()?")),k!==void 0&&k>M-1&&console.warn("(react-paginate): The initialPage prop provided is greater than the maximum page index from pageCount prop (".concat(k," > ").concat(M-1,").")),_!==void 0&&_>M-1&&console.warn("(react-paginate): The forcePage prop provided is greater than the maximum page index from pageCount prop (".concat(_," > ").concat(M-1,")."))}},{key:"componentDidUpdate",value:function(R){this.props.forcePage!==void 0&&this.props.forcePage!==R.forcePage&&(this.props.forcePage>this.props.pageCount-1&&console.warn("(react-paginate): The forcePage prop provided is greater than the maximum page index from pageCount prop (".concat(this.props.forcePage," > ").concat(this.props.pageCount-1,").")),this.setState({selected:this.props.forcePage})),Number.isInteger(R.pageCount)&&!Number.isInteger(this.props.pageCount)&&console.warn("(react-paginate): The pageCount prop value provided is not an integer (".concat(this.props.pageCount,"). Did you forget a Math.ceil()?"))}},{key:"getForwardJump",value:function(){var R=this.state.selected,k=this.props,W=k.pageCount,A=R+k.pageRangeDisplayed;return A>=W?W-1:A}},{key:"getBackwardJump",value:function(){var R=this.state.selected-this.props.pageRangeDisplayed;return R<0?0:R}},{key:"getElementHref",value:function(R){var k=this.props,W=k.hrefBuilder,A=k.pageCount,M=k.hrefAllControls;if(W)return M||R>=0&&R<A?W(R+1,A,this.state.selected):void 0}},{key:"ariaLabelBuilder",value:function(R){var k=R===this.state.selected;if(this.props.ariaLabelBuilder&&R>=0&&R<this.props.pageCount){var W=this.props.ariaLabelBuilder(R+1,k);return this.props.extraAriaContext&&!k&&(W=W+" "+this.props.extraAriaContext),W}}},{key:"getPageElement",value:function(R){var k=this.state.selected,W=this.props,A=W.pageClassName,M=W.pageLinkClassName,_=W.activeClassName,U=W.activeLinkClassName,q=W.extraAriaContext,ue=W.pageLabelBuilder;return a().createElement(d,{key:R,pageSelectedHandler:this.handlePageSelected.bind(null,R),selected:k===R,rel:this.getElementPageRel(R),pageClassName:A,pageLinkClassName:M,activeClassName:_,activeLinkClassName:U,extraAriaContext:q,href:this.getElementHref(R),ariaLabel:this.ariaLabelBuilder(R),page:R+1,pageLabelBuilder:ue,getEventListener:this.getEventListener})}},{key:"render",value:function(){var R=this.props.renderOnZeroPageCount;if(this.props.pageCount===0&&R!==void 0)return R&&R(this.props);var k=this.props,W=k.disabledClassName,A=k.disabledLinkClassName,M=k.pageCount,_=k.className,U=k.containerClassName,q=k.previousLabel,ue=k.previousClassName,ye=k.previousLinkClassName,H=k.previousAriaLabel,G=k.prevRel,te=k.nextLabel,K=k.nextClassName,ne=k.nextLinkClassName,Z=k.nextAriaLabel,le=k.nextRel,Ce=this.state.selected,Se=Ce===0,ie=Ce===M-1,we="".concat(h(ue)).concat(Se?" ".concat(h(W)):""),xe="".concat(h(K)).concat(ie?" ".concat(h(W)):""),he="".concat(h(ye)).concat(Se?" ".concat(h(A)):""),ve="".concat(h(ne)).concat(ie?" ".concat(h(A)):""),Ie=Se?"true":"false",ke=ie?"true":"false";return a().createElement("ul",{className:_||U,role:"navigation","aria-label":"Pagination"},a().createElement("li",{className:we},a().createElement("a",v({className:he,href:this.getElementHref(Ce-1),tabIndex:Se?"-1":"0",role:"button",onKeyPress:this.handlePreviousPage,"aria-disabled":Ie,"aria-label":H,rel:G},this.getEventListener(this.handlePreviousPage)),q)),this.pagination(),a().createElement("li",{className:xe},a().createElement("a",v({className:ve,href:this.getElementHref(Ce+1),tabIndex:ie?"-1":"0",role:"button",onKeyPress:this.handleNextPage,"aria-disabled":ke,"aria-label":Z,rel:le},this.getEventListener(this.handleNextPage)),te)))}}])&&b(L.prototype,P),Object.defineProperty(L,"prototype",{writable:!1}),j}(i.Component);E($,"propTypes",{pageCount:s().number.isRequired,pageRangeDisplayed:s().number,marginPagesDisplayed:s().number,previousLabel:s().node,previousAriaLabel:s().string,prevPageRel:s().string,prevRel:s().string,nextLabel:s().node,nextAriaLabel:s().string,nextPageRel:s().string,nextRel:s().string,breakLabel:s().oneOfType([s().string,s().node]),breakAriaLabels:s().shape({forward:s().string,backward:s().string}),hrefBuilder:s().func,hrefAllControls:s().bool,onPageChange:s().func,onPageActive:s().func,onClick:s().func,initialPage:s().number,forcePage:s().number,disableInitialCallback:s().bool,containerClassName:s().string,className:s().string,pageClassName:s().string,pageLinkClassName:s().string,pageLabelBuilder:s().func,activeClassName:s().string,activeLinkClassName:s().string,previousClassName:s().string,nextClassName:s().string,previousLinkClassName:s().string,nextLinkClassName:s().string,disabledClassName:s().string,disabledLinkClassName:s().string,breakClassName:s().string,breakLinkClassName:s().string,extraAriaContext:s().string,ariaLabelBuilder:s().func,eventListener:s().string,renderOnZeroPageCount:s().func,selectedPageRel:s().string}),E($,"defaultProps",{pageRangeDisplayed:2,marginPagesDisplayed:3,activeClassName:"selected",previousLabel:"Previous",previousClassName:"previous",previousAriaLabel:"Previous page",prevPageRel:"prev",prevRel:"prev",nextLabel:"Next",nextClassName:"next",nextAriaLabel:"Next page",nextPageRel:"next",nextRel:"next",breakLabel:"...",breakAriaLabels:{forward:"Jump forward",backward:"Jump backward"},disabledClassName:"disabled",disableInitialCallback:!1,pageLabelBuilder:function(I){return I},eventListener:"onClick",renderOnZeroPageCount:void 0,selectedPageRel:"canonical",hrefAllControls:!1});let T=$})(),o})())});var Wk=be(hS=>{"use strict";Object.defineProperty(hS,"__esModule",{value:!0});var sse=Wc(),mS=Uc(),gS=Gc();function lse(t){return t&&t.__esModule?t:{default:t}}var use=lse(sse);function zk(t,e){if(t.inserted[e.name]===void 0)return t.insert("",e,t.sheet,!0)}function Hk(t,e,r){var n=[],o=gS.getRegisteredStyles(t,n,r);return n.length<2?r:o+e(n)}var cse=function(e){var r=use.default(e);r.sheet.speedy=function(l){this.isSpeedy=l},r.compat=!0;var n=function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];var d=mS.serializeStyles(u,r.registered,void 0);return gS.insertStyles(r,d,!1),r.key+"-"+d.name},o=function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];var d=mS.serializeStyles(u,r.registered),f="animation-"+d.name;return zk(r,{name:d.name,styles:"@keyframes "+f+"{"+d.styles+"}"}),f},i=function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];var d=mS.serializeStyles(u,r.registered);zk(r,d)},a=function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return Hk(r.registered,n,dse(u))};return{css:n,cx:a,injectGlobal:i,keyframes:o,hydrate:function(s){s.forEach(function(u){r.inserted[u]=!0})},flush:function(){r.registered={},r.inserted={},r.sheet.flush()},sheet:r.sheet,cache:r,getRegisteredStyles:gS.getRegisteredStyles.bind(null,r.registered),merge:Hk.bind(null,r.registered,n)}},dse=function t(e){for(var r="",n=0;n<e.length;n++){var o=e[n];if(o!=null){var i=void 0;switch(typeof o){case"boolean":break;case"object":{if(Array.isArray(o))i=t(o);else{i="";for(var a in o)o[a]&&a&&(i&&(i+=" "),i+=a)}break}default:i=o}i&&(r&&(r+=" "),r+=i)}}return r};hS.default=cse});var Gk=be(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});var fse=Wk();Wc();Uc();Gc();var ra=fse.default({key:"css"}),pse=ra.flush,mse=ra.hydrate,gse=ra.cx,hse=ra.merge,vse=ra.getRegisteredStyles,bse=ra.injectGlobal,yse=ra.keyframes,xse=ra.css,Cse=ra.sheet,Sse=ra.cache;Go.cache=Sse;Go.css=xse;Go.cx=gse;Go.flush=pse;Go.getRegisteredStyles=vse;Go.hydrate=mse;Go.injectGlobal=bse;Go.keyframes=yse;Go.merge=hse;Go.sheet=Cse});var cB=be((YYe,uB)=>{"use strict";var Qme=Object.prototype.hasOwnProperty,ege=Object.prototype.toString;uB.exports=function(e,r,n){if(ege.call(r)!=="[object Function]")throw new TypeError("iterator must be a function");var o=e.length;if(o===+o)for(var i=0;i<o;i++)r.call(n,e[i],i,e);else for(var a in e)Qme.call(e,a)&&r.call(n,e[a],a,e)}});var iw=be((KYe,dB)=>{"use strict";var tge=cB();dB.exports=Wt;function Wt(t,e,r){if(arguments.length===3)return Wt.set(t,e,r);if(arguments.length===2)return Wt.get(t,e);var n=Wt.bind(Wt,t);for(var o in Wt)Wt.hasOwnProperty(o)&&(n[o]=Wt[o].bind(n,t));return n}Wt.get=function(e,r){for(var n=Array.isArray(r)?r:Wt.parse(r),o=0;o<n.length;++o){var i=n[o];if(!(typeof e=="object"&&i in e))throw new Error("Invalid reference token: "+i);e=e[i]}return e};Wt.set=function(e,r,n){var o=Array.isArray(r)?r:Wt.parse(r),i=o[0];if(o.length===0)throw Error("Can not set the root object");for(var a=0;a<o.length-1;++a){var l=o[a];typeof l!="string"&&typeof l!="number"&&(l=String(l)),!(l==="__proto__"||l==="constructor"||l==="prototype")&&(l==="-"&&Array.isArray(e)&&(l=e.length),i=o[a+1],l in e||(i.match(/^(\d+|-)$/)?e[l]=[]:e[l]={}),e=e[l])}return i==="-"&&Array.isArray(e)&&(i=e.length),e[i]=n,this};Wt.remove=function(t,e){var r=Array.isArray(e)?e:Wt.parse(e),n=r[r.length-1];if(n===void 0)throw new Error('Invalid JSON pointer for remove: "'+e+'"');var o=Wt.get(t,r.slice(0,-1));if(Array.isArray(o)){var i=+n;if(n===""&&isNaN(i))throw new Error('Invalid array index: "'+n+'"');Array.prototype.splice.call(o,i,1)}else delete o[n]};Wt.dict=function(e,r){var n={};return Wt.walk(e,function(o,i){n[i]=o},r),n};Wt.walk=function(e,r,n){var o=[];n=n||function(i){var a=Object.prototype.toString.call(i);return a==="[object Object]"||a==="[object Array]"},function i(a){tge(a,function(l,s){o.push(String(s)),n(l)?i(l):r(l,Wt.compile(o)),o.pop()})}(e)};Wt.has=function(e,r){try{Wt.get(e,r)}catch{return!1}return!0};Wt.escape=function(e){return e.toString().replace(/~/g,"~0").replace(/\//g,"~1")};Wt.unescape=function(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")};Wt.parse=function(e){if(e==="")return[];if(e.charAt(0)!=="/")throw new Error("Invalid JSON pointer: "+e);return e.substring(1).split(/\//).map(Wt.unescape)};Wt.compile=function(e){return e.length===0?"":"/"+e.map(Wt.escape).join("/")}});import{z as uc}from"zod";var tE={displayName:"Ask Una",description:"Ask the Uniform Docs assistant, Una, questions about Uniform features, usage, and best practices.",inputSchema:uc.object({question:uc.string().describe(`Prompt for the uniform docs AI assistant.
21
21
  The prompt should describe the information you are looking for.
22
22
  You may be detailed but do not use more than 100 words.
23
- When answering a user question, your prompt should be exactly that question.`)}),outputSchema:uc.object({success:uc.boolean(),error:uc.string().optional().describe("The error message if the question was not answered successfully"),answerMarkdown:uc.string().describe("The answer, in markdown format, from the Uniform docs chatbot")}),runsAt:"server",timeout:60,callable:!0};function rE(t,e){t.tool("askQuestion","Ask the Uniform Docs assistant, Una, questions about Uniform features, usage, and best practices",tE.inputSchema.shape,async r=>{let n=await e.toolInvoker.invoke("askQuestion",r);return{content:[{type:"text",text:JSON.stringify(n,null,2)}]}})}import{autoFixParameterGroups as sE,CanvasClient as nz}from"@uniformdev/canvas";import*as Ph from"zod/v3";import Vj from"fast-json-patch";function Ah(t,e){return Vj.applyPatch(t,e).newDocument}import*as wi from"zod/v3";var Lh=wi.array(wi.object({op:wi.enum(["add","remove","replace"]),path:wi.string().describe("The JSON path to patch"),value:wi.unknown().describe("The value to patch - for remove, leave this blank")}));function jj(t){return Array.isArray(t)&&t.length>0}function nE(t){return!!t&&typeof t=="object"&&"type"in t}function oE(t){return typeof t=="object"&&t!==null&&"root"in t&&nE(t.root)}function Sl(t){return"children"in t&&jj(t.children)}var zj=({context:t,renderChildren:e})=>Sl(t.currentNode)?`${e(t.currentNode.children)} `:"";var Hj=({context:t,renderChildren:e})=>{if(!Sl(t.currentNode))return"";let r=e(t.currentNode.children);return r.endsWith(" ")?r:`${r} `};var Wj=({context:t,renderChildren:e})=>Sl(t.currentNode)?`${e(t.currentNode.children)} `:"";var Gj=({context:t,renderChildren:e})=>Sl(t.currentNode)?`${e(t.currentNode.children)} `:"";var Uj=({context:t,renderChildren:e})=>Sl(t.currentNode)?`${e(t.currentNode.children)} `:"";var Zj=({context:t,renderChildren:e})=>Sl(t.currentNode)?`${e(t.currentNode.children)} `:"";var Yj=({context:t})=>t.currentNode.text;var Kj=()=>" ";var Xj=()=>" ",Jj=new Map([["text",Yj],["tab",Kj],["linebreak",Xj],["paragraph",Wj],["listitem",Hj],["heading",zj],["table",Gj],["tablecell",Uj],["tablerow",Zj]]),qj=t=>{let e=Jj.get(t.currentNode.type);return e||(({context:r,renderChildren:n})=>Sl(r.currentNode)?n(r.currentNode.children):"")};function Qj(t,e){let r=[];return e?.ancestorNodes&&(r=r.concat(e.ancestorNodes)),e?.currentNode&&r.unshift(e.currentNode),{...e??{},currentNode:t,ancestorNodes:r}}function F2(t,e){var r;if(!nE(t))return"";let n=Qj(t,e),o=(r=n.resolveRenderer)==null?void 0:r.call(n,n);if(typeof o>"u")o=qj(n);else if(o===null)return"";let i=a=>ez(a,n);if(o){let a=o({context:n,renderChildren:i});return n.ancestorNodes.length>0?a:a.trim()}else throw new Error(`There is no renderer for node type: ${n.currentNode.type}`)}function ez(t,e){return Array.isArray(t)?t.map(r=>F2(r,e)).join(""):""}var tz=[{label:"Heading 1",type:"h1"},{label:"Heading 2",type:"h2"},{label:"Heading 3",type:"h3"},{label:"Heading 4",type:"h4"},{label:"Heading 5",type:"h5"},{label:"Heading 6",type:"h6"},{label:"Bullet List",type:"unorderedList"},{label:"Ordered List",type:"orderedList"},{label:"Link",type:"link"},{label:"Blockquote",type:"quote"},{label:"Code Block",type:"code"},{label:"Table",type:"table"},{label:"Asset",type:"asset"},{label:"Dynamic Token",type:"variable"}],rz=[{label:"Bold",type:"bold"},{label:"Italic",type:"italic"},{label:"Underline",type:"underline"},{label:"Strikethrough",type:"strikethrough"},{label:"Code",type:"code"},{label:"Superscript",type:"superscript"},{label:"Subscript",type:"subscript"}];var _h={required:!1,formatting:{builtIn:rz.map(t=>t.type)},elements:{builtIn:tz.map(t=>t.type)},elementsConfig:{asset:{allowedTypes:["image"]}}};import*as Dr from"zod/v3";import*as $t from"zod/v3";var Nh=$t.object({name:$t.string().describe('Title-cased display name. Ex: "Headline"'),id:$t.string().describe("The public ID. Must be unique within the current entity fields/parameters."),type:$t.enum(["text","richText","select","multi-select","number","date","dateTime","checkbox","link","asset","json","contentReference","$enr","group"]).describe("The data type of the property. The group type defines a grouping of other properties."),guidance:$t.string().describe('Describe what kind of content should be populated, for a LLM to use as a guide. 1-2 sentences max. Ex: "Meta tags based on the content", "2-3 word headline"'),localizable:$t.boolean().describe("Whether values are stored as locale-specific"),typeConfig:$t.object({allowedTypes:$t.array($t.enum(["image","video","audio","other"])).optional().describe("The types of asset allowed. ONLY applies when type=asset, omit for other types"),options:$t.array($t.object({text:$t.string().describe("The text to display to the author"),value:$t.string().describe("The value to store for the option")})).optional().describe("The author-selectable options for the select property. ONLY applies when type=select or multi-select, omit for other types"),required:$t.boolean().optional().describe("Whether an author must enter a value for this property"),min:$t.number().optional().describe("When type=number, this is the smallest allowed value (omit for no minimum). When type=multi-select, this is the minimum number of selections the author must make (omit for no minimum). When type=reference and isMulti=true, this is the minimum number of references the author must select (omit for no minimum). Omit for all other types."),max:$t.number().optional().describe("When type=number, this is the largest allowed value (omit for no maximum). When type=multi-select, this is the maximum number of selections the author can make (omit for no maximum). When type=reference and isMulti=true, this is the maximum number of references the author can select (omit for no maximum). Omit for all other types."),allowedContentTypes:$t.array($t.string()).optional().describe("When type=reference, this is a list of content type public IDs the author can reference. The content type ID must already exist. Omit for all other types."),isMulti:$t.boolean().optional().describe("When type=reference, this is whether the author can select multiple referenced entries. When false, only one reference is allowed. Omit for all other types."),childrenParams:$t.array($t.string()).optional().describe("When type=group, this is a list of public IDs of the properties to group. The property ID must be defined within this definition. Omit for all other types."),collapsed:$t.boolean().optional().describe("When type=group, this is whether the group is collapsed by default."),schema:$t.any().describe("When type=json, this is an optional JSON schema the property value must follow. Omit for all other types.")}).optional()});var iE=Dr.object({name:Dr.string().describe('Title-cased display name of the component. Ex: "Hero"'),id:Dr.string().describe("Public ID of the component, the camelCase version of name, using only alphanumeric characters"),description:Dr.string().describe('Describe the purpose of the component in 1-2 sentences. If the component seems generic, such as "Promo" or "Hero", this should be blank.'),canBeComposition:Dr.boolean().describe("True if the component can have pages/compositions created from it. False if it is a part of a page."),parameters:Dr.array(Nh).describe("The properties of the component. The key is the publicId of the property.").optional(),slots:Dr.array(Dr.object({name:Dr.string().describe('Title-cased display name of the slot. Ex: "Content"'),id:Dr.string().describe("The public id of the slot. Must be unique within this component's slots."),allowedComponents:Dr.array(Dr.string()).describe("The components public IDs allowed in the slot."),minComponents:Dr.number().describe("The minimum number of components allowed in the slot. Omit for no minimum.").min(0).optional(),maxComponents:Dr.number().describe("The maximum number of components allowed in the slot. Omit for no maximum.").min(1).optional(),inheritAllowedComponents:Dr.boolean().describe("Set to false")})).describe("The slots of the component. The key is the publicId of the slot.").optional()});function aE(t){let e=t.slots?.map(o=>({...o,patternsInAllowedComponents:!0,inheritAllowedComponents:!1,maxComponents:o.maxComponents===0?void 0:o.maxComponents,minComponents:o.minComponents===0?void 0:o.minComponents})),r=t.parameters?.find(o=>o.type==="asset"&&typeof o.typeConfig=="object"&&o.typeConfig!==null&&"allowedTypes"in o.typeConfig&&Array.isArray(o.typeConfig.allowedTypes)&&o.typeConfig.allowedTypes?.includes("image"))?.id,n=t.parameters?.find(o=>o.type==="text")?.id;return{...t,slots:e,titleParameter:n,thumbnailParameter:r}}function Mh(t,e){return`${e.baseWebUrl}/dashboards/canvas/components/${t}`}function cc(t,e){let r=t.filter(n=>e===void 0&&n.type==="richText"||e!==void 0&&e.includes(n.id));if(r.length!==0)for(let n of r){if(n.typeConfig===void 0){n.typeConfig=_h;continue}n.typeConfig={..._h,required:n.typeConfig.required??_h.required}}}var oz={action:Ph.enum(["create","update","delete"]).describe("The action to perform"),publicId:Ph.string().describe("Public ID of the component, the camelCase version of name, using only alphanumeric characters"),component:iE.describe("Full component definition to create. Omit for update or delete.").optional(),patches:Lh.describe("JSON patch to apply to the existing component definition. Omit for create or delete.").optional()};function lE(t,e){t.tool("componentAction","Creates, updates, or deletes a Uniform Component definition (or Composition definition)",oz,async({publicId:r,action:n,component:o,patches:i})=>{let a=new nz(e),l=!1;if(n==="create"){if(!o)throw new Error("Component definition is required for create");let s=aE(o);s.parameters&&(l=sE(s.parameters),cc(s.parameters)),await a.updateComponentDefinition({componentDefinition:s})}if(n==="update"){if(!i)throw new Error("Patches are required for update");let s=await a.getComponentDefinitions({componentId:r});if(!s.componentDefinitions.length)throw new Error(`Component with public ID ${r} does not exist, try creating it instead`);let u=s.componentDefinitions[0],c=u.parameters?.filter(f=>f.type==="richText").map(f=>f.id),d=Ah(u,i);if(d.parameters){l=sE(d.parameters);let f=d.parameters?.filter(p=>p.type==="richText").map(p=>p.id).filter(p=>!c?.includes(p));cc(d.parameters,f)}await a.updateComponentDefinition({componentDefinition:d})}return n==="delete"&&await a.removeComponentDefinition({componentId:r}),{content:[{type:"text",text:JSON.stringify({success:!0,editUrl:Mh(r,e),warning:l?"Issues with parameter group order were fixed. Ensure definition data is re-fetched before any future updates.":void 0},null,2)}]}})}import{CanvasClient as uE}from"@uniformdev/canvas";import*as cE from"zod/v3";var iz={id:cE.string()};function dE(t,e){t.tool("componentList","Lists all Uniform Component definitions",async()=>{let o=(await new uE(e).getComponentDefinitions({includeSystem:!0})).componentDefinitions.map(i=>({id:i.id,name:i.name,type:i.canBeComposition?"composition":"component",description:i.description,editUrl:Mh(i.id,e)}));return{content:[{type:"text",text:JSON.stringify(o,null,2)}]}}),t.tool("componentGet","Gets a Uniform Component definition details (slots, parameters, etc.)",iz,async({id:r})=>{let o=await new uE(e).getComponentDefinitions({componentId:r,includeSystem:!0});return{content:[{type:"text",text:JSON.stringify(o.componentDefinitions[0],null,2)}]}})}import*as He from"zod/v3";import*as dc from"zod/v3";var is=dc.object({componentId:dc.string().describe("ID of the component pattern instance the data resource belongs to - can be created in the same call to this tool"),dataResourceName:dc.string().describe("Name of the data resource to update. Must be defined as a pattern data resource on the pattern, new names cannot be created"),editInstructions:dc.string().describe('Prompt that will be used to generate the data resource value. Omission will leave the value unchanged. To reset an overridden value to pattern default, say "reset override".').optional()}).describe("A value change to a pattern data resource. Omit unchanged data resources.");var az=He.object({parentComponentId:He.string().describe("ID of the component the slot belongs to"),slotName:He.string().describe("Public ID of the target slot"),slotIndex:He.number().describe("Index to insert the new component at. Omit for append.").optional(),newComponentInstanceUuid:He.string().uuid().describe("UUID of the new component to create. You MUST generate a valid unique UUID using the `createUuid` tool."),instanceType:He.enum(["component","componentPattern"]),componentType:He.string().describe("Public ID of the component definition to insert. Component definition must be registered with Uniform. Omit when inserting a component pattern instance.").optional(),componentPatternId:He.string().describe("UUID of the component pattern definition to insert. Component pattern must be registered with Uniform. Omit when inserting a component instance.").optional()}),Oh=He.object({componentId:He.string().describe("ID of the component the parameter belongs to - can be created in the same call to this tool"),parameterId:He.string().describe("Public ID of the parameter to update. Must be defined in the component type of the parent componentId"),parameterType:He.string().describe("The type of the parameterId as defined on the component definition"),fromLocale:He.string().describe("When translating from a different locale, use the locale you are translating from. Omit for non-localized values.").optional(),locale:He.string().describe("Locale of the parameter value. Omit for non-localized values.").optional(),editInstructions:He.string().describe('Prompt that will be used to generate the parameter value. Omission will leave the value unchanged. To reset an overridden value to pattern default, say "reset override".').optional()}).describe("A value change to a parameter. Omit unchanged parameters."),kh=He.object({createComponentInstances:He.array(az).describe("New components to insert in slots. Do not use for moves or duplications. Omit for delete. These actions are performed before moving, duplicating, or deleting components, and parameter updates.").optional(),moveComponentInstances:He.array(He.object({componentId:He.string().describe("Existing component ID to move. Cannot be root component."),newParentComponentId:He.string(),newSlotName:He.string().describe("Destination slot to move to"),newSlotIndex:He.number().describe("Destination index in the parent slot to move to")})).describe("Moves existing component instances to a new location in a composition. The destination can be the same slot to cause a reorder. Omit for create or delete, or if nothing needs moving. These actions are performed before duplicating or deleting components, and parameter updates.").optional(),duplicateComponentInstances:He.array(He.string().describe("Component ID to duplicate. Cannot be root component. All descendants of the duplicated component will be duplicated as well. Duplicates are placed in the same slot as the original component, at the end.")).describe("Component instances to duplicate/copy. Omit when empty. These actions are performed before deleting components and parameter updates.").optional(),deleteComponentInstances:He.array(He.string().describe("Component ID to remove. Cannot be the pattern root component.")).describe("Component instances to delete from slots during an update. Omit for create or delete, or if nothing needs deleting. These actions are performed after moving and duplicating components, and before parameter updates.").optional(),dataResourceUpdates:He.array(is).describe("Updates to pattern data resources. Use empty array if no changes are needed.").optional()}),as=He.object({enableLocales:He.array(He.string()).describe("Locales to enable. Omit for no change.").optional(),disableLocales:He.array(He.string()).describe("Locales to disable. Existing data in disabled locales will be lost. Omit for no change.").optional()}),sz=He.object({summary:He.string().describe("Short summary of the edit that was made.").optional(),success:He.boolean()}),m1e=He.object({success:He.boolean().describe("Whether all actions were successful"),actionsTaken:He.array(sz).describe("Array of individual actions that were taken")});import*as sa from"zod/v3";var lz=Oh.extend({overridable:sa.enum(["yes","no"]).describe("Whether the parameter value set on the pattern definition is overridable by pattern consumers. Omit when no change is needed.").optional()}),fE=kh.extend({name:sa.string().describe("Name of the pattern. If the name does not need to be changed, omit this field. Always include for creates.").optional(),type:sa.string().describe("Component definition type of the pattern. Must be registered with Uniform. Always include for creates. Omit otherwise.").optional(),description:sa.string().describe("Description of the pattern for authors. If the description does not need to be changed, omit this field.").optional(),parameterUpdates:sa.array(lz).describe("Updates to the parameters of the pattern. Use empty array if no changes are needed.").optional(),dataResourceUpdates:sa.array(is).describe("Updates to the pattern instance data resources. Use empty array if no changes are needed.").optional(),localeUpdates:as.optional()}).describe("Modification instructions for the pattern");import*as ss from"zod/v3";var pE=ss.object({...kh.shape,name:ss.string().describe("Name of the composition. If the name does not need to be changed, omit this field. Always include for creates.").optional(),type:ss.string().describe("Component definition type of the composition. Must be registered with Uniform and have canBeComposition=true in the component definition. Always include for creates. Omit otherwise.").optional(),parameterUpdates:ss.array(Oh).describe("Updates to the parameters of the pattern. Use empty array if no changes are needed.").optional(),localeUpdates:as.optional(),dataResourceUpdates:ss.array(is).describe("Updates to pattern instance data resources. Use empty array if no changes are needed.").optional()}).describe("Modification instructions for the composition");import*as Ei from"zod/v3";import*as On from"zod/v3";var B2=On.object({fieldId:On.string().describe("Public ID of the field to update. Must be defined in the content type of the parent entry."),fieldType:On.string().describe("The type of the fieldId as defined on the content type"),fromLocale:On.string().describe("When translating from a different locale, use the locale you are translating from. Omit for non-localized values.").optional(),locale:On.string().describe("Locale of the field value. Omit for non-localized values.").optional(),editInstructions:On.string().describe('Prompt that will be used to generate the field value. Omission will leave the value unchanged. To reset an overridden value to pattern default, say "reset override".').optional()}).describe("A value change to a field. Omit unchanged fields."),mE=On.object({type:On.string().describe("Content type of the entry. Must be registered with Uniform. Always include for creates. Omit otherwise.").optional(),slug:On.string().describe("Slug (human-readable identifier) of the entry. If the slug does not need to be changed, omit this field.").optional(),fieldUpdates:On.array(B2).describe("Updates to the fields of the entry. Use empty array if no changes are needed.").optional(),localeUpdates:as.optional(),dataResourceUpdates:On.array(is).describe("Updates to the data resources of the entry. Use empty array if no changes are needed.").optional()}).describe("Modification instructions for the entry");var uz=B2.extend({overridable:Ei.enum(["yes","no"]).describe("Whether the parameter value set on the pattern definition is overridable by pattern consumers. Omit when no change is needed.").optional()}),gE=Ei.object({name:Ei.string().describe("Name of the entry pattern. If the name does not need to be changed, omit this field. Always include for creates.").optional(),type:Ei.string().describe("Content type of the entry pattern. Must be registered with Uniform. Always include for creates. Omit otherwise.").optional(),description:Ei.string().describe("Description of the entry pattern for authors. If the description does not need to be changed, omit this field.").optional(),fieldUpdates:Ei.array(uz).describe("Updates to the fields of the entry pattern. Use empty array if no changes are needed.").optional(),localeUpdates:as.optional()}).describe("Modification instructions for the entry pattern");import*as en from"zod/v3";import{CANVAS_BLOCK_PARAM_TYPE as Ume}from"@uniformdev/canvas";import{getEffectivePropertyValue as Zme}from"@uniformdev/canvas";import{CANVAS_PERSONALIZATION_PARAM as Yme}from"@uniformdev/canvas";var wl="uniformContentInternalReference";var cz="$p:";function Rh(t){return`${cz}${t}`}function hE({slotDefinition:t,slotSectionDefinition:e}){return{slotDefinition:{...t,allowedComponentsIndex:new Set(t?.allowedComponents??[]),maxComponents:t?.maxComponents??Number.MAX_VALUE,minComponents:t?.minComponents??0,allowAllPatternsOfAllowedTypes:!t?.patternsInAllowedComponents},slotSectionDefinition:e?{...e,specificTypesIndex:new Set(e?.specificTypes??[])}:void 0}}import{CANVAS_HYPOTHESIS_PARAM as N1e,CANVAS_LOCALIZATION_SLOT as M1e,CANVAS_LOCALIZATION_TYPE as P1e,CANVAS_PERSONALIZATION_ALGORITHM_PARAM as O1e,CANVAS_PERSONALIZATION_ALGORITHM_TYPE as k1e,CANVAS_PERSONALIZATION_EVENT_NAME_PARAM as R1e,CANVAS_PERSONALIZATION_TAKE_PARAM as F1e,CANVAS_PERSONALIZE_SLOT as B1e,CANVAS_PERSONALIZE_TYPE as V1e,CANVAS_SLOT_SECTION_GROUP_TYPE_PARAM as j1e,CANVAS_SLOT_SECTION_MAX_PARAM as z1e,CANVAS_SLOT_SECTION_MIN_PARAM as H1e,CANVAS_SLOT_SECTION_NAME_PARAM as W1e,CANVAS_SLOT_SECTION_SLOT as G1e,CANVAS_SLOT_SECTION_SPECIFIC_PARAM as U1e,CANVAS_SLOT_SECTION_TYPE as Z1e,CANVAS_TEST_SLOT as Y1e,CANVAS_TEST_TYPE as K1e}from"@uniformdev/canvas";var dz={$personalization:{isNestableIntoItself:!0},$test:void 0,$localization:void 0,$loop:void 0,$slotSection:{isAutoAllowed:!0,isNestableIntoItself:!0,isOnlyAllowedInPatternEditor:!0}},vE=t=>dz[t];function Fh(t,{slotDefinition:e,slotSectionDefinition:r},n=!1){let o=fz(t,e,n);return r?o?pz(t,r):!1:o}function fz(t,e,r=!1){let n=vE(t.type);if(n?.isOnlyAllowedInPatternEditor&&!r)return!1;if(n?.isAutoAllowed||e.allowAllComponents)return!0;let o=e.allowedComponentsIndex.has(t.type);return e.allowAllPatternsOfAllowedTypes||!t._pattern?o:e.allowedComponentsIndex.has(Rh(t._pattern))||!1}function pz(t,e){return e.groupType==="inherit"||!e.groupType?!0:e.groupType==="specific"?t._pattern?e.specificTypesIndex.has(Rh(t._pattern)):e.specificTypesIndex.has(t.type):e.groupType==="except"?t._pattern?!e.specificTypesIndex.has(Rh(t._pattern)):!e.specificTypesIndex.has(t.type):!1}function Bh(t,e,r,n){return`ref-${t}-${e}`+(r?`-${r}`:"")+(n!==void 0&&n>-1?`(${n})`:"")}function bE(t,e={}){let{targetLocale:r,enabledLocales:n=[],isPatternParameter:o=!1}=e,i=r??(n.length>0?"${locale}":void 0);return{type:wl,...o?{isPatternParameter:!0}:{},variables:{entryIds:t,...i?{locale:i}:{}}}}import{CANVAS_SLOT_SECTION_GROUP_TYPE_PARAM as mz,CANVAS_SLOT_SECTION_MAX_PARAM as gz,CANVAS_SLOT_SECTION_MIN_PARAM as hz,CANVAS_SLOT_SECTION_NAME_PARAM as vz,CANVAS_SLOT_SECTION_SLOT as bz,CANVAS_SLOT_SECTION_SPECIFIC_PARAM as yz,CANVAS_SLOT_SECTION_TYPE as xz}from"@uniformdev/canvas";var j2=({twee:t,parentNodeId:e,slotName:r,componentDefinitionsIndex:n})=>{let o=V2({twee:t,parentNodeId:e,slotName:r,componentDefinitionsIndex:n});if(o)return hE(o)};function V2({twee:t,parentNodeId:e,slotName:r,componentDefinitionsIndex:n}){let o=t.getNodeById(e);if(!o)return;if(r===bz){let u=Cz({node:o,twee:t}),c=t.getParentInfo(e);if(!c)return;let d=V2({parentNodeId:c.parentId,slotName:c.parentName,twee:t,componentDefinitionsIndex:n});return d?{slotDefinition:d.slotDefinition,slotSectionDefinition:u}:void 0}let a=n[o.value.type]?.slots?.find(u=>u.id===r);if(!a)return;if(!a.inheritAllowedComponents)return{slotDefinition:a,slotSectionDefinition:void 0};let l=t.getParentInfo(e);if(!l)return{slotDefinition:a,slotSectionDefinition:void 0};let s=V2({parentNodeId:l.parentId,slotName:l.parentName,twee:t,componentDefinitionsIndex:n});return s?{slotDefinition:s.slotDefinition,slotSectionDefinition:void 0}:{slotDefinition:a,slotSectionDefinition:void 0}}function Cz({node:t,twee:e}){if(t.value.type!==xz)return;let r=e.getNodeProperty(t.nodeId,mz)?.value??"inherit",n=e.getNodeProperty(t.nodeId,vz)?.value??"Slot Section",o=Number(e.getNodeProperty(t.nodeId,hz)?.value),i=Number(e.getNodeProperty(t.nodeId,gz)?.value),a=e.getNodeProperty(t.nodeId,yz)?.value??[];return{groupType:r,name:n,specificTypes:a,min:o,max:i}}function jh({definition:t,lastUserChoice:e,currentValue:r}){if(t&&!t.localizable)return!1;if(r){if(r.locales&&Vh(r.locales)||r.localesConditions&&Vh(r.localesConditions))return!0;if(r.value!==void 0||r.conditions!==void 0)return!1}if(e!==void 0)return e;if(t)return!t.notLocalizedByDefault}function Vh(t){return Array.isArray(t)?t.some(e=>Vh(e)):t===void 0?!1:t===null||typeof t!="object"?!0:Object.values(t).some(e=>Vh(e))}function z2({twee:t,nodeId:e,currentEditorLocale:r,definition:n}){let o=t.getNodeById(e),i=o?.propertyValueLocalizability?.[n.id],a=t.getNodeProperty(e,n?.id),l=jh({lastUserChoice:i,currentValue:a,definition:n});if(o&&l!==void 0&&l!==(i??!1)&&t.updateNode({nodeId:e,updateMetadata:s=>{s.propertyValueLocalizability[n.id]=l},doNotSetDirty:!0}),l)return r}function yE({twee:t,nodeId:e,dataType:r,dataResourceName:n,dataResourceEdit:o}){if(!t.getNodeById(e))throw new Error(`Node with ID ${e} not found`);o.action==="resetOverride"?t.updateNode({nodeId:e,updateDataResources:[{type:"reset",name:n}]}):o.action==="setValue"&&t.updateNode({nodeId:e,updateDataResources:[{type:"set",name:n,value:{type:r,variables:o.newValue}}]})}import{CANVAS_ENRICHMENT_TAG_PARAM as kme,CANVAS_PERSONALIZATION_ALGORITHM_PARAM as Rme,CANVAS_PERSONALIZATION_PARAM as Fme,CANVAS_PERSONALIZE_SLOT as Bme,convertToBindExpression as Vme,createVariableReference as jme,isSystemComponentDefinition as zme}from"@uniformdev/canvas";var xE=Object.prototype.hasOwnProperty;function Vr(t,e){var r,n;if(t===e)return!0;if(t&&e&&(r=t.constructor)===e.constructor){if(r===Date)return t.getTime()===e.getTime();if(r===RegExp)return t.toString()===e.toString();if(r===Array){if((n=t.length)===e.length)for(;n--&&Vr(t[n],e[n]););return n===-1}if(!r||typeof t=="object"){n=0;for(r in t)if(xE.call(t,r)&&++n&&!xE.call(e,r)||!(r in e)||!Vr(t[r],e[r]))return!1;return Object.keys(e).length===n}}return t!==t&&e!==e}function zh(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}var Sz={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function H2(t,e){function r(o,i,a){if(!(typeof document>"u")){a=zh({},e,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var s in a)a[s]&&(l+="; "+s,a[s]!==!0&&(l+="="+a[s].split(";")[0]));return document.cookie=o+"="+t.write(i,o)+l}}function n(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],a={},l=0;l<i.length;l++){var s=i[l].split("="),u=s.slice(1).join("=");try{var c=decodeURIComponent(s[0]);if(a[c]=t.read(u,c),o===c)break}catch{}}return o?a[o]:a}}return Object.create({set:r,get:n,remove:function(o,i){r(o,"",zh({},i,{expires:-1}))},withAttributes:function(o){return H2(this.converter,zh({},this.attributes,o))},withConverter:function(o){return H2(zh({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var wz=H2(Sz,{path:"/"});function Lf(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(o){o(r)}),(n=t.get("*"))&&n.slice().map(function(o){o(e,r)})}}}var EE=B(_f(),1);var LE=B(_f(),1),_E=B(_f(),1);var Tz=t=>{throw TypeError(t)};var Y2=(t,e,r)=>e.has(t)||Tz("Cannot "+r),Bt=(t,e,r)=>(Y2(t,e,"read from private field"),r?r.call(t):e.get(t));var SE=(t,e,r,n)=>(Y2(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),Mf=(t,e,r)=>(Y2(t,e,"access private method"),r);var Iz="_",Dz;Dz=new WeakMap;var Az,Lz;Az=new WeakMap;Lz=new WeakMap;var _z,Nz,Mz,Pz;_z=new WeakMap;Nz=new WeakMap;Mz=new WeakMap;Pz=new WeakMap;function Oz(t,e){return`${t}${Iz}${e}`}function kz(t,e){var r;if(typeof t>"u"||t===null)return!1;let n=Number(t);if(isNaN(n))return!1;switch((r=e?.op)!=null?r:"="){case"=":return n===e.rhs;case"!=":return n!==e.rhs;case">":return n>e.rhs;case"<":return n<e.rhs;default:return console.warn(`Unknown match type ${e.op} is false.`),!1}}function Rz(t,e){return`${t} ${Fz(e)}`}function Fz(t){return`${t.op} ${t.rhs}`}var W2=Oz("$pvc","v"),Bz=({update:t,criteria:e,commands:r,onLogMessage:n})=>{var o,i;if(e.type!=="PVC")return{result:!1,changed:!1};let a=!!(t.state.url&&(!t.previousState||((o=t.state.url)==null?void 0:o.toString())!==((i=t.previousState.url)==null?void 0:i.toString()))),s=(t.visitor.sessionScores[W2]||0)+1,u={result:!1,changed:a},c=r.some(d=>d.type==="modscoreS"&&d.data.dimension===W2);return a&&!c&&r.push({type:"modscoreS",data:{dimension:W2,delta:1}}),kz(s,e.match)&&(u.result=!0),n?.(["debug",203,{criteria:e,result:u,explanation:Rz(s,e.match)}]),u};Bz.alwaysExecute=!0;var Vz;Vz=new WeakMap;var wE="ssc";var jz,zz,Hz;jz=new WeakMap;zz=new WeakMap;Hz=new WeakMap;var G2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xve=G2.split(""),Wz=new Array(123);for(let t=0;t<G2.length;t++)Wz[G2.charCodeAt(t)]=t;var Gz,Uz,Zz,Yz;Gz=new WeakMap;Uz=new WeakMap;Zz=new WeakMap;Yz=new WeakMap;var Kz,Xz;Kz=new WeakSet;Xz=async function(){let t=await new Promise(e=>{setTimeout(()=>{e(void 0)},2e3)});t&&this.signalAsyncDataUpdate(t)};var Jz=()=>({quirks:{},scores:{},sessionScores:{},tests:{},goals:{},consent:!1,controlGroup:!1,personalizeVariants:{}}),wve=(0,EE.default)();var qz,Qz;qz=new WeakSet;Qz=function(t){return this.partitionKey?`${this.partitionKey}.${t}`:t};var $E="ufvisitor",El,K2,Hh,no,Nf,TE,eH,IE,tH,U2,rH;El=new WeakMap;K2=new WeakMap;Hh=new WeakMap;no=new WeakMap;Nf=new WeakSet;TE=function(){return Bt(this,K2).get($E)};eH=function(t,e=!1){var r,n,o,i,a,l,s,u,c,d,f;let p=Bt(this,Nf,TE),m=Date.now();Mf(this,Nf,U2).call(this,t.scores),Mf(this,Nf,U2).call(this,t.sessionScores),(n=(r=Bt(this,no)).decay)==null||n.call(r,{now:m,lastUpd:p?.updated,scores:t.scores,sessionScores:t.sessionScores,onLogMessage:Bt(this,no).onLogMessage});let h=!Vr(p?.visitorData.scores,t.scores),g=!Vr(p?.visitorData.sessionScores,t.sessionScores),v=!Vr(p?.visitorData.quirks,t.quirks),b=!Vr(p?.visitorData.tests,t.tests),x=!Vr(p?.visitorData.goals,t.goals),C={updated:m,visitorData:t};if(Mf(this,Nf,IE).call(this),Bt(this,K2).set($E,C,!!t.consent),(i=(o=Bt(this,no)).onLogMessage)==null||i.call(o,["debug",102,t]),!e&&((h||g)&&Bt(this,El).emit("scoresUpdated",t),v&&Bt(this,El).emit("quirksUpdated",t),b&&Bt(this,El).emit("testsUpdated",t),((a=p?.visitorData)==null?void 0:a.consent)!==t.consent&&Bt(this,El).emit("consentUpdated",t),((l=p?.visitorData)==null?void 0:l.controlGroup)!==t.controlGroup&&(Bt(this,El).emit("controlGroupUpdated",t),(c=(u=Bt(this,no)).onLogMessage)==null||c.call(u,["debug",104,(s=t.controlGroup)!=null?s:!1])),x)){let S=Object.keys((d=t.goals)!=null?d:{});for(let w=0;w<S.length;w++){let E=S[w];(f=p?.visitorData.goals)!=null&&f[E]||Bt(this,El).emit("goalConverted",{goalId:E})}}};IE=function(){typeof document>"u"||!Bt(this,no).visitLifespan||(Bt(this,Hh)&&window.clearTimeout(Bt(this,Hh)),SE(this,Hh,window.setTimeout(()=>{this.data},Bt(this,no).visitLifespan+50)))};tH=function(t){let e=Bt(this,no).visitLifespan;return e?t.updated+e<Date.now():!1};U2=function(t){var e,r;if(Bt(this,no).manifest)for(let n in t){let o=t[n],i=Bt(this,no).manifest.getDimensionByKey(n);i&&o>i.cap&&((r=(e=Bt(this,no)).onLogMessage)==null||r.call(e,["debug",110,{dim:n,score:o,cap:i.cap}]),t[n]=i.cap)}};rH=function(){var t,e,r;return{...Jz(),consent:(t=Bt(this,no).defaultConsent)!=null?t:!1,controlGroup:(r=(e=Bt(this,no).manifest)==null?void 0:e.rollForControlGroup())!=null?r:!1}};var nH,oH,Wh,iH,aH,sH,lH,uH,Gh,Z2,cH,DE,dH,AE;nH=new WeakMap;oH=new WeakMap;Wh=new WeakMap;iH=new WeakMap;aH=new WeakMap;sH=new WeakMap;lH=new WeakMap;uH=new WeakMap;Gh=new WeakMap;Z2=new WeakSet;cH=function(t){Bt(this,Gh).emit("testResult",t)};DE=async function(t){let e=this.manifest.computeGoals(t);e.length!==0&&await this.storage.updateData(e)};dH=function(t){let e=Mf(this,Z2,AE).call(this,t);!Vr(e,Bt(this,Wh))&&(SE(this,Wh,e),Mf(this,Z2,DE).call(this,{scores:Bt(this,Wh),quirks:void 0}),Bt(this,Gh).emit("scoresUpdated",e),Bt(this,Gh).emit("log",["info",3,e]))};AE=function(t){var e;let r={...t.scores};for(let n in t.sessionScores)r[n]=((e=r[n])!=null?e:0)+t.sessionScores[n];return r=this.manifest.computeAggregateDimensions(r),r};var Tve=(0,LE.default)();var Ive=(0,_E.default)();function fe(t,...e){let r=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",t);for(let o of e)n.append("v",o);throw r.search=n.toString(),Error(`Minified Lexical error #${t}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function $8(t,...e){let r=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",t);for(let o of e)n.append("v",o);r.search=n.toString(),console.warn(`Minified Lexical warning #${t}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Qo=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,fH=Qo&&"documentMode"in document?document.documentMode:null,Xo=Qo&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),_l=Qo&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),e0=!(!Qo||!("InputEvent"in window)||fH)&&"getTargetRanges"in new window.InputEvent("input"),Zf=Qo&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Sc=Qo&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,pH=Qo&&/Android/.test(navigator.userAgent),T8=Qo&&/^(?=.*Chrome).*/i.test(navigator.userAgent),NE=Qo&&pH&&T8,Yf=Qo&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Xo&&!T8;function I8(...t){let e=[];for(let r of t)if(r&&typeof r=="string")for(let[n]of r.matchAll(/\S+/g))e.push(n);return e}var mH=0,gH=1,hH=2;var D8=128;var vH=1,bH=2,yH=3,xH=4,CH=5,SH=6,v0=Zf||Sc||Yf?"\xA0":"\u200B",us=`
23
+ When answering a user question, your prompt should be exactly that question.`)}),outputSchema:uc.object({success:uc.boolean(),error:uc.string().optional().describe("The error message if the question was not answered successfully"),answerMarkdown:uc.string().describe("The answer, in markdown format, from the Uniform docs chatbot")}),runsAt:"server",timeout:60,callable:!0};function rE(t,e){t.tool("askQuestion","Ask the Uniform Docs assistant, Una, questions about Uniform features, usage, and best practices",tE.inputSchema.shape,async r=>{let n=await e.toolInvoker.invoke("askQuestion",r);return{content:[{type:"text",text:JSON.stringify(n,null,2)}]}})}import{autoFixParameterGroups as sE,CanvasClient as nz}from"@uniformdev/canvas";import*as Ph from"zod/v3";import Vj from"fast-json-patch";function Ah(t,e){return Vj.applyPatch(t,e).newDocument}import*as wi from"zod/v3";var Lh=wi.array(wi.object({op:wi.enum(["add","remove","replace"]),path:wi.string().describe("The JSON path to patch"),value:wi.unknown().describe("The value to patch - for remove, leave this blank")}));function jj(t){return Array.isArray(t)&&t.length>0}function nE(t){return!!t&&typeof t=="object"&&"type"in t}function oE(t){return typeof t=="object"&&t!==null&&"root"in t&&nE(t.root)}function Sl(t){return"children"in t&&jj(t.children)}var zj=({context:t,renderChildren:e})=>Sl(t.currentNode)?`${e(t.currentNode.children)} `:"";var Hj=({context:t,renderChildren:e})=>{if(!Sl(t.currentNode))return"";let r=e(t.currentNode.children);return r.endsWith(" ")?r:`${r} `};var Wj=({context:t,renderChildren:e})=>Sl(t.currentNode)?`${e(t.currentNode.children)} `:"";var Gj=({context:t,renderChildren:e})=>Sl(t.currentNode)?`${e(t.currentNode.children)} `:"";var Uj=({context:t,renderChildren:e})=>Sl(t.currentNode)?`${e(t.currentNode.children)} `:"";var Zj=({context:t,renderChildren:e})=>Sl(t.currentNode)?`${e(t.currentNode.children)} `:"";var Yj=({context:t})=>t.currentNode.text;var Kj=()=>" ";var Xj=()=>" ",Jj=new Map([["text",Yj],["tab",Kj],["linebreak",Xj],["paragraph",Wj],["listitem",Hj],["heading",zj],["table",Gj],["tablecell",Uj],["tablerow",Zj]]),qj=t=>{let e=Jj.get(t.currentNode.type);return e||(({context:r,renderChildren:n})=>Sl(r.currentNode)?n(r.currentNode.children):"")};function Qj(t,e){let r=[];return e?.ancestorNodes&&(r=r.concat(e.ancestorNodes)),e?.currentNode&&r.unshift(e.currentNode),{...e??{},currentNode:t,ancestorNodes:r}}function F2(t,e){var r;if(!nE(t))return"";let n=Qj(t,e),o=(r=n.resolveRenderer)==null?void 0:r.call(n,n);if(typeof o>"u")o=qj(n);else if(o===null)return"";let i=a=>ez(a,n);if(o){let a=o({context:n,renderChildren:i});return n.ancestorNodes.length>0?a:a.trim()}else throw new Error(`There is no renderer for node type: ${n.currentNode.type}`)}function ez(t,e){return Array.isArray(t)?t.map(r=>F2(r,e)).join(""):""}var tz=[{label:"Heading 1",type:"h1"},{label:"Heading 2",type:"h2"},{label:"Heading 3",type:"h3"},{label:"Heading 4",type:"h4"},{label:"Heading 5",type:"h5"},{label:"Heading 6",type:"h6"},{label:"Bullet List",type:"unorderedList"},{label:"Ordered List",type:"orderedList"},{label:"Link",type:"link"},{label:"Blockquote",type:"quote"},{label:"Code Block",type:"code"},{label:"Table",type:"table"},{label:"Asset",type:"asset"},{label:"Dynamic Token",type:"variable"}],rz=[{label:"Bold",type:"bold"},{label:"Italic",type:"italic"},{label:"Underline",type:"underline"},{label:"Strikethrough",type:"strikethrough"},{label:"Code",type:"code"},{label:"Superscript",type:"superscript"},{label:"Subscript",type:"subscript"}];var _h={required:!1,formatting:{builtIn:rz.map(t=>t.type)},elements:{builtIn:tz.map(t=>t.type)},elementsConfig:{asset:{allowedTypes:["image"]}}};import*as Dr from"zod/v3";import*as $t from"zod/v3";var Nh=$t.object({name:$t.string().describe('Title-cased display name. Ex: "Headline"'),id:$t.string().describe("The public ID. Must be unique within the current entity fields/parameters."),type:$t.enum(["text","richText","select","multi-select","number","date","dateTime","checkbox","link","asset","json","contentReference","$enr","group"]).describe("The data type of the property. The group type defines a grouping of other properties."),guidance:$t.string().describe('Describe what kind of content should be populated, for a LLM to use as a guide. 1-2 sentences max. Ex: "Meta tags based on the content", "2-3 word headline"'),localizable:$t.boolean().describe("Whether values are stored as locale-specific"),typeConfig:$t.object({allowedTypes:$t.array($t.enum(["image","video","audio","other"])).optional().describe("The types of asset allowed. ONLY applies when type=asset, omit for other types"),options:$t.array($t.object({text:$t.string().describe("The text to display to the author"),value:$t.string().describe("The value to store for the option")})).optional().describe("The author-selectable options for the select property. ONLY applies when type=select or multi-select, omit for other types"),required:$t.boolean().optional().describe("Whether an author must enter a value for this property"),min:$t.number().optional().describe("When type=number, this is the smallest allowed value (omit for no minimum). When type=multi-select, this is the minimum number of selections the author must make (omit for no minimum). When type=reference and isMulti=true, this is the minimum number of references the author must select (omit for no minimum). Omit for all other types."),max:$t.number().optional().describe("When type=number, this is the largest allowed value (omit for no maximum). When type=multi-select, this is the maximum number of selections the author can make (omit for no maximum). When type=reference and isMulti=true, this is the maximum number of references the author can select (omit for no maximum). Omit for all other types."),allowedContentTypes:$t.array($t.string()).optional().describe("When type=reference, this is a list of content type public IDs the author can reference. The content type ID must already exist. Omit for all other types."),isMulti:$t.boolean().optional().describe("When type=reference, this is whether the author can select multiple referenced entries. When false, only one reference is allowed. Omit for all other types."),childrenParams:$t.array($t.string()).optional().describe("When type=group, this is a list of public IDs of the properties to group. The property ID must be defined within this definition. Omit for all other types."),collapsed:$t.boolean().optional().describe("When type=group, this is whether the group is collapsed by default."),schema:$t.any().describe("When type=json, this is an optional JSON schema the property value must follow. Omit for all other types.")}).optional()});var iE=Dr.object({name:Dr.string().describe('Title-cased display name of the component. Ex: "Hero"'),id:Dr.string().describe("Public ID of the component, the camelCase version of name, using only alphanumeric characters"),description:Dr.string().describe('Describe the purpose of the component in 1-2 sentences. If the component seems generic, such as "Promo" or "Hero", this should be blank.'),canBeComposition:Dr.boolean().describe("True if the component can have pages/compositions created from it. False if it is a part of a page."),parameters:Dr.array(Nh).describe("The properties of the component. The key is the publicId of the property.").optional(),slots:Dr.array(Dr.object({name:Dr.string().describe('Title-cased display name of the slot. Ex: "Content"'),id:Dr.string().describe("The public id of the slot. Must be unique within this component's slots."),allowedComponents:Dr.array(Dr.string()).describe("The components public IDs allowed in the slot."),minComponents:Dr.number().describe("The minimum number of components allowed in the slot. Omit for no minimum.").min(0).optional(),maxComponents:Dr.number().describe("The maximum number of components allowed in the slot. Omit for no maximum.").min(1).optional(),inheritAllowedComponents:Dr.boolean().describe("Set to false")})).describe("The slots of the component. The key is the publicId of the slot.").optional()});function aE(t){let e=t.slots?.map(o=>({...o,patternsInAllowedComponents:!0,inheritAllowedComponents:!1,maxComponents:o.maxComponents===0?void 0:o.maxComponents,minComponents:o.minComponents===0?void 0:o.minComponents})),r=t.parameters?.find(o=>o.type==="asset"&&typeof o.typeConfig=="object"&&o.typeConfig!==null&&"allowedTypes"in o.typeConfig&&Array.isArray(o.typeConfig.allowedTypes)&&o.typeConfig.allowedTypes?.includes("image"))?.id,n=t.parameters?.find(o=>o.type==="text")?.id;return{...t,slots:e,titleParameter:n,thumbnailParameter:r}}function Mh(t,e){return`${e.baseWebUrl}/dashboards/canvas/components/${t}`}function cc(t,e){let r=t.filter(n=>e===void 0&&n.type==="richText"||e!==void 0&&e.includes(n.id));if(r.length!==0)for(let n of r){if(n.typeConfig===void 0){n.typeConfig=_h;continue}n.typeConfig={..._h,required:n.typeConfig.required??_h.required}}}var oz={action:Ph.enum(["create","update","delete"]).describe("The action to perform"),publicId:Ph.string().describe("Public ID of the component, the camelCase version of name, using only alphanumeric characters"),component:iE.describe("Full component definition to create. Omit for update or delete.").optional(),patches:Lh.describe("JSON patch to apply to the existing component definition. Omit for create or delete.").optional()};function lE(t,e){t.tool("componentAction","Creates, updates, or deletes a Uniform Component definition (or Composition definition)",oz,async({publicId:r,action:n,component:o,patches:i})=>{let a=new nz(e),l=!1;if(n==="create"){if(!o)throw new Error("Component definition is required for create");let s=aE(o);s.parameters&&(l=sE(s.parameters),cc(s.parameters)),await a.updateComponentDefinition({componentDefinition:s})}if(n==="update"){if(!i)throw new Error("Patches are required for update");let s=await a.getComponentDefinitions({componentId:r});if(!s.componentDefinitions.length)throw new Error(`Component with public ID ${r} does not exist, try creating it instead`);let u=s.componentDefinitions[0],c=u.parameters?.filter(f=>f.type==="richText").map(f=>f.id),d=Ah(u,i);if(d.parameters){l=sE(d.parameters);let f=d.parameters?.filter(p=>p.type==="richText").map(p=>p.id).filter(p=>!c?.includes(p));cc(d.parameters,f)}await a.updateComponentDefinition({componentDefinition:d})}return n==="delete"&&await a.removeComponentDefinition({componentId:r}),{content:[{type:"text",text:JSON.stringify({success:!0,editUrl:Mh(r,e),warning:l?"Issues with parameter group order were fixed. Ensure definition data is re-fetched before any future updates.":void 0},null,2)}]}})}import{CanvasClient as uE}from"@uniformdev/canvas";import*as cE from"zod/v3";var iz={id:cE.string()};function dE(t,e){t.tool("componentList","Lists all Uniform Component definitions",async()=>{let o=(await new uE(e).getComponentDefinitions({includeSystem:!0})).componentDefinitions.map(i=>({id:i.id,name:i.name,type:i.canBeComposition?"composition":"component",description:i.description,editUrl:Mh(i.id,e)}));return{content:[{type:"text",text:JSON.stringify(o,null,2)}]}}),t.tool("componentGet","Gets a Uniform Component definition details (slots, parameters, etc.)",iz,async({id:r})=>{let o=await new uE(e).getComponentDefinitions({componentId:r,includeSystem:!0});return{content:[{type:"text",text:JSON.stringify(o.componentDefinitions[0],null,2)}]}})}import*as He from"zod/v3";import*as dc from"zod/v3";var is=dc.object({componentId:dc.string().describe("ID of the component pattern instance the data resource belongs to - can be created in the same call to this tool"),dataResourceName:dc.string().describe("Name of the data resource to update. Must be defined as a pattern data resource on the pattern, new names cannot be created"),editInstructions:dc.string().describe('Prompt that will be used to generate the data resource value. Omission will leave the value unchanged. To reset an overridden value to pattern default, say "reset override".').optional()}).describe("A value change to a pattern data resource. Omit unchanged data resources.");var az=He.object({parentComponentId:He.string().describe("ID of the component the slot belongs to"),slotName:He.string().describe("Public ID of the target slot"),slotIndex:He.number().describe("Index to insert the new component at. Omit for append.").optional(),newComponentInstanceUuid:He.string().uuid().describe("UUID of the new component to create. You MUST generate a valid unique UUID using the `createUuid` tool."),instanceType:He.enum(["component","componentPattern"]),componentType:He.string().describe("Public ID of the component definition to insert. Component definition must be registered with Uniform. Omit when inserting a component pattern instance.").optional(),componentPatternId:He.string().describe("UUID of the component pattern definition to insert. Component pattern must be registered with Uniform. Omit when inserting a component instance.").optional()}),Oh=He.object({componentId:He.string().describe("ID of the component the parameter belongs to - can be created in the same call to this tool"),parameterId:He.string().describe("Public ID of the parameter to update. Must be defined in the component type of the parent componentId"),parameterType:He.string().describe("The type of the parameterId as defined on the component definition"),fromLocale:He.string().describe("When translating from a different locale, use the locale you are translating from. Omit for non-localized values.").optional(),locale:He.string().describe("Locale of the parameter value. Omit for non-localized values.").optional(),editInstructions:He.string().describe('Prompt that will be used to generate the parameter value. Omission will leave the value unchanged. To reset an overridden value to pattern default, say "reset override".').optional()}).describe("A value change to a parameter. Omit unchanged parameters."),kh=He.object({createComponentInstances:He.array(az).describe("New components to insert in slots. Do not use for moves or duplications. Omit for delete. These actions are performed before moving, duplicating, or deleting components, and parameter updates.").optional(),moveComponentInstances:He.array(He.object({componentId:He.string().describe("Existing component ID to move. Cannot be root component."),newParentComponentId:He.string(),newSlotName:He.string().describe("Destination slot to move to"),newSlotIndex:He.number().describe("Destination index in the parent slot to move to")})).describe("Moves existing component instances to a new location in a composition. The destination can be the same slot to cause a reorder. Omit for create or delete, or if nothing needs moving. These actions are performed before duplicating or deleting components, and parameter updates.").optional(),duplicateComponentInstances:He.array(He.string().describe("Component ID to duplicate. Cannot be root component. All descendants of the duplicated component will be duplicated as well. Duplicates are placed in the same slot as the original component, at the end.")).describe("Component instances to duplicate/copy. Omit when empty. These actions are performed before deleting components and parameter updates.").optional(),deleteComponentInstances:He.array(He.string().describe("Component ID to remove. Cannot be the pattern root component.")).describe("Component instances to delete from slots during an update. Omit for create or delete, or if nothing needs deleting. These actions are performed after moving and duplicating components, and before parameter updates.").optional(),dataResourceUpdates:He.array(is).describe("Updates to pattern data resources. Use empty array if no changes are needed.").optional()}),as=He.object({enableLocales:He.array(He.string()).describe("Locales to enable. Omit for no change.").optional(),disableLocales:He.array(He.string()).describe("Locales to disable. Existing data in disabled locales will be lost. Omit for no change.").optional()}),sz=He.object({summary:He.string().describe("Short summary of the edit that was made.").optional(),success:He.boolean()}),m1e=He.object({success:He.boolean().describe("Whether all actions were successful"),actionsTaken:He.array(sz).describe("Array of individual actions that were taken")});import*as sa from"zod/v3";var lz=Oh.extend({overridable:sa.enum(["yes","no"]).describe("Whether the parameter value set on the pattern definition is overridable by pattern consumers. Omit when no change is needed.").optional()}),fE=kh.extend({name:sa.string().describe("Name of the pattern. If the name does not need to be changed, omit this field. Always include for creates.").optional(),type:sa.string().describe("Component definition type of the pattern. Must be registered with Uniform. Always include for creates. Omit otherwise.").optional(),description:sa.string().describe("Description of the pattern for authors. If the description does not need to be changed, omit this field.").optional(),parameterUpdates:sa.array(lz).describe("Updates to the parameters of the pattern. Use empty array if no changes are needed.").optional(),dataResourceUpdates:sa.array(is).describe("Updates to the pattern instance data resources. Use empty array if no changes are needed.").optional(),localeUpdates:as.optional()}).describe("Modification instructions for the pattern");import*as ss from"zod/v3";var pE=ss.object({...kh.shape,name:ss.string().describe("Name of the composition. If the name does not need to be changed, omit this field. Always include for creates.").optional(),type:ss.string().describe("Component definition type of the composition. Must be registered with Uniform and have canBeComposition=true in the component definition. Always include for creates. Omit otherwise.").optional(),parameterUpdates:ss.array(Oh).describe("Updates to the parameters of the pattern. Use empty array if no changes are needed.").optional(),localeUpdates:as.optional(),dataResourceUpdates:ss.array(is).describe("Updates to pattern instance data resources. Use empty array if no changes are needed.").optional()}).describe("Modification instructions for the composition");import*as Ei from"zod/v3";import*as On from"zod/v3";var B2=On.object({fieldId:On.string().describe("Public ID of the field to update. Must be defined in the content type of the parent entry."),fieldType:On.string().describe("The type of the fieldId as defined on the content type"),fromLocale:On.string().describe("When translating from a different locale, use the locale you are translating from. Omit for non-localized values.").optional(),locale:On.string().describe("Locale of the field value. Omit for non-localized values.").optional(),editInstructions:On.string().describe('Prompt that will be used to generate the field value. Omission will leave the value unchanged. To reset an overridden value to pattern default, say "reset override".').optional()}).describe("A value change to a field. Omit unchanged fields."),mE=On.object({type:On.string().describe("Content type of the entry. Must be registered with Uniform. Always include for creates. Omit otherwise.").optional(),slug:On.string().describe("Slug (human-readable identifier) of the entry. If the slug does not need to be changed, omit this field.").optional(),fieldUpdates:On.array(B2).describe("Updates to the fields of the entry. Use empty array if no changes are needed.").optional(),localeUpdates:as.optional(),dataResourceUpdates:On.array(is).describe("Updates to the data resources of the entry. Use empty array if no changes are needed.").optional()}).describe("Modification instructions for the entry");var uz=B2.extend({overridable:Ei.enum(["yes","no"]).describe("Whether the parameter value set on the pattern definition is overridable by pattern consumers. Omit when no change is needed.").optional()}),gE=Ei.object({name:Ei.string().describe("Name of the entry pattern. If the name does not need to be changed, omit this field. Always include for creates.").optional(),type:Ei.string().describe("Content type of the entry pattern. Must be registered with Uniform. Always include for creates. Omit otherwise.").optional(),description:Ei.string().describe("Description of the entry pattern for authors. If the description does not need to be changed, omit this field.").optional(),fieldUpdates:Ei.array(uz).describe("Updates to the fields of the entry pattern. Use empty array if no changes are needed.").optional(),localeUpdates:as.optional()}).describe("Modification instructions for the entry pattern");import*as en from"zod/v3";import{CANVAS_BLOCK_PARAM_TYPE as Ume}from"@uniformdev/canvas";import{getEffectivePropertyValue as Zme}from"@uniformdev/canvas";import{CANVAS_PERSONALIZATION_PARAM as Yme}from"@uniformdev/canvas";var wl="uniformContentInternalReference";var cz="$p:";function Rh(t){return`${cz}${t}`}function hE({slotDefinition:t,slotSectionDefinition:e}){return{slotDefinition:{...t,allowedComponentsIndex:new Set(t?.allowedComponents??[]),maxComponents:t?.maxComponents??Number.MAX_VALUE,minComponents:t?.minComponents??0,allowAllPatternsOfAllowedTypes:!t?.patternsInAllowedComponents},slotSectionDefinition:e?{...e,specificTypesIndex:new Set(e?.specificTypes??[])}:void 0}}import{CANVAS_HYPOTHESIS_PARAM as N1e,CANVAS_LOCALIZATION_SLOT as M1e,CANVAS_LOCALIZATION_TYPE as P1e,CANVAS_PERSONALIZATION_ALGORITHM_PARAM as O1e,CANVAS_PERSONALIZATION_ALGORITHM_TYPE as k1e,CANVAS_PERSONALIZATION_EVENT_NAME_PARAM as R1e,CANVAS_PERSONALIZATION_TAKE_PARAM as F1e,CANVAS_PERSONALIZE_SLOT as B1e,CANVAS_PERSONALIZE_TYPE as V1e,CANVAS_SLOT_SECTION_GROUP_TYPE_PARAM as j1e,CANVAS_SLOT_SECTION_MAX_PARAM as z1e,CANVAS_SLOT_SECTION_MIN_PARAM as H1e,CANVAS_SLOT_SECTION_NAME_PARAM as W1e,CANVAS_SLOT_SECTION_SLOT as G1e,CANVAS_SLOT_SECTION_SPECIFIC_PARAM as U1e,CANVAS_SLOT_SECTION_TYPE as Z1e,CANVAS_TEST_SLOT as Y1e,CANVAS_TEST_TYPE as K1e}from"@uniformdev/canvas";var dz={$personalization:{isNestableIntoItself:!0},$test:void 0,$localization:void 0,$loop:void 0,$slotSection:{isAutoAllowed:!0,isNestableIntoItself:!0,isOnlyAllowedInPatternEditor:!0}},vE=t=>dz[t];function Fh(t,{slotDefinition:e,slotSectionDefinition:r},n=!1){let o=fz(t,e,n);return r?o?pz(t,r):!1:o}function fz(t,e,r=!1){let n=vE(t.type);if(n?.isOnlyAllowedInPatternEditor&&!r)return!1;if(n?.isAutoAllowed||e.allowAllComponents)return!0;let o=e.allowedComponentsIndex.has(t.type);return e.allowAllPatternsOfAllowedTypes||!t._pattern?o:e.allowedComponentsIndex.has(Rh(t._pattern))||!1}function pz(t,e){return e.groupType==="inherit"||!e.groupType?!0:e.groupType==="specific"?t._pattern?e.specificTypesIndex.has(Rh(t._pattern)):e.specificTypesIndex.has(t.type):e.groupType==="except"?t._pattern?!e.specificTypesIndex.has(Rh(t._pattern)):!e.specificTypesIndex.has(t.type):!1}function Bh(t,e,r,n){return`ref-${t}-${e}`+(r?`-${r}`:"")+(n!==void 0&&n>-1?`(${n})`:"")}function bE(t,e={}){let{targetLocale:r,enabledLocales:n=[],isPatternParameter:o=!1}=e,i=r??(n.length>0?"${locale}":void 0);return{type:wl,...o?{isPatternParameter:!0}:{},variables:{entryIds:t,...i?{locale:i}:{}}}}import{CANVAS_SLOT_SECTION_GROUP_TYPE_PARAM as mz,CANVAS_SLOT_SECTION_MAX_PARAM as gz,CANVAS_SLOT_SECTION_MIN_PARAM as hz,CANVAS_SLOT_SECTION_NAME_PARAM as vz,CANVAS_SLOT_SECTION_SLOT as bz,CANVAS_SLOT_SECTION_SPECIFIC_PARAM as yz,CANVAS_SLOT_SECTION_TYPE as xz}from"@uniformdev/canvas";var j2=({twee:t,parentNodeId:e,slotName:r,componentDefinitionsIndex:n})=>{let o=V2({twee:t,parentNodeId:e,slotName:r,componentDefinitionsIndex:n});if(o)return hE(o)};function V2({twee:t,parentNodeId:e,slotName:r,componentDefinitionsIndex:n}){let o=t.getNodeById(e);if(!o)return;if(r===bz){let u=Cz({node:o,twee:t}),c=t.getParentInfo(e);if(!c)return;let d=V2({parentNodeId:c.parentId,slotName:c.parentName,twee:t,componentDefinitionsIndex:n});return d?{slotDefinition:d.slotDefinition,slotSectionDefinition:u}:void 0}let a=n[o.value.type]?.slots?.find(u=>u.id===r);if(!a)return;if(!a.inheritAllowedComponents)return{slotDefinition:a,slotSectionDefinition:void 0};let l=t.getParentInfo(e);if(!l)return{slotDefinition:a,slotSectionDefinition:void 0};let s=V2({parentNodeId:l.parentId,slotName:l.parentName,twee:t,componentDefinitionsIndex:n});return s?{slotDefinition:s.slotDefinition,slotSectionDefinition:s.slotSectionDefinition}:{slotDefinition:a,slotSectionDefinition:void 0}}function Cz({node:t,twee:e}){if(t.value.type!==xz)return;let r=e.getNodeProperty(t.nodeId,mz)?.value??"inherit",n=e.getNodeProperty(t.nodeId,vz)?.value??"Slot Section",o=Number(e.getNodeProperty(t.nodeId,hz)?.value),i=Number(e.getNodeProperty(t.nodeId,gz)?.value),a=e.getNodeProperty(t.nodeId,yz)?.value??[];return{groupType:r,name:n,specificTypes:a,min:o,max:i}}function jh({definition:t,lastUserChoice:e,currentValue:r}){if(t&&!t.localizable)return!1;if(r){if(r.locales&&Vh(r.locales)||r.localesConditions&&Vh(r.localesConditions))return!0;if(r.value!==void 0||r.conditions!==void 0)return!1}if(e!==void 0)return e;if(t)return!t.notLocalizedByDefault}function Vh(t){return Array.isArray(t)?t.some(e=>Vh(e)):t===void 0?!1:t===null||typeof t!="object"?!0:Object.values(t).some(e=>Vh(e))}function z2({twee:t,nodeId:e,currentEditorLocale:r,definition:n}){let o=t.getNodeById(e),i=o?.propertyValueLocalizability?.[n.id],a=t.getNodeProperty(e,n?.id),l=jh({lastUserChoice:i,currentValue:a,definition:n});if(o&&l!==void 0&&l!==(i??!1)&&t.updateNode({nodeId:e,updateMetadata:s=>{s.propertyValueLocalizability[n.id]=l},doNotSetDirty:!0}),l)return r}function yE({twee:t,nodeId:e,dataType:r,dataResourceName:n,dataResourceEdit:o}){if(!t.getNodeById(e))throw new Error(`Node with ID ${e} not found`);o.action==="resetOverride"?t.updateNode({nodeId:e,updateDataResources:[{type:"reset",name:n}]}):o.action==="setValue"&&t.updateNode({nodeId:e,updateDataResources:[{type:"set",name:n,value:{type:r,variables:o.newValue}}]})}import{CANVAS_ENRICHMENT_TAG_PARAM as kme,CANVAS_PERSONALIZATION_ALGORITHM_PARAM as Rme,CANVAS_PERSONALIZATION_PARAM as Fme,CANVAS_PERSONALIZE_SLOT as Bme,convertToBindExpression as Vme,createVariableReference as jme,isSystemComponentDefinition as zme}from"@uniformdev/canvas";var xE=Object.prototype.hasOwnProperty;function Vr(t,e){var r,n;if(t===e)return!0;if(t&&e&&(r=t.constructor)===e.constructor){if(r===Date)return t.getTime()===e.getTime();if(r===RegExp)return t.toString()===e.toString();if(r===Array){if((n=t.length)===e.length)for(;n--&&Vr(t[n],e[n]););return n===-1}if(!r||typeof t=="object"){n=0;for(r in t)if(xE.call(t,r)&&++n&&!xE.call(e,r)||!(r in e)||!Vr(t[r],e[r]))return!1;return Object.keys(e).length===n}}return t!==t&&e!==e}function zh(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}var Sz={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function H2(t,e){function r(o,i,a){if(!(typeof document>"u")){a=zh({},e,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var s in a)a[s]&&(l+="; "+s,a[s]!==!0&&(l+="="+a[s].split(";")[0]));return document.cookie=o+"="+t.write(i,o)+l}}function n(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],a={},l=0;l<i.length;l++){var s=i[l].split("="),u=s.slice(1).join("=");try{var c=decodeURIComponent(s[0]);if(a[c]=t.read(u,c),o===c)break}catch{}}return o?a[o]:a}}return Object.create({set:r,get:n,remove:function(o,i){r(o,"",zh({},i,{expires:-1}))},withAttributes:function(o){return H2(this.converter,zh({},this.attributes,o))},withConverter:function(o){return H2(zh({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var wz=H2(Sz,{path:"/"});function Lf(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(o){o(r)}),(n=t.get("*"))&&n.slice().map(function(o){o(e,r)})}}}var EE=B(_f(),1);var LE=B(_f(),1),_E=B(_f(),1);var Tz=t=>{throw TypeError(t)};var Y2=(t,e,r)=>e.has(t)||Tz("Cannot "+r),Bt=(t,e,r)=>(Y2(t,e,"read from private field"),r?r.call(t):e.get(t));var SE=(t,e,r,n)=>(Y2(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),Mf=(t,e,r)=>(Y2(t,e,"access private method"),r);var Iz="_",Dz;Dz=new WeakMap;var Az,Lz;Az=new WeakMap;Lz=new WeakMap;var _z,Nz,Mz,Pz;_z=new WeakMap;Nz=new WeakMap;Mz=new WeakMap;Pz=new WeakMap;function Oz(t,e){return`${t}${Iz}${e}`}function kz(t,e){var r;if(typeof t>"u"||t===null)return!1;let n=Number(t);if(isNaN(n))return!1;switch((r=e?.op)!=null?r:"="){case"=":return n===e.rhs;case"!=":return n!==e.rhs;case">":return n>e.rhs;case"<":return n<e.rhs;default:return console.warn(`Unknown match type ${e.op} is false.`),!1}}function Rz(t,e){return`${t} ${Fz(e)}`}function Fz(t){return`${t.op} ${t.rhs}`}var W2=Oz("$pvc","v"),Bz=({update:t,criteria:e,commands:r,onLogMessage:n})=>{var o,i;if(e.type!=="PVC")return{result:!1,changed:!1};let a=!!(t.state.url&&(!t.previousState||((o=t.state.url)==null?void 0:o.toString())!==((i=t.previousState.url)==null?void 0:i.toString()))),s=(t.visitor.sessionScores[W2]||0)+1,u={result:!1,changed:a},c=r.some(d=>d.type==="modscoreS"&&d.data.dimension===W2);return a&&!c&&r.push({type:"modscoreS",data:{dimension:W2,delta:1}}),kz(s,e.match)&&(u.result=!0),n?.(["debug",203,{criteria:e,result:u,explanation:Rz(s,e.match)}]),u};Bz.alwaysExecute=!0;var Vz;Vz=new WeakMap;var wE="ssc";var jz,zz,Hz;jz=new WeakMap;zz=new WeakMap;Hz=new WeakMap;var G2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xve=G2.split(""),Wz=new Array(123);for(let t=0;t<G2.length;t++)Wz[G2.charCodeAt(t)]=t;var Gz,Uz,Zz,Yz;Gz=new WeakMap;Uz=new WeakMap;Zz=new WeakMap;Yz=new WeakMap;var Kz,Xz;Kz=new WeakSet;Xz=async function(){let t=await new Promise(e=>{setTimeout(()=>{e(void 0)},2e3)});t&&this.signalAsyncDataUpdate(t)};var Jz=()=>({quirks:{},scores:{},sessionScores:{},tests:{},goals:{},consent:!1,controlGroup:!1,personalizeVariants:{}}),wve=(0,EE.default)();var qz,Qz;qz=new WeakSet;Qz=function(t){return this.partitionKey?`${this.partitionKey}.${t}`:t};var $E="ufvisitor",El,K2,Hh,no,Nf,TE,eH,IE,tH,U2,rH;El=new WeakMap;K2=new WeakMap;Hh=new WeakMap;no=new WeakMap;Nf=new WeakSet;TE=function(){return Bt(this,K2).get($E)};eH=function(t,e=!1){var r,n,o,i,a,l,s,u,c,d,f;let p=Bt(this,Nf,TE),m=Date.now();Mf(this,Nf,U2).call(this,t.scores),Mf(this,Nf,U2).call(this,t.sessionScores),(n=(r=Bt(this,no)).decay)==null||n.call(r,{now:m,lastUpd:p?.updated,scores:t.scores,sessionScores:t.sessionScores,onLogMessage:Bt(this,no).onLogMessage});let h=!Vr(p?.visitorData.scores,t.scores),g=!Vr(p?.visitorData.sessionScores,t.sessionScores),v=!Vr(p?.visitorData.quirks,t.quirks),b=!Vr(p?.visitorData.tests,t.tests),x=!Vr(p?.visitorData.goals,t.goals),C={updated:m,visitorData:t};if(Mf(this,Nf,IE).call(this),Bt(this,K2).set($E,C,!!t.consent),(i=(o=Bt(this,no)).onLogMessage)==null||i.call(o,["debug",102,t]),!e&&((h||g)&&Bt(this,El).emit("scoresUpdated",t),v&&Bt(this,El).emit("quirksUpdated",t),b&&Bt(this,El).emit("testsUpdated",t),((a=p?.visitorData)==null?void 0:a.consent)!==t.consent&&Bt(this,El).emit("consentUpdated",t),((l=p?.visitorData)==null?void 0:l.controlGroup)!==t.controlGroup&&(Bt(this,El).emit("controlGroupUpdated",t),(c=(u=Bt(this,no)).onLogMessage)==null||c.call(u,["debug",104,(s=t.controlGroup)!=null?s:!1])),x)){let S=Object.keys((d=t.goals)!=null?d:{});for(let w=0;w<S.length;w++){let E=S[w];(f=p?.visitorData.goals)!=null&&f[E]||Bt(this,El).emit("goalConverted",{goalId:E})}}};IE=function(){typeof document>"u"||!Bt(this,no).visitLifespan||(Bt(this,Hh)&&window.clearTimeout(Bt(this,Hh)),SE(this,Hh,window.setTimeout(()=>{this.data},Bt(this,no).visitLifespan+50)))};tH=function(t){let e=Bt(this,no).visitLifespan;return e?t.updated+e<Date.now():!1};U2=function(t){var e,r;if(Bt(this,no).manifest)for(let n in t){let o=t[n],i=Bt(this,no).manifest.getDimensionByKey(n);i&&o>i.cap&&((r=(e=Bt(this,no)).onLogMessage)==null||r.call(e,["debug",110,{dim:n,score:o,cap:i.cap}]),t[n]=i.cap)}};rH=function(){var t,e,r;return{...Jz(),consent:(t=Bt(this,no).defaultConsent)!=null?t:!1,controlGroup:(r=(e=Bt(this,no).manifest)==null?void 0:e.rollForControlGroup())!=null?r:!1}};var nH,oH,Wh,iH,aH,sH,lH,uH,Gh,Z2,cH,DE,dH,AE;nH=new WeakMap;oH=new WeakMap;Wh=new WeakMap;iH=new WeakMap;aH=new WeakMap;sH=new WeakMap;lH=new WeakMap;uH=new WeakMap;Gh=new WeakMap;Z2=new WeakSet;cH=function(t){Bt(this,Gh).emit("testResult",t)};DE=async function(t){let e=this.manifest.computeGoals(t);e.length!==0&&await this.storage.updateData(e)};dH=function(t){let e=Mf(this,Z2,AE).call(this,t);!Vr(e,Bt(this,Wh))&&(SE(this,Wh,e),Mf(this,Z2,DE).call(this,{scores:Bt(this,Wh),quirks:void 0}),Bt(this,Gh).emit("scoresUpdated",e),Bt(this,Gh).emit("log",["info",3,e]))};AE=function(t){var e;let r={...t.scores};for(let n in t.sessionScores)r[n]=((e=r[n])!=null?e:0)+t.sessionScores[n];return r=this.manifest.computeAggregateDimensions(r),r};var Tve=(0,LE.default)();var Ive=(0,_E.default)();function fe(t,...e){let r=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",t);for(let o of e)n.append("v",o);throw r.search=n.toString(),Error(`Minified Lexical error #${t}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function $8(t,...e){let r=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",t);for(let o of e)n.append("v",o);r.search=n.toString(),console.warn(`Minified Lexical warning #${t}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Qo=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,fH=Qo&&"documentMode"in document?document.documentMode:null,Xo=Qo&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),_l=Qo&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),e0=!(!Qo||!("InputEvent"in window)||fH)&&"getTargetRanges"in new window.InputEvent("input"),Zf=Qo&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Sc=Qo&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,pH=Qo&&/Android/.test(navigator.userAgent),T8=Qo&&/^(?=.*Chrome).*/i.test(navigator.userAgent),NE=Qo&&pH&&T8,Yf=Qo&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Xo&&!T8;function I8(...t){let e=[];for(let r of t)if(r&&typeof r=="string")for(let[n]of r.matchAll(/\S+/g))e.push(n);return e}var mH=0,gH=1,hH=2;var D8=128;var vH=1,bH=2,yH=3,xH=4,CH=5,SH=6,v0=Zf||Sc||Yf?"\xA0":"\u200B",us=`
24
24
 
25
25
  `,wH=_l?"\xA0":v0,A8="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",L8="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",Ave=new RegExp("^[^"+L8+"]*["+A8+"]"),Lve=new RegExp("^[^"+A8+"]*["+L8+"]"),on={bold:1,capitalize:1024,code:16,highlight:D8,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},EH={directionless:1,unmergeable:2},ME={center:2,end:6,justify:4,left:1,right:3,start:5},$H={[bH]:"center",[SH]:"end",[xH]:"justify",[vH]:"left",[yH]:"right",[CH]:"start"},TH={normal:0,segmented:2,token:1},IH={[mH]:"normal",[hH]:"segmented",[gH]:"token"};var PE="$config";function _8(t,e,r,n,o,i){let a=t.getFirstChild();for(;a!==null;){let l=a.__key;a.__parent===e&&(X(a)&&_8(a,l,r,n,o,i),r.has(l)||i.delete(l),o.push(l)),a=a.getNextSibling()}}var a4=!1,L4=0;function DH(t){L4=t.timeStamp}function X2(t,e,r){let n=t.nodeName==="BR",o=e.__lexicalLineBreak;return o&&(t===o||n&&t.previousSibling===o)||n&&L0(t,r)!==void 0}function AH(t,e,r){let n=ln(Lo(r)),o=null,i=null;n!==null&&n.anchorNode===t&&(o=n.anchorOffset,i=n.focusOffset);let a=t.nodeValue;a!==null&&H4(e,a,o,i,!1)}function LH(t,e,r){if(ee(t)){let n=t.anchor.getNode();if(n.is(r)&&t.format!==n.getFormat())return!1}return Ca(e)&&r.isAttached()}function _H(t,e,r,n){for(let o=t;o&&!gW(o);o=ep(o)){let i=L0(o,e);if(i!==void 0){let a=st(i,r);if(a)return pt(a)||!lt(o)?void 0:[o,a]}else if(o===n)return[n,A$(r)]}}function N8(t,e,r){a4=!0;let n=performance.now()-L4>100;try{Ii(t,()=>{let o=ae()||function(f){return f.getEditorState().read(()=>{let p=ae();return p!==null?p.clone():null})}(t),i=new Map,a=t.getRootElement(),l=t._editorState,s=t._blockCursorElement,u=!1,c="";for(let f=0;f<e.length;f++){let p=e[f],m=p.type,h=p.target,g=_H(h,t,l,a);if(!g)continue;let[v,b]=g;if(m==="characterData")n&&ge(b)&&Ca(h)&&LH(o,h,b)&&AH(h,b,t);else if(m==="childList"){u=!0;let x=p.addedNodes;for(let w=0;w<x.length;w++){let E=x[w],$=A0(E),T=E.parentNode;if(T!=null&&E!==s&&$===null&&!X2(E,T,t)){if(_l){let I=(lt(E)?E.innerText:null)||E.nodeValue;I&&(c+=I)}T.removeChild(E)}}let C=p.removedNodes,S=C.length;if(S>0){let w=0;for(let E=0;E<S;E++){let $=C[E];(X2($,h,t)||s===$)&&(h.appendChild($),w++)}S!==w&&i.set(v,b)}}}if(i.size>0)for(let[f,p]of i)p.reconcileObservedMutation(f,t);let d=r.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){let p=d[f],m=p.addedNodes,h=p.target;for(let g=0;g<m.length;g++){let v=m[g],b=v.parentNode;b==null||v.nodeName!=="BR"||X2(v,h,t)||b.removeChild(v)}}r.takeRecords()}o!==null&&(u&&vt(o),_l&&P$(t)&&o.insertRawText(c))})}finally{a4=!1}}function M8(t){let e=t._observer;e!==null&&N8(t,e.takeRecords(),e)}function P8(t){(function(e){L4===0&&Lo(e).addEventListener("textInput",DH,!0)})(t),t._observer=new MutationObserver((e,r)=>{N8(t,e,r)})}var s4=class{key;parse;unparse;isEqual;defaultValue;constructor(e,r){this.key=e,this.parse=r.parse.bind(r),this.unparse=(r.unparse||MH).bind(r),this.isEqual=(r.isEqual||Object.is).bind(r),this.defaultValue=this.parse(void 0)}};function O8(t,e){return new s4(t,e)}function b0(t,e,r="latest"){let n=(r==="latest"?t.getLatest():t).__state;return n?n.getValue(e):e.defaultValue}function Kf(t,e,r){let n;if(jr(),typeof r=="function"){let i=t.getLatest(),a=b0(i,e);if(n=r(a),e.isEqual(a,n))return i}else n=r;let o=t.getWritable();return k8(o).updateFromKnown(e,n),o}function NH(t){let e=new Map,r=new Set;for(let n=typeof t=="function"?t:t.replace;n.prototype&&n.prototype.getType!==void 0;n=Object.getPrototypeOf(n)){let{ownNodeConfig:o}=k0(n);if(o&&o.stateConfigs)for(let i of o.stateConfigs){let a;"stateConfig"in i?(a=i.stateConfig,i.flat&&r.add(a.key)):a=i,e.set(a.key,a)}}return{flatKeys:r,sharedConfigMap:e}}var l4=class t{node;knownState;unknownState;sharedNodeState;size;constructor(e,r,n=void 0,o=new Map,i=void 0){this.node=e,this.sharedNodeState=r,this.unknownState=n,this.knownState=o;let{sharedConfigMap:a}=this.sharedNodeState,l=i!==void 0?i:function(s,u,c){let d=c.size;if(u)for(let f in u){let p=s.get(f);p&&c.has(p)||d++}return d}(a,n,o);this.size=l}getValue(e){let r=this.knownState.get(e);if(r!==void 0)return r;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let o=this.unknownState[e.key];o!==void 0&&(n=e.parse(o)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},r={};for(let[n,o]of this.knownState)n.isEqual(o,n.defaultValue)?delete e[n.key]:e[n.key]=n.unparse(o);for(let n of this.sharedNodeState.flatKeys)n in e&&(r[n]=e[n],delete e[n]);return OE(e)&&(r.$=e),r}getWritable(e){if(this.node===e)return this;let{sharedNodeState:r,unknownState:n}=this,o=new Map(this.knownState);return new t(e,r,function(i,a,l){let s;if(l)for(let[u,c]of Object.entries(l)){let d=i.get(u);d?a.has(d)||a.set(d,d.parse(c)):(s=s||{},s[u]=c)}return s}(r.sharedConfigMap,o,n),o,this.size)}updateFromKnown(e,r){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:o,unknownState:i}=this;o.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=OE(i)),this.size++),o.set(e,r)}updateFromUnknown(e,r){let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(r)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=r)}updateFromJSON(e){let{knownState:r}=this;for(let n of r.keys())r.set(n,n.defaultValue);if(this.size=r.size,this.unknownState=void 0,e)for(let[n,o]of Object.entries(e))this.updateFromUnknown(n,o)}};function k8(t){let e=t.getWritable(),r=e.__state?e.__state.getWritable(e):new l4(e,R8(e));return e.__state=r,r}function R8(t){return t.__state?t.__state.sharedNodeState:$$(Sa(),t.getType()).sharedNodeState}function OE(t){if(t)for(let e in t)return t}function MH(t){return t}function kE(t,e,r){for(let[n,o]of e.knownState){if(t.has(n.key))continue;t.add(n.key);let i=r?r.getValue(n):n.defaultValue;if(i!==o&&!n.isEqual(i,o))return!0}return!1}function RE(t,e,r){let{unknownState:n}=e,o=r?r.unknownState:void 0;if(n){for(let[i,a]of Object.entries(n))if(!t.has(i)&&(t.add(i),a!==(o?o[i]:void 0)))return!0}return!1}function FE(t,e){let r=t.__state;return r&&r.node===t?r.getWritable(e):r}function BE(t,e){let r=t.__mode,n=t.__format,o=t.__style,i=e.__mode,a=e.__format,l=e.__style,s=t.__state,u=e.__state;return(r===null||r===i)&&(n===null||n===a)&&(o===null||o===l)&&(t.__state===null||s===u||function(c,d){if(c===d)return!0;if(c&&d&&c.size!==d.size)return!1;let f=new Set;return!(c&&kE(f,c,d)||d&&kE(f,d,c)||c&&RE(f,c,d)||d&&RE(f,d,c))}(s,u))}function VE(t,e){let r=t.mergeWithSibling(e),n=Vt()._normalizedNodes;return n.add(t.__key),n.add(e.__key),r}function jE(t){let e,r,n=t;if(n.__text!==""||!n.isSimpleText()||n.isUnmergeable()){for(;(e=n.getPreviousSibling())!==null&&ge(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(BE(e,n)){n=VE(e,n);break}break}e.remove()}for(;(r=n.getNextSibling())!==null&&ge(r)&&r.isSimpleText()&&!r.isUnmergeable();){if(r.__text!==""){if(BE(n,r)){n=VE(n,r);break}break}r.remove()}}else n.remove()}function Ao(t){return zE(t.anchor),zE(t.focus),t}function zE(t){for(;t.type==="element";){let e=t.getNode(),r=t.offset,n,o;if(r===e.getChildrenSize()?(n=e.getChildAtIndex(r-1),o=!0):(n=e.getChildAtIndex(r),o=!1),ge(n)){t.set(n.__key,o?n.getTextContentSize():0,"text",!0);break}if(!X(n))break;t.set(n.__key,o?n.getChildrenSize():0,"element",!0)}}var Nl,fn,Vf,y0,u4,c4,Ml,qo,d4,jf,Pr="",$i=null,Tl=null,da="",pc=!1,t0=!1;function r0(t,e){let r=Ml.get(t);if(e!==null){let n=g4(t);n.parentNode===e&&e.removeChild(n)}if(qo.has(t)||fn._keyToDOMMap.delete(t),X(r)){let n=o0(r,Ml);f4(n,0,n.length-1,null)}r!==void 0&&W4(jf,Vf,y0,r,"destroyed")}function f4(t,e,r,n){let o=e;for(;o<=r;++o){let i=t[o];i!==void 0&&r0(i,n)}}function $l(t,e){t.setProperty("text-align",e)}var PH="40px";function F8(t,e){let r=Nl.theme.indent;if(typeof r=="string"){let o=t.classList.contains(r);e>0&&!o?t.classList.add(r):e<1&&o&&t.classList.remove(r)}let n=getComputedStyle(t).getPropertyValue("--lexical-indent-base-value")||PH;t.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${n})`)}function B8(t,e){let r=t.style;e===0?$l(r,""):e===1?$l(r,"left"):e===2?$l(r,"center"):e===3?$l(r,"right"):e===4?$l(r,"justify"):e===5?$l(r,"start"):e===6&&$l(r,"end")}function p4(t,e){let r=function(n){let o=n.__dir;if(o!==null)return o;if(sr(n))return null;let i=n.getParentOrThrow();return sr(i)&&i.__dir===null?"auto":null}(e);r!==null?t.dir=r:t.removeAttribute("dir")}function n0(t,e){let r=qo.get(t);r===void 0&&fe(60);let n=r.createDOM(Nl,fn);if(function(o,i,a){let l=a._keyToDOMMap;(function(s,u,c){let d=`__lexicalKey_${u._key}`;s[d]=c})(i,a,o),l.set(o,i)}(t,n,fn),ge(r)?n.setAttribute("data-lexical-text","true"):pt(r)&&n.setAttribute("data-lexical-decorator","true"),X(r)){let o=r.__indent,i=r.__size;if(p4(n,r),o!==0&&F8(n,o),i!==0){let l=i-1;m4(o0(r,qo),r,0,l,r.getDOMSlot(n))}let a=r.__format;a!==0&&B8(n,a),r.isInline()||V8(null,r,n),N0(r)&&(Pr+=us,da+=us)}else{let o=r.getTextContent();if(pt(r)){let i=r.decorate(fn,Nl);i!==null&&j8(t,i),n.contentEditable="false"}Pr+=o,da+=o}return e!==null&&e.insertChild(n),W4(jf,Vf,y0,r,"created"),n}function m4(t,e,r,n,o){let i=Pr;Pr="";let a=r;for(;a<=n;++a){n0(t[a],o);let l=qo.get(t[a]);l!==null&&ge(l)&&$i===null&&($i=l.getFormat(),Tl=l.getStyle())}N0(e)&&(Pr+=us),o.element.__lexicalTextContent=Pr,Pr=i+Pr}function HE(t,e){if(t){let r=t.__last;if(r){let n=e.get(r);if(n)return kn(n)?"line-break":pt(n)&&n.isInline()?"decorator":null}return"empty"}return null}function V8(t,e,r){let n=HE(t,Ml),o=HE(e,qo);n!==o&&e.getDOMSlot(r).setManagedLineBreak(o)}function OH(t,e,r){var n;$i=null,Tl=null,function(o,i,a){let l=Pr,s=o.__size,u=i.__size;Pr="";let c=a.element;if(s===1&&u===1){let d=o.__first,f=i.__first;if(d===f)Of(d,c);else{let m=g4(d),h=n0(f,null);try{c.replaceChild(h,m)}catch(g){if(typeof g=="object"&&g!=null){let v=`${g.toString()} Parent: ${c.tagName}, new child: {tag: ${h.tagName} key: ${f}}, old child: {tag: ${m.tagName}, key: ${d}}.`;throw new Error(v)}throw g}r0(d,null)}let p=qo.get(f);ge(p)&&$i===null&&($i=p.getFormat(),Tl=p.getStyle())}else{let d=o0(o,Ml),f=o0(i,qo);if(d.length!==s&&fe(227),f.length!==u&&fe(228),s===0)u!==0&&m4(f,i,0,u-1,a);else if(u===0){if(s!==0){let p=a.after==null&&a.before==null&&a.element.__lexicalLineBreak==null;f4(d,0,s-1,p?null:c),p&&(c.textContent="")}}else(function(p,m,h,g,v,b){let x=g-1,C=v-1,S,w,E=b.getFirstChild(),$=0,T=0;for(;$<=x&&T<=C;){let P=m[$],V=h[T];if(P===V)E=J2(Of(V,b.element)),$++,T++;else{S===void 0&&(S=new Set(m)),w===void 0&&(w=new Set(h));let F=w.has(P),j=S.has(V);if(F)if(j){let R=Bl(fn,V);R===E?E=J2(Of(V,b.element)):(b.withBefore(E).insertChild(R),Of(V,b.element)),$++,T++}else n0(V,b.withBefore(E)),T++;else E=J2(g4(P)),r0(P,b.element),$++}let O=qo.get(V);O!==null&&ge(O)&&$i===null&&($i=O.getFormat(),Tl=O.getStyle())}let I=$>x,L=T>C;if(I&&!L){let P=h[C+1],V=P===void 0?null:fn.getElementByKey(P);m4(h,p,T,C,b.withBefore(V))}else L&&!I&&f4(m,$,x,b.element)})(i,d,f,s,u,a)}N0(i)&&(Pr+=us),c.__lexicalTextContent=Pr,Pr=l+Pr}(t,e,e.getDOMSlot(r)),n=e,$i==null||$i===n.__textFormat||t0||n.setTextFormat($i),function(o){Tl==null||Tl===o.__textStyle||t0||o.setTextStyle(Tl)}(e)}function o0(t,e){let r=[],n=t.__first;for(;n!==null;){let o=e.get(n);o===void 0&&fe(101),r.push(n),n=o.__next}return r}function Of(t,e){let r=Ml.get(t),n=qo.get(t);r!==void 0&&n!==void 0||fe(61);let o=pc||c4.has(t)||u4.has(t),i=Bl(fn,t);if(r===n&&!o){if(X(r)){let a=i.__lexicalTextContent;a!==void 0&&(Pr+=a,da+=a)}else{let a=r.getTextContent();da+=a,Pr+=a}return i}if(r!==n&&o&&W4(jf,Vf,y0,n,"updated"),n.updateDOM(r,i,Nl)){let a=n0(t,null);return e===null&&fe(62),e.replaceChild(a,i),r0(t,null),a}if(X(r)&&X(n)){let a=n.__indent;(pc||a!==r.__indent)&&F8(i,a);let l=n.__format;if((pc||l!==r.__format)&&B8(i,l),o&&(OH(r,n,i),sr(n)||n.isInline()||V8(r,n,i)),N0(n)&&(Pr+=us,da+=us),(pc||n.__dir!==r.__dir)&&(p4(i,n),sr(n)&&!pc))for(let s of n.getChildren())X(s)&&p4(Bl(fn,s.getKey()),s)}else{let a=n.getTextContent();if(pt(n)){let l=n.decorate(fn,Nl);l!==null&&j8(t,l)}Pr+=a,da+=a}if(!t0&&sr(n)&&n.__cachedText!==da){let a=n.getWritable();a.__cachedText=da,n=a}return i}function j8(t,e){let r=fn._pendingDecorators,n=fn._decorators;if(r===null){if(n[t]===e)return;r=D$(fn)}r[t]=e}function J2(t){let e=t.nextSibling;return e!==null&&e===fn._blockCursorElement&&(e=e.nextSibling),e}function kH(t,e,r,n,o,i){Pr="",da="",pc=n===2,fn=r,Nl=r._config,Vf=r._nodes,y0=fn._listeners.mutation,u4=o,c4=i,Ml=t._nodeMap,qo=e._nodeMap,t0=e._readOnly,d4=new Map(r._keyToDOMMap);let a=new Map;return jf=a,Of("root",null),fn=void 0,Vf=void 0,u4=void 0,c4=void 0,Ml=void 0,qo=void 0,Nl=void 0,d4=void 0,jf=void 0,a}function g4(t){let e=d4.get(t);return e===void 0&&fe(75,t),e}function $e(t){return{type:t}}var va=$e("SELECTION_CHANGE_COMMAND"),Xf=$e("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Vl=$e("CLICK_COMMAND"),z8=$e("BEFORE_INPUT_COMMAND"),H8=$e("INPUT_COMMAND"),W8=$e("COMPOSITION_START_COMMAND"),G8=$e("COMPOSITION_END_COMMAND"),Ai=$e("DELETE_CHARACTER_COMMAND"),Dl=$e("INSERT_LINE_BREAK_COMMAND"),Li=$e("INSERT_PARAGRAPH_COMMAND"),ma=$e("CONTROLLED_TEXT_INSERTION_COMMAND"),jl=$e("PASTE_COMMAND"),i0=$e("REMOVE_TEXT_COMMAND"),cs=$e("DELETE_WORD_COMMAND"),ga=$e("DELETE_LINE_COMMAND"),Jo=$e("FORMAT_TEXT_COMMAND"),U8=$e("UNDO_COMMAND"),Z8=$e("REDO_COMMAND"),Y8=$e("KEYDOWN_COMMAND"),zl=$e("KEY_ARROW_RIGHT_COMMAND"),K8=$e("MOVE_TO_END"),ba=$e("KEY_ARROW_LEFT_COMMAND"),X8=$e("MOVE_TO_START"),ps=$e("KEY_ARROW_UP_COMMAND"),ms=$e("KEY_ARROW_DOWN_COMMAND"),zf=$e("KEY_ENTER_COMMAND"),Jf=$e("KEY_SPACE_COMMAND"),Hl=$e("KEY_BACKSPACE_COMMAND"),Wl=$e("KEY_ESCAPE_COMMAND"),Gl=$e("KEY_DELETE_COMMAND"),gs=$e("KEY_TAB_COMMAND"),qf=$e("INSERT_TAB_COMMAND"),wc=$e("INDENT_CONTENT_COMMAND"),Ec=$e("OUTDENT_CONTENT_COMMAND"),_4=$e("DROP_COMMAND"),x0=$e("FORMAT_ELEMENT_COMMAND"),N4=$e("DRAGSTART_COMMAND"),M4=$e("DRAGOVER_COMMAND"),RH=$e("DRAGEND_COMMAND"),$c=$e("COPY_COMMAND"),Tc=$e("CUT_COMMAND"),a0=$e("SELECT_ALL_COMMAND"),J8=$e("CLEAR_EDITOR_COMMAND"),_ve=$e("CLEAR_HISTORY_COMMAND"),Nve=$e("CAN_REDO_COMMAND"),Mve=$e("CAN_UNDO_COMMAND"),C0=$e("FOCUS_COMMAND"),q8=$e("BLUR_COMMAND"),FH=$e("KEY_MODIFIER_COMMAND"),la=Object.freeze({}),h4=[["keydown",function(t,e){Hf=t.timeStamp,Q8=t.key,!e.isComposing()&&Te(e,Y8,t)}],["pointerdown",function(t,e){let r=t.target,n=t.pointerType;un(r)&&n!=="touch"&&n!=="pen"&&t.button===0&&Ii(e,()=>{T$(r)||(y4=!0)})}],["compositionstart",function(t,e){Te(e,W8,t)}],["compositionend",function(t,e){_l?kf=!0:Sc||!Zf&&!Yf?Te(e,G8,t):(x4=!0,C4=t.data)}],["input",function(t,e){t.stopPropagation(),Ii(e,()=>{e.dispatchCommand(H8,t)},{event:t}),mc=null}],["click",function(t,e){Ii(e,()=>{let r=ae(),n=ln(Lo(e)),o=ao();if(n){if(ee(r)){let i=r.anchor,a=i.getNode();if(i.type==="element"&&i.offset===0&&r.isCollapsed()&&!sr(a)&&jt().getChildrenSize()===1&&a.getTopLevelElementOrThrow().isEmpty()&&o!==null&&r.is(o))n.removeAllRanges(),r.dirty=!0;else if(t.detail===3&&!r.isCollapsed()&&a!==r.focus.getNode()){let l=Re(a,s=>X(s)&&!s.isInline());X(l)&&l.select(0)}}else if(t.pointerType==="touch"||t.pointerType==="pen"){let i=n.anchorNode;(lt(i)||Ca(i))&&vt(S0(o,n,e,t))}}Te(e,Vl,t)})}],["cut",la],["copy",la],["dragstart",la],["dragover",la],["dragend",la],["paste",la],["focus",la],["blur",la],["drop",la]];e0&&h4.push(["beforeinput",(t,e)=>function(r,n){let o=r.inputType;o==="deleteCompositionText"||_l&&P$(n)||o!=="insertCompositionText"&&Te(n,z8,r)}(t,e)]);var Hf=0,Q8=null,e$=0,mc=null,v4=new WeakMap,s0=new WeakMap,b4=!1,y4=!1,Rf=!1,kf=!1,x4=!1,C4="",Il=null,t$=[0,"",0,"root",0];function r$(t,e,r,n,o){let i=t.anchor,a=t.focus,l=i.getNode(),s=Vt(),u=ln(Lo(s)),c=u!==null?u.anchorNode:null,d=i.key,f=s.getElementByKey(d),p=r.length;return d!==a.key||!ge(l)||(!o&&(!e0||e$<n+50)||l.isDirty()&&p<2||L$(r))&&i.offset!==a.offset&&!l.isComposing()||Ti(l)||l.isDirty()&&p>1||(o||!e0)&&f!==null&&!l.isComposing()&&c!==Fl(f)||u!==null&&e!==null&&(!e.collapsed||e.startContainer!==u.anchorNode||e.startOffset!==u.anchorOffset)||l.getFormat()!==t.format||l.getStyle()!==t.style||function(m,h){if(h.isSegmented())return!0;if(!m.isCollapsed())return!1;let g=m.anchor.offset,v=h.getParentOrThrow(),b=Al(h);return g===0?!h.canInsertTextBefore()||!v.canInsertTextBefore()&&!h.isComposing()||b||function(x){let C=x.getPreviousSibling();return(ge(C)||X(C)&&C.isInline())&&!C.canInsertTextAfter()}(h):g===h.getTextContentSize()&&(!h.canInsertTextAfter()||!v.canInsertTextAfter()&&!h.isComposing()||b)}(t,l)}function WE(t,e){return Ca(t)&&t.nodeValue!==null&&e!==0&&e!==t.nodeValue.length}function GE(t,e,r){let{anchorNode:n,anchorOffset:o,focusNode:i,focusOffset:a}=t;b4&&(b4=!1,WE(n,o)&&WE(i,a)&&!Il)||Ii(e,()=>{if(!r)return void vt(null);if(!Lc(e,n,i))return;let l=ae();if(Il&&ee(l)&&l.isCollapsed()){let s=l.anchor,u=Il.anchor;(s.key===u.key&&s.offset===u.offset+1||s.offset===1&&u.getNode().is(s.getNode().getPreviousSibling()))&&(l=Il.clone(),vt(l))}if(Il=null,ee(l)){let s=l.anchor,u=s.getNode();if(l.isCollapsed()){t.type==="Range"&&t.anchorNode===t.focusNode&&(l.dirty=!0);let c=Lo(e).event,d=c?c.timeStamp:performance.now(),[f,p,m,h,g]=t$,v=jt(),b=e.isComposing()===!1&&v.getTextContent()==="";if(d<g+200&&s.offset===m&&s.key===h)Xh(l,f,p);else if(s.type==="text")ge(u)||fe(141),n$(l,u);else if(s.type==="element"&&!b){X(u)||fe(259);let x=s.getNode();x.isEmpty()?function(C,S){let w=S.getTextFormat(),E=S.getTextStyle();Xh(C,w,E)}(l,x):Xh(l,0,"")}}else{let c=s.key,d=l.focus.key,f=l.getNodes(),p=f.length,m=l.isBackward(),h=m?a:o,g=m?o:a,v=m?d:c,b=m?c:d,x=2047,C=!1;for(let S=0;S<p;S++){let w=f[S],E=w.getTextContentSize();if(ge(w)&&E!==0&&!(S===0&&w.__key===v&&h===E||S===p-1&&w.__key===b&&g===0)&&(C=!0,x&=w.getFormat(),x===0))break}l.format=C?x:0}}Te(e,va,void 0)})}function Xh(t,e,r){t.format===e&&t.style===r||(t.format=e,t.style=r,t.dirty=!0)}function n$(t,e){Xh(t,e.getFormat(),e.getStyle())}function o$(t){if(!t.getTargetRanges)return null;let e=t.getTargetRanges();return e.length===0?null:e[0]}function BH(t){let e=t.inputType,r=o$(t),n=Vt(),o=ae();if(e==="deleteContentBackward"){if(o===null){let d=ao();if(!ee(d))return!0;vt(d.clone())}if(ee(o)){let d=o.anchor.key===o.focus.key;if(i=t.timeStamp,Q8==="MediaLast"&&i<Hf+30&&n.isComposing()&&d){if(an(null),Hf=0,setTimeout(()=>{Ii(n,()=>{an(null)})},30),ee(o)){let f=o.anchor.getNode();f.markDirty(),ge(f)||fe(142),n$(o,f)}}else{an(null),t.preventDefault();let f=o.anchor.getNode(),p=f.getTextContent(),m=f.canInsertTextAfter(),h=o.anchor.offset===0&&o.focus.offset===p.length,g=NE&&d&&!h&&m;if(g&&o.isCollapsed()&&(g=!pt(_0(o.anchor,!0))),!g){Te(n,Ai,!0);let v=ae();NE&&ee(v)&&v.isCollapsed()&&(Il=v,setTimeout(()=>Il=null))}}return!0}}var i;if(!ee(o))return!0;let a=t.data;mc!==null&&z4(!1,n,mc),o.dirty&&mc===null||!o.isCollapsed()||sr(o.anchor.getNode())||r===null||o.applyDOMRange(r),mc=null;let l=o.anchor,s=o.focus,u=l.getNode(),c=s.getNode();if(e==="insertText"||e==="insertTranspose"){if(a===`
26
26
  `)t.preventDefault(),Te(n,Dl,!1);else if(a===us)t.preventDefault(),Te(n,Li,void 0);else if(a==null&&t.dataTransfer){let d=t.dataTransfer.getData("text/plain");t.preventDefault(),o.insertRawText(d)}else a!=null&&r$(o,r,a,t.timeStamp,!0)?(t.preventDefault(),Te(n,ma,a)):mc=a;return e$=t.timeStamp,!0}switch(t.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Te(n,ma,t);break;case"insertFromComposition":an(null),Te(n,ma,t);break;case"insertLineBreak":an(null),Te(n,Dl,!1);break;case"insertParagraph":an(null),Rf&&!Sc?(Rf=!1,Te(n,Dl,!1)):Te(n,Li,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Te(n,jl,t);break;case"deleteByComposition":(function(d,f){return d!==f||X(d)||X(f)||!Al(d)||!Al(f)})(u,c)&&Te(n,i0,t);break;case"deleteByDrag":case"deleteByCut":Te(n,i0,t);break;case"deleteContent":Te(n,Ai,!1);break;case"deleteWordBackward":Te(n,cs,!0);break;case"deleteWordForward":Te(n,cs,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Te(n,ga,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Te(n,ga,!1);break;case"formatStrikeThrough":Te(n,Jo,"strikethrough");break;case"formatBold":Te(n,Jo,"bold");break;case"formatItalic":Te(n,Jo,"italic");break;case"formatUnderline":Te(n,Jo,"underline");break;case"historyUndo":Te(n,U8,void 0);break;case"historyRedo":Te(n,Z8,void 0)}return!0}function VH(t){if(lt(t.target)&&T$(t.target))return!0;let e=Vt(),r=ae(),n=t.data,o=o$(t);if(n!=null&&ee(r)&&r$(r,o,n,t.timeStamp,!1)){kf&&(l0(e,n),kf=!1);let i=r.anchor.getNode(),a=ln(Lo(e));if(a===null)return!0;let l=r.isBackward(),s=l?r.anchor.offset:r.focus.offset,u=l?r.focus.offset:r.anchor.offset;e0&&!r.isCollapsed()&&ge(i)&&a.anchorNode!==null&&i.getTextContent().slice(0,s)+n+i.getTextContent().slice(s+u)===N$(a.anchorNode)||Te(e,ma,n);let c=n.length;_l&&c>1&&t.inputType==="insertCompositionText"&&!e.isComposing()&&(r.anchor.offset-=c),Zf||Sc||Yf||!e.isComposing()||(Hf=0,an(null))}else z4(!1,e,n!==null?n:void 0),kf&&(l0(e,n||void 0),kf=!1);return function(){jr();let i=Vt();M8(i)}(),!0}function jH(t){let e=Vt(),r=ae();if(ee(r)&&!e.isComposing()){let n=r.anchor,o=r.anchor.getNode();an(n.key),(t.timeStamp<Hf+30||n.type==="element"||!r.isCollapsed()||o.getFormat()!==r.format||ge(o)&&o.getStyle()!==r.style)&&Te(e,ma,wH)}return!0}function zH(t){return l0(Vt(),t.data),!0}function l0(t,e){let r=t._compositionKey;if(an(null),r!==null&&e!=null){if(e===""){let n=st(r),o=Fl(t.getElementByKey(r));return void(o!==null&&o.nodeValue!==null&&ge(n)&&H4(n,o.nodeValue,null,null,!0))}if(e[e.length-1]===`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/uniform-mcp",
3
- "version": "20.50.2-alpha.1+8798ffc32d",
3
+ "version": "20.50.2",
4
4
  "description": "Uniform MCP Server",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "bin": {
@@ -30,8 +30,8 @@
30
30
  "dependencies": {
31
31
  "@modelcontextprotocol/sdk": "1.25.2",
32
32
  "@types/uuid": "9.0.4",
33
- "@uniformdev/canvas": "20.50.2-alpha.1+8798ffc32d",
34
- "@uniformdev/project-map": "20.50.2-alpha.1+8798ffc32d",
33
+ "@uniformdev/canvas": "20.50.2",
34
+ "@uniformdev/project-map": "20.50.2",
35
35
  "fast-json-patch": "3.1.1",
36
36
  "immer": "10.1.3",
37
37
  "linkedom": "0.18.12",
@@ -45,10 +45,10 @@
45
45
  "access": "public"
46
46
  },
47
47
  "devDependencies": {
48
- "@uniformdev/design-system": "20.50.2-alpha.1+8798ffc32d",
49
- "@uniformdev/files": "20.50.2-alpha.1+8798ffc32d",
50
- "@uniformdev/mesh-edgehancer-sdk": "20.50.2-alpha.1+8798ffc32d",
51
- "@uniformdev/richtext": "20.50.2-alpha.1+8798ffc32d"
48
+ "@uniformdev/design-system": "20.50.2",
49
+ "@uniformdev/files": "20.50.2",
50
+ "@uniformdev/mesh-edgehancer-sdk": "20.50.2",
51
+ "@uniformdev/richtext": "20.50.2"
52
52
  },
53
- "gitHead": "8798ffc32d405a5d357628861a40cd964e3ea6f0"
53
+ "gitHead": "fe4b29739822916548656e4b61d51faeab3340b5"
54
54
  }