@uniformdev/uniform-mcp 20.26.1 → 20.26.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.
Files changed (2) hide show
  1. package/dist/index.mjs +199 -203
  2. package/package.json +7 -7
package/dist/index.mjs CHANGED
@@ -233,7 +233,7 @@ Check the render method of %s.`,Kt(da)||"Unknown"));var P=af(T,D);P.payload={ele
233
233
  You might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq`:""),"font-weight:bold")}El.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_k,El.createPortal=V9e,El.createRoot=j9e,El.findDOMNode=P9e,El.flushSync=K9e,El.hydrate=I9e,El.hydrateRoot=U9e,El.render=F9e,El.unmountComponentAtNode=z9e,El.unstable_batchedUpdates=nk,El.unstable_renderSubtreeIntoContainer=H9e,El.version=bk,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()});var Nd=rt((lyt,Fj)=>{"use strict";function w0e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(process.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(w0e)}catch(t){console.error(t)}}}process.env.NODE_ENV==="production"?(w0e(),Fj.exports=C0e()):Fj.exports=S0e()});var iWe,d1e=He(()=>{"use strict";iWe=[{id:"ci",name:"Circum Icons",projectUrl:"https://circumicons.com/",license:"MPL-2.0 license",licenseUrl:"https://github.com/Klarr-Agency/Circum-Icons/blob/main/LICENSE"},{id:"fa",name:"Font Awesome 5",projectUrl:"https://fontawesome.com/",license:"CC BY 4.0 License",licenseUrl:"https://creativecommons.org/licenses/by/4.0/"},{id:"fa6",name:"Font Awesome 6",projectUrl:"https://fontawesome.com/",license:"CC BY 4.0 License",licenseUrl:"https://creativecommons.org/licenses/by/4.0/"},{id:"io",name:"Ionicons 4",projectUrl:"https://ionicons.com/",license:"MIT",licenseUrl:"https://github.com/ionic-team/ionicons/blob/master/LICENSE"},{id:"io5",name:"Ionicons 5",projectUrl:"https://ionicons.com/",license:"MIT",licenseUrl:"https://github.com/ionic-team/ionicons/blob/master/LICENSE"},{id:"md",name:"Material Design icons",projectUrl:"http://google.github.io/material-design-icons/",license:"Apache License Version 2.0",licenseUrl:"https://github.com/google/material-design-icons/blob/master/LICENSE"},{id:"ti",name:"Typicons",projectUrl:"http://s-ings.com/typicons/",license:"CC BY-SA 3.0",licenseUrl:"https://creativecommons.org/licenses/by-sa/3.0/"},{id:"go",name:"Github Octicons icons",projectUrl:"https://octicons.github.com/",license:"MIT",licenseUrl:"https://github.com/primer/octicons/blob/master/LICENSE"},{id:"fi",name:"Feather",projectUrl:"https://feathericons.com/",license:"MIT",licenseUrl:"https://github.com/feathericons/feather/blob/master/LICENSE"},{id:"lu",name:"Lucide",projectUrl:"https://lucide.dev/",license:"ISC",licenseUrl:"https://github.com/lucide-icons/lucide/blob/main/LICENSE"},{id:"gi",name:"Game Icons",projectUrl:"https://game-icons.net/",license:"CC BY 3.0",licenseUrl:"https://creativecommons.org/licenses/by/3.0/"},{id:"wi",name:"Weather Icons",projectUrl:"https://erikflowers.github.io/weather-icons/",license:"SIL OFL 1.1",licenseUrl:"http://scripts.sil.org/OFL"},{id:"di",name:"Devicons",projectUrl:"https://vorillaz.github.io/devicons/",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"ai",name:"Ant Design Icons",projectUrl:"https://github.com/ant-design/ant-design-icons",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"bs",name:"Bootstrap Icons",projectUrl:"https://github.com/twbs/icons",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"ri",name:"Remix Icon",projectUrl:"https://github.com/Remix-Design/RemixIcon",license:"Apache License Version 2.0",licenseUrl:"http://www.apache.org/licenses/"},{id:"fc",name:"Flat Color Icons",projectUrl:"https://github.com/icons8/flat-color-icons",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"gr",name:"Grommet-Icons",projectUrl:"https://github.com/grommet/grommet-icons",license:"Apache License Version 2.0",licenseUrl:"http://www.apache.org/licenses/"},{id:"hi",name:"Heroicons",projectUrl:"https://github.com/tailwindlabs/heroicons",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"hi2",name:"Heroicons 2",projectUrl:"https://github.com/tailwindlabs/heroicons",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"si",name:"Simple Icons",projectUrl:"https://simpleicons.org/",license:"CC0 1.0 Universal",licenseUrl:"https://creativecommons.org/publicdomain/zero/1.0/"},{id:"sl",name:"Simple Line Icons",projectUrl:"https://thesabbir.github.io/simple-line-icons/",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"im",name:"IcoMoon Free",projectUrl:"https://github.com/Keyamoon/IcoMoon-Free",license:"CC BY 4.0 License",licenseUrl:"https://github.com/Keyamoon/IcoMoon-Free/blob/master/License.txt"},{id:"bi",name:"BoxIcons",projectUrl:"https://github.com/atisawd/boxicons",license:"MIT",licenseUrl:"https://github.com/atisawd/boxicons/blob/master/LICENSE"},{id:"cg",name:"css.gg",projectUrl:"https://github.com/astrit/css.gg",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"vsc",name:"VS Code Icons",projectUrl:"https://github.com/microsoft/vscode-codicons",license:"CC BY 4.0",licenseUrl:"https://creativecommons.org/licenses/by/4.0/"},{id:"tb",name:"Tabler Icons",projectUrl:"https://github.com/tabler/tabler-icons",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"tfi",name:"Themify Icons",projectUrl:"https://github.com/lykmapipo/themify-icons",license:"MIT",licenseUrl:"https://github.com/thecreation/standard-icons/blob/master/modules/themify-icons/LICENSE"},{id:"rx",name:"Radix Icons",projectUrl:"https://icons.radix-ui.com",license:"MIT",licenseUrl:"https://github.com/radix-ui/icons/blob/master/LICENSE"},{id:"pi",name:"Phosphor Icons",projectUrl:"https://github.com/phosphor-icons/core",license:"MIT",licenseUrl:"https://github.com/phosphor-icons/core/blob/main/LICENSE"},{id:"lia",name:"Icons8 Line Awesome",projectUrl:"https://icons8.com/line-awesome",license:"MIT",licenseUrl:"https://github.com/icons8/line-awesome/blob/master/LICENSE.md"}]});var SU,n8,r8,wU=He(()=>{"use strict";SU=J(ae(),1),n8={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},r8=SU.default.createContext&&SU.default.createContext(n8)});function sWe(t,e){if(t==null)return{};var n=lWe(t,e),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function lWe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function o8(){return o8=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o8.apply(this,arguments)}function f1e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function i8(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?f1e(Object(n),!0).forEach(function(r){uWe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f1e(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function uWe(t,e,n){return e=cWe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cWe(t){var e=dWe(t,"string");return typeof e=="symbol"?e:e+""}function dWe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function p1e(t){return t&&t.map((e,n)=>Mx.default.createElement(e.tag,i8({key:n},e.attr),p1e(e.child)))}function Xt(t){return e=>Mx.default.createElement(m1e,o8({attr:i8({},t.attr)},e),p1e(t.child))}function m1e(t){var e=n=>{var{attr:r,size:o,title:i}=t,a=sWe(t,aWe),l=o||n.size||"1em",c;return n.className&&(c=n.className),t.className&&(c=(c?c+" ":"")+t.className),Mx.default.createElement("svg",o8({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:c,style:i8(i8({color:t.color||n.color},n.style),t.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&Mx.default.createElement("title",null,i),t.children)};return r8!==void 0?Mx.default.createElement(r8.Consumer,null,n=>e(n)):e(n8)}var Mx,aWe,h1e=He(()=>{"use strict";Mx=J(ae(),1);wU();aWe=["attr","size","title"]});var bc={};Br(bc,{DefaultContext:()=>n8,GenIcon:()=>Xt,IconBase:()=>m1e,IconContext:()=>r8,IconsManifest:()=>iWe});var Dl=He(()=>{"use strict";d1e();h1e();wU()});var v1e=rt((C4t,g1e)=>{"use strict";var fWe=(Dl(),jc(bc)).GenIcon;g1e.exports.MdSettings=function(e){return fWe({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.488.488 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 0 0-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"},child:[]}]})(e)}});var EU=rt((S4t,y1e)=>{"use strict";var pWe=(Dl(),jc(bc)).GenIcon;y1e.exports.CgClose=function(e){return pWe({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{d:"M6.2253 4.81108C5.83477 4.42056 5.20161 4.42056 4.81108 4.81108C4.42056 5.20161 4.42056 5.83477 4.81108 6.2253L10.5858 12L4.81114 17.7747C4.42062 18.1652 4.42062 18.7984 4.81114 19.1889C5.20167 19.5794 5.83483 19.5794 6.22535 19.1889L12 13.4142L17.7747 19.1889C18.1652 19.5794 18.7984 19.5794 19.1889 19.1889C19.5794 18.7984 19.5794 18.1652 19.1889 17.7747L13.4142 12L19.189 6.2253C19.5795 5.83477 19.5795 5.20161 19.189 4.81108C18.7985 4.42056 18.1653 4.42056 17.7748 4.81108L12 10.5858L6.2253 4.81108Z",fill:"currentColor"},child:[]}]})(e)}});var x1e=rt((w4t,b1e)=>{"use strict";var mWe=(Dl(),jc(bc)).GenIcon;b1e.exports.CgChevronDown=function(e){return mWe({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{d:"M6.34317 7.75732L4.92896 9.17154L12 16.2426L19.0711 9.17157L17.6569 7.75735L12 13.4142L6.34317 7.75732Z",fill:"currentColor"},child:[]}]})(e)}});var TU=rt((E4t,C1e)=>{"use strict";var hWe=(Dl(),jc(bc)).GenIcon;C1e.exports.MdWarning=function(e){return hWe({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"},child:[]}]})(e)}});var w1e=rt((T4t,S1e)=>{"use strict";var gWe=(Dl(),jc(bc)).GenIcon;S1e.exports.MdInfoOutline=function(e){return gWe({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 7h2v2h-2V7zm0 4h2v6h-2v-6zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"},child:[]}]})(e)}});var Bw=rt((D4t,op)=>{"use strict";function _U(t){"@babel/helpers - typeof";return op.exports=_U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},op.exports.__esModule=!0,op.exports.default=op.exports,_U(t)}op.exports=_U,op.exports.__esModule=!0,op.exports.default=op.exports});var _1e=rt(($4t,zw)=>{"use strict";var T1e=Bw().default;function vWe(t,e){if(T1e(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(T1e(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}zw.exports=vWe,zw.exports.__esModule=!0,zw.exports.default=zw.exports});var DU=rt((N4t,Vw)=>{"use strict";var yWe=Bw().default,bWe=_1e();function xWe(t){var e=bWe(t,"string");return yWe(e)=="symbol"?e:e+""}Vw.exports=xWe,Vw.exports.__esModule=!0,Vw.exports.default=Vw.exports});var $U=rt((L4t,Hw)=>{"use strict";var CWe=DU();function SWe(t,e,n){return(e=CWe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Hw.exports=SWe,Hw.exports.__esModule=!0,Hw.exports.default=Hw.exports});var $1e=rt((M4t,jw)=>{"use strict";var wWe=$U();function D1e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function EWe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?D1e(Object(n),!0).forEach(function(r){wWe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D1e(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}jw.exports=EWe,jw.exports.__esModule=!0,jw.exports.default=jw.exports});var N1e=rt((O4t,Uw)=>{"use strict";function TWe(t){if(Array.isArray(t))return t}Uw.exports=TWe,Uw.exports.__esModule=!0,Uw.exports.default=Uw.exports});var L1e=rt((R4t,Kw)=>{"use strict";function _We(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,o,i,a,l=[],c=!0,d=!1;try{if(i=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(f){d=!0,o=f}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(d)throw o}}return l}}Kw.exports=_We,Kw.exports.__esModule=!0,Kw.exports.default=Kw.exports});var NU=rt((A4t,Ww)=>{"use strict";function DWe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Ww.exports=DWe,Ww.exports.__esModule=!0,Ww.exports.default=Ww.exports});var LU=rt((k4t,Gw)=>{"use strict";var M1e=NU();function $We(t,e){if(t){if(typeof t=="string")return M1e(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M1e(t,e):void 0}}Gw.exports=$We,Gw.exports.__esModule=!0,Gw.exports.default=Gw.exports});var O1e=rt((P4t,Yw)=>{"use strict";function NWe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
234
234
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}Yw.exports=NWe,Yw.exports.__esModule=!0,Yw.exports.default=Yw.exports});var R1e=rt((I4t,Zw)=>{"use strict";var LWe=N1e(),MWe=L1e(),OWe=LU(),RWe=O1e();function AWe(t,e){return LWe(t)||MWe(t,e)||OWe(t,e)||RWe()}Zw.exports=AWe,Zw.exports.__esModule=!0,Zw.exports.default=Zw.exports});var A1e=rt((F4t,qw)=>{"use strict";function kWe(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}qw.exports=kWe,qw.exports.__esModule=!0,qw.exports.default=qw.exports});var k1e=rt((B4t,Jw)=>{"use strict";var PWe=A1e();function IWe(t,e){if(t==null)return{};var n,r,o=PWe(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}Jw.exports=IWe,Jw.exports.__esModule=!0,Jw.exports.default=Jw.exports});var P1e=rt((z4t,Xw)=>{"use strict";function FWe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Xw.exports=FWe,Xw.exports.__esModule=!0,Xw.exports.default=Xw.exports});var F1e=rt((V4t,Qw)=>{"use strict";var BWe=DU();function I1e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,BWe(r.key),r)}}function zWe(t,e,n){return e&&I1e(t.prototype,e),n&&I1e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}Qw.exports=zWe,Qw.exports.__esModule=!0,Qw.exports.default=Qw.exports});var B1e=rt((H4t,ip)=>{"use strict";function MU(t,e){return ip.exports=MU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ip.exports.__esModule=!0,ip.exports.default=ip.exports,MU(t,e)}ip.exports=MU,ip.exports.__esModule=!0,ip.exports.default=ip.exports});var z1e=rt((j4t,eE)=>{"use strict";var VWe=B1e();function HWe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&VWe(t,e)}eE.exports=HWe,eE.exports.__esModule=!0,eE.exports.default=eE.exports});var V1e=rt((U4t,ap)=>{"use strict";function OU(t){return ap.exports=OU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ap.exports.__esModule=!0,ap.exports.default=ap.exports,OU(t)}ap.exports=OU,ap.exports.__esModule=!0,ap.exports.default=ap.exports});var j1e=rt((K4t,sp)=>{"use strict";function H1e(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sp.exports=H1e=function(){return!!t},sp.exports.__esModule=!0,sp.exports.default=sp.exports)()}sp.exports=H1e,sp.exports.__esModule=!0,sp.exports.default=sp.exports});var U1e=rt((W4t,tE)=>{"use strict";function jWe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}tE.exports=jWe,tE.exports.__esModule=!0,tE.exports.default=tE.exports});var K1e=rt((G4t,nE)=>{"use strict";var UWe=Bw().default,KWe=U1e();function WWe(t,e){if(e&&(UWe(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return KWe(t)}nE.exports=WWe,nE.exports.__esModule=!0,nE.exports.default=nE.exports});var G1e=rt((Y4t,rE)=>{"use strict";var W1e=V1e(),GWe=j1e(),YWe=K1e();function ZWe(t){var e=GWe();return function(){var n,r=W1e(t);if(e){var o=W1e(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return YWe(this,n)}}rE.exports=ZWe,rE.exports.__esModule=!0,rE.exports.default=rE.exports});var Y1e=rt((Z4t,oE)=>{"use strict";var qWe=NU();function JWe(t){if(Array.isArray(t))return qWe(t)}oE.exports=JWe,oE.exports.__esModule=!0,oE.exports.default=oE.exports});var Z1e=rt((q4t,iE)=>{"use strict";function XWe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}iE.exports=XWe,iE.exports.__esModule=!0,iE.exports.default=iE.exports});var q1e=rt((J4t,aE)=>{"use strict";function QWe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
235
235
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}aE.exports=QWe,aE.exports.__esModule=!0,aE.exports.default=aE.exports});var J1e=rt((X4t,sE)=>{"use strict";var eGe=Y1e(),tGe=Z1e(),nGe=LU(),rGe=q1e();function oGe(t){return eGe(t)||tGe(t)||nGe(t)||rGe()}sE.exports=oGe,sE.exports.__esModule=!0,sE.exports.default=sE.exports});var X1e=rt((Q4t,lE)=>{"use strict";function iGe(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}lE.exports=iGe,lE.exports.__esModule=!0,lE.exports.default=lE.exports});var ebe=rt((h3t,Q1e)=>{"use strict";var lGe=(Dl(),jc(bc)).GenIcon;Q1e.exports.CgSearch=function(e){return lGe({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M18.319 14.4326C20.7628 11.2941 20.542 6.75347 17.6569 3.86829C14.5327 0.744098 9.46734 0.744098 6.34315 3.86829C3.21895 6.99249 3.21895 12.0578 6.34315 15.182C9.22833 18.0672 13.769 18.2879 16.9075 15.8442C16.921 15.8595 16.9351 15.8745 16.9497 15.8891L21.1924 20.1317C21.5829 20.5223 22.2161 20.5223 22.6066 20.1317C22.9971 19.7412 22.9971 19.1081 22.6066 18.7175L18.364 14.4749C18.3493 14.4603 18.3343 14.4462 18.319 14.4326ZM16.2426 5.28251C18.5858 7.62565 18.5858 11.4246 16.2426 13.7678C13.8995 16.1109 10.1005 16.1109 7.75736 13.7678C5.41421 11.4246 5.41421 7.62565 7.75736 5.28251C10.1005 2.93936 13.8995 2.93936 16.2426 5.28251Z",fill:"currentColor"},child:[]}]})(e)}});var nCe=rt((S9t,tCe)=>{"use strict";var HZe=(Dl(),jc(bc)).GenIcon;tCe.exports.CgExternal=function(e){return HZe({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{d:"M15.6396 7.02527H12.0181V5.02527H19.0181V12.0253H17.0181V8.47528L12.1042 13.3892L10.6899 11.975L15.6396 7.02527Z",fill:"currentColor"},child:[]},{tag:"path",attr:{d:"M10.9819 6.97473H4.98193V18.9747H16.9819V12.9747H14.9819V16.9747H6.98193V8.97473H10.9819V6.97473Z",fill:"currentColor"},child:[]}]})(e)}});var oCe=rt((w9t,rCe)=>{"use strict";var jZe=(Dl(),jc(bc)).GenIcon;rCe.exports.TbCheck=function(e){return jZe({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M5 12l5 5l10 -10"},child:[]}]})(e)}});var aCe=rt((E9t,iCe)=>{"use strict";var UZe=(Dl(),jc(bc)).GenIcon;iCe.exports.TbMinus=function(e){return UZe({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M5 12l14 0"},child:[]}]})(e)}});var lCe=rt((T9t,sCe)=>{"use strict";var KZe=(Dl(),jc(bc)).GenIcon;sCe.exports.CgChevronRight=function(e){return KZe({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{d:"M10.5858 6.34317L12 4.92896L19.0711 12L12 19.0711L10.5858 17.6569L16.2427 12L10.5858 6.34317Z",fill:"currentColor"},child:[]}]})(e)}});var qCe=rt((FE,YY)=>{"use strict";(function(t,e){typeof FE=="object"&&typeof YY=="object"?YY.exports=e(ae()):typeof define=="function"&&define.amd?define(["react"],e):typeof FE=="object"?FE.ReactPaginate=e(ae()):t.ReactPaginate=e(t.React)})(FE,t=>(()=>{var e={703:(i,a,l)=>{"use strict";var c=l(414);function d(){}function f(){}f.resetWarningCache=d,i.exports=function(){function m(y,b,C,S,w,E){if(E!==c){var _=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw _.name="Invariant Violation",_}}function h(){return m}m.isRequired=m;var g={array:m,bigint:m,bool:m,func:m,number:m,object:m,string:m,symbol:m,any:m,arrayOf:h,element:m,elementType:m,instanceOf:h,node:m,objectOf:h,oneOf:h,oneOfType:h,shape:h,exact:h,checkPropTypes:f,resetWarningCache:d};return g.PropTypes=g,g}},697:(i,a,l)=>{i.exports=l(703)()},414:i=>{"use strict";i.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},98:i=>{"use strict";i.exports=t}},n={};function r(i){var a=n[i];if(a!==void 0)return a.exports;var l=n[i]={exports:{}};return e[i](l,l.exports,r),l.exports}r.n=i=>{var a=i&&i.__esModule?()=>i.default:()=>i;return r.d(a,{a}),a},r.d=(i,a)=>{for(var l in a)r.o(a,l)&&!r.o(i,l)&&Object.defineProperty(i,l,{enumerable:!0,get:a[l]})},r.o=(i,a)=>Object.prototype.hasOwnProperty.call(i,a),r.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var o={};return(()=>{"use strict";r.r(o),r.d(o,{default:()=>A});var i=r(98),a=r.n(i),l=r(697),c=r.n(l);function d(){return d=Object.assign?Object.assign.bind():function(k){for(var F=1;F<arguments.length;F++){var U=arguments[F];for(var B in U)Object.prototype.hasOwnProperty.call(U,B)&&(k[B]=U[B])}return k},d.apply(this,arguments)}var f=function(k){var F=k.pageClassName,U=k.pageLinkClassName,B=k.page,H=k.selected,j=k.activeClassName,Y=k.activeLinkClassName,K=k.getEventListener,Z=k.pageSelectedHandler,X=k.href,se=k.extraAriaContext,de=k.pageLabelBuilder,ye=k.rel,Fe=k.ariaLabel||"Page "+B+(se?" "+se:""),Ge=null;return H&&(Ge="page",Fe=k.ariaLabel||"Page "+B+" is your current page",F=F!==void 0?F+" "+j:j,U!==void 0?Y!==void 0&&(U=U+" "+Y):U=Y),a().createElement("li",{className:F},a().createElement("a",d({rel:ye,role:X?void 0:"button",className:U,href:X,tabIndex:H?"-1":"0","aria-label":Fe,"aria-current":Ge,onKeyPress:Z},K(Z)),de(B)))};f.propTypes={pageSelectedHandler:c().func.isRequired,selected:c().bool.isRequired,pageClassName:c().string,pageLinkClassName:c().string,activeClassName:c().string,activeLinkClassName:c().string,extraAriaContext:c().string,href:c().string,ariaLabel:c().string,page:c().number.isRequired,getEventListener:c().func.isRequired,pageLabelBuilder:c().func.isRequired,rel:c().string};let m=f;function h(){return h=Object.assign?Object.assign.bind():function(k){for(var F=1;F<arguments.length;F++){var U=arguments[F];for(var B in U)Object.prototype.hasOwnProperty.call(U,B)&&(k[B]=U[B])}return k},h.apply(this,arguments)}var g=function(k){var F=k.breakLabel,U=k.breakAriaLabel,B=k.breakClassName,H=k.breakLinkClassName,j=k.breakHandler,Y=k.getEventListener,K=B||"break";return a().createElement("li",{className:K},a().createElement("a",h({className:H,role:"button",tabIndex:"0","aria-label":U,onKeyPress:j},Y(j)),F))};g.propTypes={breakLabel:c().oneOfType([c().string,c().node]),breakAriaLabel:c().string,breakClassName:c().string,breakLinkClassName:c().string,breakHandler:c().func.isRequired,getEventListener:c().func.isRequired};let y=g;function b(k){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return k??F}function C(k){return C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},C(k)}function S(){return S=Object.assign?Object.assign.bind():function(k){for(var F=1;F<arguments.length;F++){var U=arguments[F];for(var B in U)Object.prototype.hasOwnProperty.call(U,B)&&(k[B]=U[B])}return k},S.apply(this,arguments)}function w(k,F){for(var U=0;U<F.length;U++){var B=F[U];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(k,B.key,B)}}function E(k,F){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(U,B){return U.__proto__=B,U},E(k,F)}function _(k,F){if(F&&(C(F)==="object"||typeof F=="function"))return F;if(F!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return N(k)}function N(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function $(k){return $=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(F){return F.__proto__||Object.getPrototypeOf(F)},$(k)}function O(k,F,U){return F in k?Object.defineProperty(k,F,{value:U,enumerable:!0,configurable:!0,writable:!0}):k[F]=U,k}var M=function(k){(function(K,Z){if(typeof Z!="function"&&Z!==null)throw new TypeError("Super expression must either be null or a function");K.prototype=Object.create(Z&&Z.prototype,{constructor:{value:K,writable:!0,configurable:!0}}),Object.defineProperty(K,"prototype",{writable:!1}),Z&&E(K,Z)})(Y,k);var F,U,B,H,j=(B=Y,H=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var K,Z=$(B);if(H){var X=$(this).constructor;K=Reflect.construct(Z,arguments,X)}else K=Z.apply(this,arguments);return _(this,K)});function Y(K){var Z,X;return function(se,de){if(!(se instanceof de))throw new TypeError("Cannot call a class as a function")}(this,Y),O(N(Z=j.call(this,K)),"handlePreviousPage",function(se){var de=Z.state.selected;Z.handleClick(se,null,de>0?de-1:void 0,{isPrevious:!0})}),O(N(Z),"handleNextPage",function(se){var de=Z.state.selected,ye=Z.props.pageCount;Z.handleClick(se,null,de<ye-1?de+1:void 0,{isNext:!0})}),O(N(Z),"handlePageSelected",function(se,de){if(Z.state.selected===se)return Z.callActiveCallback(se),void Z.handleClick(de,null,void 0,{isActive:!0});Z.handleClick(de,null,se)}),O(N(Z),"handlePageChange",function(se){Z.state.selected!==se&&(Z.setState({selected:se}),Z.callCallback(se))}),O(N(Z),"getEventListener",function(se){return O({},Z.props.eventListener,se)}),O(N(Z),"handleClick",function(se,de,ye){var Fe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Ge=Fe.isPrevious,lt=Ge!==void 0&&Ge,xt=Fe.isNext,we=xt!==void 0&&xt,Pe=Fe.isBreak,Je=Pe!==void 0&&Pe,yt=Fe.isActive,rn=yt!==void 0&&yt;se.preventDefault?se.preventDefault():se.returnValue=!1;var $e=Z.state.selected,Ct=Z.props.onClick,Wt=ye;if(Ct){var Ht=Ct({index:de,selected:$e,nextSelectedPage:ye,event:se,isPrevious:lt,isNext:we,isBreak:Je,isActive:rn});if(Ht===!1)return;Number.isInteger(Ht)&&(Wt=Ht)}Wt!==void 0&&Z.handlePageChange(Wt)}),O(N(Z),"handleBreakClick",function(se,de){var ye=Z.state.selected;Z.handleClick(de,se,ye<se?Z.getForwardJump():Z.getBackwardJump(),{isBreak:!0})}),O(N(Z),"callCallback",function(se){Z.props.onPageChange!==void 0&&typeof Z.props.onPageChange=="function"&&Z.props.onPageChange({selected:se})}),O(N(Z),"callActiveCallback",function(se){Z.props.onPageActive!==void 0&&typeof Z.props.onPageActive=="function"&&Z.props.onPageActive({selected:se})}),O(N(Z),"getElementPageRel",function(se){var de=Z.state.selected,ye=Z.props,Fe=ye.nextPageRel,Ge=ye.prevPageRel,lt=ye.selectedPageRel;return de-1===se?Ge:de===se?lt:de+1===se?Fe:void 0}),O(N(Z),"pagination",function(){var se=[],de=Z.props,ye=de.pageRangeDisplayed,Fe=de.pageCount,Ge=de.marginPagesDisplayed,lt=de.breakLabel,xt=de.breakClassName,we=de.breakLinkClassName,Pe=de.breakAriaLabels,Je=Z.state.selected;if(Fe<=ye)for(var yt=0;yt<Fe;yt++)se.push(Z.getPageElement(yt));else{var rn=ye/2,$e=ye-rn;Je>Fe-ye/2?rn=ye-($e=Fe-Je):Je<ye/2&&($e=ye-(rn=Je));var Ct,Wt,Ht=function(bt){return Z.getPageElement(bt)},jt=[];for(Ct=0;Ct<Fe;Ct++){var Xn=Ct+1;if(Xn<=Ge)jt.push({type:"page",index:Ct,display:Ht(Ct)});else if(Xn>Fe-Ge)jt.push({type:"page",index:Ct,display:Ht(Ct)});else if(Ct>=Je-rn&&Ct<=Je+(Je===0&&ye>1?$e-1:$e))jt.push({type:"page",index:Ct,display:Ht(Ct)});else if(lt&&jt.length>0&&jt[jt.length-1].display!==Wt&&(ye>0||Ge>0)){var ke=Ct<Je?Pe.backward:Pe.forward;Wt=a().createElement(y,{key:Ct,breakAriaLabel:ke,breakLabel:lt,breakClassName:xt,breakLinkClassName:we,breakHandler:Z.handleBreakClick.bind(null,Ct),getEventListener:Z.getEventListener}),jt.push({type:"break",index:Ct,display:Wt})}}jt.forEach(function(bt,Sn){var Gt=bt;bt.type==="break"&&jt[Sn-1]&&jt[Sn-1].type==="page"&&jt[Sn+1]&&jt[Sn+1].type==="page"&&jt[Sn+1].index-jt[Sn-1].index<=2&&(Gt={type:"page",index:bt.index,display:Ht(bt.index)}),se.push(Gt.display)})}return se}),K.initialPage!==void 0&&K.forcePage!==void 0&&console.warn("(react-paginate): Both initialPage (".concat(K.initialPage,") and forcePage (").concat(K.forcePage,") props are provided, which is discouraged.")+` Use exclusively forcePage prop for a controlled component.
236
- See https://reactjs.org/docs/forms.html#controlled-components`),X=K.initialPage?K.initialPage:K.forcePage?K.forcePage:0,Z.state={selected:X},Z}return F=Y,(U=[{key:"componentDidMount",value:function(){var K=this.props,Z=K.initialPage,X=K.disableInitialCallback,se=K.extraAriaContext,de=K.pageCount,ye=K.forcePage;Z===void 0||X||this.callCallback(Z),se&&console.warn("DEPRECATED (react-paginate): The extraAriaContext prop is deprecated. You should now use the ariaLabelBuilder instead."),Number.isInteger(de)||console.warn("(react-paginate): The pageCount prop value provided is not an integer (".concat(de,"). Did you forget a Math.ceil()?")),Z!==void 0&&Z>de-1&&console.warn("(react-paginate): The initialPage prop provided is greater than the maximum page index from pageCount prop (".concat(Z," > ").concat(de-1,").")),ye!==void 0&&ye>de-1&&console.warn("(react-paginate): The forcePage prop provided is greater than the maximum page index from pageCount prop (".concat(ye," > ").concat(de-1,")."))}},{key:"componentDidUpdate",value:function(K){this.props.forcePage!==void 0&&this.props.forcePage!==K.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(K.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 K=this.state.selected,Z=this.props,X=Z.pageCount,se=K+Z.pageRangeDisplayed;return se>=X?X-1:se}},{key:"getBackwardJump",value:function(){var K=this.state.selected-this.props.pageRangeDisplayed;return K<0?0:K}},{key:"getElementHref",value:function(K){var Z=this.props,X=Z.hrefBuilder,se=Z.pageCount,de=Z.hrefAllControls;if(X)return de||K>=0&&K<se?X(K+1,se,this.state.selected):void 0}},{key:"ariaLabelBuilder",value:function(K){var Z=K===this.state.selected;if(this.props.ariaLabelBuilder&&K>=0&&K<this.props.pageCount){var X=this.props.ariaLabelBuilder(K+1,Z);return this.props.extraAriaContext&&!Z&&(X=X+" "+this.props.extraAriaContext),X}}},{key:"getPageElement",value:function(K){var Z=this.state.selected,X=this.props,se=X.pageClassName,de=X.pageLinkClassName,ye=X.activeClassName,Fe=X.activeLinkClassName,Ge=X.extraAriaContext,lt=X.pageLabelBuilder;return a().createElement(m,{key:K,pageSelectedHandler:this.handlePageSelected.bind(null,K),selected:Z===K,rel:this.getElementPageRel(K),pageClassName:se,pageLinkClassName:de,activeClassName:ye,activeLinkClassName:Fe,extraAriaContext:Ge,href:this.getElementHref(K),ariaLabel:this.ariaLabelBuilder(K),page:K+1,pageLabelBuilder:lt,getEventListener:this.getEventListener})}},{key:"render",value:function(){var K=this.props.renderOnZeroPageCount;if(this.props.pageCount===0&&K!==void 0)return K&&K(this.props);var Z=this.props,X=Z.disabledClassName,se=Z.disabledLinkClassName,de=Z.pageCount,ye=Z.className,Fe=Z.containerClassName,Ge=Z.previousLabel,lt=Z.previousClassName,xt=Z.previousLinkClassName,we=Z.previousAriaLabel,Pe=Z.prevRel,Je=Z.nextLabel,yt=Z.nextClassName,rn=Z.nextLinkClassName,$e=Z.nextAriaLabel,Ct=Z.nextRel,Wt=this.state.selected,Ht=Wt===0,jt=Wt===de-1,Xn="".concat(b(lt)).concat(Ht?" ".concat(b(X)):""),ke="".concat(b(yt)).concat(jt?" ".concat(b(X)):""),bt="".concat(b(xt)).concat(Ht?" ".concat(b(se)):""),Sn="".concat(b(rn)).concat(jt?" ".concat(b(se)):""),Gt=Ht?"true":"false",sr=jt?"true":"false";return a().createElement("ul",{className:ye||Fe,role:"navigation","aria-label":"Pagination"},a().createElement("li",{className:Xn},a().createElement("a",S({className:bt,href:this.getElementHref(Wt-1),tabIndex:Ht?"-1":"0",role:"button",onKeyPress:this.handlePreviousPage,"aria-disabled":Gt,"aria-label":we,rel:Pe},this.getEventListener(this.handlePreviousPage)),Ge)),this.pagination(),a().createElement("li",{className:ke},a().createElement("a",S({className:Sn,href:this.getElementHref(Wt+1),tabIndex:jt?"-1":"0",role:"button",onKeyPress:this.handleNextPage,"aria-disabled":sr,"aria-label":$e,rel:Ct},this.getEventListener(this.handleNextPage)),Je)))}}])&&w(F.prototype,U),Object.defineProperty(F,"prototype",{writable:!1}),Y}(i.Component);O(M,"propTypes",{pageCount:c().number.isRequired,pageRangeDisplayed:c().number,marginPagesDisplayed:c().number,previousLabel:c().node,previousAriaLabel:c().string,prevPageRel:c().string,prevRel:c().string,nextLabel:c().node,nextAriaLabel:c().string,nextPageRel:c().string,nextRel:c().string,breakLabel:c().oneOfType([c().string,c().node]),breakAriaLabels:c().shape({forward:c().string,backward:c().string}),hrefBuilder:c().func,hrefAllControls:c().bool,onPageChange:c().func,onPageActive:c().func,onClick:c().func,initialPage:c().number,forcePage:c().number,disableInitialCallback:c().bool,containerClassName:c().string,className:c().string,pageClassName:c().string,pageLinkClassName:c().string,pageLabelBuilder:c().func,activeClassName:c().string,activeLinkClassName:c().string,previousClassName:c().string,nextClassName:c().string,previousLinkClassName:c().string,nextLinkClassName:c().string,disabledClassName:c().string,disabledLinkClassName:c().string,breakClassName:c().string,breakLinkClassName:c().string,extraAriaContext:c().string,ariaLabelBuilder:c().func,eventListener:c().string,renderOnZeroPageCount:c().func,selectedPageRel:c().string}),O(M,"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(k){return k},eventListener:"onClick",renderOnZeroPageCount:void 0,selectedPageRel:"canonical",hrefAllControls:!1});let A=M})(),o})())});var JSe=rt((azt,qSe)=>{"use strict";var Xnt=Object.prototype.hasOwnProperty,Qnt=Object.prototype.toString;qSe.exports=function(e,n,r){if(Qnt.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 a in e)Xnt.call(e,a)&&n.call(r,e[a],a,e)}});var bZ=rt((szt,XSe)=>{"use strict";var ert=JSe();XSe.exports=Sr;function Sr(t,e,n){if(arguments.length===3)return Sr.set(t,e,n);if(arguments.length===2)return Sr.get(t,e);var r=Sr.bind(Sr,t);for(var o in Sr)Sr.hasOwnProperty(o)&&(r[o]=Sr[o].bind(r,t));return r}Sr.get=function(e,n){for(var r=Array.isArray(n)?n:Sr.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};Sr.set=function(e,n,r){var o=Array.isArray(n)?n:Sr.parse(n),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]=r,this};Sr.remove=function(t,e){var n=Array.isArray(e)?e:Sr.parse(e),r=n[n.length-1];if(r===void 0)throw new Error('Invalid JSON pointer for remove: "'+e+'"');var o=Sr.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]};Sr.dict=function(e,n){var r={};return Sr.walk(e,function(o,i){r[i]=o},n),r};Sr.walk=function(e,n,r){var o=[];r=r||function(i){var a=Object.prototype.toString.call(i);return a==="[object Object]"||a==="[object Array]"},function i(a){ert(a,function(l,c){o.push(String(c)),r(l)?i(l):n(l,Sr.compile(o)),o.pop()})}(e)};Sr.has=function(e,n){try{Sr.get(e,n)}catch{return!1}return!0};Sr.escape=function(e){return e.toString().replace(/~/g,"~0").replace(/\//g,"~1")};Sr.unescape=function(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")};Sr.parse=function(e){if(e==="")return[];if(e.charAt(0)!=="/")throw new Error("Invalid JSON pointer: "+e);return e.substring(1).split(/\//).map(Sr.unescape)};Sr.compile=function(e){return e.length===0?"":"/"+e.map(Sr.escape).join("/")}});var e4e=rt((lzt,QSe)=>{"use strict";QSe.exports=trt;function dC(t){return t instanceof Buffer?Buffer.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function trt(t){if(t=t||{},t.circles)return nrt(t);let e=new Map;if(e.set(Date,a=>new Date(a)),e.set(Map,(a,l)=>new Map(r(Array.from(a),l))),e.set(Set,(a,l)=>new Set(r(Array.from(a),l))),t.constructorHandlers)for(let a of t.constructorHandlers)e.set(a[0],a[1]);let n=null;return t.proto?i:o;function r(a,l){let c=Object.keys(a),d=new Array(c.length);for(let f=0;f<c.length;f++){let m=c[f],h=a[m];typeof h!="object"||h===null?d[m]=h:h.constructor!==Object&&(n=e.get(h.constructor))?d[m]=n(h,l):ArrayBuffer.isView(h)?d[m]=dC(h):d[m]=l(h)}return d}function o(a){if(typeof a!="object"||a===null)return a;if(Array.isArray(a))return r(a,o);if(a.constructor!==Object&&(n=e.get(a.constructor)))return n(a,o);let l={};for(let c in a){if(Object.hasOwnProperty.call(a,c)===!1)continue;let d=a[c];typeof d!="object"||d===null?l[c]=d:d.constructor!==Object&&(n=e.get(d.constructor))?l[c]=n(d,o):ArrayBuffer.isView(d)?l[c]=dC(d):l[c]=o(d)}return l}function i(a){if(typeof a!="object"||a===null)return a;if(Array.isArray(a))return r(a,i);if(a.constructor!==Object&&(n=e.get(a.constructor)))return n(a,i);let l={};for(let c in a){let d=a[c];typeof d!="object"||d===null?l[c]=d:d.constructor!==Object&&(n=e.get(d.constructor))?l[c]=n(d,i):ArrayBuffer.isView(d)?l[c]=dC(d):l[c]=i(d)}return l}}function nrt(t){let e=[],n=[],r=new Map;if(r.set(Date,c=>new Date(c)),r.set(Map,(c,d)=>new Map(i(Array.from(c),d))),r.set(Set,(c,d)=>new Set(i(Array.from(c),d))),t.constructorHandlers)for(let c of t.constructorHandlers)r.set(c[0],c[1]);let o=null;return t.proto?l:a;function i(c,d){let f=Object.keys(c),m=new Array(f.length);for(let h=0;h<f.length;h++){let g=f[h],y=c[g];if(typeof y!="object"||y===null)m[g]=y;else if(y.constructor!==Object&&(o=r.get(y.constructor)))m[g]=o(y,d);else if(ArrayBuffer.isView(y))m[g]=dC(y);else{let b=e.indexOf(y);b!==-1?m[g]=n[b]:m[g]=d(y)}}return m}function a(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return i(c,a);if(c.constructor!==Object&&(o=r.get(c.constructor)))return o(c,a);let d={};e.push(c),n.push(d);for(let f in c){if(Object.hasOwnProperty.call(c,f)===!1)continue;let m=c[f];if(typeof m!="object"||m===null)d[f]=m;else if(m.constructor!==Object&&(o=r.get(m.constructor)))d[f]=o(m,a);else if(ArrayBuffer.isView(m))d[f]=dC(m);else{let h=e.indexOf(m);h!==-1?d[f]=n[h]:d[f]=a(m)}}return e.pop(),n.pop(),d}function l(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return i(c,l);if(c.constructor!==Object&&(o=r.get(c.constructor)))return o(c,l);let d={};e.push(c),n.push(d);for(let f in c){let m=c[f];if(typeof m!="object"||m===null)d[f]=m;else if(m.constructor!==Object&&(o=r.get(m.constructor)))d[f]=o(m,l);else if(ArrayBuffer.isView(m))d[f]=dC(m);else{let h=e.indexOf(m);h!==-1?d[f]=n[h]:d[f]=l(m)}}return e.pop(),n.pop(),d}}});var r4e=rt((xzt,n4e)=>{"use strict";var SZ=class{constructor(e){this.value=e,this.next=void 0}},wZ=class{constructor(){this.clear()}enqueue(e){let n=new SZ(e);this._head?(this._tail.next=n,this._tail=n):(this._head=n,this._tail=n),this._size++}dequeue(){let e=this._head;if(e)return this._head=this._head.next,this._size--,e.value}clear(){this._head=void 0,this._tail=void 0,this._size=0}get size(){return this._size}*[Symbol.iterator](){let e=this._head;for(;e;)yield e.value,e=e.next}};n4e.exports=wZ});var i4e=rt((Czt,o4e)=>{"use strict";var art=r4e(),srt=t=>{if(!((Number.isInteger(t)||t===1/0)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=new art,n=0,r=()=>{n--,e.size>0&&e.dequeue()()},o=async(l,c,...d)=>{n++;let f=(async()=>l(...d))();c(f);try{await f}catch{}r()},i=(l,c,...d)=>{e.enqueue(o.bind(null,l,c,...d)),(async()=>(await Promise.resolve(),n<t&&e.size>0&&e.dequeue()()))()},a=(l,...c)=>new Promise(d=>{i(l,d,...c)});return Object.defineProperties(a,{activeCount:{get:()=>n},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),a};o4e.exports=srt});import{McpServer as Uit}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as Kit}from"@modelcontextprotocol/sdk/server/stdio.js";import{CanvasClient as yNe}from"@uniformdev/canvas";import{z as Bte}from"zod";var Ate=process.env.UNIFORM_API_KEY,Dk=process.env.UNIFORM_PROJECT_ID,Rte=process.env.UNIFORM_API_HOST??"https://uniform.app",eNe=process.env.UNIFORM_AI_API_HOST??"https://ai.uniform.global";if(!Ate&&process.env.NODE_ENV!=="test")throw new Error("UNIFORM_API_KEY is not set");if(!Dk&&process.env.NODE_ENV!=="test")throw new Error("UNIFORM_PROJECT_ID is not set");var pt={apiHost:Rte,apiKey:Ate,projectId:Dk,aiApiHost:eNe,baseWebUrl:`${Rte}/projects/${Dk}`};import tNe from"fast-json-patch";function V_(t,e){return tNe.applyPatch(t,e).newDocument}import{z as vS}from"zod";var H_=vS.array(vS.object({op:vS.enum(["add","remove","replace"]),path:vS.string().describe("The JSON path to patch"),value:vS.unknown().describe("The value to patch - for remove, leave this blank")}));function nNe(t){return Array.isArray(t)&&t.length>0}function kte(t){return!!t&&typeof t=="object"&&"type"in t}function Pte(t){return typeof t=="object"&&t!==null&&"root"in t&&kte(t.root)}function Ng(t){return"children"in t&&nNe(t.children)}var rNe=({context:t,renderChildren:e})=>Ng(t.currentNode)?`${e(t.currentNode.children)} `:"";var oNe=({context:t,renderChildren:e})=>{if(!Ng(t.currentNode))return"";let n=e(t.currentNode.children);return n.endsWith(" ")?n:`${n} `};var iNe=({context:t,renderChildren:e})=>Ng(t.currentNode)?`${e(t.currentNode.children)} `:"";var aNe=({context:t,renderChildren:e})=>Ng(t.currentNode)?`${e(t.currentNode.children)} `:"";var sNe=({context:t,renderChildren:e})=>Ng(t.currentNode)?`${e(t.currentNode.children)} `:"";var lNe=({context:t,renderChildren:e})=>Ng(t.currentNode)?`${e(t.currentNode.children)} `:"";var uNe=({context:t})=>t.currentNode.text;var cNe=()=>" ";var dNe=()=>" ",fNe=new Map([["text",uNe],["tab",cNe],["linebreak",dNe],["paragraph",iNe],["listitem",oNe],["heading",rNe],["table",aNe],["tablecell",sNe],["tablerow",lNe]]),pNe=t=>{let e=fNe.get(t.currentNode.type);return e||(({context:n,renderChildren:r})=>Ng(n.currentNode)?r(n.currentNode.children):"")};function mNe(t,e){let n=[];return e?.ancestorNodes&&(n=n.concat(e.ancestorNodes)),e?.currentNode&&n.unshift(e.currentNode),{...e??{},currentNode:t,ancestorNodes:n}}function $k(t,e){var n;if(!kte(t))return"";let r=mNe(t,e),o=(n=r.resolveRenderer)==null?void 0:n.call(r,r);if(typeof o>"u")o=pNe(r);else if(o===null)return"";let i=a=>hNe(a,r);if(o){let a=o({context:r,renderChildren:i});return r.ancestorNodes.length>0?a:a.trim()}else throw new Error(`There is no renderer for node type: ${r.currentNode.type}`)}function hNe(t,e){return Array.isArray(t)?t.map(n=>$k(n,e)).join(""):""}var gNe=[{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"}],vNe=[{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 j_={required:!1,formatting:{builtIn:vNe.map(t=>t.type)},elements:{builtIn:gNe.map(t=>t.type)},elementsConfig:{asset:{allowedTypes:["image"]}}};import{z as Ja}from"zod";import{z as so}from"zod";var U_=so.object({name:so.string().describe('Title-cased display name. Ex: "Headline"'),id:so.string().describe("The public ID. Must be unique within the current entity fields/parameters."),type:so.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:so.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:so.boolean().describe("Whether values are stored as locale-specific"),typeConfig:so.object({allowedTypes:so.array(so.enum(["image","video","audio","other"])).optional().describe("The types of asset allowed. ONLY applies when type=asset, omit for other types"),options:so.array(so.object({text:so.string().describe("The text to display to the author"),value:so.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:so.boolean().optional().describe("Whether an author must enter a value for this property"),min:so.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:so.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:so.array(so.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:so.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:so.array(so.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:so.boolean().optional().describe("When type=group, this is whether the group is collapsed by default."),schema:so.any().describe("When type=json, this is an optional JSON schema the property value must follow. Omit for all other types.")}).optional()});var Ite=Ja.object({name:Ja.string().describe('Title-cased display name of the component. Ex: "Hero"'),id:Ja.string().describe("Public ID of the component, the camelCase version of name, using only alphanumeric characters"),description:Ja.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:Ja.boolean().describe("True if the component can have pages/compositions created from it. False if it is a part of a page."),parameters:Ja.array(U_).describe("The properties of the component. The key is the publicId of the property.").optional(),slots:Ja.array(Ja.object({name:Ja.string().describe('Title-cased display name of the slot. Ex: "Content"'),id:Ja.string().describe("The public id of the slot. Must be unique within this component's slots."),allowedComponents:Ja.array(Ja.string()).describe("The components public IDs allowed in the slot."),minComponents:Ja.number().describe("The minimum number of components allowed in the slot. Omit for no minimum.").min(0).optional(),maxComponents:Ja.number().describe("The maximum number of components allowed in the slot. Omit for no maximum.").min(1).optional(),inheritAllowedComponents:Ja.boolean().describe("Set to false")})).describe("The slots of the component. The key is the publicId of the slot.").optional()});function Fte(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 Sy(t){let e=t.filter(r=>r.type==="group")??[];if(e.length===0)return!1;let n=!1;for(;e.length>0;){let r=e.shift(),o=r.typeConfig&&typeof r.typeConfig=="object"&&"childrenParams"in r.typeConfig&&Array.isArray(r.typeConfig.childrenParams)?r.typeConfig.childrenParams:[],i=new Set(o),a=t.findIndex(c=>c.id===r.id),l=i.size;for(let c=a+1;c<=a+l;c++){let d=t[c];if(d)if(i.has(d.id))i.delete(d.id);else break}if(i.size>0){let c=Array.from(i),d=a+l-i.size;for(let f of c){let m=t.findIndex(h=>h.id===f);if(m!==-1){let[h]=t.splice(m,1);m>d&&d++,t.splice(d,0,h)}else o.splice(o.indexOf(f),1)}n=!0}}return n}function K_(t){return`${pt.baseWebUrl}/dashboards/canvas/components/${t}`}function wy(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=j_;continue}r.typeConfig={...j_,required:r.typeConfig.required??j_.required}}}var bNe={action:Bte.enum(["create","update","delete"]).describe("The action to perform"),publicId:Bte.string().describe("Public ID of the component, the camelCase version of name, using only alphanumeric characters"),component:Ite.describe("Full component definition to create. Omit for update or delete.").optional(),patches:H_.describe("JSON patch to apply to the existing component definition. Omit for create or delete.").optional()};function zte(t){t.tool("componentAction","Creates, updates, or deletes a Uniform Component definition (or Composition definition)",bNe,async({publicId:e,action:n,component:r,patches:o})=>{let i=new yNe(pt),a=!1;if(n==="create"){if(!r)throw new Error("Component definition is required for create");let l=Fte(r);l.parameters&&(a=Sy(l.parameters),wy(l.parameters)),await i.updateComponentDefinition({componentDefinition:l})}if(n==="update"){if(!o)throw new Error("Patches are required for update");let l=await i.getComponentDefinitions({componentId:e});if(!l.componentDefinitions.length)throw new Error(`Component with public ID ${e} does not exist, try creating it instead`);let c=l.componentDefinitions[0],d=c.parameters?.filter(m=>m.type==="richText").map(m=>m.id),f=V_(c,o);if(f.parameters){a=Sy(f.parameters);let m=f.parameters?.filter(h=>h.type==="richText").map(h=>h.id).filter(h=>!d?.includes(h));wy(f.parameters,m)}await i.updateComponentDefinition({componentDefinition:f})}return n==="delete"&&await i.removeComponentDefinition({componentId:e}),{content:[{type:"text",text:JSON.stringify({success:!0,editUrl:K_(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 Vte}from"@uniformdev/canvas";import{z as xNe}from"zod";var CNe={id:xNe.string()};function Hte(t){t.tool("componentList","Lists all Uniform Component definitions",async()=>{let r=(await new Vte(pt).getComponentDefinitions({includeSystem:!0})).componentDefinitions.map(o=>({id:o.id,name:o.name,type:o.canBeComposition?"composition":"component",description:o.description,editUrl:K_(o.id)}));return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}),t.tool("componentGet","Gets a Uniform Component definition details (slots, parameters, etc.)",CNe,async({id:e})=>{let r=await new Vte(pt).getComponentDefinitions({componentId:e,includeSystem:!0});return{content:[{type:"text",text:JSON.stringify(r.componentDefinitions[0],null,2)}]}})}import{z as pn}from"zod";var SNe=pn.object({parentComponentId:pn.string().describe("ID of the component the slot belongs to"),slotName:pn.string().describe("Public ID of the target slot"),slotIndex:pn.number().describe("Index to insert the new component at. Omit for append.").optional(),newComponentInstanceUuid:pn.string().uuid().describe("ID of the new component to create - generate a random unique UUID"),instanceType:pn.enum(["component","componentPattern"]),componentType:pn.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:pn.string().describe("UUID of the component pattern definition to insert. Component pattern must be registered with Uniform. Omit when inserting a component instance.").optional()}),W_=pn.object({componentId:pn.string().describe("ID of the component the parameter belongs to - can be created in the same call to this tool"),parameterId:pn.string().describe("Public ID of the parameter to update. Must be defined in the component type of the parent componentId"),parameterType:pn.string().describe("The type of the parameterId as defined on the component definition"),locale:pn.string().describe("Locale of the parameter value. Omit for non-localized values.").optional(),editInstructions:pn.string().describe("Prompt that will be used to generate the parameter value. Omission will leave the value unchanged.").optional()}).describe("A value change to a parameter. Omit unchanged parameters."),G_=pn.object({newComponentsInSlots:pn.array(SNe).describe("New components to insert in slots. Omit for delete. Performed before deleting, moving or duplicating components, and parameter updates.").optional(),deletedComponentsInSlots:pn.array(pn.string().describe("Component ID to remove. Cannot be the pattern root component.")).describe("Components to delete from slots during an update. Omit for create or delete, or if nothing needs deleting. These are performed before moving or duplicating components, and parameter updates.").optional(),moveComponentsInSlots:pn.array(pn.object({componentId:pn.string().describe("Component ID to move. Cannot be root component."),newParentComponentId:pn.string(),newSlotName:pn.string(),newSlotIndex:pn.number()})).describe("Components to move between slots. Omit for create or delete, or if nothing needs moving. These are performed before duplicating components, and parameter updates.").optional(),duplicateComponentsInSlots:pn.array(pn.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("Components to duplicate/copy. Omit when empty. These are performed before parameter updates.").optional()}),tm=pn.object({enableLocales:pn.array(pn.string()).describe("Locales to enable. Omit for no change.").optional(),disableLocales:pn.array(pn.string()).describe("Locales to disable. Existing data in disabled locales will be lost. Omit for no change.").optional()}),wNe=pn.object({summary:pn.string().describe("Short summary of the edit that was made.").optional(),success:pn.boolean()}),Tat=pn.object({success:pn.boolean().describe("Whether all actions were successful"),actionsTaken:pn.array(wNe).describe("Array of individual actions that were taken")});import{z as yS}from"zod";var ENe=W_.extend({overridable:yS.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()}),jte=G_.extend({name:yS.string().describe("Name of the pattern. If the name does not need to be changed, omit this field. Always include for creates.").optional(),type:yS.string().describe("Component definition type of the pattern. Must be registered with Uniform. Always include for creates. Omit otherwise.").optional(),description:yS.string().describe("Description of the pattern for authors. If the description does not need to be changed, omit this field.").optional(),parameterUpdates:yS.array(ENe).describe("Updates to the parameters of the pattern. Use empty array if no changes are needed.").optional(),localeUpdates:tm.optional()}).describe("Modification instructions for the pattern");import{z as Y_}from"zod";var Ute=Y_.object({...G_.shape,name:Y_.string().describe("Name of the composition. If the name does not need to be changed, omit this field. Always include for creates.").optional(),type:Y_.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:Y_.array(W_).describe("Updates to the parameters of the pattern. Use empty array if no changes are needed.").optional(),localeUpdates:tm.optional()}).describe("Modification instructions for the composition");import{z as Ey}from"zod";import{z as pf}from"zod";var Nk=pf.object({fieldId:pf.string().describe("Public ID of the field to update. Must be defined in the content type of the parent entry."),fieldType:pf.string().describe("The type of the fieldId as defined on the content type"),locale:pf.string().describe("Locale of the field value. Omit for non-localized values.").optional(),editInstructions:pf.string().describe("Prompt that will be used to generate the field value. Setting this to an empty string will clear or remove any existing value. Omission will leave the value unchanged.").optional()}).describe("A value change to a field. Omit unchanged fields."),Kte=pf.object({type:pf.string().describe("Content type of the entry. Must be registered with Uniform. Always include for creates. Omit otherwise.").optional(),slug:pf.string().describe("Slug (human-readable identifier) of the entry. If the slug does not need to be changed, omit this field.").optional(),fieldUpdates:pf.array(Nk).describe("Updates to the fields of the entry. Use empty array if no changes are needed.").optional(),localeUpdates:tm.optional()}).describe("Modification instructions for the entry");var TNe=Nk.extend({overridable:Ey.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()}),Wte=Ey.object({name:Ey.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:Ey.string().describe("Content type of the entry pattern. Must be registered with Uniform. Always include for creates. Omit otherwise.").optional(),description:Ey.string().describe("Description of the entry pattern for authors. If the description does not need to be changed, omit this field.").optional(),fieldUpdates:Ey.array(TNe).describe("Updates to the fields of the entry pattern. Use empty array if no changes are needed.").optional(),localeUpdates:tm.optional()}).describe("Modification instructions for the entry pattern");import{z as PZ}from"zod";import{getEffectivePropertyValue as Znt}from"@uniformdev/canvas";var _Ne="$p:";function Gte(t){return`${_Ne}${t}`}function Yte(t){return{...t,allowedComponentsIndex:new Set(t?.allowedComponents??[]),maxComponents:t?.maxComponents??Number.MAX_VALUE,minComponents:t?.minComponents??0,allowAllPatternsOfAllowedTypes:!t?.patternsInAllowedComponents}}import{CANVAS_LOCALIZATION_SLOT as jat,CANVAS_LOCALIZATION_TYPE as Uat,CANVAS_PERSONALIZATION_ALGORITHM_PARAM as Kat,CANVAS_PERSONALIZATION_EVENT_NAME_PARAM as Wat,CANVAS_PERSONALIZATION_TAKE_PARAM as Gat,CANVAS_PERSONALIZE_SLOT as Yat,CANVAS_PERSONALIZE_TYPE as Zat,CANVAS_SLOT_SECTION_SLOT as qat,CANVAS_SLOT_SECTION_TYPE as Jat,CANVAS_TEST_SLOT as Xat,CANVAS_TEST_TYPE as Qat}from"@uniformdev/canvas";var DNe={$personalization:{isNestableIntoItself:!0},$test:void 0,$localization:void 0,$loop:void 0,$slotSection:{isAutoAllowed:!0,isNestableIntoItself:!0,isOnlyAllowedInPatternEditor:!0}},Zte=t=>DNe[t];function Lk(t,e,n=!1){let r=Zte(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(Gte(t._pattern))||!1}var Mk=({twee:t,parentSlotDefinition:e,nodeId:n,componentDefinitionsIndex:r})=>{if(!e.inheritAllowedComponents)return e;let o=t.getParentInfo(n);if(!o)return;let i=r[o.value.type]?.slots?.find(({id:a})=>a===o.parentName);if(i)return Mk({parentSlotDefinition:i,nodeId:o.parentId,twee:t,componentDefinitionsIndex:r})};function q_({definition:t,lastUserChoice:e,currentValue:n}){if(t&&!t.localizable)return!1;if(n){if(n.locales&&Z_(n.locales)||n.localesConditions&&Z_(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 Z_(t){return Array.isArray(t)?t.some(e=>Z_(e)):t===void 0?!1:t===null||typeof t!="object"?!0:Object.values(t).some(e=>Z_(e))}function qte({twee:t,nodeId:e,currentEditorLocale:n,definition:r}){let o=t.getNodeById(e),i=o?.propertyValueLocalizability?.[r.id],a=t.getNodeProperty(e,r?.id),l=q_({lastUserChoice:i,currentValue:a,definition:r});if(o&&l!==void 0&&l!==(i??!1)&&t.updateNode({nodeId:e,updateMetadata:c=>{c.propertyValueLocalizability[r.id]=l},doNotSetDirty:!0}),l)return n}import{CANVAS_ENRICHMENT_TAG_PARAM as Knt,CANVAS_PERSONALIZE_SLOT as Wnt,isSystemComponentDefinition as Gnt}from"@uniformdev/canvas";await B1();var tPe=await(process.env.NODE_ENV!=="production"?Nle().then(()=>$le):Mle().then(()=>Lle)),Ole=tPe.createHeadlessEditor;await SD();await wB();await OD();await Efe();var Zm=J(So());Lpe();var Dmt=J(ae());Eb();var Nmt=J(Vz());q4();var Mmt=J(Rz());_b();Db();R$();var Ws=Zm.Fragment;function W(t,e,n){return t3.call(e,"css")?Zm.jsx(Bz,Fz(t,e),n):Zm.jsx(t,e,n)}function Me(t,e,n){return t3.call(e,"css")?Zm.jsxs(Bz,Fz(t,e),n):Zm.jsxs(t,e,n)}Ee();Ee();Ee();Ee();Ee();function Ape(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];t&&t.addEventListener&&t.addEventListener.apply(t,e)}function kpe(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];t&&t.removeEventListener&&t.removeEventListener.apply(t,e)}var Ppe=typeof window<"u";var Ipe=J(ae());var ac=J(ae());function jz(t,e){e===void 0&&(e=0);var n=(0,ac.useRef)(!1),r=(0,ac.useRef)(),o=(0,ac.useRef)(t),i=(0,ac.useCallback)(function(){return n.current},[]),a=(0,ac.useCallback)(function(){n.current=!1,r.current&&clearTimeout(r.current),r.current=setTimeout(function(){n.current=!0,o.current()},e)},[e]),l=(0,ac.useCallback)(function(){n.current=null,r.current&&clearTimeout(r.current)},[]);return(0,ac.useEffect)(function(){o.current=t},[t]),(0,ac.useEffect)(function(){return a(),l},[e]),[i,l,a]}function F$(t,e,n){e===void 0&&(e=0),n===void 0&&(n=[]);var r=jz(t,e),o=r[0],i=r[1],a=r[2];return(0,Ipe.useEffect)(a,n),[o,i]}var $b=J(ae());var jze=function(t){return t===void 0&&(t={laptopL:1440,laptop:1024,tablet:768}),function(){var e=(0,$b.useState)(Ppe?window.innerWidth:0),n=e[0],r=e[1];(0,$b.useEffect)(function(){var a=function(){r(window.innerWidth)};return a(),Ape(window,"resize",a),function(){kpe(window,"resize",a)}});var o=(0,$b.useMemo)(function(){return Object.entries(t).sort(function(a,l){return a[1]>=l[1]?1:-1})},[t]),i=o.reduce(function(a,l){var c=l[0],d=l[1];return n>=d?c:a},o[0][0]);return i}},Uz=jze;Ee();Ee();Ee();var qJe=J(ae());Ee();Ee();var Uze=Object.defineProperty,Kze=Object.defineProperties,Wze=Object.getOwnPropertyDescriptors,B$=Object.getOwnPropertySymbols,Bpe=Object.prototype.hasOwnProperty,zpe=Object.prototype.propertyIsEnumerable,Fpe=(t,e,n)=>e in t?Uze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,me=(t,e)=>{for(var n in e||(e={}))Bpe.call(e,n)&&Fpe(t,n,e[n]);if(B$)for(var n of B$(e))zpe.call(e,n)&&Fpe(t,n,e[n]);return t},Ne=(t,e)=>Kze(t,Wze(e)),ut=(t,e)=>{var n={};for(var r in t)Bpe.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&B$)for(var r of B$(t))e.indexOf(r)<0&&zpe.call(t,r)&&(n[r]=t[r]);return n};var Gze=Object.defineProperty,Yze=Object.defineProperties,Zze=Object.getOwnPropertyDescriptors,z$=Object.getOwnPropertySymbols,Hpe=Object.prototype.hasOwnProperty,jpe=Object.prototype.propertyIsEnumerable,Vpe=(t,e,n)=>e in t?Gze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Jt=(t,e)=>{for(var n in e||(e={}))Hpe.call(e,n)&&Vpe(t,n,e[n]);if(z$)for(var n of z$(e))jpe.call(e,n)&&Vpe(t,n,e[n]);return t},ir=(t,e)=>Yze(t,Zze(e)),V$=(t,e)=>{var n={};for(var r in t)Hpe.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&z$)for(var r of z$(t))e.indexOf(r)<0&&jpe.call(t,r)&&(n[r]=t[r]);return n};function mv(...t){}function n3(t,e){if(qze(t)){let n=Jze(e)?e():e;return t(n)}return t}function qze(t){return typeof t=="function"}function Jze(t){return typeof t=="function"}function cs(t,e){return typeof Object.hasOwn=="function"?Object.hasOwn(t,e):Object.prototype.hasOwnProperty.call(t,e)}function Hr(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}function Kz(t){return t.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function Wz(t,e){let n=Jt({},t);for(let r of e)cs(n,r)&&delete n[r];return n}function Gz(t,e){let n={};for(let r of e)cs(t,r)&&(n[r]=t[r]);return n}function r3(t){return t}function tn(t,e){if(!t)throw typeof e!="string"?new Error("Invariant failed"):new Error(e)}function Yz(t){return Object.keys(t)}function bd(t,...e){let n=typeof t=="function"?t(...e):t;return n==null?!1:!n}function sc(t){return t.disabled||t["aria-disabled"]===!0||t["aria-disabled"]==="true"}function ds(t){let e={};for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}function Zt(...t){for(let e of t)if(e!==void 0)return e}var Upe=J(ae(),1);function o3(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function Xze(t){return!t||!(0,Upe.isValidElement)(t)?!1:"ref"in t.props||"ref"in t}function Kpe(t){return Xze(t)?me({},t.props).ref||t.ref:null}function Wpe(t,e){let n=me({},t);for(let r in e){if(!cs(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]?me(me({},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]=(...a)=>{o(...a),i(...a)};continue}}n[r]=o}return n}var Ff=Qze();function Qze(){var t;return typeof window<"u"&&!!((t=window.document)!=null&&t.createElement)}function xn(t){return t?"self"in t?t.document:t.ownerDocument||document:document}function hv(t){return t?"self"in t?t.self:xn(t).defaultView||window:self}function hl(t,e=!1){let{activeElement:n}=xn(t);if(!n?.nodeName)return null;if(i3(n)&&n.contentDocument)return hl(n.contentDocument.body,e);if(e){let r=n.getAttribute("aria-activedescendant");if(r){let o=xn(n).getElementById(r);if(o)return o}}return n}function Bn(t,e){return t===e||t.contains(e)}function i3(t){return t.tagName==="IFRAME"}function Gs(t){let e=t.tagName.toLowerCase();return e==="button"?!0:e==="input"&&t.type?eVe.indexOf(t.type)!==-1:!1}var eVe=["button","color","file","image","reset","submit"];function a3(t){if(typeof t.checkVisibility=="function")return t.checkVisibility();let e=t;return e.offsetWidth>0||e.offsetHeight>0||t.getClientRects().length>0}function fs(t){try{let e=t instanceof HTMLInputElement&&t.selectionStart!==null,n=t.tagName==="TEXTAREA";return e||n||!1}catch{return!1}}function s3(t){return t.isContentEditable||fs(t)}function Zz(t){if(fs(t))return t.value;if(t.isContentEditable){let e=xn(t).createRange();return e.selectNodeContents(t),e.toString()}return""}function qz(t){let e=0,n=0;if(fs(t))e=t.selectionStart||0,n=t.selectionEnd||0;else if(t.isContentEditable){let r=xn(t).getSelection();if(r?.rangeCount&&r.anchorNode&&Bn(t,r.anchorNode)&&r.focusNode&&Bn(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 Nb(t,e){let n=["dialog","menu","listbox","tree","grid"],r=t?.getAttribute("role");return r&&n.indexOf(r)!==-1?r:e}function l3(t,e){var n;let r={menu:"menuitem",listbox:"option",tree:"treeitem"},o=Nb(t);return o&&(n=r[o])!=null?n:e}function H$(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 H$(t.parentElement)||document.scrollingElement||document.body}function u3(t,e){let n=t.map((o,i)=>[i,o]),r=!1;return n.sort(([o,i],[a,l])=>{let c=e(i),d=e(l);return c===d||!c||!d?0:tVe(c,d)?(o>a&&(r=!0),-1):(o<a&&(r=!0),1)}),r?n.map(([o,i])=>i):t}function tVe(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}function Gpe(){return Ff&&!!navigator.maxTouchPoints}function Lb(){return Ff?/mac|iphone|ipad|ipod/i.test(navigator.platform):!1}function gv(){return Ff&&Lb()&&/apple/i.test(navigator.vendor)}function Jz(){return Ff&&/firefox\//i.test(navigator.userAgent)}function Xz(){return Ff&&navigator.platform.startsWith("Mac")&&!Gpe()}function j$(t){return!!(t.currentTarget&&!Bn(t.currentTarget,t.target))}function Oi(t){return t.target===t.currentTarget}function Ype(t){let e=t.currentTarget;if(!e)return!1;let n=Lb();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 Zpe(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 qpe(t,e,n){let r=new Event(e,n);return t.dispatchEvent(r)}function vv(t,e){let n=new FocusEvent("blur",e),r=t.dispatchEvent(n),o=ir(Jt({},e),{bubbles:!0});return t.dispatchEvent(new FocusEvent("focusout",o)),r}function Jpe(t,e,n){let r=new KeyboardEvent(e,n);return t.dispatchEvent(r)}function Qz(t,e){let n=new MouseEvent("click",e);return t.dispatchEvent(n)}function qm(t,e){let n=e||t.currentTarget,r=t.relatedTarget;return!r||!Bn(n,r)}function Jm(t,e,n,r){let i=(l=>{if(r){let d=setTimeout(l,r);return()=>clearTimeout(d)}let c=requestAnimationFrame(l);return()=>cancelAnimationFrame(c)})(()=>{t.removeEventListener(e,a,!0),n()}),a=()=>{i(),n()};return t.addEventListener(e,a,{once:!0,capture:!0}),i}function no(t,e,n,r=window){let o=[];try{r.document.addEventListener(t,e,n);for(let a of Array.from(r.frames))o.push(no(t,e,n,a))}catch{}return()=>{try{r.document.removeEventListener(t,e,n)}catch{}for(let a of o)a()}}var ro=J(ae(),1),nVe=J(ae(),1),eV=me({},nVe),Xpe=eV.useId,wht=eV.useDeferredValue,Qpe=eV.useInsertionEffect,cn=Ff?ro.useLayoutEffect:ro.useEffect;function K$(t){let e=(0,ro.useRef)(t);return cn(()=>{e.current=t}),e}function vt(t){let e=(0,ro.useRef)(()=>{throw new Error("Cannot call an event handler while rendering.")});return Qpe?Qpe(()=>{e.current=t}):e.current=t,(0,ro.useCallback)((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function nme(t){let[e,n]=(0,ro.useState)(null);return cn(()=>{if(e==null||!t)return;let r=null;return t(o=>(r=o,e)),()=>{t(r)}},[e,t]),[e,n]}function sn(...t){return(0,ro.useMemo)(()=>{if(t.some(Boolean))return e=>{for(let n of t)o3(n,e)}},t)}function lu(t){if(Xpe){let r=Xpe();return t||r}let[e,n]=(0,ro.useState)(t);return cn(()=>{if(t||e)return;let r=Math.random().toString(36).slice(2,8);n(`id-${r}`)},[t,e]),t||e}function W$(t,e){let n=i=>{if(typeof i=="string")return i},[r,o]=(0,ro.useState)(()=>n(e));return cn(()=>{let i=t&&"current"in t?t.current:t;o(i?.tagName.toLowerCase()||n(e))},[t,e]),r}function Xm(t,e){let n=(0,ro.useRef)(!1);(0,ro.useEffect)(()=>{if(n.current)return t();n.current=!0},e),(0,ro.useEffect)(()=>()=>{n.current=!1},[])}function rme(){return(0,ro.useReducer)(()=>[],[])}function Lo(t){return vt(typeof t=="function"?t:()=>t)}function dr(t,e,n=[]){let r=(0,ro.useCallback)(o=>(t.wrapElement&&(o=t.wrapElement(o)),e(o)),[...n,t.wrapElement]);return Ne(me({},t),{wrapElement:r})}function Mb(t=!1,e){let[n,r]=(0,ro.useState)(null);return{portalRef:sn(r,e),portalNode:n,domReady:!t||n}}function G$(t,e,n){let r=t.onLoadedMetadataCapture,o=(0,ro.useMemo)(()=>Object.assign(()=>{},Ne(me({},r),{[e]:n})),[r,e,n]);return[r?.[e],{onLoadedMetadataCapture:o}]}function Ob(){return(0,ro.useEffect)(()=>{no("mousemove",oVe,!0),no("mousedown",U$,!0),no("mouseup",U$,!0),no("keydown",U$,!0),no("scroll",U$,!0)},[]),vt(()=>tV)}var tV=!1,eme=0,tme=0;function rVe(t){let e=t.movementX||t.screenX-eme,n=t.movementY||t.screenY-tme;return eme=t.screenX,tme=t.screenY,e||n||process.env.NODE_ENV==="test"}function oVe(t){rVe(t)&&(tV=!0)}function U$(){tV=!1}var ps=J(ae(),1),yv=J(So(),1);function st(t){let e=ps.forwardRef((n,r)=>t(Ne(me({},n),{ref:r})));return e.displayName=t.displayName||t.name,e}function Rb(t,e){return ps.memo(t,e)}function ct(t,e){let n=e,{wrapElement:r,render:o}=n,i=ut(n,["wrapElement","render"]),a=sn(e.ref,Kpe(o)),l;if(ps.isValidElement(o)){let c=Ne(me({},o.props),{ref:a});l=ps.cloneElement(o,Wpe(i,c))}else o?l=o(i):l=(0,yv.jsx)(t,me({},i));return r?r(l):l}function ft(t){let e=(n={})=>t(n);return e.displayName=t.name,e}function Ho(t=[],e=[]){let n=ps.createContext(void 0),r=ps.createContext(void 0),o=()=>ps.useContext(n),i=(d=!1)=>{let f=ps.useContext(r),m=o();return d?f:f||m},a=()=>{let d=ps.useContext(r),f=o();if(!(d&&d===f))return f},l=d=>t.reduceRight((f,m)=>(0,yv.jsx)(m,Ne(me({},d),{children:f})),(0,yv.jsx)(n.Provider,me({},d)));return{context:n,scopedContext:r,useContext:o,useScopedContext:i,useProviderContext:a,ContextProvider:l,ScopedContextProvider:d=>(0,yv.jsx)(l,Ne(me({},d),{children:e.reduceRight((f,m)=>(0,yv.jsx)(m,Ne(me({},d),{children:f})),(0,yv.jsx)(r.Provider,me({},d)))}))}}var c3=Ho(),ome=c3.useContext,Lht=c3.useScopedContext,Mht=c3.useProviderContext,ime=c3.ContextProvider,ame=c3.ScopedContextProvider;var nV=J(ae(),1),d3=Ho([ime],[ame]),Ab=d3.useContext,kht=d3.useScopedContext,sme=d3.useProviderContext,Qm=d3.ContextProvider,kb=d3.ScopedContextProvider,lme=(0,nV.createContext)(void 0),ume=(0,nV.createContext)(void 0);function bv(t,e){let n=t.__unstableInternals;return tn(n,"Invalid store"),n[e]}function Mo(t,...e){let n=t,r=n,o=Symbol(),i=mv,a=new Set,l=new Set,c=new Set,d=new Set,f=new Set,m=new WeakMap,h=new WeakMap,g=M=>(c.add(M),()=>c.delete(M)),y=()=>{let M=a.size,A=Symbol();a.add(A);let k=()=>{a.delete(A),!a.size&&i()};if(M)return k;let F=Yz(n).map(H=>Hr(...e.map(j=>{var Y;let K=(Y=j?.getState)==null?void 0:Y.call(j);if(K&&cs(K,H))return ci(j,[H],Z=>{$(H,Z[H],!0)})}))),U=[];for(let H of c)U.push(H());let B=e.map(Pb);return i=Hr(...F,...U,...B),k},b=(M,A,k=d)=>(k.add(A),h.set(A,M),()=>{var F;(F=m.get(A))==null||F(),m.delete(A),h.delete(A),k.delete(A)}),C=(M,A)=>b(M,A),S=(M,A)=>(m.set(A,A(n,n)),b(M,A)),w=(M,A)=>(m.set(A,A(n,r)),b(M,A,f)),E=M=>Mo(Gz(n,M),O),_=M=>Mo(Wz(n,M),O),N=()=>n,$=(M,A,k=!1)=>{var F;if(!cs(n,M))return;let U=n3(A,n[M]);if(U===n[M])return;if(!k)for(let Y of e)(F=Y?.setState)==null||F.call(Y,M,U);let B=n;n=ir(Jt({},n),{[M]:U});let H=Symbol();o=H,l.add(M);let j=(Y,K,Z)=>{var X;let se=h.get(Y),de=ye=>Z?Z.has(ye):ye===M;(!se||se.some(de))&&((X=m.get(Y))==null||X(),m.set(Y,Y(n,K)))};for(let Y of d)j(Y,B);queueMicrotask(()=>{if(o!==H)return;let Y=n;for(let K of f)j(K,r,l);r=Y,l.clear()})},O={getState:N,setState:$,__unstableInternals:{setup:g,init:y,subscribe:C,sync:S,batch:w,pick:E,omit:_}};return O}function Ys(t,...e){if(t)return bv(t,"setup")(...e)}function Pb(t,...e){if(t)return bv(t,"init")(...e)}function Ib(t,...e){if(t)return bv(t,"subscribe")(...e)}function ci(t,...e){if(t)return bv(t,"sync")(...e)}function Fb(t,...e){if(t)return bv(t,"batch")(...e)}function xv(t,...e){if(t)return bv(t,"omit")(...e)}function rV(t,...e){if(t)return bv(t,"pick")(...e)}function Cv(...t){let e=t.reduce((r,o)=>{var i;let a=(i=o?.getState)==null?void 0:i.call(o);return a?Object.assign(r,a):r},{}),n=Mo(e,...t);return Object.assign({},...t,n)}function Bf(t,e){if(process.env.NODE_ENV==="production"||!e)return;let n=Object.entries(t).filter(([i,a])=>i.startsWith("default")&&a!==void 0).map(([i])=>{var a;let l=i.replace("default","");return`${((a=l[0])==null?void 0:a.toLowerCase())||""}${l.slice(1)}`});if(!n.length)return;let r=e.getState();if(n.filter(i=>cs(r,i)).length)throw new Error(`Passing a store prop in conjunction with a default state is not supported.
236
+ See https://reactjs.org/docs/forms.html#controlled-components`),X=K.initialPage?K.initialPage:K.forcePage?K.forcePage:0,Z.state={selected:X},Z}return F=Y,(U=[{key:"componentDidMount",value:function(){var K=this.props,Z=K.initialPage,X=K.disableInitialCallback,se=K.extraAriaContext,de=K.pageCount,ye=K.forcePage;Z===void 0||X||this.callCallback(Z),se&&console.warn("DEPRECATED (react-paginate): The extraAriaContext prop is deprecated. You should now use the ariaLabelBuilder instead."),Number.isInteger(de)||console.warn("(react-paginate): The pageCount prop value provided is not an integer (".concat(de,"). Did you forget a Math.ceil()?")),Z!==void 0&&Z>de-1&&console.warn("(react-paginate): The initialPage prop provided is greater than the maximum page index from pageCount prop (".concat(Z," > ").concat(de-1,").")),ye!==void 0&&ye>de-1&&console.warn("(react-paginate): The forcePage prop provided is greater than the maximum page index from pageCount prop (".concat(ye," > ").concat(de-1,")."))}},{key:"componentDidUpdate",value:function(K){this.props.forcePage!==void 0&&this.props.forcePage!==K.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(K.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 K=this.state.selected,Z=this.props,X=Z.pageCount,se=K+Z.pageRangeDisplayed;return se>=X?X-1:se}},{key:"getBackwardJump",value:function(){var K=this.state.selected-this.props.pageRangeDisplayed;return K<0?0:K}},{key:"getElementHref",value:function(K){var Z=this.props,X=Z.hrefBuilder,se=Z.pageCount,de=Z.hrefAllControls;if(X)return de||K>=0&&K<se?X(K+1,se,this.state.selected):void 0}},{key:"ariaLabelBuilder",value:function(K){var Z=K===this.state.selected;if(this.props.ariaLabelBuilder&&K>=0&&K<this.props.pageCount){var X=this.props.ariaLabelBuilder(K+1,Z);return this.props.extraAriaContext&&!Z&&(X=X+" "+this.props.extraAriaContext),X}}},{key:"getPageElement",value:function(K){var Z=this.state.selected,X=this.props,se=X.pageClassName,de=X.pageLinkClassName,ye=X.activeClassName,Fe=X.activeLinkClassName,Ge=X.extraAriaContext,lt=X.pageLabelBuilder;return a().createElement(m,{key:K,pageSelectedHandler:this.handlePageSelected.bind(null,K),selected:Z===K,rel:this.getElementPageRel(K),pageClassName:se,pageLinkClassName:de,activeClassName:ye,activeLinkClassName:Fe,extraAriaContext:Ge,href:this.getElementHref(K),ariaLabel:this.ariaLabelBuilder(K),page:K+1,pageLabelBuilder:lt,getEventListener:this.getEventListener})}},{key:"render",value:function(){var K=this.props.renderOnZeroPageCount;if(this.props.pageCount===0&&K!==void 0)return K&&K(this.props);var Z=this.props,X=Z.disabledClassName,se=Z.disabledLinkClassName,de=Z.pageCount,ye=Z.className,Fe=Z.containerClassName,Ge=Z.previousLabel,lt=Z.previousClassName,xt=Z.previousLinkClassName,we=Z.previousAriaLabel,Pe=Z.prevRel,Je=Z.nextLabel,yt=Z.nextClassName,rn=Z.nextLinkClassName,$e=Z.nextAriaLabel,Ct=Z.nextRel,Wt=this.state.selected,Ht=Wt===0,jt=Wt===de-1,Xn="".concat(b(lt)).concat(Ht?" ".concat(b(X)):""),ke="".concat(b(yt)).concat(jt?" ".concat(b(X)):""),bt="".concat(b(xt)).concat(Ht?" ".concat(b(se)):""),Sn="".concat(b(rn)).concat(jt?" ".concat(b(se)):""),Gt=Ht?"true":"false",sr=jt?"true":"false";return a().createElement("ul",{className:ye||Fe,role:"navigation","aria-label":"Pagination"},a().createElement("li",{className:Xn},a().createElement("a",S({className:bt,href:this.getElementHref(Wt-1),tabIndex:Ht?"-1":"0",role:"button",onKeyPress:this.handlePreviousPage,"aria-disabled":Gt,"aria-label":we,rel:Pe},this.getEventListener(this.handlePreviousPage)),Ge)),this.pagination(),a().createElement("li",{className:ke},a().createElement("a",S({className:Sn,href:this.getElementHref(Wt+1),tabIndex:jt?"-1":"0",role:"button",onKeyPress:this.handleNextPage,"aria-disabled":sr,"aria-label":$e,rel:Ct},this.getEventListener(this.handleNextPage)),Je)))}}])&&w(F.prototype,U),Object.defineProperty(F,"prototype",{writable:!1}),Y}(i.Component);O(M,"propTypes",{pageCount:c().number.isRequired,pageRangeDisplayed:c().number,marginPagesDisplayed:c().number,previousLabel:c().node,previousAriaLabel:c().string,prevPageRel:c().string,prevRel:c().string,nextLabel:c().node,nextAriaLabel:c().string,nextPageRel:c().string,nextRel:c().string,breakLabel:c().oneOfType([c().string,c().node]),breakAriaLabels:c().shape({forward:c().string,backward:c().string}),hrefBuilder:c().func,hrefAllControls:c().bool,onPageChange:c().func,onPageActive:c().func,onClick:c().func,initialPage:c().number,forcePage:c().number,disableInitialCallback:c().bool,containerClassName:c().string,className:c().string,pageClassName:c().string,pageLinkClassName:c().string,pageLabelBuilder:c().func,activeClassName:c().string,activeLinkClassName:c().string,previousClassName:c().string,nextClassName:c().string,previousLinkClassName:c().string,nextLinkClassName:c().string,disabledClassName:c().string,disabledLinkClassName:c().string,breakClassName:c().string,breakLinkClassName:c().string,extraAriaContext:c().string,ariaLabelBuilder:c().func,eventListener:c().string,renderOnZeroPageCount:c().func,selectedPageRel:c().string}),O(M,"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(k){return k},eventListener:"onClick",renderOnZeroPageCount:void 0,selectedPageRel:"canonical",hrefAllControls:!1});let A=M})(),o})())});var JSe=rt((izt,qSe)=>{"use strict";var Xnt=Object.prototype.hasOwnProperty,Qnt=Object.prototype.toString;qSe.exports=function(e,n,r){if(Qnt.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 a in e)Xnt.call(e,a)&&n.call(r,e[a],a,e)}});var bZ=rt((azt,XSe)=>{"use strict";var ert=JSe();XSe.exports=Sr;function Sr(t,e,n){if(arguments.length===3)return Sr.set(t,e,n);if(arguments.length===2)return Sr.get(t,e);var r=Sr.bind(Sr,t);for(var o in Sr)Sr.hasOwnProperty(o)&&(r[o]=Sr[o].bind(r,t));return r}Sr.get=function(e,n){for(var r=Array.isArray(n)?n:Sr.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};Sr.set=function(e,n,r){var o=Array.isArray(n)?n:Sr.parse(n),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]=r,this};Sr.remove=function(t,e){var n=Array.isArray(e)?e:Sr.parse(e),r=n[n.length-1];if(r===void 0)throw new Error('Invalid JSON pointer for remove: "'+e+'"');var o=Sr.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]};Sr.dict=function(e,n){var r={};return Sr.walk(e,function(o,i){r[i]=o},n),r};Sr.walk=function(e,n,r){var o=[];r=r||function(i){var a=Object.prototype.toString.call(i);return a==="[object Object]"||a==="[object Array]"},function i(a){ert(a,function(l,c){o.push(String(c)),r(l)?i(l):n(l,Sr.compile(o)),o.pop()})}(e)};Sr.has=function(e,n){try{Sr.get(e,n)}catch{return!1}return!0};Sr.escape=function(e){return e.toString().replace(/~/g,"~0").replace(/\//g,"~1")};Sr.unescape=function(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")};Sr.parse=function(e){if(e==="")return[];if(e.charAt(0)!=="/")throw new Error("Invalid JSON pointer: "+e);return e.substring(1).split(/\//).map(Sr.unescape)};Sr.compile=function(e){return e.length===0?"":"/"+e.map(Sr.escape).join("/")}});var e4e=rt((szt,QSe)=>{"use strict";QSe.exports=trt;function dC(t){return t instanceof Buffer?Buffer.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function trt(t){if(t=t||{},t.circles)return nrt(t);let e=new Map;if(e.set(Date,a=>new Date(a)),e.set(Map,(a,l)=>new Map(r(Array.from(a),l))),e.set(Set,(a,l)=>new Set(r(Array.from(a),l))),t.constructorHandlers)for(let a of t.constructorHandlers)e.set(a[0],a[1]);let n=null;return t.proto?i:o;function r(a,l){let c=Object.keys(a),d=new Array(c.length);for(let f=0;f<c.length;f++){let m=c[f],h=a[m];typeof h!="object"||h===null?d[m]=h:h.constructor!==Object&&(n=e.get(h.constructor))?d[m]=n(h,l):ArrayBuffer.isView(h)?d[m]=dC(h):d[m]=l(h)}return d}function o(a){if(typeof a!="object"||a===null)return a;if(Array.isArray(a))return r(a,o);if(a.constructor!==Object&&(n=e.get(a.constructor)))return n(a,o);let l={};for(let c in a){if(Object.hasOwnProperty.call(a,c)===!1)continue;let d=a[c];typeof d!="object"||d===null?l[c]=d:d.constructor!==Object&&(n=e.get(d.constructor))?l[c]=n(d,o):ArrayBuffer.isView(d)?l[c]=dC(d):l[c]=o(d)}return l}function i(a){if(typeof a!="object"||a===null)return a;if(Array.isArray(a))return r(a,i);if(a.constructor!==Object&&(n=e.get(a.constructor)))return n(a,i);let l={};for(let c in a){let d=a[c];typeof d!="object"||d===null?l[c]=d:d.constructor!==Object&&(n=e.get(d.constructor))?l[c]=n(d,i):ArrayBuffer.isView(d)?l[c]=dC(d):l[c]=i(d)}return l}}function nrt(t){let e=[],n=[],r=new Map;if(r.set(Date,c=>new Date(c)),r.set(Map,(c,d)=>new Map(i(Array.from(c),d))),r.set(Set,(c,d)=>new Set(i(Array.from(c),d))),t.constructorHandlers)for(let c of t.constructorHandlers)r.set(c[0],c[1]);let o=null;return t.proto?l:a;function i(c,d){let f=Object.keys(c),m=new Array(f.length);for(let h=0;h<f.length;h++){let g=f[h],y=c[g];if(typeof y!="object"||y===null)m[g]=y;else if(y.constructor!==Object&&(o=r.get(y.constructor)))m[g]=o(y,d);else if(ArrayBuffer.isView(y))m[g]=dC(y);else{let b=e.indexOf(y);b!==-1?m[g]=n[b]:m[g]=d(y)}}return m}function a(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return i(c,a);if(c.constructor!==Object&&(o=r.get(c.constructor)))return o(c,a);let d={};e.push(c),n.push(d);for(let f in c){if(Object.hasOwnProperty.call(c,f)===!1)continue;let m=c[f];if(typeof m!="object"||m===null)d[f]=m;else if(m.constructor!==Object&&(o=r.get(m.constructor)))d[f]=o(m,a);else if(ArrayBuffer.isView(m))d[f]=dC(m);else{let h=e.indexOf(m);h!==-1?d[f]=n[h]:d[f]=a(m)}}return e.pop(),n.pop(),d}function l(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return i(c,l);if(c.constructor!==Object&&(o=r.get(c.constructor)))return o(c,l);let d={};e.push(c),n.push(d);for(let f in c){let m=c[f];if(typeof m!="object"||m===null)d[f]=m;else if(m.constructor!==Object&&(o=r.get(m.constructor)))d[f]=o(m,l);else if(ArrayBuffer.isView(m))d[f]=dC(m);else{let h=e.indexOf(m);h!==-1?d[f]=n[h]:d[f]=l(m)}}return e.pop(),n.pop(),d}}});var r4e=rt((bzt,n4e)=>{"use strict";var SZ=class{constructor(e){this.value=e,this.next=void 0}},wZ=class{constructor(){this.clear()}enqueue(e){let n=new SZ(e);this._head?(this._tail.next=n,this._tail=n):(this._head=n,this._tail=n),this._size++}dequeue(){let e=this._head;if(e)return this._head=this._head.next,this._size--,e.value}clear(){this._head=void 0,this._tail=void 0,this._size=0}get size(){return this._size}*[Symbol.iterator](){let e=this._head;for(;e;)yield e.value,e=e.next}};n4e.exports=wZ});var i4e=rt((xzt,o4e)=>{"use strict";var art=r4e(),srt=t=>{if(!((Number.isInteger(t)||t===1/0)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=new art,n=0,r=()=>{n--,e.size>0&&e.dequeue()()},o=async(l,c,...d)=>{n++;let f=(async()=>l(...d))();c(f);try{await f}catch{}r()},i=(l,c,...d)=>{e.enqueue(o.bind(null,l,c,...d)),(async()=>(await Promise.resolve(),n<t&&e.size>0&&e.dequeue()()))()},a=(l,...c)=>new Promise(d=>{i(l,d,...c)});return Object.defineProperties(a,{activeCount:{get:()=>n},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),a};o4e.exports=srt});import{McpServer as Uit}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as Kit}from"@modelcontextprotocol/sdk/server/stdio.js";import{CanvasClient as yNe}from"@uniformdev/canvas";import{z as Bte}from"zod";var Ate=process.env.UNIFORM_API_KEY,Dk=process.env.UNIFORM_PROJECT_ID,Rte=process.env.UNIFORM_API_HOST??"https://uniform.app",eNe=process.env.UNIFORM_AI_API_HOST??"https://ai.uniform.global";if(!Ate&&process.env.NODE_ENV!=="test")throw new Error("UNIFORM_API_KEY is not set");if(!Dk&&process.env.NODE_ENV!=="test")throw new Error("UNIFORM_PROJECT_ID is not set");var pt={apiHost:Rte,apiKey:Ate,projectId:Dk,aiApiHost:eNe,baseWebUrl:`${Rte}/projects/${Dk}`};import tNe from"fast-json-patch";function V_(t,e){return tNe.applyPatch(t,e).newDocument}import{z as vS}from"zod";var H_=vS.array(vS.object({op:vS.enum(["add","remove","replace"]),path:vS.string().describe("The JSON path to patch"),value:vS.unknown().describe("The value to patch - for remove, leave this blank")}));function nNe(t){return Array.isArray(t)&&t.length>0}function kte(t){return!!t&&typeof t=="object"&&"type"in t}function Pte(t){return typeof t=="object"&&t!==null&&"root"in t&&kte(t.root)}function Ng(t){return"children"in t&&nNe(t.children)}var rNe=({context:t,renderChildren:e})=>Ng(t.currentNode)?`${e(t.currentNode.children)} `:"";var oNe=({context:t,renderChildren:e})=>{if(!Ng(t.currentNode))return"";let n=e(t.currentNode.children);return n.endsWith(" ")?n:`${n} `};var iNe=({context:t,renderChildren:e})=>Ng(t.currentNode)?`${e(t.currentNode.children)} `:"";var aNe=({context:t,renderChildren:e})=>Ng(t.currentNode)?`${e(t.currentNode.children)} `:"";var sNe=({context:t,renderChildren:e})=>Ng(t.currentNode)?`${e(t.currentNode.children)} `:"";var lNe=({context:t,renderChildren:e})=>Ng(t.currentNode)?`${e(t.currentNode.children)} `:"";var uNe=({context:t})=>t.currentNode.text;var cNe=()=>" ";var dNe=()=>" ",fNe=new Map([["text",uNe],["tab",cNe],["linebreak",dNe],["paragraph",iNe],["listitem",oNe],["heading",rNe],["table",aNe],["tablecell",sNe],["tablerow",lNe]]),pNe=t=>{let e=fNe.get(t.currentNode.type);return e||(({context:n,renderChildren:r})=>Ng(n.currentNode)?r(n.currentNode.children):"")};function mNe(t,e){let n=[];return e?.ancestorNodes&&(n=n.concat(e.ancestorNodes)),e?.currentNode&&n.unshift(e.currentNode),{...e??{},currentNode:t,ancestorNodes:n}}function $k(t,e){var n;if(!kte(t))return"";let r=mNe(t,e),o=(n=r.resolveRenderer)==null?void 0:n.call(r,r);if(typeof o>"u")o=pNe(r);else if(o===null)return"";let i=a=>hNe(a,r);if(o){let a=o({context:r,renderChildren:i});return r.ancestorNodes.length>0?a:a.trim()}else throw new Error(`There is no renderer for node type: ${r.currentNode.type}`)}function hNe(t,e){return Array.isArray(t)?t.map(n=>$k(n,e)).join(""):""}var gNe=[{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"}],vNe=[{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 j_={required:!1,formatting:{builtIn:vNe.map(t=>t.type)},elements:{builtIn:gNe.map(t=>t.type)},elementsConfig:{asset:{allowedTypes:["image"]}}};import{z as Ja}from"zod";import{z as so}from"zod";var U_=so.object({name:so.string().describe('Title-cased display name. Ex: "Headline"'),id:so.string().describe("The public ID. Must be unique within the current entity fields/parameters."),type:so.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:so.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:so.boolean().describe("Whether values are stored as locale-specific"),typeConfig:so.object({allowedTypes:so.array(so.enum(["image","video","audio","other"])).optional().describe("The types of asset allowed. ONLY applies when type=asset, omit for other types"),options:so.array(so.object({text:so.string().describe("The text to display to the author"),value:so.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:so.boolean().optional().describe("Whether an author must enter a value for this property"),min:so.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:so.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:so.array(so.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:so.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:so.array(so.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:so.boolean().optional().describe("When type=group, this is whether the group is collapsed by default."),schema:so.any().describe("When type=json, this is an optional JSON schema the property value must follow. Omit for all other types.")}).optional()});var Ite=Ja.object({name:Ja.string().describe('Title-cased display name of the component. Ex: "Hero"'),id:Ja.string().describe("Public ID of the component, the camelCase version of name, using only alphanumeric characters"),description:Ja.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:Ja.boolean().describe("True if the component can have pages/compositions created from it. False if it is a part of a page."),parameters:Ja.array(U_).describe("The properties of the component. The key is the publicId of the property.").optional(),slots:Ja.array(Ja.object({name:Ja.string().describe('Title-cased display name of the slot. Ex: "Content"'),id:Ja.string().describe("The public id of the slot. Must be unique within this component's slots."),allowedComponents:Ja.array(Ja.string()).describe("The components public IDs allowed in the slot."),minComponents:Ja.number().describe("The minimum number of components allowed in the slot. Omit for no minimum.").min(0).optional(),maxComponents:Ja.number().describe("The maximum number of components allowed in the slot. Omit for no maximum.").min(1).optional(),inheritAllowedComponents:Ja.boolean().describe("Set to false")})).describe("The slots of the component. The key is the publicId of the slot.").optional()});function Fte(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 Sy(t){let e=t.filter(r=>r.type==="group")??[];if(e.length===0)return!1;let n=!1;for(;e.length>0;){let r=e.shift(),o=r.typeConfig&&typeof r.typeConfig=="object"&&"childrenParams"in r.typeConfig&&Array.isArray(r.typeConfig.childrenParams)?r.typeConfig.childrenParams:[],i=new Set(o),a=t.findIndex(c=>c.id===r.id),l=i.size;for(let c=a+1;c<=a+l;c++){let d=t[c];if(d)if(i.has(d.id))i.delete(d.id);else break}if(i.size>0){let c=Array.from(i),d=a+l-i.size;for(let f of c){let m=t.findIndex(h=>h.id===f);if(m!==-1){let[h]=t.splice(m,1);m>d&&d++,t.splice(d,0,h)}else o.splice(o.indexOf(f),1)}n=!0}}return n}function K_(t){return`${pt.baseWebUrl}/dashboards/canvas/components/${t}`}function wy(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=j_;continue}r.typeConfig={...j_,required:r.typeConfig.required??j_.required}}}var bNe={action:Bte.enum(["create","update","delete"]).describe("The action to perform"),publicId:Bte.string().describe("Public ID of the component, the camelCase version of name, using only alphanumeric characters"),component:Ite.describe("Full component definition to create. Omit for update or delete.").optional(),patches:H_.describe("JSON patch to apply to the existing component definition. Omit for create or delete.").optional()};function zte(t){t.tool("componentAction","Creates, updates, or deletes a Uniform Component definition (or Composition definition)",bNe,async({publicId:e,action:n,component:r,patches:o})=>{let i=new yNe(pt),a=!1;if(n==="create"){if(!r)throw new Error("Component definition is required for create");let l=Fte(r);l.parameters&&(a=Sy(l.parameters),wy(l.parameters)),await i.updateComponentDefinition({componentDefinition:l})}if(n==="update"){if(!o)throw new Error("Patches are required for update");let l=await i.getComponentDefinitions({componentId:e});if(!l.componentDefinitions.length)throw new Error(`Component with public ID ${e} does not exist, try creating it instead`);let c=l.componentDefinitions[0],d=c.parameters?.filter(m=>m.type==="richText").map(m=>m.id),f=V_(c,o);if(f.parameters){a=Sy(f.parameters);let m=f.parameters?.filter(h=>h.type==="richText").map(h=>h.id).filter(h=>!d?.includes(h));wy(f.parameters,m)}await i.updateComponentDefinition({componentDefinition:f})}return n==="delete"&&await i.removeComponentDefinition({componentId:e}),{content:[{type:"text",text:JSON.stringify({success:!0,editUrl:K_(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 Vte}from"@uniformdev/canvas";import{z as xNe}from"zod";var CNe={id:xNe.string()};function Hte(t){t.tool("componentList","Lists all Uniform Component definitions",async()=>{let r=(await new Vte(pt).getComponentDefinitions({includeSystem:!0})).componentDefinitions.map(o=>({id:o.id,name:o.name,type:o.canBeComposition?"composition":"component",description:o.description,editUrl:K_(o.id)}));return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}),t.tool("componentGet","Gets a Uniform Component definition details (slots, parameters, etc.)",CNe,async({id:e})=>{let r=await new Vte(pt).getComponentDefinitions({componentId:e,includeSystem:!0});return{content:[{type:"text",text:JSON.stringify(r.componentDefinitions[0],null,2)}]}})}import{z as pn}from"zod";var SNe=pn.object({parentComponentId:pn.string().describe("ID of the component the slot belongs to"),slotName:pn.string().describe("Public ID of the target slot"),slotIndex:pn.number().describe("Index to insert the new component at. Omit for append.").optional(),newComponentInstanceUuid:pn.string().uuid().describe("ID of the new component to create - generate a random unique UUID"),instanceType:pn.enum(["component","componentPattern"]),componentType:pn.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:pn.string().describe("UUID of the component pattern definition to insert. Component pattern must be registered with Uniform. Omit when inserting a component instance.").optional()}),W_=pn.object({componentId:pn.string().describe("ID of the component the parameter belongs to - can be created in the same call to this tool"),parameterId:pn.string().describe("Public ID of the parameter to update. Must be defined in the component type of the parent componentId"),parameterType:pn.string().describe("The type of the parameterId as defined on the component definition"),locale:pn.string().describe("Locale of the parameter value. Omit for non-localized values.").optional(),editInstructions:pn.string().describe("Prompt that will be used to generate the parameter value. Omission will leave the value unchanged.").optional()}).describe("A value change to a parameter. Omit unchanged parameters."),G_=pn.object({newComponentsInSlots:pn.array(SNe).describe("New components to insert in slots. Omit for delete. Performed before deleting, moving or duplicating components, and parameter updates.").optional(),deletedComponentsInSlots:pn.array(pn.string().describe("Component ID to remove. Cannot be the pattern root component.")).describe("Components to delete from slots during an update. Omit for create or delete, or if nothing needs deleting. These are performed before moving or duplicating components, and parameter updates.").optional(),moveComponentsInSlots:pn.array(pn.object({componentId:pn.string().describe("Component ID to move. Cannot be root component."),newParentComponentId:pn.string(),newSlotName:pn.string(),newSlotIndex:pn.number()})).describe("Components to move between slots. Omit for create or delete, or if nothing needs moving. These are performed before duplicating components, and parameter updates.").optional(),duplicateComponentsInSlots:pn.array(pn.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("Components to duplicate/copy. Omit when empty. These are performed before parameter updates.").optional()}),tm=pn.object({enableLocales:pn.array(pn.string()).describe("Locales to enable. Omit for no change.").optional(),disableLocales:pn.array(pn.string()).describe("Locales to disable. Existing data in disabled locales will be lost. Omit for no change.").optional()}),wNe=pn.object({summary:pn.string().describe("Short summary of the edit that was made.").optional(),success:pn.boolean()}),Tat=pn.object({success:pn.boolean().describe("Whether all actions were successful"),actionsTaken:pn.array(wNe).describe("Array of individual actions that were taken")});import{z as yS}from"zod";var ENe=W_.extend({overridable:yS.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()}),jte=G_.extend({name:yS.string().describe("Name of the pattern. If the name does not need to be changed, omit this field. Always include for creates.").optional(),type:yS.string().describe("Component definition type of the pattern. Must be registered with Uniform. Always include for creates. Omit otherwise.").optional(),description:yS.string().describe("Description of the pattern for authors. If the description does not need to be changed, omit this field.").optional(),parameterUpdates:yS.array(ENe).describe("Updates to the parameters of the pattern. Use empty array if no changes are needed.").optional(),localeUpdates:tm.optional()}).describe("Modification instructions for the pattern");import{z as Y_}from"zod";var Ute=Y_.object({...G_.shape,name:Y_.string().describe("Name of the composition. If the name does not need to be changed, omit this field. Always include for creates.").optional(),type:Y_.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:Y_.array(W_).describe("Updates to the parameters of the pattern. Use empty array if no changes are needed.").optional(),localeUpdates:tm.optional()}).describe("Modification instructions for the composition");import{z as Ey}from"zod";import{z as pf}from"zod";var Nk=pf.object({fieldId:pf.string().describe("Public ID of the field to update. Must be defined in the content type of the parent entry."),fieldType:pf.string().describe("The type of the fieldId as defined on the content type"),locale:pf.string().describe("Locale of the field value. Omit for non-localized values.").optional(),editInstructions:pf.string().describe("Prompt that will be used to generate the field value. Setting this to an empty string will clear or remove any existing value. Omission will leave the value unchanged.").optional()}).describe("A value change to a field. Omit unchanged fields."),Kte=pf.object({type:pf.string().describe("Content type of the entry. Must be registered with Uniform. Always include for creates. Omit otherwise.").optional(),slug:pf.string().describe("Slug (human-readable identifier) of the entry. If the slug does not need to be changed, omit this field.").optional(),fieldUpdates:pf.array(Nk).describe("Updates to the fields of the entry. Use empty array if no changes are needed.").optional(),localeUpdates:tm.optional()}).describe("Modification instructions for the entry");var TNe=Nk.extend({overridable:Ey.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()}),Wte=Ey.object({name:Ey.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:Ey.string().describe("Content type of the entry pattern. Must be registered with Uniform. Always include for creates. Omit otherwise.").optional(),description:Ey.string().describe("Description of the entry pattern for authors. If the description does not need to be changed, omit this field.").optional(),fieldUpdates:Ey.array(TNe).describe("Updates to the fields of the entry pattern. Use empty array if no changes are needed.").optional(),localeUpdates:tm.optional()}).describe("Modification instructions for the entry pattern");import{z as PZ}from"zod";import{getEffectivePropertyValue as Znt}from"@uniformdev/canvas";var _Ne="$p:";function Gte(t){return`${_Ne}${t}`}function Yte(t){return{...t,allowedComponentsIndex:new Set(t?.allowedComponents??[]),maxComponents:t?.maxComponents??Number.MAX_VALUE,minComponents:t?.minComponents??0,allowAllPatternsOfAllowedTypes:!t?.patternsInAllowedComponents}}import{CANVAS_LOCALIZATION_SLOT as jat,CANVAS_LOCALIZATION_TYPE as Uat,CANVAS_PERSONALIZATION_ALGORITHM_PARAM as Kat,CANVAS_PERSONALIZATION_EVENT_NAME_PARAM as Wat,CANVAS_PERSONALIZATION_TAKE_PARAM as Gat,CANVAS_PERSONALIZE_SLOT as Yat,CANVAS_PERSONALIZE_TYPE as Zat,CANVAS_SLOT_SECTION_SLOT as qat,CANVAS_SLOT_SECTION_TYPE as Jat,CANVAS_TEST_SLOT as Xat,CANVAS_TEST_TYPE as Qat}from"@uniformdev/canvas";var DNe={$personalization:{isNestableIntoItself:!0},$test:void 0,$localization:void 0,$loop:void 0,$slotSection:{isAutoAllowed:!0,isNestableIntoItself:!0,isOnlyAllowedInPatternEditor:!0}},Zte=t=>DNe[t];function Lk(t,e,n=!1){let r=Zte(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(Gte(t._pattern))||!1}var Mk=({twee:t,parentSlotDefinition:e,nodeId:n,componentDefinitionsIndex:r})=>{if(!e.inheritAllowedComponents)return e;let o=t.getParentInfo(n);if(!o)return;let i=r[o.value.type]?.slots?.find(({id:a})=>a===o.parentName);if(i)return Mk({parentSlotDefinition:i,nodeId:o.parentId,twee:t,componentDefinitionsIndex:r})};function q_({definition:t,lastUserChoice:e,currentValue:n}){if(t&&!t.localizable)return!1;if(n){if(n.locales&&Z_(n.locales)||n.localesConditions&&Z_(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 Z_(t){return Array.isArray(t)?t.some(e=>Z_(e)):t===void 0?!1:t===null||typeof t!="object"?!0:Object.values(t).some(e=>Z_(e))}function qte({twee:t,nodeId:e,currentEditorLocale:n,definition:r}){let o=t.getNodeById(e),i=o?.propertyValueLocalizability?.[r.id],a=t.getNodeProperty(e,r?.id),l=q_({lastUserChoice:i,currentValue:a,definition:r});if(o&&l!==void 0&&l!==(i??!1)&&t.updateNode({nodeId:e,updateMetadata:c=>{c.propertyValueLocalizability[r.id]=l},doNotSetDirty:!0}),l)return n}import{CANVAS_ENRICHMENT_TAG_PARAM as Knt,CANVAS_PERSONALIZE_SLOT as Wnt,isSystemComponentDefinition as Gnt}from"@uniformdev/canvas";await B1();var tPe=await(process.env.NODE_ENV!=="production"?Nle().then(()=>$le):Mle().then(()=>Lle)),Ole=tPe.createHeadlessEditor;await SD();await wB();await OD();await Efe();var Zm=J(So());Lpe();var Dmt=J(ae());Eb();var Nmt=J(Vz());q4();var Mmt=J(Rz());_b();Db();R$();var Ws=Zm.Fragment;function W(t,e,n){return t3.call(e,"css")?Zm.jsx(Bz,Fz(t,e),n):Zm.jsx(t,e,n)}function Me(t,e,n){return t3.call(e,"css")?Zm.jsxs(Bz,Fz(t,e),n):Zm.jsxs(t,e,n)}Ee();Ee();Ee();Ee();Ee();function Ape(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];t&&t.addEventListener&&t.addEventListener.apply(t,e)}function kpe(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];t&&t.removeEventListener&&t.removeEventListener.apply(t,e)}var Ppe=typeof window<"u";var Ipe=J(ae());var ac=J(ae());function jz(t,e){e===void 0&&(e=0);var n=(0,ac.useRef)(!1),r=(0,ac.useRef)(),o=(0,ac.useRef)(t),i=(0,ac.useCallback)(function(){return n.current},[]),a=(0,ac.useCallback)(function(){n.current=!1,r.current&&clearTimeout(r.current),r.current=setTimeout(function(){n.current=!0,o.current()},e)},[e]),l=(0,ac.useCallback)(function(){n.current=null,r.current&&clearTimeout(r.current)},[]);return(0,ac.useEffect)(function(){o.current=t},[t]),(0,ac.useEffect)(function(){return a(),l},[e]),[i,l,a]}function F$(t,e,n){e===void 0&&(e=0),n===void 0&&(n=[]);var r=jz(t,e),o=r[0],i=r[1],a=r[2];return(0,Ipe.useEffect)(a,n),[o,i]}var $b=J(ae());var jze=function(t){return t===void 0&&(t={laptopL:1440,laptop:1024,tablet:768}),function(){var e=(0,$b.useState)(Ppe?window.innerWidth:0),n=e[0],r=e[1];(0,$b.useEffect)(function(){var a=function(){r(window.innerWidth)};return a(),Ape(window,"resize",a),function(){kpe(window,"resize",a)}});var o=(0,$b.useMemo)(function(){return Object.entries(t).sort(function(a,l){return a[1]>=l[1]?1:-1})},[t]),i=o.reduce(function(a,l){var c=l[0],d=l[1];return n>=d?c:a},o[0][0]);return i}},Uz=jze;Ee();Ee();Ee();var qJe=J(ae());Ee();Ee();var Uze=Object.defineProperty,Kze=Object.defineProperties,Wze=Object.getOwnPropertyDescriptors,B$=Object.getOwnPropertySymbols,Bpe=Object.prototype.hasOwnProperty,zpe=Object.prototype.propertyIsEnumerable,Fpe=(t,e,n)=>e in t?Uze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,me=(t,e)=>{for(var n in e||(e={}))Bpe.call(e,n)&&Fpe(t,n,e[n]);if(B$)for(var n of B$(e))zpe.call(e,n)&&Fpe(t,n,e[n]);return t},Ne=(t,e)=>Kze(t,Wze(e)),ut=(t,e)=>{var n={};for(var r in t)Bpe.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&B$)for(var r of B$(t))e.indexOf(r)<0&&zpe.call(t,r)&&(n[r]=t[r]);return n};var Gze=Object.defineProperty,Yze=Object.defineProperties,Zze=Object.getOwnPropertyDescriptors,z$=Object.getOwnPropertySymbols,Hpe=Object.prototype.hasOwnProperty,jpe=Object.prototype.propertyIsEnumerable,Vpe=(t,e,n)=>e in t?Gze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Jt=(t,e)=>{for(var n in e||(e={}))Hpe.call(e,n)&&Vpe(t,n,e[n]);if(z$)for(var n of z$(e))jpe.call(e,n)&&Vpe(t,n,e[n]);return t},ir=(t,e)=>Yze(t,Zze(e)),V$=(t,e)=>{var n={};for(var r in t)Hpe.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&z$)for(var r of z$(t))e.indexOf(r)<0&&jpe.call(t,r)&&(n[r]=t[r]);return n};function mv(...t){}function n3(t,e){if(qze(t)){let n=Jze(e)?e():e;return t(n)}return t}function qze(t){return typeof t=="function"}function Jze(t){return typeof t=="function"}function cs(t,e){return typeof Object.hasOwn=="function"?Object.hasOwn(t,e):Object.prototype.hasOwnProperty.call(t,e)}function Hr(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}function Kz(t){return t.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function Wz(t,e){let n=Jt({},t);for(let r of e)cs(n,r)&&delete n[r];return n}function Gz(t,e){let n={};for(let r of e)cs(t,r)&&(n[r]=t[r]);return n}function r3(t){return t}function tn(t,e){if(!t)throw typeof e!="string"?new Error("Invariant failed"):new Error(e)}function Yz(t){return Object.keys(t)}function bd(t,...e){let n=typeof t=="function"?t(...e):t;return n==null?!1:!n}function sc(t){return t.disabled||t["aria-disabled"]===!0||t["aria-disabled"]==="true"}function ds(t){let e={};for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}function Zt(...t){for(let e of t)if(e!==void 0)return e}var Upe=J(ae(),1);function o3(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function Xze(t){return!t||!(0,Upe.isValidElement)(t)?!1:"ref"in t.props||"ref"in t}function Kpe(t){return Xze(t)?me({},t.props).ref||t.ref:null}function Wpe(t,e){let n=me({},t);for(let r in e){if(!cs(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]?me(me({},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]=(...a)=>{o(...a),i(...a)};continue}}n[r]=o}return n}var Ff=Qze();function Qze(){var t;return typeof window<"u"&&!!((t=window.document)!=null&&t.createElement)}function xn(t){return t?"self"in t?t.document:t.ownerDocument||document:document}function hv(t){return t?"self"in t?t.self:xn(t).defaultView||window:self}function hl(t,e=!1){let{activeElement:n}=xn(t);if(!n?.nodeName)return null;if(i3(n)&&n.contentDocument)return hl(n.contentDocument.body,e);if(e){let r=n.getAttribute("aria-activedescendant");if(r){let o=xn(n).getElementById(r);if(o)return o}}return n}function Bn(t,e){return t===e||t.contains(e)}function i3(t){return t.tagName==="IFRAME"}function Gs(t){let e=t.tagName.toLowerCase();return e==="button"?!0:e==="input"&&t.type?eVe.indexOf(t.type)!==-1:!1}var eVe=["button","color","file","image","reset","submit"];function a3(t){if(typeof t.checkVisibility=="function")return t.checkVisibility();let e=t;return e.offsetWidth>0||e.offsetHeight>0||t.getClientRects().length>0}function fs(t){try{let e=t instanceof HTMLInputElement&&t.selectionStart!==null,n=t.tagName==="TEXTAREA";return e||n||!1}catch{return!1}}function s3(t){return t.isContentEditable||fs(t)}function Zz(t){if(fs(t))return t.value;if(t.isContentEditable){let e=xn(t).createRange();return e.selectNodeContents(t),e.toString()}return""}function qz(t){let e=0,n=0;if(fs(t))e=t.selectionStart||0,n=t.selectionEnd||0;else if(t.isContentEditable){let r=xn(t).getSelection();if(r?.rangeCount&&r.anchorNode&&Bn(t,r.anchorNode)&&r.focusNode&&Bn(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 Nb(t,e){let n=["dialog","menu","listbox","tree","grid"],r=t?.getAttribute("role");return r&&n.indexOf(r)!==-1?r:e}function l3(t,e){var n;let r={menu:"menuitem",listbox:"option",tree:"treeitem"},o=Nb(t);return o&&(n=r[o])!=null?n:e}function H$(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 H$(t.parentElement)||document.scrollingElement||document.body}function u3(t,e){let n=t.map((o,i)=>[i,o]),r=!1;return n.sort(([o,i],[a,l])=>{let c=e(i),d=e(l);return c===d||!c||!d?0:tVe(c,d)?(o>a&&(r=!0),-1):(o<a&&(r=!0),1)}),r?n.map(([o,i])=>i):t}function tVe(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}function Gpe(){return Ff&&!!navigator.maxTouchPoints}function Lb(){return Ff?/mac|iphone|ipad|ipod/i.test(navigator.platform):!1}function gv(){return Ff&&Lb()&&/apple/i.test(navigator.vendor)}function Jz(){return Ff&&/firefox\//i.test(navigator.userAgent)}function Xz(){return Ff&&navigator.platform.startsWith("Mac")&&!Gpe()}function j$(t){return!!(t.currentTarget&&!Bn(t.currentTarget,t.target))}function Oi(t){return t.target===t.currentTarget}function Ype(t){let e=t.currentTarget;if(!e)return!1;let n=Lb();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 Zpe(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 qpe(t,e,n){let r=new Event(e,n);return t.dispatchEvent(r)}function vv(t,e){let n=new FocusEvent("blur",e),r=t.dispatchEvent(n),o=ir(Jt({},e),{bubbles:!0});return t.dispatchEvent(new FocusEvent("focusout",o)),r}function Jpe(t,e,n){let r=new KeyboardEvent(e,n);return t.dispatchEvent(r)}function Qz(t,e){let n=new MouseEvent("click",e);return t.dispatchEvent(n)}function qm(t,e){let n=e||t.currentTarget,r=t.relatedTarget;return!r||!Bn(n,r)}function Jm(t,e,n,r){let i=(l=>{if(r){let d=setTimeout(l,r);return()=>clearTimeout(d)}let c=requestAnimationFrame(l);return()=>cancelAnimationFrame(c)})(()=>{t.removeEventListener(e,a,!0),n()}),a=()=>{i(),n()};return t.addEventListener(e,a,{once:!0,capture:!0}),i}function no(t,e,n,r=window){let o=[];try{r.document.addEventListener(t,e,n);for(let a of Array.from(r.frames))o.push(no(t,e,n,a))}catch{}return()=>{try{r.document.removeEventListener(t,e,n)}catch{}for(let a of o)a()}}var ro=J(ae(),1),nVe=J(ae(),1),eV=me({},nVe),Xpe=eV.useId,wht=eV.useDeferredValue,Qpe=eV.useInsertionEffect,cn=Ff?ro.useLayoutEffect:ro.useEffect;function K$(t){let e=(0,ro.useRef)(t);return cn(()=>{e.current=t}),e}function vt(t){let e=(0,ro.useRef)(()=>{throw new Error("Cannot call an event handler while rendering.")});return Qpe?Qpe(()=>{e.current=t}):e.current=t,(0,ro.useCallback)((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function nme(t){let[e,n]=(0,ro.useState)(null);return cn(()=>{if(e==null||!t)return;let r=null;return t(o=>(r=o,e)),()=>{t(r)}},[e,t]),[e,n]}function sn(...t){return(0,ro.useMemo)(()=>{if(t.some(Boolean))return e=>{for(let n of t)o3(n,e)}},t)}function lu(t){if(Xpe){let r=Xpe();return t||r}let[e,n]=(0,ro.useState)(t);return cn(()=>{if(t||e)return;let r=Math.random().toString(36).slice(2,8);n(`id-${r}`)},[t,e]),t||e}function W$(t,e){let n=i=>{if(typeof i=="string")return i},[r,o]=(0,ro.useState)(()=>n(e));return cn(()=>{let i=t&&"current"in t?t.current:t;o(i?.tagName.toLowerCase()||n(e))},[t,e]),r}function Xm(t,e){let n=(0,ro.useRef)(!1);(0,ro.useEffect)(()=>{if(n.current)return t();n.current=!0},e),(0,ro.useEffect)(()=>()=>{n.current=!1},[])}function rme(){return(0,ro.useReducer)(()=>[],[])}function Lo(t){return vt(typeof t=="function"?t:()=>t)}function dr(t,e,n=[]){let r=(0,ro.useCallback)(o=>(t.wrapElement&&(o=t.wrapElement(o)),e(o)),[...n,t.wrapElement]);return Ne(me({},t),{wrapElement:r})}function Mb(t=!1,e){let[n,r]=(0,ro.useState)(null);return{portalRef:sn(r,e),portalNode:n,domReady:!t||n}}function G$(t,e,n){let r=t.onLoadedMetadataCapture,o=(0,ro.useMemo)(()=>Object.assign(()=>{},Ne(me({},r),{[e]:n})),[r,e,n]);return[r?.[e],{onLoadedMetadataCapture:o}]}function Ob(){return(0,ro.useEffect)(()=>{no("mousemove",oVe,!0),no("mousedown",U$,!0),no("mouseup",U$,!0),no("keydown",U$,!0),no("scroll",U$,!0)},[]),vt(()=>tV)}var tV=!1,eme=0,tme=0;function rVe(t){let e=t.movementX||t.screenX-eme,n=t.movementY||t.screenY-tme;return eme=t.screenX,tme=t.screenY,e||n||process.env.NODE_ENV==="test"}function oVe(t){rVe(t)&&(tV=!0)}function U$(){tV=!1}var ps=J(ae(),1),yv=J(So(),1);function st(t){let e=ps.forwardRef((n,r)=>t(Ne(me({},n),{ref:r})));return e.displayName=t.displayName||t.name,e}function Rb(t,e){return ps.memo(t,e)}function ct(t,e){let n=e,{wrapElement:r,render:o}=n,i=ut(n,["wrapElement","render"]),a=sn(e.ref,Kpe(o)),l;if(ps.isValidElement(o)){let c=Ne(me({},o.props),{ref:a});l=ps.cloneElement(o,Wpe(i,c))}else o?l=o(i):l=(0,yv.jsx)(t,me({},i));return r?r(l):l}function ft(t){let e=(n={})=>t(n);return e.displayName=t.name,e}function Ho(t=[],e=[]){let n=ps.createContext(void 0),r=ps.createContext(void 0),o=()=>ps.useContext(n),i=(d=!1)=>{let f=ps.useContext(r),m=o();return d?f:f||m},a=()=>{let d=ps.useContext(r),f=o();if(!(d&&d===f))return f},l=d=>t.reduceRight((f,m)=>(0,yv.jsx)(m,Ne(me({},d),{children:f})),(0,yv.jsx)(n.Provider,me({},d)));return{context:n,scopedContext:r,useContext:o,useScopedContext:i,useProviderContext:a,ContextProvider:l,ScopedContextProvider:d=>(0,yv.jsx)(l,Ne(me({},d),{children:e.reduceRight((f,m)=>(0,yv.jsx)(m,Ne(me({},d),{children:f})),(0,yv.jsx)(r.Provider,me({},d)))}))}}var c3=Ho(),ome=c3.useContext,Lht=c3.useScopedContext,Mht=c3.useProviderContext,ime=c3.ContextProvider,ame=c3.ScopedContextProvider;var nV=J(ae(),1),d3=Ho([ime],[ame]),Ab=d3.useContext,kht=d3.useScopedContext,sme=d3.useProviderContext,Qm=d3.ContextProvider,kb=d3.ScopedContextProvider,lme=(0,nV.createContext)(void 0),ume=(0,nV.createContext)(void 0);function bv(t,e){let n=t.__unstableInternals;return tn(n,"Invalid store"),n[e]}function Mo(t,...e){let n=t,r=n,o=Symbol(),i=mv,a=new Set,l=new Set,c=new Set,d=new Set,f=new Set,m=new WeakMap,h=new WeakMap,g=M=>(c.add(M),()=>c.delete(M)),y=()=>{let M=a.size,A=Symbol();a.add(A);let k=()=>{a.delete(A),!a.size&&i()};if(M)return k;let F=Yz(n).map(H=>Hr(...e.map(j=>{var Y;let K=(Y=j?.getState)==null?void 0:Y.call(j);if(K&&cs(K,H))return ci(j,[H],Z=>{$(H,Z[H],!0)})}))),U=[];for(let H of c)U.push(H());let B=e.map(Pb);return i=Hr(...F,...U,...B),k},b=(M,A,k=d)=>(k.add(A),h.set(A,M),()=>{var F;(F=m.get(A))==null||F(),m.delete(A),h.delete(A),k.delete(A)}),C=(M,A)=>b(M,A),S=(M,A)=>(m.set(A,A(n,n)),b(M,A)),w=(M,A)=>(m.set(A,A(n,r)),b(M,A,f)),E=M=>Mo(Gz(n,M),O),_=M=>Mo(Wz(n,M),O),N=()=>n,$=(M,A,k=!1)=>{var F;if(!cs(n,M))return;let U=n3(A,n[M]);if(U===n[M])return;if(!k)for(let Y of e)(F=Y?.setState)==null||F.call(Y,M,U);let B=n;n=ir(Jt({},n),{[M]:U});let H=Symbol();o=H,l.add(M);let j=(Y,K,Z)=>{var X;let se=h.get(Y),de=ye=>Z?Z.has(ye):ye===M;(!se||se.some(de))&&((X=m.get(Y))==null||X(),m.set(Y,Y(n,K)))};for(let Y of d)j(Y,B);queueMicrotask(()=>{if(o!==H)return;let Y=n;for(let K of f)j(K,r,l);r=Y,l.clear()})},O={getState:N,setState:$,__unstableInternals:{setup:g,init:y,subscribe:C,sync:S,batch:w,pick:E,omit:_}};return O}function Ys(t,...e){if(t)return bv(t,"setup")(...e)}function Pb(t,...e){if(t)return bv(t,"init")(...e)}function Ib(t,...e){if(t)return bv(t,"subscribe")(...e)}function ci(t,...e){if(t)return bv(t,"sync")(...e)}function Fb(t,...e){if(t)return bv(t,"batch")(...e)}function xv(t,...e){if(t)return bv(t,"omit")(...e)}function rV(t,...e){if(t)return bv(t,"pick")(...e)}function Cv(...t){let e=t.reduce((r,o)=>{var i;let a=(i=o?.getState)==null?void 0:i.call(o);return a?Object.assign(r,a):r},{}),n=Mo(e,...t);return Object.assign({},...t,n)}function Bf(t,e){if(process.env.NODE_ENV==="production"||!e)return;let n=Object.entries(t).filter(([i,a])=>i.startsWith("default")&&a!==void 0).map(([i])=>{var a;let l=i.replace("default","");return`${((a=l[0])==null?void 0:a.toLowerCase())||""}${l.slice(1)}`});if(!n.length)return;let r=e.getState();if(n.filter(i=>cs(r,i)).length)throw new Error(`Passing a store prop in conjunction with a default state is not supported.
237
237
 
238
238
  const store = useSelectStore();
239
239
  <SelectProvider store={store} defaultValue="Apple" />
@@ -257,7 +257,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
257
257
  monaco.config({ paths: { vs: '...' } })
258
258
 
259
259
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
260
- `},bCe=vCe(yqe)(xCe),bqe={config:gqe},CCe=bqe;var xqe=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(o){return n.reduceRight(function(i,a){return a(i)},o)}},SCe=xqe;function wCe(t,e){return Object.keys(e).forEach(function(n){e[n]instanceof Object&&t[n]&&Object.assign(e[n],wCe(t[n],e[n]))}),OY(OY({},t),e)}var ECe=wCe;var Cqe={type:"cancelation",msg:"operation is manually canceled"};function Sqe(t){var e=!1,n=new Promise(function(r,o){t.then(function(i){return e?o(Cqe):r(i)}),t.catch(o)});return n.cancel=function(){return e=!0},n}var sL=Sqe;var wqe=hCe.create({config:gCe,isInitialized:!1,resolve:null,reject:null,monaco:null}),TCe=fCe(wqe,2),OE=TCe[0],lL=TCe[1];function Eqe(t){var e=CCe.config(t),n=e.monaco,r=dCe(e,["monaco"]);lL(function(o){return{config:ECe(o.config,r),monaco:n}})}function Tqe(){var t=OE(function(e){var n=e.monaco,r=e.isInitialized,o=e.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!t.isInitialized){if(lL({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),sL(RY);if(window.monaco&&window.monaco.editor)return _Ce(window.monaco),t.resolve(window.monaco),sL(RY);SCe(_qe,$qe)(Nqe)}return sL(RY)}function _qe(t){return document.body.appendChild(t)}function Dqe(t){var e=document.createElement("script");return t&&(e.src=t),e}function $qe(t){var e=OE(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=Dqe("".concat(e.config.paths.vs,"/loader.js"));return n.onload=function(){return t()},n.onerror=e.reject,n}function Nqe(){var t=OE(function(n){var r=n.config,o=n.resolve,i=n.reject;return{config:r,resolve:o,reject:i}}),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],function(n){_Ce(n),t.resolve(n)},function(n){t.reject(n)})}function _Ce(t){OE().monaco||lL({monaco:t})}function Lqe(){return OE(function(t){var e=t.monaco;return e})}var RY=new Promise(function(t,e){return lL({resolve:t,reject:e})}),Mqe={config:Eqe,init:Tqe,__getMonacoInstance:Lqe},r0=Mqe;var DCe=J(ae(),1),Vi=J(ae(),1);var $Ce=J(ae(),1),cL=J(ae(),1),NCe=J(ae(),1),MCe=J(ae(),1),dL=J(ae(),1),Wqe=J(ae(),1);var ACe=J(ae(),1),Eo=J(ae(),1);var fL=J(ae(),1),Oqe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},AY=Oqe,Rqe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Aqe=Rqe;function kqe({children:t}){return NCe.default.createElement("div",{style:Aqe.container},t)}var Pqe=kqe,Iqe=Pqe;function Fqe({width:t,height:e,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:a}){return cL.default.createElement("section",{style:{...AY.wrapper,width:t,height:e},...a},!n&&cL.default.createElement(Iqe,null,r),cL.default.createElement("div",{ref:o,style:{...AY.fullWidth,...!n&&AY.hide},className:i}))}var Bqe=Fqe,LCe=(0,$Ce.memo)(Bqe);function zqe(t){(0,MCe.useEffect)(t,[])}var OCe=zqe;function Vqe(t,e,n=!0){let r=(0,dL.useRef)(!0);(0,dL.useEffect)(r.current||!n?()=>{r.current=!1}:t,e)}var Ml=Vqe;function RE(){}function Xx(t,e,n,r){return Hqe(t,r)||jqe(t,e,n,r)}function Hqe(t,e){return t.editor.getModel(RCe(t,e))}function jqe(t,e,n,r){return t.editor.createModel(e,n,r?RCe(t,r):void 0)}function RCe(t,e){return t.Uri.parse(e)}function Uqe({original:t,modified:e,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:a,keepCurrentOriginalModel:l=!1,keepCurrentModifiedModel:c=!1,theme:d="light",loading:f="Loading...",options:m={},height:h="100%",width:g="100%",className:y,wrapperProps:b={},beforeMount:C=RE,onMount:S=RE}){let[w,E]=(0,Vi.useState)(!1),[_,N]=(0,Vi.useState)(!0),$=(0,Vi.useRef)(null),O=(0,Vi.useRef)(null),M=(0,Vi.useRef)(null),A=(0,Vi.useRef)(S),k=(0,Vi.useRef)(C),F=(0,Vi.useRef)(!1);OCe(()=>{let j=r0.init();return j.then(Y=>(O.current=Y)&&N(!1)).catch(Y=>Y?.type!=="cancelation"&&console.error("Monaco initialization: error:",Y)),()=>$.current?H():j.cancel()}),Ml(()=>{if($.current&&O.current){let j=$.current.getOriginalEditor(),Y=Xx(O.current,t||"",r||n||"text",i||"");Y!==j.getModel()&&j.setModel(Y)}},[i],w),Ml(()=>{if($.current&&O.current){let j=$.current.getModifiedEditor(),Y=Xx(O.current,e||"",o||n||"text",a||"");Y!==j.getModel()&&j.setModel(Y)}},[a],w),Ml(()=>{let j=$.current.getModifiedEditor();j.getOption(O.current.editor.EditorOption.readOnly)?j.setValue(e||""):e!==j.getValue()&&(j.executeEdits("",[{range:j.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),j.pushUndoStop())},[e],w),Ml(()=>{$.current?.getModel()?.original.setValue(t||"")},[t],w),Ml(()=>{let{original:j,modified:Y}=$.current.getModel();O.current.editor.setModelLanguage(j,r||n||"text"),O.current.editor.setModelLanguage(Y,o||n||"text")},[n,r,o],w),Ml(()=>{O.current?.editor.setTheme(d)},[d],w),Ml(()=>{$.current?.updateOptions(m)},[m],w);let U=(0,Vi.useCallback)(()=>{if(!O.current)return;k.current(O.current);let j=Xx(O.current,t||"",r||n||"text",i||""),Y=Xx(O.current,e||"",o||n||"text",a||"");$.current?.setModel({original:j,modified:Y})},[n,e,o,t,r,i,a]),B=(0,Vi.useCallback)(()=>{!F.current&&M.current&&($.current=O.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...m}),U(),O.current?.editor.setTheme(d),E(!0),F.current=!0)},[m,d,U]);(0,Vi.useEffect)(()=>{w&&A.current($.current,O.current)},[w]),(0,Vi.useEffect)(()=>{!_&&!w&&B()},[_,w,B]);function H(){let j=$.current?.getModel();l||j?.original?.dispose(),c||j?.modified?.dispose(),$.current?.dispose()}return Vi.default.createElement(LCe,{width:g,height:h,isEditorReady:w,loading:f,_ref:M,className:y,wrapperProps:b})}var Kqe=Uqe,X9t=(0,DCe.memo)(Kqe);function Gqe(t){let e=(0,fL.useRef)();return(0,fL.useEffect)(()=>{e.current=t},[t]),e.current}var Yqe=Gqe,uL=new Map;function Zqe({defaultValue:t,defaultLanguage:e,defaultPath:n,value:r,language:o,path:i,theme:a="light",line:l,loading:c="Loading...",options:d={},overrideServices:f={},saveViewState:m=!0,keepCurrentModel:h=!1,width:g="100%",height:y="100%",className:b,wrapperProps:C={},beforeMount:S=RE,onMount:w=RE,onChange:E,onValidate:_=RE}){let[N,$]=(0,Eo.useState)(!1),[O,M]=(0,Eo.useState)(!0),A=(0,Eo.useRef)(null),k=(0,Eo.useRef)(null),F=(0,Eo.useRef)(null),U=(0,Eo.useRef)(w),B=(0,Eo.useRef)(S),H=(0,Eo.useRef)(),j=(0,Eo.useRef)(r),Y=Yqe(i),K=(0,Eo.useRef)(!1),Z=(0,Eo.useRef)(!1);OCe(()=>{let de=r0.init();return de.then(ye=>(A.current=ye)&&M(!1)).catch(ye=>ye?.type!=="cancelation"&&console.error("Monaco initialization: error:",ye)),()=>k.current?se():de.cancel()}),Ml(()=>{let de=Xx(A.current,t||r||"",e||o||"",i||n||"");de!==k.current?.getModel()&&(m&&uL.set(Y,k.current?.saveViewState()),k.current?.setModel(de),m&&k.current?.restoreViewState(uL.get(i)))},[i],N),Ml(()=>{k.current?.updateOptions(d)},[d],N),Ml(()=>{!k.current||r===void 0||(k.current.getOption(A.current.editor.EditorOption.readOnly)?k.current.setValue(r):r!==k.current.getValue()&&(Z.current=!0,k.current.executeEdits("",[{range:k.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),k.current.pushUndoStop(),Z.current=!1))},[r],N),Ml(()=>{let de=k.current?.getModel();de&&o&&A.current?.editor.setModelLanguage(de,o)},[o],N),Ml(()=>{l!==void 0&&k.current?.revealLine(l)},[l],N),Ml(()=>{A.current?.editor.setTheme(a)},[a],N);let X=(0,Eo.useCallback)(()=>{if(!(!F.current||!A.current)&&!K.current){B.current(A.current);let de=i||n,ye=Xx(A.current,r||t||"",e||o||"",de||"");k.current=A.current?.editor.create(F.current,{model:ye,automaticLayout:!0,...d},f),m&&k.current.restoreViewState(uL.get(de)),A.current.editor.setTheme(a),l!==void 0&&k.current.revealLine(l),$(!0),K.current=!0}},[t,e,n,r,o,i,d,f,m,a,l]);(0,Eo.useEffect)(()=>{N&&U.current(k.current,A.current)},[N]),(0,Eo.useEffect)(()=>{!O&&!N&&X()},[O,N,X]),j.current=r,(0,Eo.useEffect)(()=>{N&&E&&(H.current?.dispose(),H.current=k.current?.onDidChangeModelContent(de=>{Z.current||E(k.current.getValue(),de)}))},[N,E]),(0,Eo.useEffect)(()=>{if(N){let de=A.current.editor.onDidChangeMarkers(ye=>{let Fe=k.current.getModel()?.uri;if(Fe&&ye.find(Ge=>Ge.path===Fe.path)){let Ge=A.current.editor.getModelMarkers({resource:Fe});_?.(Ge)}});return()=>{de?.dispose()}}return()=>{}},[N,_]);function se(){H.current?.dispose(),h?m&&uL.set(i,k.current.saveViewState()):k.current.getModel()?.dispose(),k.current.dispose()}return Eo.default.createElement(LCe,{width:g,height:y,isEditorReady:N,loading:c,_ref:F,className:b,wrapperProps:C})}var qqe=Zqe,tNt=(0,ACe.memo)(qqe);var Rl=J(ae()),GCe=J(Nd());var AE=J(ae());var kCe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function pL(t){let e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function kY(t){return"nodeType"in t}function Ol(t){var e,n;return t?pL(t)?t:kY(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function PY(t){let{Document:e}=Ol(t);return t instanceof e}function IY(t){return pL(t)?!1:t instanceof Ol(t).HTMLElement}function FY(t){return t instanceof Ol(t).SVGElement}function Qx(t){return t?pL(t)?t.document:kY(t)?PY(t)?t:IY(t)||FY(t)?t.ownerDocument:document:document:document}function PCe(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,a)=>{let l=Object.entries(a);for(let[c,d]of l){let f=i[c];f!=null&&(i[c]=f+t*d)}return i},{...e})}}var ICe=PCe(1),kE=PCe(-1);function Jqe(t){return"clientX"in t&&"clientY"in t}function BY(t){if(!t)return!1;let{KeyboardEvent:e}=Ol(t.target);return e&&t instanceof e}function Xqe(t){if(!t)return!1;let{TouchEvent:e}=Ol(t.target);return e&&t instanceof e}function mL(t){if(Xqe(t)){if(t.touches&&t.touches.length){let{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){let{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return Jqe(t)?{x:t.clientX,y:t.clientY}:null}var zY=J(ae());var FCe;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(FCe||(FCe={}));var PE=Object.freeze({x:0,y:0});function tJe(t){if(t.startsWith("matrix3d(")){let e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){let e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function nJe(t,e,n){let r=tJe(e);if(!r)return t;let{scaleX:o,scaleY:i,x:a,y:l}=r,c=t.left-a-(1-o)*parseFloat(n),d=t.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?t.width/o:t.width,m=i?t.height/i:t.height;return{width:f,height:m,top:d,right:c+f,bottom:d+m,left:c}}var rJe={ignoreTransform:!1};function vL(t,e){e===void 0&&(e=rJe);let n=t.getBoundingClientRect();if(e.ignoreTransform){let{transform:d,transformOrigin:f}=Ol(t).getComputedStyle(t);d&&(n=nJe(n,d,f))}let{top:r,left:o,width:i,height:a,bottom:l,right:c}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:c}}function BCe(t){return vL(t,{ignoreTransform:!0})}function oJe(t,e){return e===void 0&&(e=Ol(t).getComputedStyle(t)),e.position==="fixed"}function iJe(t,e){e===void 0&&(e=Ol(t).getComputedStyle(t));let n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{let i=e[o];return typeof i=="string"?n.test(i):!1})}function YCe(t,e){let n=[];function r(o){if(e!=null&&n.length>=e||!o)return n;if(PY(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!IY(o)||FY(o)||n.includes(o))return n;let i=Ol(t).getComputedStyle(o);return o!==t&&iJe(o,i)&&n.push(o),oJe(o,i)?n:r(o.parentNode)}return t?r(t):n}function aJe(t){let[e]=YCe(t,1);return e??null}var eC;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(eC||(eC={}));function sJe(t){return!kCe||!t?!1:t===document.scrollingElement}function lJe(t){let e={x:0,y:0},n=sJe(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},o=t.scrollTop<=e.y,i=t.scrollLeft<=e.x,a=t.scrollTop>=r.y,l=t.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:a,isRight:l,maxScroll:r,minScroll:e}}function uJe(t){if(t===document.scrollingElement){let{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}let{top:e,left:n,right:r,bottom:o}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:o,width:t.clientWidth,height:t.clientHeight}}function cJe(t,e){if(e===void 0&&(e=vL),!t)return;let{top:n,left:r,bottom:o,right:i}=e(t);aJe(t)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}var o0=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var o;(o=this.target)==null||o.addEventListener(e,n,r),this.listeners.push([e,n,r])}};function dJe(t){let{EventTarget:e}=Ol(t);return t instanceof e?t:Qx(t)}function VY(t,e){let n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var Su;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Su||(Su={}));function zCe(t){t.preventDefault()}function fJe(t){t.stopPropagation()}var zn;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter"})(zn||(zn={}));var ZCe={start:[zn.Space,zn.Enter],cancel:[zn.Esc],end:[zn.Space,zn.Enter]},pJe=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case zn.Right:return{...n,x:n.x+25};case zn.Left:return{...n,x:n.x-25};case zn.Down:return{...n,y:n.y+25};case zn.Up:return{...n,y:n.y-25}}},hL=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:n}}=e;this.props=e,this.listeners=new o0(Qx(n)),this.windowListeners=new o0(Ol(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Su.Resize,this.handleCancel),this.windowListeners.add(Su.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Su.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&cJe(r),n(PE)}handleKeyDown(e){if(BY(e)){let{active:n,context:r,options:o}=this.props,{keyboardCodes:i=ZCe,coordinateGetter:a=pJe,scrollBehavior:l="smooth"}=o,{code:c}=e;if(i.end.includes(c)){this.handleEnd(e);return}if(i.cancel.includes(c)){this.handleCancel(e);return}let{collisionRect:d}=r.current,f=d?{x:d.left,y:d.top}:PE;this.referenceCoordinates||(this.referenceCoordinates=f);let m=a(e,{active:n,context:r.current,currentCoordinates:f});if(m){let h=kE(m,f),g={x:0,y:0},{scrollableAncestors:y}=r.current;for(let b of y){let C=e.code,{isTop:S,isRight:w,isLeft:E,isBottom:_,maxScroll:N,minScroll:$}=lJe(b),O=uJe(b),M={x:Math.min(C===zn.Right?O.right-O.width/2:O.right,Math.max(C===zn.Right?O.left:O.left+O.width/2,m.x)),y:Math.min(C===zn.Down?O.bottom-O.height/2:O.bottom,Math.max(C===zn.Down?O.top:O.top+O.height/2,m.y))},A=C===zn.Right&&!w||C===zn.Left&&!E,k=C===zn.Down&&!_||C===zn.Up&&!S;if(A&&M.x!==m.x){let F=b.scrollLeft+h.x,U=C===zn.Right&&F<=N.x||C===zn.Left&&F>=$.x;if(U&&!h.y){b.scrollTo({left:F,behavior:l});return}U?g.x=b.scrollLeft-F:g.x=C===zn.Right?b.scrollLeft-N.x:b.scrollLeft-$.x,g.x&&b.scrollBy({left:-g.x,behavior:l});break}else if(k&&M.y!==m.y){let F=b.scrollTop+h.y,U=C===zn.Down&&F<=N.y||C===zn.Up&&F>=$.y;if(U&&!h.x){b.scrollTo({top:F,behavior:l});return}U?g.y=b.scrollTop-F:g.y=C===zn.Down?b.scrollTop-N.y:b.scrollTop-$.y,g.y&&b.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(e,ICe(kE(m,this.referenceCoordinates),g))}}}handleMove(e,n){let{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){let{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){let{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};hL.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=ZCe,onActivation:o}=e,{active:i}=n,{code:a}=t.nativeEvent;if(r.start.includes(a)){let l=i.activatorNode.current;return l&&t.target!==l?!1:(t.preventDefault(),o?.({event:t.nativeEvent}),!0)}return!1}}];function VCe(t){return!!(t&&"distance"in t)}function HCe(t){return!!(t&&"delay"in t)}var IE=class{constructor(e,n,r){var o;r===void 0&&(r=dJe(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;let{event:i}=e,{target:a}=i;this.props=e,this.events=n,this.document=Qx(a),this.documentListeners=new o0(this.document),this.listeners=new o0(r),this.windowListeners=new o0(Ol(a)),this.initialCoordinates=(o=mL(i))!=null?o:PE,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(Su.Resize,this.handleCancel),this.windowListeners.add(Su.DragStart,zCe),this.windowListeners.add(Su.VisibilityChange,this.handleCancel),this.windowListeners.add(Su.ContextMenu,zCe),this.documentListeners.add(Su.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(HCe(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}if(VCe(n))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){let{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Su.Click,fJe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Su.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;let{activated:r,initialCoordinates:o,props:i}=this,{onMove:a,options:{activationConstraint:l}}=i;if(!o)return;let c=(n=mL(e))!=null?n:PE,d=kE(o,c);if(!r&&l){if(VCe(l)){if(l.tolerance!=null&&VY(d,l.tolerance))return this.handleCancel();if(VY(d,l.distance))return this.handleStart()}return HCe(l)&&VY(d,l.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),a(c)}handleEnd(){let{onEnd:e}=this.props;this.detach(),e()}handleCancel(){let{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===zn.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},mJe={move:{name:"pointermove"},end:{name:"pointerup"}},gL=class extends IE{constructor(e){let{event:n}=e,r=Qx(n.target);super(e,mJe,r)}};gL.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var hJe={move:{name:"mousemove"},end:{name:"mouseup"}},jY;(function(t){t[t.RightClick=2]="RightClick"})(jY||(jY={}));var UY=class extends IE{constructor(e){super(e,hJe,Qx(e.event.target))}};UY.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===jY.RightClick?!1:(r?.({event:n}),!0)}}];var HY={move:{name:"touchmove"},end:{name:"touchend"}},KY=class extends IE{constructor(e){super(e,HY)}static setup(){return window.addEventListener(HY.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(HY.move.name,e)};function e(){}}};KY.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e,{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var jCe;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(jCe||(jCe={}));var UCe;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(UCe||(UCe={}));var vNt={x:{[eC.Backward]:!1,[eC.Forward]:!1},y:{[eC.Backward]:!1,[eC.Forward]:!1}};var WY;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(WY||(WY={}));var GY;(function(t){t.Optimized="optimized"})(GY||(GY={}));var yNt={draggable:{measure:BCe},droppable:{measure:BCe,strategy:WY.WhileDragging,frequency:GY.Optimized},dragOverlay:{measure:vL}};var bNt=(0,Rl.createContext)({...PE,scaleX:1,scaleY:1}),KCe;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(KCe||(KCe={}));var tC=J(ae());var MNt=[zn.Down,zn.Right,zn.Up,zn.Left];var jE=J(ae()),uZ=J(ae());Ee();Ee();Ee();Ee();Ee();Ee();Ee();var DSe=J(EU()),a0=J(ae());Ee();var NSe=J(ae());var LSe=J(ae());Ee();Ee();Ee();var dZ=J(ae());Ee();Ee();Ee();Ee();var Dtt=J(qCe());Eb();Db();_b();function JCe(t,e){if(t.inserted[e.name]===void 0)return t.insert("",e,t.sheet,!0)}function XCe(t,e,n){var r=[],o=Tb(t,r,n);return r.length<2?n:o+e(r)}var QCe=function(e){var n=J4(e);n.sheet.speedy=function(l){this.isSpeedy=l},n.compat=!0;var r=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var m=Ym(d,n.registered,void 0);return X4(n,m,!1),n.key+"-"+m.name},o=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var m=Ym(d,n.registered),h="animation-"+m.name;return JCe(n,{name:m.name,styles:"@keyframes "+h+"{"+m.styles+"}"}),h},i=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var m=Ym(d,n.registered);JCe(n,m)},a=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];return XCe(n.registered,r,gJe(d))};return{css:r,cx:a,injectGlobal:i,keyframes:o,hydrate:function(c){c.forEach(function(d){n.inserted[d]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:Tb.bind(null,n.registered),merge:XCe.bind(null,n.registered,r)}},gJe=function t(e){for(var n="",r=0;r<e.length;r++){var o=e[r];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&&(n&&(n+=" "),n+=i)}}return n};Eb();Db();_b();var Fd=QCe({key:"css"}),VNt=Fd.flush,HNt=Fd.hydrate,jNt=Fd.cx,UNt=Fd.merge,KNt=Fd.getRegisteredStyles,WNt=Fd.injectGlobal,GNt=Fd.keyframes,nn=Fd.css,YNt=Fd.sheet,ZNt=Fd.cache;var DL=J(ae());Ee();Ee();var OSe=J(ae());Ee();var UE=J(ae()),RSe=J(ae()),ASe=J(Nd());Ee();Ee();var kSe=J(ae());Ee();var FSe=J(ae());Ee();var fZ=J(ae());var pZ=J(ae());Ee();await wB();var vJe=Object.getOwnPropertyNames,yJe=Object.getOwnPropertySymbols,bJe=Object.prototype.hasOwnProperty;function e2e(t,e){return function(r,o,i){return t(r,o,i)&&e(r,o,i)}}function yL(t){return function(n,r,o){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,o);var i=o.cache,a=i.get(n),l=i.get(r);if(a&&l)return a===r&&l===n;i.set(n,r),i.set(r,n);var c=t(n,r,o);return i.delete(n),i.delete(r),c}}function t2e(t){return vJe(t).concat(yJe(t))}var l2e=Object.hasOwn||function(t,e){return bJe.call(t,e)};function nC(t,e){return t||e?t===e:t===e||t!==t&&e!==e}var u2e="_owner",n2e=Object.getOwnPropertyDescriptor,r2e=Object.keys;function xJe(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function CJe(t,e){return nC(t.getTime(),e.getTime())}function o2e(t,e,n){if(t.size!==e.size)return!1;for(var r={},o=t.entries(),i=0,a,l;(a=o.next())&&!a.done;){for(var c=e.entries(),d=!1,f=0;(l=c.next())&&!l.done;){var m=a.value,h=m[0],g=m[1],y=l.value,b=y[0],C=y[1];!d&&!r[f]&&(d=n.equals(h,b,i,f,t,e,n)&&n.equals(g,C,h,b,t,e,n))&&(r[f]=!0),f++}if(!d)return!1;i++}return!0}function SJe(t,e,n){var r=r2e(t),o=r.length;if(r2e(e).length!==o)return!1;for(var i;o-- >0;)if(i=r[o],i===u2e&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!l2e(e,i)||!n.equals(t[i],e[i],i,i,t,e,n))return!1;return!0}function BE(t,e,n){var r=t2e(t),o=r.length;if(t2e(e).length!==o)return!1;for(var i,a,l;o-- >0;)if(i=r[o],i===u2e&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!l2e(e,i)||!n.equals(t[i],e[i],i,i,t,e,n)||(a=n2e(t,i),l=n2e(e,i),(a||l)&&(!a||!l||a.configurable!==l.configurable||a.enumerable!==l.enumerable||a.writable!==l.writable)))return!1;return!0}function wJe(t,e){return nC(t.valueOf(),e.valueOf())}function EJe(t,e){return t.source===e.source&&t.flags===e.flags}function i2e(t,e,n){if(t.size!==e.size)return!1;for(var r={},o=t.values(),i,a;(i=o.next())&&!i.done;){for(var l=e.values(),c=!1,d=0;(a=l.next())&&!a.done;)!c&&!r[d]&&(c=n.equals(i.value,a.value,i.value,a.value,t,e,n))&&(r[d]=!0),d++;if(!c)return!1}return!0}function TJe(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var _Je="[object Arguments]",DJe="[object Boolean]",$Je="[object Date]",NJe="[object Map]",LJe="[object Number]",MJe="[object Object]",OJe="[object RegExp]",RJe="[object Set]",AJe="[object String]",kJe=Array.isArray,a2e=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,s2e=Object.assign,PJe=Object.prototype.toString.call.bind(Object.prototype.toString);function IJe(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,o=t.areObjectsEqual,i=t.arePrimitiveWrappersEqual,a=t.areRegExpsEqual,l=t.areSetsEqual,c=t.areTypedArraysEqual;return function(f,m,h){if(f===m)return!0;if(f==null||m==null||typeof f!="object"||typeof m!="object")return f!==f&&m!==m;var g=f.constructor;if(g!==m.constructor)return!1;if(g===Object)return o(f,m,h);if(kJe(f))return e(f,m,h);if(a2e!=null&&a2e(f))return c(f,m,h);if(g===Date)return n(f,m,h);if(g===RegExp)return a(f,m,h);if(g===Map)return r(f,m,h);if(g===Set)return l(f,m,h);var y=PJe(f);return y===$Je?n(f,m,h):y===OJe?a(f,m,h):y===NJe?r(f,m,h):y===RJe?l(f,m,h):y===MJe?typeof f.then!="function"&&typeof m.then!="function"&&o(f,m,h):y===_Je?o(f,m,h):y===DJe||y===LJe||y===AJe?i(f,m,h):!1}}function FJe(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,o={areArraysEqual:r?BE:xJe,areDatesEqual:CJe,areMapsEqual:r?e2e(o2e,BE):o2e,areObjectsEqual:r?BE:SJe,arePrimitiveWrappersEqual:wJe,areRegExpsEqual:EJe,areSetsEqual:r?e2e(i2e,BE):i2e,areTypedArraysEqual:r?BE:TJe};if(n&&(o=s2e({},o,n(o))),e){var i=yL(o.areArraysEqual),a=yL(o.areMapsEqual),l=yL(o.areObjectsEqual),c=yL(o.areSetsEqual);o=s2e({},o,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:l,areSetsEqual:c})}return o}function BJe(t){return function(e,n,r,o,i,a,l){return t(e,n,l)}}function zJe(t){var e=t.circular,n=t.comparator,r=t.createState,o=t.equals,i=t.strict;if(r)return function(c,d){var f=r(),m=f.cache,h=m===void 0?e?new WeakMap:void 0:m,g=f.meta;return n(c,d,{cache:h,equals:o,meta:g,strict:i})};if(e)return function(c,d){return n(c,d,{cache:new WeakMap,equals:o,meta:void 0,strict:i})};var a={cache:void 0,equals:o,meta:void 0,strict:i};return function(c,d){return n(c,d,a)}}var c2e=kh(),JNt=kh({strict:!0}),XNt=kh({circular:!0}),QNt=kh({circular:!0,strict:!0}),e8t=kh({createInternalComparator:function(){return nC}}),t8t=kh({strict:!0,createInternalComparator:function(){return nC}}),n8t=kh({circular:!0,createInternalComparator:function(){return nC}}),r8t=kh({circular:!0,createInternalComparator:function(){return nC},strict:!0});function kh(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,o=t.createState,i=t.strict,a=i===void 0?!1:i,l=FJe(t),c=IJe(l),d=r?r(c):BJe(c);return zJe({circular:n,comparator:c,createState:o,equals:d,strict:a})}var BSe=J(ae());await B1();var snt=J(ae());var mnt=J(ae());Ee();await Ni();await er();var $L=J(ae());var VSe=J(ae());Ee();var Fh=J(ae());Ee();var WE=J(ae()),xnt=J(Nd());var HSe=J(ae());Ee();await B1();var jSe=J(ae()),USe=J(ae());var gZ=J(ae());var vZ=J(ae());var yZ=J(ae());var Ent=J(ae());Ee();var _nt=J(ae());Ee();var GE=J(ae());Ee();Ee();var KSe=J(ae());Ee();var NL=J(ae());Ee();Ee();var Bh=J(ae());var WSe=J(ae());Ee();Ee();var xL=L`
260
+ `},bCe=vCe(yqe)(xCe),bqe={config:gqe},CCe=bqe;var xqe=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(o){return n.reduceRight(function(i,a){return a(i)},o)}},SCe=xqe;function wCe(t,e){return Object.keys(e).forEach(function(n){e[n]instanceof Object&&t[n]&&Object.assign(e[n],wCe(t[n],e[n]))}),OY(OY({},t),e)}var ECe=wCe;var Cqe={type:"cancelation",msg:"operation is manually canceled"};function Sqe(t){var e=!1,n=new Promise(function(r,o){t.then(function(i){return e?o(Cqe):r(i)}),t.catch(o)});return n.cancel=function(){return e=!0},n}var sL=Sqe;var wqe=hCe.create({config:gCe,isInitialized:!1,resolve:null,reject:null,monaco:null}),TCe=fCe(wqe,2),OE=TCe[0],lL=TCe[1];function Eqe(t){var e=CCe.config(t),n=e.monaco,r=dCe(e,["monaco"]);lL(function(o){return{config:ECe(o.config,r),monaco:n}})}function Tqe(){var t=OE(function(e){var n=e.monaco,r=e.isInitialized,o=e.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!t.isInitialized){if(lL({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),sL(RY);if(window.monaco&&window.monaco.editor)return _Ce(window.monaco),t.resolve(window.monaco),sL(RY);SCe(_qe,$qe)(Nqe)}return sL(RY)}function _qe(t){return document.body.appendChild(t)}function Dqe(t){var e=document.createElement("script");return t&&(e.src=t),e}function $qe(t){var e=OE(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=Dqe("".concat(e.config.paths.vs,"/loader.js"));return n.onload=function(){return t()},n.onerror=e.reject,n}function Nqe(){var t=OE(function(n){var r=n.config,o=n.resolve,i=n.reject;return{config:r,resolve:o,reject:i}}),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],function(n){_Ce(n),t.resolve(n)},function(n){t.reject(n)})}function _Ce(t){OE().monaco||lL({monaco:t})}function Lqe(){return OE(function(t){var e=t.monaco;return e})}var RY=new Promise(function(t,e){return lL({resolve:t,reject:e})}),Mqe={config:Eqe,init:Tqe,__getMonacoInstance:Lqe},r0=Mqe;var DCe=J(ae(),1),Vi=J(ae(),1);var $Ce=J(ae(),1),cL=J(ae(),1),NCe=J(ae(),1),MCe=J(ae(),1),dL=J(ae(),1),Wqe=J(ae(),1);var ACe=J(ae(),1),Eo=J(ae(),1);var fL=J(ae(),1),Oqe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},AY=Oqe,Rqe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Aqe=Rqe;function kqe({children:t}){return NCe.default.createElement("div",{style:Aqe.container},t)}var Pqe=kqe,Iqe=Pqe;function Fqe({width:t,height:e,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:a}){return cL.default.createElement("section",{style:{...AY.wrapper,width:t,height:e},...a},!n&&cL.default.createElement(Iqe,null,r),cL.default.createElement("div",{ref:o,style:{...AY.fullWidth,...!n&&AY.hide},className:i}))}var Bqe=Fqe,LCe=(0,$Ce.memo)(Bqe);function zqe(t){(0,MCe.useEffect)(t,[])}var OCe=zqe;function Vqe(t,e,n=!0){let r=(0,dL.useRef)(!0);(0,dL.useEffect)(r.current||!n?()=>{r.current=!1}:t,e)}var Ml=Vqe;function RE(){}function Xx(t,e,n,r){return Hqe(t,r)||jqe(t,e,n,r)}function Hqe(t,e){return t.editor.getModel(RCe(t,e))}function jqe(t,e,n,r){return t.editor.createModel(e,n,r?RCe(t,r):void 0)}function RCe(t,e){return t.Uri.parse(e)}function Uqe({original:t,modified:e,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:a,keepCurrentOriginalModel:l=!1,keepCurrentModifiedModel:c=!1,theme:d="light",loading:f="Loading...",options:m={},height:h="100%",width:g="100%",className:y,wrapperProps:b={},beforeMount:C=RE,onMount:S=RE}){let[w,E]=(0,Vi.useState)(!1),[_,N]=(0,Vi.useState)(!0),$=(0,Vi.useRef)(null),O=(0,Vi.useRef)(null),M=(0,Vi.useRef)(null),A=(0,Vi.useRef)(S),k=(0,Vi.useRef)(C),F=(0,Vi.useRef)(!1);OCe(()=>{let j=r0.init();return j.then(Y=>(O.current=Y)&&N(!1)).catch(Y=>Y?.type!=="cancelation"&&console.error("Monaco initialization: error:",Y)),()=>$.current?H():j.cancel()}),Ml(()=>{if($.current&&O.current){let j=$.current.getOriginalEditor(),Y=Xx(O.current,t||"",r||n||"text",i||"");Y!==j.getModel()&&j.setModel(Y)}},[i],w),Ml(()=>{if($.current&&O.current){let j=$.current.getModifiedEditor(),Y=Xx(O.current,e||"",o||n||"text",a||"");Y!==j.getModel()&&j.setModel(Y)}},[a],w),Ml(()=>{let j=$.current.getModifiedEditor();j.getOption(O.current.editor.EditorOption.readOnly)?j.setValue(e||""):e!==j.getValue()&&(j.executeEdits("",[{range:j.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),j.pushUndoStop())},[e],w),Ml(()=>{$.current?.getModel()?.original.setValue(t||"")},[t],w),Ml(()=>{let{original:j,modified:Y}=$.current.getModel();O.current.editor.setModelLanguage(j,r||n||"text"),O.current.editor.setModelLanguage(Y,o||n||"text")},[n,r,o],w),Ml(()=>{O.current?.editor.setTheme(d)},[d],w),Ml(()=>{$.current?.updateOptions(m)},[m],w);let U=(0,Vi.useCallback)(()=>{if(!O.current)return;k.current(O.current);let j=Xx(O.current,t||"",r||n||"text",i||""),Y=Xx(O.current,e||"",o||n||"text",a||"");$.current?.setModel({original:j,modified:Y})},[n,e,o,t,r,i,a]),B=(0,Vi.useCallback)(()=>{!F.current&&M.current&&($.current=O.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...m}),U(),O.current?.editor.setTheme(d),E(!0),F.current=!0)},[m,d,U]);(0,Vi.useEffect)(()=>{w&&A.current($.current,O.current)},[w]),(0,Vi.useEffect)(()=>{!_&&!w&&B()},[_,w,B]);function H(){let j=$.current?.getModel();l||j?.original?.dispose(),c||j?.modified?.dispose(),$.current?.dispose()}return Vi.default.createElement(LCe,{width:g,height:h,isEditorReady:w,loading:f,_ref:M,className:y,wrapperProps:b})}var Kqe=Uqe,X9t=(0,DCe.memo)(Kqe);function Gqe(t){let e=(0,fL.useRef)();return(0,fL.useEffect)(()=>{e.current=t},[t]),e.current}var Yqe=Gqe,uL=new Map;function Zqe({defaultValue:t,defaultLanguage:e,defaultPath:n,value:r,language:o,path:i,theme:a="light",line:l,loading:c="Loading...",options:d={},overrideServices:f={},saveViewState:m=!0,keepCurrentModel:h=!1,width:g="100%",height:y="100%",className:b,wrapperProps:C={},beforeMount:S=RE,onMount:w=RE,onChange:E,onValidate:_=RE}){let[N,$]=(0,Eo.useState)(!1),[O,M]=(0,Eo.useState)(!0),A=(0,Eo.useRef)(null),k=(0,Eo.useRef)(null),F=(0,Eo.useRef)(null),U=(0,Eo.useRef)(w),B=(0,Eo.useRef)(S),H=(0,Eo.useRef)(),j=(0,Eo.useRef)(r),Y=Yqe(i),K=(0,Eo.useRef)(!1),Z=(0,Eo.useRef)(!1);OCe(()=>{let de=r0.init();return de.then(ye=>(A.current=ye)&&M(!1)).catch(ye=>ye?.type!=="cancelation"&&console.error("Monaco initialization: error:",ye)),()=>k.current?se():de.cancel()}),Ml(()=>{let de=Xx(A.current,t||r||"",e||o||"",i||n||"");de!==k.current?.getModel()&&(m&&uL.set(Y,k.current?.saveViewState()),k.current?.setModel(de),m&&k.current?.restoreViewState(uL.get(i)))},[i],N),Ml(()=>{k.current?.updateOptions(d)},[d],N),Ml(()=>{!k.current||r===void 0||(k.current.getOption(A.current.editor.EditorOption.readOnly)?k.current.setValue(r):r!==k.current.getValue()&&(Z.current=!0,k.current.executeEdits("",[{range:k.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),k.current.pushUndoStop(),Z.current=!1))},[r],N),Ml(()=>{let de=k.current?.getModel();de&&o&&A.current?.editor.setModelLanguage(de,o)},[o],N),Ml(()=>{l!==void 0&&k.current?.revealLine(l)},[l],N),Ml(()=>{A.current?.editor.setTheme(a)},[a],N);let X=(0,Eo.useCallback)(()=>{if(!(!F.current||!A.current)&&!K.current){B.current(A.current);let de=i||n,ye=Xx(A.current,r||t||"",e||o||"",de||"");k.current=A.current?.editor.create(F.current,{model:ye,automaticLayout:!0,...d},f),m&&k.current.restoreViewState(uL.get(de)),A.current.editor.setTheme(a),l!==void 0&&k.current.revealLine(l),$(!0),K.current=!0}},[t,e,n,r,o,i,d,f,m,a,l]);(0,Eo.useEffect)(()=>{N&&U.current(k.current,A.current)},[N]),(0,Eo.useEffect)(()=>{!O&&!N&&X()},[O,N,X]),j.current=r,(0,Eo.useEffect)(()=>{N&&E&&(H.current?.dispose(),H.current=k.current?.onDidChangeModelContent(de=>{Z.current||E(k.current.getValue(),de)}))},[N,E]),(0,Eo.useEffect)(()=>{if(N){let de=A.current.editor.onDidChangeMarkers(ye=>{let Fe=k.current.getModel()?.uri;if(Fe&&ye.find(Ge=>Ge.path===Fe.path)){let Ge=A.current.editor.getModelMarkers({resource:Fe});_?.(Ge)}});return()=>{de?.dispose()}}return()=>{}},[N,_]);function se(){H.current?.dispose(),h?m&&uL.set(i,k.current.saveViewState()):k.current.getModel()?.dispose(),k.current.dispose()}return Eo.default.createElement(LCe,{width:g,height:y,isEditorReady:N,loading:c,_ref:F,className:b,wrapperProps:C})}var qqe=Zqe,tNt=(0,ACe.memo)(qqe);var Rl=J(ae()),GCe=J(Nd());var AE=J(ae());var kCe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function pL(t){let e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function kY(t){return"nodeType"in t}function Ol(t){var e,n;return t?pL(t)?t:kY(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function PY(t){let{Document:e}=Ol(t);return t instanceof e}function IY(t){return pL(t)?!1:t instanceof Ol(t).HTMLElement}function FY(t){return t instanceof Ol(t).SVGElement}function Qx(t){return t?pL(t)?t.document:kY(t)?PY(t)?t:IY(t)||FY(t)?t.ownerDocument:document:document:document}function PCe(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,a)=>{let l=Object.entries(a);for(let[c,d]of l){let f=i[c];f!=null&&(i[c]=f+t*d)}return i},{...e})}}var ICe=PCe(1),kE=PCe(-1);function Jqe(t){return"clientX"in t&&"clientY"in t}function BY(t){if(!t)return!1;let{KeyboardEvent:e}=Ol(t.target);return e&&t instanceof e}function Xqe(t){if(!t)return!1;let{TouchEvent:e}=Ol(t.target);return e&&t instanceof e}function mL(t){if(Xqe(t)){if(t.touches&&t.touches.length){let{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){let{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return Jqe(t)?{x:t.clientX,y:t.clientY}:null}var zY=J(ae());var FCe;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(FCe||(FCe={}));var PE=Object.freeze({x:0,y:0});function tJe(t){if(t.startsWith("matrix3d(")){let e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){let e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function nJe(t,e,n){let r=tJe(e);if(!r)return t;let{scaleX:o,scaleY:i,x:a,y:l}=r,c=t.left-a-(1-o)*parseFloat(n),d=t.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?t.width/o:t.width,m=i?t.height/i:t.height;return{width:f,height:m,top:d,right:c+f,bottom:d+m,left:c}}var rJe={ignoreTransform:!1};function vL(t,e){e===void 0&&(e=rJe);let n=t.getBoundingClientRect();if(e.ignoreTransform){let{transform:d,transformOrigin:f}=Ol(t).getComputedStyle(t);d&&(n=nJe(n,d,f))}let{top:r,left:o,width:i,height:a,bottom:l,right:c}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:c}}function BCe(t){return vL(t,{ignoreTransform:!0})}function oJe(t,e){return e===void 0&&(e=Ol(t).getComputedStyle(t)),e.position==="fixed"}function iJe(t,e){e===void 0&&(e=Ol(t).getComputedStyle(t));let n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{let i=e[o];return typeof i=="string"?n.test(i):!1})}function YCe(t,e){let n=[];function r(o){if(e!=null&&n.length>=e||!o)return n;if(PY(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!IY(o)||FY(o)||n.includes(o))return n;let i=Ol(t).getComputedStyle(o);return o!==t&&iJe(o,i)&&n.push(o),oJe(o,i)?n:r(o.parentNode)}return t?r(t):n}function aJe(t){let[e]=YCe(t,1);return e??null}var eC;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(eC||(eC={}));function sJe(t){return!kCe||!t?!1:t===document.scrollingElement}function lJe(t){let e={x:0,y:0},n=sJe(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},o=t.scrollTop<=e.y,i=t.scrollLeft<=e.x,a=t.scrollTop>=r.y,l=t.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:a,isRight:l,maxScroll:r,minScroll:e}}function uJe(t){if(t===document.scrollingElement){let{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}let{top:e,left:n,right:r,bottom:o}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:o,width:t.clientWidth,height:t.clientHeight}}function cJe(t,e){if(e===void 0&&(e=vL),!t)return;let{top:n,left:r,bottom:o,right:i}=e(t);aJe(t)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}var o0=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var o;(o=this.target)==null||o.addEventListener(e,n,r),this.listeners.push([e,n,r])}};function dJe(t){let{EventTarget:e}=Ol(t);return t instanceof e?t:Qx(t)}function VY(t,e){let n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var Su;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Su||(Su={}));function zCe(t){t.preventDefault()}function fJe(t){t.stopPropagation()}var zn;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter"})(zn||(zn={}));var ZCe={start:[zn.Space,zn.Enter],cancel:[zn.Esc],end:[zn.Space,zn.Enter]},pJe=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case zn.Right:return{...n,x:n.x+25};case zn.Left:return{...n,x:n.x-25};case zn.Down:return{...n,y:n.y+25};case zn.Up:return{...n,y:n.y-25}}},hL=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:n}}=e;this.props=e,this.listeners=new o0(Qx(n)),this.windowListeners=new o0(Ol(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Su.Resize,this.handleCancel),this.windowListeners.add(Su.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Su.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&cJe(r),n(PE)}handleKeyDown(e){if(BY(e)){let{active:n,context:r,options:o}=this.props,{keyboardCodes:i=ZCe,coordinateGetter:a=pJe,scrollBehavior:l="smooth"}=o,{code:c}=e;if(i.end.includes(c)){this.handleEnd(e);return}if(i.cancel.includes(c)){this.handleCancel(e);return}let{collisionRect:d}=r.current,f=d?{x:d.left,y:d.top}:PE;this.referenceCoordinates||(this.referenceCoordinates=f);let m=a(e,{active:n,context:r.current,currentCoordinates:f});if(m){let h=kE(m,f),g={x:0,y:0},{scrollableAncestors:y}=r.current;for(let b of y){let C=e.code,{isTop:S,isRight:w,isLeft:E,isBottom:_,maxScroll:N,minScroll:$}=lJe(b),O=uJe(b),M={x:Math.min(C===zn.Right?O.right-O.width/2:O.right,Math.max(C===zn.Right?O.left:O.left+O.width/2,m.x)),y:Math.min(C===zn.Down?O.bottom-O.height/2:O.bottom,Math.max(C===zn.Down?O.top:O.top+O.height/2,m.y))},A=C===zn.Right&&!w||C===zn.Left&&!E,k=C===zn.Down&&!_||C===zn.Up&&!S;if(A&&M.x!==m.x){let F=b.scrollLeft+h.x,U=C===zn.Right&&F<=N.x||C===zn.Left&&F>=$.x;if(U&&!h.y){b.scrollTo({left:F,behavior:l});return}U?g.x=b.scrollLeft-F:g.x=C===zn.Right?b.scrollLeft-N.x:b.scrollLeft-$.x,g.x&&b.scrollBy({left:-g.x,behavior:l});break}else if(k&&M.y!==m.y){let F=b.scrollTop+h.y,U=C===zn.Down&&F<=N.y||C===zn.Up&&F>=$.y;if(U&&!h.x){b.scrollTo({top:F,behavior:l});return}U?g.y=b.scrollTop-F:g.y=C===zn.Down?b.scrollTop-N.y:b.scrollTop-$.y,g.y&&b.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(e,ICe(kE(m,this.referenceCoordinates),g))}}}handleMove(e,n){let{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){let{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){let{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};hL.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=ZCe,onActivation:o}=e,{active:i}=n,{code:a}=t.nativeEvent;if(r.start.includes(a)){let l=i.activatorNode.current;return l&&t.target!==l?!1:(t.preventDefault(),o?.({event:t.nativeEvent}),!0)}return!1}}];function VCe(t){return!!(t&&"distance"in t)}function HCe(t){return!!(t&&"delay"in t)}var IE=class{constructor(e,n,r){var o;r===void 0&&(r=dJe(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;let{event:i}=e,{target:a}=i;this.props=e,this.events=n,this.document=Qx(a),this.documentListeners=new o0(this.document),this.listeners=new o0(r),this.windowListeners=new o0(Ol(a)),this.initialCoordinates=(o=mL(i))!=null?o:PE,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(Su.Resize,this.handleCancel),this.windowListeners.add(Su.DragStart,zCe),this.windowListeners.add(Su.VisibilityChange,this.handleCancel),this.windowListeners.add(Su.ContextMenu,zCe),this.documentListeners.add(Su.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(HCe(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}if(VCe(n))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){let{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Su.Click,fJe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Su.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;let{activated:r,initialCoordinates:o,props:i}=this,{onMove:a,options:{activationConstraint:l}}=i;if(!o)return;let c=(n=mL(e))!=null?n:PE,d=kE(o,c);if(!r&&l){if(VCe(l)){if(l.tolerance!=null&&VY(d,l.tolerance))return this.handleCancel();if(VY(d,l.distance))return this.handleStart()}return HCe(l)&&VY(d,l.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),a(c)}handleEnd(){let{onEnd:e}=this.props;this.detach(),e()}handleCancel(){let{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===zn.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},mJe={move:{name:"pointermove"},end:{name:"pointerup"}},gL=class extends IE{constructor(e){let{event:n}=e,r=Qx(n.target);super(e,mJe,r)}};gL.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var hJe={move:{name:"mousemove"},end:{name:"mouseup"}},jY;(function(t){t[t.RightClick=2]="RightClick"})(jY||(jY={}));var UY=class extends IE{constructor(e){super(e,hJe,Qx(e.event.target))}};UY.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===jY.RightClick?!1:(r?.({event:n}),!0)}}];var HY={move:{name:"touchmove"},end:{name:"touchend"}},KY=class extends IE{constructor(e){super(e,HY)}static setup(){return window.addEventListener(HY.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(HY.move.name,e)};function e(){}}};KY.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e,{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var jCe;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(jCe||(jCe={}));var UCe;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(UCe||(UCe={}));var vNt={x:{[eC.Backward]:!1,[eC.Forward]:!1},y:{[eC.Backward]:!1,[eC.Forward]:!1}};var WY;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(WY||(WY={}));var GY;(function(t){t.Optimized="optimized"})(GY||(GY={}));var yNt={draggable:{measure:BCe},droppable:{measure:BCe,strategy:WY.WhileDragging,frequency:GY.Optimized},dragOverlay:{measure:vL}};var bNt=(0,Rl.createContext)({...PE,scaleX:1,scaleY:1}),KCe;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(KCe||(KCe={}));var tC=J(ae());var MNt=[zn.Down,zn.Right,zn.Up,zn.Left];var jE=J(ae()),uZ=J(ae());Ee();var ptt=J(ae());Ee();Ee();Ee();Ee();Ee();Ee();var DSe=J(EU()),a0=J(ae());Ee();var NSe=J(ae());var LSe=J(ae());Ee();Ee();Ee();var dZ=J(ae());Ee();Ee();Ee();Ee();var $tt=J(qCe());Eb();Db();_b();function JCe(t,e){if(t.inserted[e.name]===void 0)return t.insert("",e,t.sheet,!0)}function XCe(t,e,n){var r=[],o=Tb(t,r,n);return r.length<2?n:o+e(r)}var QCe=function(e){var n=J4(e);n.sheet.speedy=function(l){this.isSpeedy=l},n.compat=!0;var r=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var m=Ym(d,n.registered,void 0);return X4(n,m,!1),n.key+"-"+m.name},o=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var m=Ym(d,n.registered),h="animation-"+m.name;return JCe(n,{name:m.name,styles:"@keyframes "+h+"{"+m.styles+"}"}),h},i=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var m=Ym(d,n.registered);JCe(n,m)},a=function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];return XCe(n.registered,r,gJe(d))};return{css:r,cx:a,injectGlobal:i,keyframes:o,hydrate:function(c){c.forEach(function(d){n.inserted[d]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:Tb.bind(null,n.registered),merge:XCe.bind(null,n.registered,r)}},gJe=function t(e){for(var n="",r=0;r<e.length;r++){var o=e[r];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&&(n&&(n+=" "),n+=i)}}return n};Eb();Db();_b();var Fd=QCe({key:"css"}),VNt=Fd.flush,HNt=Fd.hydrate,jNt=Fd.cx,UNt=Fd.merge,KNt=Fd.getRegisteredStyles,WNt=Fd.injectGlobal,GNt=Fd.keyframes,nn=Fd.css,YNt=Fd.sheet,ZNt=Fd.cache;var DL=J(ae());Ee();Ee();var OSe=J(ae());Ee();var UE=J(ae()),RSe=J(ae()),ASe=J(Nd());Ee();Ee();var kSe=J(ae());Ee();var FSe=J(ae());Ee();var fZ=J(ae());var pZ=J(ae());Ee();await wB();var vJe=Object.getOwnPropertyNames,yJe=Object.getOwnPropertySymbols,bJe=Object.prototype.hasOwnProperty;function e2e(t,e){return function(r,o,i){return t(r,o,i)&&e(r,o,i)}}function yL(t){return function(n,r,o){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,o);var i=o.cache,a=i.get(n),l=i.get(r);if(a&&l)return a===r&&l===n;i.set(n,r),i.set(r,n);var c=t(n,r,o);return i.delete(n),i.delete(r),c}}function t2e(t){return vJe(t).concat(yJe(t))}var l2e=Object.hasOwn||function(t,e){return bJe.call(t,e)};function nC(t,e){return t||e?t===e:t===e||t!==t&&e!==e}var u2e="_owner",n2e=Object.getOwnPropertyDescriptor,r2e=Object.keys;function xJe(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function CJe(t,e){return nC(t.getTime(),e.getTime())}function o2e(t,e,n){if(t.size!==e.size)return!1;for(var r={},o=t.entries(),i=0,a,l;(a=o.next())&&!a.done;){for(var c=e.entries(),d=!1,f=0;(l=c.next())&&!l.done;){var m=a.value,h=m[0],g=m[1],y=l.value,b=y[0],C=y[1];!d&&!r[f]&&(d=n.equals(h,b,i,f,t,e,n)&&n.equals(g,C,h,b,t,e,n))&&(r[f]=!0),f++}if(!d)return!1;i++}return!0}function SJe(t,e,n){var r=r2e(t),o=r.length;if(r2e(e).length!==o)return!1;for(var i;o-- >0;)if(i=r[o],i===u2e&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!l2e(e,i)||!n.equals(t[i],e[i],i,i,t,e,n))return!1;return!0}function BE(t,e,n){var r=t2e(t),o=r.length;if(t2e(e).length!==o)return!1;for(var i,a,l;o-- >0;)if(i=r[o],i===u2e&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!l2e(e,i)||!n.equals(t[i],e[i],i,i,t,e,n)||(a=n2e(t,i),l=n2e(e,i),(a||l)&&(!a||!l||a.configurable!==l.configurable||a.enumerable!==l.enumerable||a.writable!==l.writable)))return!1;return!0}function wJe(t,e){return nC(t.valueOf(),e.valueOf())}function EJe(t,e){return t.source===e.source&&t.flags===e.flags}function i2e(t,e,n){if(t.size!==e.size)return!1;for(var r={},o=t.values(),i,a;(i=o.next())&&!i.done;){for(var l=e.values(),c=!1,d=0;(a=l.next())&&!a.done;)!c&&!r[d]&&(c=n.equals(i.value,a.value,i.value,a.value,t,e,n))&&(r[d]=!0),d++;if(!c)return!1}return!0}function TJe(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var _Je="[object Arguments]",DJe="[object Boolean]",$Je="[object Date]",NJe="[object Map]",LJe="[object Number]",MJe="[object Object]",OJe="[object RegExp]",RJe="[object Set]",AJe="[object String]",kJe=Array.isArray,a2e=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,s2e=Object.assign,PJe=Object.prototype.toString.call.bind(Object.prototype.toString);function IJe(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,o=t.areObjectsEqual,i=t.arePrimitiveWrappersEqual,a=t.areRegExpsEqual,l=t.areSetsEqual,c=t.areTypedArraysEqual;return function(f,m,h){if(f===m)return!0;if(f==null||m==null||typeof f!="object"||typeof m!="object")return f!==f&&m!==m;var g=f.constructor;if(g!==m.constructor)return!1;if(g===Object)return o(f,m,h);if(kJe(f))return e(f,m,h);if(a2e!=null&&a2e(f))return c(f,m,h);if(g===Date)return n(f,m,h);if(g===RegExp)return a(f,m,h);if(g===Map)return r(f,m,h);if(g===Set)return l(f,m,h);var y=PJe(f);return y===$Je?n(f,m,h):y===OJe?a(f,m,h):y===NJe?r(f,m,h):y===RJe?l(f,m,h):y===MJe?typeof f.then!="function"&&typeof m.then!="function"&&o(f,m,h):y===_Je?o(f,m,h):y===DJe||y===LJe||y===AJe?i(f,m,h):!1}}function FJe(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,o={areArraysEqual:r?BE:xJe,areDatesEqual:CJe,areMapsEqual:r?e2e(o2e,BE):o2e,areObjectsEqual:r?BE:SJe,arePrimitiveWrappersEqual:wJe,areRegExpsEqual:EJe,areSetsEqual:r?e2e(i2e,BE):i2e,areTypedArraysEqual:r?BE:TJe};if(n&&(o=s2e({},o,n(o))),e){var i=yL(o.areArraysEqual),a=yL(o.areMapsEqual),l=yL(o.areObjectsEqual),c=yL(o.areSetsEqual);o=s2e({},o,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:l,areSetsEqual:c})}return o}function BJe(t){return function(e,n,r,o,i,a,l){return t(e,n,l)}}function zJe(t){var e=t.circular,n=t.comparator,r=t.createState,o=t.equals,i=t.strict;if(r)return function(c,d){var f=r(),m=f.cache,h=m===void 0?e?new WeakMap:void 0:m,g=f.meta;return n(c,d,{cache:h,equals:o,meta:g,strict:i})};if(e)return function(c,d){return n(c,d,{cache:new WeakMap,equals:o,meta:void 0,strict:i})};var a={cache:void 0,equals:o,meta:void 0,strict:i};return function(c,d){return n(c,d,a)}}var c2e=kh(),JNt=kh({strict:!0}),XNt=kh({circular:!0}),QNt=kh({circular:!0,strict:!0}),e8t=kh({createInternalComparator:function(){return nC}}),t8t=kh({strict:!0,createInternalComparator:function(){return nC}}),n8t=kh({circular:!0,createInternalComparator:function(){return nC}}),r8t=kh({circular:!0,createInternalComparator:function(){return nC},strict:!0});function kh(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,o=t.createState,i=t.strict,a=i===void 0?!1:i,l=FJe(t),c=IJe(l),d=r?r(c):BJe(c);return zJe({circular:n,comparator:c,createState:o,equals:d,strict:a})}var BSe=J(ae());await B1();var lnt=J(ae());var hnt=J(ae());Ee();await Ni();await er();var $L=J(ae());var VSe=J(ae());Ee();var Fh=J(ae());Ee();var WE=J(ae()),Cnt=J(Nd());var HSe=J(ae());Ee();await B1();var jSe=J(ae()),USe=J(ae());var gZ=J(ae());var vZ=J(ae());var yZ=J(ae());Ee();var _nt=J(ae());Ee();var GE=J(ae());Ee();Ee();var KSe=J(ae());Ee();var NL=J(ae());Ee();Ee();var Bh=J(ae());var WSe=J(ae());Ee();Ee();var xL=L`
261
261
  --utility-caution-icon: #facc15;
262
262
  --utility-caution-title: #854d0e;
263
263
  --utility-caution-container: #fefce8;
@@ -3025,23 +3025,19 @@ to {
3025
3025
  inset: 0;
3026
3026
  transition: transform var(--duration-fast) var(--timing-ease-out);
3027
3027
  `,Ckt=L`
3028
- display: flex;
3029
- justify-content: space-between;
3030
- font-weight: var(--fw-bold);
3031
- `,Skt=L`
3032
- font-size: var(--fs-baase);
3033
- `;var Ekt=L`
3028
+ font-size: var(--fs-sm);
3029
+ `;var wkt=L`
3034
3030
  display: flex block;
3035
3031
  flex-direction: column;
3036
3032
  gap: var(--spacing-sm);
3037
- `,Tkt=L`
3033
+ `,Ekt=L`
3038
3034
  color: var(--gray-400);
3039
3035
  font-weight: var(--fw-medium);
3040
3036
  font-size: var(--fs-sm);
3041
3037
  text-transform: uppercase;
3042
- `;var Dkt=L`
3038
+ `;var _kt=L`
3043
3039
  position: relative;
3044
- `,$kt=L`
3040
+ `,Dkt=L`
3045
3041
  background: var(--gray-50);
3046
3042
  border-top: 1px solid var(--gray-200);
3047
3043
  border-bottom: 1px solid var(--gray-200);
@@ -3061,7 +3057,7 @@ to {
3061
3057
  margin-block: 0;
3062
3058
  }
3063
3059
  }
3064
- `;var Lkt=L`
3060
+ `;var Nkt=L`
3065
3061
  align-items: center;
3066
3062
  background: var(--white);
3067
3063
  border-radius: var(--rounded-base);
@@ -3069,11 +3065,11 @@ to {
3069
3065
  display: flex;
3070
3066
  min-height: 52px;
3071
3067
  transition: border-color var(--duration-fast) var(--timing-ease-out);
3072
- `,Mkt=L`
3068
+ `,Lkt=L`
3073
3069
  box-shadow: var(--shadow-base);
3074
- `,Okt=L`
3070
+ `,Mkt=L`
3075
3071
  border-color: var(--brand-secondary-3);
3076
- `,Rkt=L`
3072
+ `,Okt=L`
3077
3073
  align-items: center;
3078
3074
  border: none;
3079
3075
  background: transparent;
@@ -3087,53 +3083,53 @@ to {
3087
3083
  &:focus {
3088
3084
  outline: none;
3089
3085
  }
3090
- `,Akt=L`
3086
+ `,Rkt=L`
3091
3087
  align-items: center;
3092
3088
  cursor: pointer;
3093
3089
  display: flex;
3094
3090
  padding: var(--spacing-xs) var(--spacing-base) var(--spacing-xs);
3095
3091
  flex-grow: 1;
3096
- `,kkt=L`
3092
+ `,Akt=L`
3097
3093
  align-items: center;
3098
3094
  display: flex;
3099
3095
  gap: var(--spacing-sm);
3100
3096
  flex-grow: 1;
3101
3097
  flex-wrap: wrap;
3102
- `,Pkt=L`
3098
+ `,kkt=L`
3103
3099
  position: absolute;
3104
3100
  height: 0;
3105
3101
  width: 0;
3106
3102
  opacity: 0;
3107
- `,Ikt=L`
3103
+ `,Pkt=L`
3108
3104
  border-radius: var(--rounded-full);
3109
3105
  background: var(--brand-secondary-3);
3110
3106
  color: var(--white);
3111
3107
  transition: opacity var(--duration-fast) var(--timing-ease-out);
3112
3108
  min-width: 24px;
3113
3109
  opacity: 0;
3114
- `,Fkt=L`
3110
+ `,Ikt=L`
3115
3111
  animation: ${I2e} var(--duration-fast) var(--timing-ease-out) forwards;
3116
- `;var zkt=L`
3112
+ `;var Bkt=L`
3117
3113
  display: inline-flex;
3118
3114
  justify-content: center;
3119
- `;var Hkt=L`
3115
+ `;var Vkt=L`
3120
3116
  inset: 0;
3121
3117
  overflow: hidden;
3122
3118
  justify-content: center;
3123
3119
  padding: var(--spacing-xl);
3124
3120
  overflow-y: auto;
3125
- `,jkt=L`
3121
+ `,Hkt=L`
3126
3122
  display: flex;
3127
- `,Ukt=L`
3123
+ `,jkt=L`
3128
3124
  display: none;
3129
- `;var Kkt=L`
3125
+ `;var Ukt=L`
3130
3126
  align-items: center;
3131
3127
  display: flex;
3132
3128
  flex-direction: column;
3133
- `,Wkt=L`
3129
+ `,Kkt=L`
3134
3130
  color: var(--gray-600);
3135
3131
  margin: var(--spacing-base) 0 0;
3136
- `,Gkt=L`
3132
+ `,Wkt=L`
3137
3133
  aspect-ratio: 1/1;
3138
3134
  position: relative;
3139
3135
  transition: filter var(--duration-xslow) ease-in-out;
@@ -3321,7 +3317,7 @@ to {
3321
3317
  z-index: 1;
3322
3318
  }
3323
3319
  }
3324
- `;var ptt=L`
3320
+ `;var mtt=L`
3325
3321
  border: none;
3326
3322
  position: relative;
3327
3323
  max-width: calc(100% - var(--spacing-base) * 2);
@@ -3334,13 +3330,13 @@ to {
3334
3330
  background-color: var(--gray-800);
3335
3331
  opacity: 0.4;
3336
3332
  }
3337
- `,mtt=L`
3338
- width: clamp(280px, 100vw, 400px);
3339
3333
  `,htt=L`
3340
- width: clamp(280px, 100vw, 600px);
3334
+ width: clamp(280px, 100vw, 400px);
3341
3335
  `,gtt=L`
3342
- width: clamp(280px, 100vw, 800px);
3336
+ width: clamp(280px, 100vw, 600px);
3343
3337
  `,vtt=L`
3338
+ width: clamp(280px, 100vw, 800px);
3339
+ `,ytt=L`
3344
3340
  position: relative;
3345
3341
  width: 100%;
3346
3342
  display: flex;
@@ -3359,9 +3355,9 @@ to {
3359
3355
  font-size: var(--fs-md);
3360
3356
  font-family: var(--ff-base);
3361
3357
  line-height: 1.2;
3362
- `,ytt=L`
3363
- max-width: calc(100% - 3rem);
3364
3358
  `,btt=L`
3359
+ max-width: calc(100% - 3rem);
3360
+ `,xtt=L`
3365
3361
  background: transparent;
3366
3362
  border: none;
3367
3363
  color: var(--gray-300);
@@ -3375,7 +3371,7 @@ to {
3375
3371
  background: transparent;
3376
3372
  color: var(--gray-400);
3377
3373
  }
3378
- `,xtt=L`
3374
+ `,Ctt=L`
3379
3375
  position: relative;
3380
3376
  flex: 1;
3381
3377
  overflow: auto;
@@ -3383,19 +3379,19 @@ to {
3383
3379
  padding: var(--spacing-md);
3384
3380
  border-radius: var(--rounded-sm);
3385
3381
  ${Cc}
3386
- `,Ctt=t=>L`
3382
+ `,Stt=t=>L`
3387
3383
  height: 100%;
3388
3384
  padding: ${t?0:"var(--spacing-md)"} var(--spacing-lg) var(--spacing-md);
3389
- `,Stt=L`
3385
+ `,wtt=L`
3390
3386
  // we need to override the gap of the modalInnerStyles when using a modal dialog
3391
3387
  > div {
3392
3388
  gap: 0;
3393
3389
  }
3394
- `,wtt="75rem",Ett="51rem",cZ=a0.default.forwardRef(({header:t,children:e,onRequestClose:n,width:r=wtt,height:o=Ett,buttonGroup:i,modalSize:a="lg",withoutContentPadding:l=!1,withoutContentBackground:c=!1,disableBodyScroll:d=!1,...f},m)=>{let h=(0,a0.useRef)(!1),g=(0,a0.useRef)(null),y={sm:mtt,md:htt,lg:gtt};return R2e({handler:()=>{n?.()},shortcut:"escape"}),(0,a0.useEffect)(()=>{var b;if(!document.contains(g.current)){console.warn("The Modal component could not be rendered because it's not attached to the current Document.");return}return(b=g.current)==null||b.showModal(),()=>{var C;(C=g.current)==null||C.close()}},[]),W("dialog",{ref:b=>{g.current=b,m&&(typeof m=="function"?m(b):m.current=b)},css:[ptt,r?void 0:y[a]],style:{width:r,height:o==="auto"?"min-content":o,overflow:"visible"},"data-testid":"side-dialog",onClick:()=>{h.current||n?.()},onMouseUp:()=>{setTimeout(()=>{h.current=!1})},onCancel:b=>{b.preventDefault()},...f,children:W(wh.Provider,{value:g.current,children:Me("div",{css:[vtt,{height:o==="auto"?"auto":"100%"}],onClick:b=>b.stopPropagation(),onMouseDown:()=>{h.current=!0},children:[t||n?Me("div",{css:$Se,children:[t?W("div",{css:ytt,children:t}):null,n?W(SL,{type:"button",onClick:n,css:btt,title:"Close dialog",buttonType:"ghost","data-testid":"close-dialog",children:W(rl,{icon:DSe.CgClose,iconColor:"currentColor",size:24})}):null]}):null,W("div",{css:[xtt,l?{padding:0}:null,c?{background:"transparent"}:null,d?{overflow:"visible"}:null],children:e}),i?W(CL,{children:i}):null]})})})});cZ.displayName="Modal";var Ttt=(0,NSe.forwardRef)(({header:t,buttonGroup:e,modalSize:n="lg",children:r,height:o="auto",onRequestClose:i,...a},l)=>W(cZ,{...a,modalSize:n,ref:l,onRequestClose:i,height:o,withoutContentBackground:!0,withoutContentPadding:!0,css:Stt,width:"",children:Me(YJe,{css:Ctt(!!i),children:[W("div",{css:$Se,children:t}),W("div",{css:{flex:1},children:r}),W(CL,{children:e})]})}));Ttt.displayName="ModalDialog";var _tt=t=>L`
3390
+ `,Ett="75rem",Ttt="51rem",cZ=a0.default.forwardRef(({header:t,children:e,onRequestClose:n,width:r=Ett,height:o=Ttt,buttonGroup:i,modalSize:a="lg",withoutContentPadding:l=!1,withoutContentBackground:c=!1,disableBodyScroll:d=!1,...f},m)=>{let h=(0,a0.useRef)(!1),g=(0,a0.useRef)(null),y={sm:htt,md:gtt,lg:vtt};return R2e({handler:()=>{n?.()},shortcut:"escape"}),(0,a0.useEffect)(()=>{var b;if(!document.contains(g.current)){console.warn("The Modal component could not be rendered because it's not attached to the current Document.");return}return(b=g.current)==null||b.showModal(),()=>{var C;(C=g.current)==null||C.close()}},[]),W("dialog",{ref:b=>{g.current=b,m&&(typeof m=="function"?m(b):m.current=b)},css:[mtt,r?void 0:y[a]],style:{width:r,height:o==="auto"?"min-content":o,overflow:"visible"},"data-testid":"side-dialog",onClick:()=>{h.current||n?.()},onMouseUp:()=>{setTimeout(()=>{h.current=!1})},onCancel:b=>{b.preventDefault()},...f,children:W(wh.Provider,{value:g.current,children:Me("div",{css:[ytt,{height:o==="auto"?"auto":"100%"}],onClick:b=>b.stopPropagation(),onMouseDown:()=>{h.current=!0},children:[t||n?Me("div",{css:$Se,children:[t?W("div",{css:btt,children:t}):null,n?W(SL,{type:"button",onClick:n,css:xtt,title:"Close dialog",buttonType:"ghost","data-testid":"close-dialog",children:W(rl,{icon:DSe.CgClose,iconColor:"currentColor",size:24})}):null]}):null,W("div",{css:[Ctt,l?{padding:0}:null,c?{background:"transparent"}:null,d?{overflow:"visible"}:null],children:e}),i?W(CL,{children:i}):null]})})})});cZ.displayName="Modal";var _tt=(0,NSe.forwardRef)(({header:t,buttonGroup:e,modalSize:n="lg",children:r,height:o="auto",onRequestClose:i,...a},l)=>W(cZ,{...a,modalSize:n,ref:l,onRequestClose:i,height:o,withoutContentBackground:!0,withoutContentPadding:!0,css:wtt,width:"",children:Me(YJe,{css:Stt(!!i),children:[W("div",{css:$Se,children:t}),W("div",{css:{flex:1},children:r}),W(CL,{children:e})]})}));_tt.displayName="ModalDialog";var Dtt=t=>L`
3395
3391
  display: grid;
3396
3392
  grid-template-columns: repeat(${t}, minmax(250px, 1fr));
3397
3393
  gap: var(--spacing-base);
3398
- `,ePt=(0,LSe.forwardRef)(({gridCount:t=3,children:e,...n},r)=>W("div",{ref:r,"data-testid":"object-grid-container",css:_tt(t),...n,children:e})),nPt=L`
3394
+ `,Qkt=(0,LSe.forwardRef)(({gridCount:t=3,children:e,...n},r)=>W("div",{ref:r,"data-testid":"object-grid-container",css:Dtt(t),...n,children:e})),tPt=L`
3399
3395
  border: 1px solid var(--gray-300);
3400
3396
  border-radius: var(--rounded-base);
3401
3397
  background: var(--white);
@@ -3413,18 +3409,18 @@ to {
3413
3409
  border: 1px solid var(--accent-dark);
3414
3410
  }
3415
3411
  }
3416
- `,rPt=L`
3412
+ `,nPt=L`
3417
3413
  cursor: pointer;
3418
3414
  &:hover,
3419
3415
  &:focus {
3420
3416
  border: 1px solid var(--accent-dark);
3421
3417
  transition: border-color var(--duration-fast) var(--timing-ease-out);
3422
3418
  }
3423
- `,oPt=L`
3419
+ `,rPt=L`
3424
3420
  display: flex;
3425
3421
  flex: 1 1 0;
3426
3422
  position: relative;
3427
- `,iPt=L`
3423
+ `,oPt=L`
3428
3424
  background: var(--gray-50);
3429
3425
  border-radius: var(--rounded-base) var(--rounded-base) 0 0;
3430
3426
  position: relative;
@@ -3435,27 +3431,27 @@ to {
3435
3431
  overflow: hidden;
3436
3432
  height: 100%;
3437
3433
  z-index: 0;
3438
- `,aPt=L`
3434
+ `,iPt=L`
3439
3435
  display: grid;
3440
3436
  grid-template-columns: 1fr auto;
3441
3437
  padding: var(--spacing-sm);
3442
3438
  gap: var(--spacing-sm);
3443
3439
  min-height: 52px;
3444
3440
  width: 100%;
3445
- `,sPt=L`
3441
+ `,aPt=L`
3446
3442
  min-width: 0;
3447
- `,lPt=L`
3443
+ `,sPt=L`
3448
3444
  object-fit: cover;
3449
3445
  width: 100%;
3450
3446
  height: auto;
3451
- `,uPt=L`
3447
+ `,lPt=L`
3452
3448
  color: var(--gray-500);
3453
3449
  font-size: var(--fs-sm);
3454
3450
  white-space: nowrap;
3455
3451
  overflow: hidden;
3456
3452
  text-overflow: ellipsis;
3457
3453
  max-width: 100%;
3458
- `;var dPt=L`
3454
+ `;var cPt=L`
3459
3455
  aspect-ratio: 16/9;
3460
3456
  max-width: 100%;
3461
3457
  max-height: 100%;
@@ -3463,25 +3459,25 @@ to {
3463
3459
  width: inherit;
3464
3460
  padding: var(--spacing-sm);
3465
3461
  object-fit: contain;
3466
- `,fPt=L`
3462
+ `,dPt=L`
3467
3463
  aspect-ratio: 16/9;
3468
3464
  width: 100%;
3469
3465
  height: 100%;
3470
- `,pPt=L`
3466
+ `,fPt=L`
3471
3467
  position: relative;
3472
3468
  display: flex;
3473
3469
  align-items: center;
3474
3470
  justify-content: center;
3475
3471
  flex: 1;
3476
3472
  height: 100%;
3477
- `,mPt=L`
3473
+ `,pPt=L`
3478
3474
  position: absolute;
3479
3475
  width: 60%;
3480
3476
  height: auto;
3481
3477
  aspect-ratio: 1;
3482
3478
  opacity: 0.05;
3483
3479
  transform: rotateZ(-15deg) translate(35%, 30%);
3484
- `,hPt=L`
3480
+ `,mPt=L`
3485
3481
  align-items: center;
3486
3482
  background: var(--gray-50);
3487
3483
  display: flex;
@@ -3491,13 +3487,13 @@ to {
3491
3487
  z-index: 1;
3492
3488
  width: 24px;
3493
3489
  height: 24px;
3494
- `,gPt=L`
3490
+ `,hPt=L`
3495
3491
  border-bottom-right-radius: var(--rounded-base);
3496
3492
  left: var(--spacing-sm);
3497
- `,vPt=L`
3493
+ `,gPt=L`
3498
3494
  border-bottom-left-radius: var(--rounded-base);
3499
3495
  right: var(--spacing-sm);
3500
- `,yPt=L`
3496
+ `,vPt=L`
3501
3497
  align-items: stretch;
3502
3498
  border: none;
3503
3499
  background: none;
@@ -3509,17 +3505,17 @@ to {
3509
3505
  &:hover {
3510
3506
  outline: none;
3511
3507
  }
3512
- `,bPt=L`
3508
+ `,yPt=L`
3513
3509
  position: absolute;
3514
3510
  bottom: var(--spacing-base);
3515
- `,xPt=L`
3511
+ `,bPt=L`
3516
3512
  left: var(--spacing-base);
3517
- `,CPt=L`
3513
+ `,xPt=L`
3518
3514
  right: var(--spacing-base);
3519
- `,SPt=L`
3515
+ `,CPt=L`
3520
3516
  animation: ${I2e} var(--duration-fast) var(--timing-ease-out) forwards;
3521
3517
  opacity: 0;
3522
- `;var EPt=L`
3518
+ `;var wPt=L`
3523
3519
  color: var(--gray-500);
3524
3520
  overflow: hidden;
3525
3521
  text-overflow: ellipsis;
@@ -3527,22 +3523,22 @@ to {
3527
3523
  min-width: 0;
3528
3524
  max-width: 100%;
3529
3525
  font-size: var(--fs-sm);
3530
- `,TPt=L`
3526
+ `,EPt=L`
3531
3527
  min-width: 50px;
3532
- `;var DPt=L`
3528
+ `;var _Pt=L`
3533
3529
  border-radius: var(--rounded-base);
3534
3530
  display: flex;
3535
3531
  flex-direction: column;
3536
3532
  gap: var(--spacing-sm);
3537
3533
  transition: border-color var(--duration-fast) var(--timing-ease-out);
3538
- `;var $Pt=L`
3534
+ `;var DPt=L`
3539
3535
  aspect-ratio: 16/9;
3540
3536
  max-width: 100%;
3541
3537
  max-height: 100%;
3542
3538
  height: auto;
3543
3539
  padding: var(--spacing-sm);
3544
3540
  overflow: hidden;
3545
- `,NPt=L`
3541
+ `,$Pt=L`
3546
3542
  animation: ${oC} 1s linear infinite alternate;
3547
3543
  border-radius: var(--rounded-base);
3548
3544
  background: var(--gray-300);
@@ -3550,13 +3546,13 @@ to {
3550
3546
  width: 100%;
3551
3547
  height: auto;
3552
3548
  aspect-ratio: 1;
3553
- `,LPt=L`
3549
+ `,NPt=L`
3554
3550
  padding: 0 var(--spacing-sm) var(--spacing-sm);
3555
3551
  min-height: 52px;
3556
- `,MPt=L`
3552
+ `,LPt=L`
3557
3553
  flex-grow: 1;
3558
3554
  gap: var(--spacing-xs);
3559
- `;var RPt=L`
3555
+ `;var OPt=L`
3560
3556
  background: var(--white);
3561
3557
  display: grid;
3562
3558
  gap: var(--spacing-sm);
@@ -3568,21 +3564,21 @@ to {
3568
3564
  &:hover {
3569
3565
  background: var(--gray-50);
3570
3566
  }
3571
- `,APt=L`
3567
+ `,RPt=L`
3572
3568
  align-items: center;
3573
- `,kPt=L`
3569
+ `,APt=L`
3574
3570
  display: grid;
3575
3571
  gap: var(--spacing-sm);
3576
3572
  justify-content: space-between;
3577
3573
  flex-grow: 1;
3578
- `,PPt=L`
3574
+ `,kPt=L`
3579
3575
  display: flex;
3580
3576
  gap: var(--spacing-sm);
3581
- `,IPt=L`
3577
+ `,PPt=L`
3582
3578
  > [role='listitem']:not(:first-of-type) {
3583
3579
  border-top: 1px solid var(--gray-200);
3584
3580
  }
3585
- `,FPt=L`
3581
+ `,IPt=L`
3586
3582
  align-items: center;
3587
3583
  background: var(--gray-100);
3588
3584
  color: var(--gray-500);
@@ -3591,30 +3587,30 @@ to {
3591
3587
  height: 45px;
3592
3588
  text-align: center;
3593
3589
  font-size: var(--fs-xs);
3594
- `,BPt=L`
3590
+ `,FPt=L`
3595
3591
  object-fit: cover;
3596
3592
  width: 100%;
3597
3593
  height: 100%;
3598
- `,zPt=L`
3594
+ `,BPt=L`
3599
3595
  animation: ${TL} 1s linear infinite alternate;
3600
3596
  background: var(--white);
3601
3597
  display: flex;
3602
3598
  gap: var(--spacing-sm);
3603
3599
  flex-grow: 1;
3604
3600
  padding: var(--spacing-sm);
3605
- `,VPt=L`
3601
+ `,zPt=L`
3606
3602
  flex-grow: 1;
3607
- `;var HPt=L`
3603
+ `;var VPt=L`
3608
3604
  animation: ${oC} 1s linear infinite alternate;
3609
3605
  border-radius: var(--rounded-base);
3610
3606
  background: var(--gray-300);
3611
3607
  display: block;
3612
3608
  width: 80px;
3613
3609
  height: 55px;
3614
- `,jPt=L`
3610
+ `,HPt=L`
3615
3611
  display: flex;
3616
3612
  gap: var(--spacing-xs);
3617
- `;var KPt=L`
3613
+ `;var UPt=L`
3618
3614
  display: flex;
3619
3615
  flex-direction: column;
3620
3616
  gap: var(--spacing-xs);
@@ -3623,27 +3619,27 @@ to {
3623
3619
  align-items: center;
3624
3620
  flex-direction: row;
3625
3621
  }
3626
- `,WPt=L`
3622
+ `,KPt=L`
3627
3623
  line-height: 1.25;
3628
- `;var YPt=nn`
3624
+ `;var GPt=nn`
3629
3625
  align-items: center;
3630
3626
  display: flex;
3631
- `,ZPt=nn`
3627
+ `,YPt=nn`
3632
3628
  opacity: var(--opacity-50);
3633
- `,qPt=nn`
3629
+ `,ZPt=nn`
3634
3630
  cursor: pointer-default;
3635
- `,JPt=nn`
3631
+ `,qPt=nn`
3636
3632
  display: block;
3637
3633
  padding: var(--spacing-sm) var(--spacing-base);
3638
- `,XPt=nn`
3634
+ `,JPt=nn`
3639
3635
  padding: var(--spacing-sm) var(--spacing-base);
3640
- `,QPt=nn`
3636
+ `,XPt=nn`
3641
3637
  border-radius: var(--rounded-base);
3642
3638
  background: var(--gray-200);
3643
- `,eIt=nn`
3639
+ `,QPt=nn`
3644
3640
  margin-left: var(--spacing-xs);
3645
3641
  margin-right: var(--spacing-xs);
3646
- `;var MSe=(0,DL.createContext)({id:"",label:"",hiddenLabel:void 0,errorMessage:void 0,handleManuallySetErrorMessage:()=>{}}),lC=()=>{let{id:t,label:e,hiddenLabel:n,errorMessage:r,handleManuallySetErrorMessage:o}=(0,DL.useContext)(MSe);return{id:t,label:e,hiddenLabel:n,errorMessage:r,handleManuallySetErrorMessage:o}},nIt=L`
3642
+ `;var MSe=(0,DL.createContext)({id:"",label:"",hiddenLabel:void 0,errorMessage:void 0,handleManuallySetErrorMessage:()=>{}}),lC=()=>{let{id:t,label:e,hiddenLabel:n,errorMessage:r,handleManuallySetErrorMessage:o}=(0,DL.useContext)(MSe);return{id:t,label:e,hiddenLabel:n,errorMessage:r,handleManuallySetErrorMessage:o}},tIt=L`
3647
3643
  align-items: center;
3648
3644
  border: none;
3649
3645
  border-radius: var(--rounded-base);
@@ -3668,22 +3664,22 @@ to {
3668
3664
  &:focus {
3669
3665
  outline: none;
3670
3666
  }
3671
- `;var oIt=L`
3667
+ `;var rIt=L`
3672
3668
  align-items: center;
3673
3669
  display: flex;
3674
3670
  gap: var(--spacing-base);
3675
3671
  justify-content: space-between;
3676
3672
  margin-bottom: var(--spacing-sm);
3677
- `,iIt=L`
3673
+ `,oIt=L`
3678
3674
  align-items: center;
3679
3675
  display: flex;
3680
3676
  gap: var(--spacing-sm);
3681
- `,aIt=L`
3677
+ `,iIt=L`
3682
3678
  text-overflow: ellipsis;
3683
3679
  white-space: nowrap;
3684
3680
  overflow: hidden;
3685
3681
  max-width: 22ch;
3686
- `;var $tt=L`
3682
+ `;var Ntt=L`
3687
3683
  &:disabled,
3688
3684
  [readonly] {
3689
3685
  pointer-events: none;
@@ -3693,25 +3689,25 @@ to {
3693
3689
  opacity: var(--opacity-60);
3694
3690
  }
3695
3691
  }
3696
- `,Ntt=L`
3692
+ `,Ltt=L`
3697
3693
  display: block;
3698
3694
  font-weight: var(--fw-medium);
3699
3695
  margin-bottom: var(--spacing-sm);
3700
3696
  width: 100%;
3701
- `,uIt=(0,OSe.forwardRef)(({legend:t,isDisabled:e,children:n,...r},o)=>Me("fieldset",{css:$tt,disabled:e,ref:o,...r,children:[W("legend",{css:Ntt,children:t}),n]})),Ltt=L`
3697
+ `,lIt=(0,OSe.forwardRef)(({legend:t,isDisabled:e,children:n,...r},o)=>Me("fieldset",{css:Ntt,disabled:e,ref:o,...r,children:[W("legend",{css:Ltt,children:t}),n]})),Mtt=L`
3702
3698
  margin-top: var(--spacing-xs);
3703
3699
  background: var(--gray-50);
3704
3700
  padding: var(--spacing-sm);
3705
3701
  border: solid 1px var(--gray-300);
3706
3702
  border-radius: var(--rounded-sm);
3707
- `,Mtt=L`
3703
+ `,Ott=L`
3708
3704
  display: block;
3709
3705
  width: 100%;
3710
3706
 
3711
3707
  img {
3712
3708
  max-height: 9rem;
3713
3709
  }
3714
- `,Ott=L`
3710
+ `,Rtt=L`
3715
3711
  background: var(--gray-50);
3716
3712
  display: flex;
3717
3713
  height: 100%;
@@ -3719,7 +3715,7 @@ to {
3719
3715
  align-items: center;
3720
3716
  border: solid 1px var(--gray-300);
3721
3717
  border-radius: var(--rounded-sm);
3722
- `,Rtt=L`
3718
+ `,Att=L`
3723
3719
  display: flex;
3724
3720
  height: 100%;
3725
3721
  width: 100%;
@@ -3728,7 +3724,7 @@ to {
3728
3724
  img {
3729
3725
  max-height: 100%;
3730
3726
  }
3731
- `;function Att({imageSrc:t}){let[e,n]=(0,RSe.useState)(!1);return t?Me("div",{css:Ltt,children:[W(ktt,{open:e,imageSrc:t,onRequestClose:()=>n(!1)}),W("button",{css:Mtt,onClick:()=>{n(!0)},children:W(wSe,{src:t,"data-testid":"parameter-image-preview"})})]}):null}var ktt=({open:t,onRequestClose:e,imageSrc:n})=>t?W(Ws,{children:(0,ASe.createPortal)(W(cZ,{header:"Image Preview",onRequestClose:e,buttonGroup:W(SL,{buttonType:"secondary",onClick:e,children:"Ok"}),children:W("div",{css:Ott,children:W(wSe,{src:n,css:Rtt,"data-testid":"parameter-image-preview"})})}),document.body)}):null,Ptt=L`
3727
+ `;function ktt({imageSrc:t}){let[e,n]=(0,RSe.useState)(!1);return t?Me("div",{css:Mtt,children:[W(Ptt,{open:e,imageSrc:t,onRequestClose:()=>n(!1)}),W("button",{css:Ott,onClick:()=>{n(!0)},children:W(wSe,{src:t,"data-testid":"parameter-image-preview"})})]}):null}var Ptt=({open:t,onRequestClose:e,imageSrc:n})=>t?W(Ws,{children:(0,ASe.createPortal)(W(cZ,{header:"Image Preview",onRequestClose:e,buttonGroup:W(SL,{buttonType:"secondary",onClick:e,children:"Ok"}),children:W("div",{css:Rtt,children:W(wSe,{src:n,css:Att,"data-testid":"parameter-image-preview"})})}),document.body)}):null,Itt=L`
3732
3728
  position: relative;
3733
3729
  scroll-margin: var(--spacing-2xl);
3734
3730
 
@@ -3793,7 +3789,7 @@ to {
3793
3789
  cursor: not-allowed;
3794
3790
  color: var(--gray-400);
3795
3791
  }
3796
- `,Itt=L`
3792
+ `,Ftt=L`
3797
3793
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%0A%3E%3Cpath d='M6.34317 7.75732L4.92896 9.17154L12 16.2426L19.0711 9.17157L17.6569 7.75735L12 13.4142L6.34317 7.75732Z' fill='currentColor' /%3E%3C/svg%3E");
3798
3794
  background-position: right var(--spacing-sm) center;
3799
3795
  background-repeat: no-repeat;
@@ -3802,7 +3798,7 @@ to {
3802
3798
  `,PSe=L`
3803
3799
  display: flex; // used to correct overflow with chrome textarea
3804
3800
  position: relative;
3805
- `,mIt=L`
3801
+ `,pIt=L`
3806
3802
  align-items: center;
3807
3803
  background: var(--white);
3808
3804
  border-radius: var(--rounded-md) 0 0 var(--rounded-md);
@@ -3817,7 +3813,7 @@ to {
3817
3813
  bottom: 0;
3818
3814
  width: var(--spacing-lg);
3819
3815
  z-index: var(--z-10);
3820
- `,Ftt=L`
3816
+ `,Btt=L`
3821
3817
  --inline-label-color: var(--typography-base);
3822
3818
  align-items: center;
3823
3819
  cursor: pointer;
@@ -3831,7 +3827,7 @@ to {
3831
3827
  &:has(:disabled) {
3832
3828
  --inline-label-color: var(--gray-400);
3833
3829
  }
3834
- `,Btt=L`
3830
+ `,ztt=L`
3835
3831
  appearance: none;
3836
3832
  border: 1px solid var(--gray-200);
3837
3833
  background: var(--white);
@@ -3884,7 +3880,7 @@ to {
3884
3880
  color: var(--gray-400);
3885
3881
  border-color: var(--gray-300);
3886
3882
  }
3887
- `,ztt=L`
3883
+ `,Vtt=L`
3888
3884
  color: var(--inline-label-color);
3889
3885
  padding-left: var(--spacing-md);
3890
3886
  font-size: var(--fs-sm);
@@ -3907,9 +3903,9 @@ to {
3907
3903
  position: absolute;
3908
3904
  top: calc(var(--spacing-md) * -1.2);
3909
3905
  right: 0;
3910
- `,Vtt=L`
3911
- display: flex;
3912
3906
  `,Htt=L`
3907
+ display: flex;
3908
+ `,jtt=L`
3913
3909
  opacity: var(--opacity-50);
3914
3910
  transition: background-color var(--duration-fast) var(--timing-ease-out);
3915
3911
 
@@ -3918,10 +3914,10 @@ to {
3918
3914
  &[aria-expanded='true'] {
3919
3915
  background-color: var(--gray-200);
3920
3916
  }
3921
- `,jtt=L`
3917
+ `,Utt=L`
3922
3918
  resize: vertical;
3923
3919
  min-height: 2rem;
3924
- `,Utt=L`
3920
+ `,Ktt=L`
3925
3921
  align-items: center;
3926
3922
  appearance: none;
3927
3923
  box-sizing: border-box;
@@ -3956,7 +3952,7 @@ to {
3956
3952
  color: var(--gray-400);
3957
3953
  pointer-events: none;
3958
3954
  }
3959
- `,Ktt=L`
3955
+ `,Wtt=L`
3960
3956
  border-radius: var(--rounded-base);
3961
3957
  background: transparent;
3962
3958
  border: none;
@@ -3964,7 +3960,7 @@ to {
3964
3960
  font-weight: var(--fw-regular);
3965
3961
  font-size: var(--fs-sm);
3966
3962
  line-height: 1;
3967
- `,Wtt=L`
3963
+ `,Gtt=L`
3968
3964
  position: absolute;
3969
3965
  inset: 0 0 0 auto;
3970
3966
  padding: 0 var(--spacing-base);
@@ -3972,7 +3968,7 @@ to {
3972
3968
  flex-direction: row;
3973
3969
  justify-content: center;
3974
3970
  gap: var(--spacing-base);
3975
- `,Gtt=t=>L`
3971
+ `,Ytt=t=>L`
3976
3972
  padding-right: calc(
3977
3973
  ${t?"calc(var(--spacing-lg) * 2 + var(--spacing-xs))":"var(--spacing-xl)"} +
3978
3974
  var(--spacing-base)
@@ -3984,7 +3980,7 @@ to {
3984
3980
  border-color: var(--white);
3985
3981
  }
3986
3982
  }
3987
- `,Ytt=L`
3983
+ `,Ztt=L`
3988
3984
  align-items: center;
3989
3985
  color: var(--brand-secondary-3);
3990
3986
  display: flex;
@@ -3996,19 +3992,19 @@ to {
3996
3992
  &:hover {
3997
3993
  color: var(--typography-base);
3998
3994
  }
3999
- `,T2e=({id:t,asSpan:e,children:n,testId:r,...o})=>e?W("span",{"aria-labelledby":t,css:XY,children:n}):W("label",{...o,htmlFor:t,css:XY,"data-testid":r,children:n}),Ztt=(0,FSe.forwardRef)(({label:t,children:e},n)=>W(KQe,{menuTrigger:W("button",{className:"parameter-menu",css:[ISe,Htt],type:"button","aria-label":`${t} options`,ref:n,children:W(rl,{icon:"more-alt",iconColor:"currentColor",size:"0.9rem"})}),children:e})),qtt=L`
3995
+ `,T2e=({id:t,asSpan:e,children:n,testId:r,...o})=>e?W("span",{"aria-labelledby":t,css:XY,children:n}):W("label",{...o,htmlFor:t,css:XY,"data-testid":r,children:n}),qtt=(0,FSe.forwardRef)(({label:t,children:e},n)=>W(KQe,{menuTrigger:W("button",{className:"parameter-menu",css:[ISe,jtt],type:"button","aria-label":`${t} options`,ref:n,children:W(rl,{icon:"more-alt",iconColor:"currentColor",size:"0.9rem"})}),children:e})),Jtt=L`
4000
3996
  border-radius: var(--rounded-sm);
4001
3997
  flex-grow: 1;
4002
3998
  position: relative;
4003
3999
  max-width: 100%;
4004
- `,yIt=L`
4000
+ `,vIt=L`
4005
4001
  background: var(--brand-secondary-6);
4006
4002
  border-radius: var(--rounded-sm);
4007
4003
  padding: var(--spacing-sm);
4008
4004
  text-align: center;
4009
4005
  font-size: var(--fs-sm);
4010
4006
  margin: 0;
4011
- `,Jtt=L`
4007
+ `,Xtt=L`
4012
4008
  border-radius: var(--rounded-sm);
4013
4009
  border: 10px solid var(--gray-300);
4014
4010
  border-left-color: transparent;
@@ -4016,19 +4012,19 @@ to {
4016
4012
  position: absolute;
4017
4013
  top: 0;
4018
4014
  right: 0;
4019
- `,uC=t=>{let{id:e,label:n,caption:r,captionTestId:o,errorMessage:i,errorTestId:a,infoMessage:l,warningMessage:c,hiddenLabel:d,labelLeadingIcon:f,menuItems:m,title:h,hasOverriddenValue:g,onResetOverriddenValue:y,...b}=t;return{shellProps:{id:e,label:n,caption:r,captionTestId:o,errorMessage:i,infoMessage:l,warningMessage:c,errorTestId:a,hiddenLabel:d,labelLeadingIcon:f,menuItems:m,title:h,hasOverriddenValue:g,onResetOverriddenValue:y},innerProps:b}},cC=({label:t,labelLeadingIcon:e,labelTrailingIcon:n,hiddenLabel:r,id:o,errorMessage:i,warningMessage:a,infoMessage:l,caption:c,errorTestId:d,captionTestId:f,menuItems:m,actionItems:h,hasOverriddenValue:g,onResetOverriddenValue:y,title:b,children:C,isParameterGroup:S=!1,...w})=>{let[E,_]=(0,kSe.useState)(void 0),N=O=>_(O),$=i||E;return Me("div",{css:Ptt,...w,id:o,children:[r||b?null:Me(T2e,{id:o,css:XY,children:[e??null,t,n??null]}),b?Me(T2e,{id:o,asSpan:!0,testId:"parameter-label",children:[e??null,b,n??null]}):null,Me("div",{css:PSe,children:[h?W("div",{css:[ISe,Vtt,m?L`
4015
+ `,uC=t=>{let{id:e,label:n,caption:r,captionTestId:o,errorMessage:i,errorTestId:a,infoMessage:l,warningMessage:c,hiddenLabel:d,labelLeadingIcon:f,menuItems:m,title:h,hasOverriddenValue:g,onResetOverriddenValue:y,...b}=t;return{shellProps:{id:e,label:n,caption:r,captionTestId:o,errorMessage:i,infoMessage:l,warningMessage:c,errorTestId:a,hiddenLabel:d,labelLeadingIcon:f,menuItems:m,title:h,hasOverriddenValue:g,onResetOverriddenValue:y},innerProps:b}},cC=({label:t,labelLeadingIcon:e,labelTrailingIcon:n,hiddenLabel:r,id:o,errorMessage:i,warningMessage:a,infoMessage:l,caption:c,errorTestId:d,captionTestId:f,menuItems:m,actionItems:h,hasOverriddenValue:g,onResetOverriddenValue:y,title:b,children:C,isParameterGroup:S=!1,...w})=>{let[E,_]=(0,kSe.useState)(void 0),N=O=>_(O),$=i||E;return Me("div",{css:Itt,...w,id:o,children:[r||b?null:Me(T2e,{id:o,css:XY,children:[e??null,t,n??null]}),b?Me(T2e,{id:o,asSpan:!0,testId:"parameter-label",children:[e??null,b,n??null]}):null,Me("div",{css:PSe,children:[h?W("div",{css:[ISe,Htt,m?L`
4020
4016
  right: var(--spacing-md);
4021
- `:void 0],children:h}):null,m?W(Ztt,{label:`${t} menu`,children:m}):null,W(MSe.Provider,{value:{id:o,label:t,hiddenLabel:r,errorMessage:$,handleManuallySetErrorMessage:O=>N(O)},children:S?W("div",{style:{flexGrow:1},children:C}):Me(Xtt,{children:[C,g&&y?W(Qtt,{onClick:y}):null]})})]}),W(aC,{helperMessageTestId:f,helperMessage:c,errorTestId:d,errorMessage:$,warningMessage:a,infoMessage:l})]})},Xtt=({children:t})=>W("div",{css:qtt,children:t}),Qtt=t=>W(A2e,{title:"The default value has been overridden",children:W("button",{type:"button",css:Jtt,...t,children:W("span",{hidden:!0,children:"reset overridden value to default"})})}),CIt=(0,UE.forwardRef)(({children:t,...e},n)=>{let{shellProps:r,innerProps:o}=uC(e);return Me(cC,{"data-test-id":"parameter-image",...r,children:[W(ent,{ref:n,...o}),t]})}),ent=(0,UE.forwardRef)((t,e)=>{let{value:n}=t,{id:r,label:o,hiddenLabel:i,errorMessage:a}=lC(),l=(0,UE.useDeferredValue)(n);return Me(Ws,{children:[W("input",{css:KE,type:"text",id:r,ref:e,"aria-label":i&&typeof o=="string"?o:void 0,autoComplete:"off",...t}),a||t.disablePreview?null:W(Att,{imageSrc:l})]})}),wIt=(0,fZ.forwardRef)((t,e)=>{let{shellProps:n,innerProps:r}=uC(t);return W(cC,{"data-testid":"parameter-input",...n,children:W(tnt,{ref:e,...r})})}),tnt=(0,fZ.forwardRef)(({...t},e)=>{let{id:n,label:r,hiddenLabel:o}=lC();return W("input",{css:KE,id:n,type:t.type||"text","aria-label":o&&typeof r=="string"?r:void 0,autoComplete:"off",ref:e,...t})}),TIt=(0,pZ.forwardRef)(({disabled:t,onConnectLink:e,externalLink:n,...r},o)=>{let{shellProps:i,innerProps:a}=uC(r);return W(cC,{"data-testid":"link-parameter-editor",...i,label:a.value?i.label:"",title:!a.value&&typeof i.label=="string"?i.label:void 0,children:W(nnt,{onConnectLink:e,externalLink:n,ref:o,...a})})}),nnt=(0,pZ.forwardRef)(({externalLink:t,onConnectLink:e,disabled:n,buttonText:r="Select link",...o},i)=>{let{id:a,label:l,hiddenLabel:c}=lC();return o.value?Me("div",{css:PSe,children:[W("input",{type:"text",css:[KE,Gtt(!!t)],readOnly:!!o.value,id:a,ref:i,"aria-label":c&&typeof l=="string"?l:void 0,...o}),Me("div",{css:Wtt,children:[W("button",{type:"button",css:Ktt,disabled:n,onClick:e,title:"edit current selection","data-testid":"edit-current-selection",children:"edit"}),t?W("a",{href:t,css:Ytt,title:"Open link in new tab",target:"_blank",rel:"noopener noreferrer",children:W(rl,{icon:"arrows-expand-up-right",iconColor:"currentColor",size:"1rem"})}):null]})]}):W("button",{type:"button",css:Utt,disabled:n,onClick:e,children:r})});var rnt=[{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"}],ont=[{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 $It={required:!1,formatting:{builtIn:ont.map(t=>t.type)},elements:{builtIn:rnt.map(t=>t.type)},elementsConfig:{asset:{allowedTypes:["image"]}}},int=Mf,mZ=Mf.importDOM(),ant=mZ.pre;mZ.pre=t=>t.childNodes.length===1&&Array.from(t.childNodes).some(e=>e.nodeName==="CODE")?null:ant(t);int.importDOM=function(){return mZ};var MIt=nn`
4017
+ `:void 0],children:h}):null,m?W(qtt,{label:`${t} menu`,children:m}):null,W(MSe.Provider,{value:{id:o,label:t,hiddenLabel:r,errorMessage:$,handleManuallySetErrorMessage:O=>N(O)},children:S?W("div",{style:{flexGrow:1},children:C}):Me(Qtt,{children:[C,g&&y?W(ent,{onClick:y}):null]})})]}),W(aC,{helperMessageTestId:f,helperMessage:c,errorTestId:d,errorMessage:$,warningMessage:a,infoMessage:l})]})},Qtt=({children:t})=>W("div",{css:Jtt,children:t}),ent=t=>W(A2e,{title:"The default value has been overridden",children:W("button",{type:"button",css:Xtt,...t,children:W("span",{hidden:!0,children:"reset overridden value to default"})})}),xIt=(0,UE.forwardRef)(({children:t,...e},n)=>{let{shellProps:r,innerProps:o}=uC(e);return Me(cC,{"data-test-id":"parameter-image",...r,children:[W(tnt,{ref:n,...o}),t]})}),tnt=(0,UE.forwardRef)((t,e)=>{let{value:n}=t,{id:r,label:o,hiddenLabel:i,errorMessage:a}=lC(),l=(0,UE.useDeferredValue)(n);return Me(Ws,{children:[W("input",{css:KE,type:"text",id:r,ref:e,"aria-label":i&&typeof o=="string"?o:void 0,autoComplete:"off",...t}),a||t.disablePreview?null:W(ktt,{imageSrc:l})]})}),SIt=(0,fZ.forwardRef)((t,e)=>{let{shellProps:n,innerProps:r}=uC(t);return W(cC,{"data-testid":"parameter-input",...n,children:W(nnt,{ref:e,...r})})}),nnt=(0,fZ.forwardRef)(({...t},e)=>{let{id:n,label:r,hiddenLabel:o}=lC();return W("input",{css:KE,id:n,type:t.type||"text","aria-label":o&&typeof r=="string"?r:void 0,autoComplete:"off",ref:e,...t})}),EIt=(0,pZ.forwardRef)(({disabled:t,onConnectLink:e,externalLink:n,...r},o)=>{let{shellProps:i,innerProps:a}=uC(r);return W(cC,{"data-testid":"link-parameter-editor",...i,label:a.value?i.label:"",title:!a.value&&typeof i.label=="string"?i.label:void 0,children:W(rnt,{onConnectLink:e,externalLink:n,ref:o,...a})})}),rnt=(0,pZ.forwardRef)(({externalLink:t,onConnectLink:e,disabled:n,buttonText:r="Select link",...o},i)=>{let{id:a,label:l,hiddenLabel:c}=lC();return o.value?Me("div",{css:PSe,children:[W("input",{type:"text",css:[KE,Ytt(!!t)],readOnly:!!o.value,id:a,ref:i,"aria-label":c&&typeof l=="string"?l:void 0,...o}),Me("div",{css:Gtt,children:[W("button",{type:"button",css:Wtt,disabled:n,onClick:e,title:"edit current selection","data-testid":"edit-current-selection",children:"edit"}),t?W("a",{href:t,css:Ztt,title:"Open link in new tab",target:"_blank",rel:"noopener noreferrer",children:W(rl,{icon:"arrows-expand-up-right",iconColor:"currentColor",size:"1rem"})}):null]})]}):W("button",{type:"button",css:Ktt,disabled:n,onClick:e,children:r})});var ont=[{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"}],int=[{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 DIt={required:!1,formatting:{builtIn:int.map(t=>t.type)},elements:{builtIn:ont.map(t=>t.type)},elementsConfig:{asset:{allowedTypes:["image"]}}},ant=Mf,mZ=Mf.importDOM(),snt=mZ.pre;mZ.pre=t=>t.childNodes.length===1&&Array.from(t.childNodes).some(e=>e.nodeName==="CODE")?null:snt(t);ant.importDOM=function(){return mZ};var LIt=nn`
4022
4018
  font-weight: 700;
4023
- `,OIt=nn`
4019
+ `,MIt=nn`
4024
4020
  font-style: italic;
4025
- `,RIt=nn`
4021
+ `,OIt=nn`
4026
4022
  text-decoration: underline;
4027
- `,AIt=nn`
4023
+ `,RIt=nn`
4028
4024
  text-decoration: line-through;
4029
- `,kIt=nn`
4025
+ `,AIt=nn`
4030
4026
  text-decoration: underline line-through;
4031
- `,PIt=nn`
4027
+ `,kIt=nn`
4032
4028
  background-color: var(--gray-100);
4033
4029
  border-radius: var(--rounded-sm);
4034
4030
  display: inline-block;
@@ -4038,60 +4034,60 @@ to {
4038
4034
  font-size: var(--fs-sm);
4039
4035
  padding-left: var(--spacing-xs);
4040
4036
  padding-right: var(--spacing-xs);
4041
- `,IIt=nn`
4037
+ `,PIt=nn`
4042
4038
  vertical-align: super;
4043
4039
  font-size: smaller;
4044
- `,FIt=nn`
4040
+ `,IIt=nn`
4045
4041
  vertical-align: sub;
4046
4042
  font-size: smaller;
4047
- `,BIt=nn`
4043
+ `,FIt=nn`
4048
4044
  ${iZ}
4049
4045
  ${aZ}
4050
4046
  text-decoration: underline;
4051
- `,lnt=nn`
4052
- font-size: clamp(1.35rem, var(--fluid-font-base), 1.7rem);
4053
4047
  `,unt=nn`
4054
- font-size: clamp(1.35rem, var(--fluid-font-base), 1.6rem);
4048
+ font-size: clamp(1.35rem, var(--fluid-font-base), 1.7rem);
4055
4049
  `,cnt=nn`
4056
- font-size: clamp(1.25rem, var(--fluid-font-base), 1.5rem);
4050
+ font-size: clamp(1.35rem, var(--fluid-font-base), 1.6rem);
4057
4051
  `,dnt=nn`
4058
- font-size: clamp(1.15rem, var(--fluid-font-base), 1.25rem);
4052
+ font-size: clamp(1.25rem, var(--fluid-font-base), 1.5rem);
4059
4053
  `,fnt=nn`
4060
- font-size: clamp(var(--fs-base), var(--fluid-font-base), 1.15rem);
4054
+ font-size: clamp(1.15rem, var(--fluid-font-base), 1.25rem);
4061
4055
  `,pnt=nn`
4056
+ font-size: clamp(var(--fs-base), var(--fluid-font-base), 1.15rem);
4057
+ `,mnt=nn`
4062
4058
  font-size: var(--fs-base);
4059
+ `,BIt=nn`
4060
+ ${unt}
4061
+ ${sC(!0)}
4062
+ ${Ih}
4063
4063
  `,zIt=nn`
4064
- ${lnt}
4064
+ ${cnt}
4065
4065
  ${sC(!0)}
4066
4066
  ${Ih}
4067
4067
  `,VIt=nn`
4068
- ${unt}
4068
+ ${dnt}
4069
4069
  ${sC(!0)}
4070
4070
  ${Ih}
4071
4071
  `,HIt=nn`
4072
- ${cnt}
4072
+ ${fnt}
4073
4073
  ${sC(!0)}
4074
4074
  ${Ih}
4075
4075
  `,jIt=nn`
4076
- ${dnt}
4076
+ ${pnt}
4077
4077
  ${sC(!0)}
4078
4078
  ${Ih}
4079
4079
  `,UIt=nn`
4080
- ${fnt}
4080
+ ${mnt}
4081
4081
  ${sC(!0)}
4082
4082
  ${Ih}
4083
4083
  `,KIt=nn`
4084
- ${pnt}
4085
- ${sC(!0)}
4086
- ${Ih}
4087
- `,WIt=nn`
4088
4084
  line-height: 1.5;
4089
4085
  margin-bottom: var(--spacing-base);
4090
4086
 
4091
4087
  &:last-child {
4092
4088
  margin-bottom: 0;
4093
4089
  }
4094
- `,GIt=nn`
4090
+ `,WIt=nn`
4095
4091
  ${Ih}
4096
4092
  display: block;
4097
4093
  list-style: decimal;
@@ -4119,7 +4115,7 @@ to {
4119
4115
  }
4120
4116
  }
4121
4117
  }
4122
- `,YIt=nn`
4118
+ `,GIt=nn`
4123
4119
  ${Ih}
4124
4120
  display: block;
4125
4121
  list-style: disc;
@@ -4139,11 +4135,11 @@ to {
4139
4135
  list-style-type: square;
4140
4136
  }
4141
4137
  }
4142
- `,ZIt=nn`
4138
+ `,YIt=nn`
4143
4139
  margin-left: var(--spacing-md);
4144
- `,qIt=nn`
4140
+ `,ZIt=nn`
4145
4141
  list-style-type: none;
4146
- `,JIt=nn`
4142
+ `,qIt=nn`
4147
4143
  border-left: 0.25rem solid var(--gray-300);
4148
4144
  color: var(--gray-600);
4149
4145
  margin-bottom: var(--spacing-base);
@@ -4152,7 +4148,7 @@ to {
4152
4148
  &:last-child {
4153
4149
  margin-bottom: 0;
4154
4150
  }
4155
- `,XIt=nn`
4151
+ `,JIt=nn`
4156
4152
  background-color: var(--gray-100);
4157
4153
  border-radius: var(--rounded-sm);
4158
4154
  display: block;
@@ -4166,7 +4162,7 @@ to {
4166
4162
  &:last-child {
4167
4163
  margin-bottom: 0;
4168
4164
  }
4169
- `,QIt=nn`
4165
+ `,XIt=nn`
4170
4166
  border-collapse: collapse;
4171
4167
  border-spacing: 0;
4172
4168
  border-color: var(--gray-300);
@@ -4178,7 +4174,7 @@ to {
4178
4174
  &:last-child {
4179
4175
  margin-bottom: 0;
4180
4176
  }
4181
- `,eFt=nn`
4177
+ `,QIt=nn`
4182
4178
  background-color: var(--white);
4183
4179
  border-color: var(--gray-300);
4184
4180
  border-style: solid;
@@ -4213,7 +4209,7 @@ to {
4213
4209
  left: 100%;
4214
4210
  z-index: 1;
4215
4211
  }
4216
- `,tFt=nn`
4212
+ `,eFt=nn`
4217
4213
  background-color: var(--gray-100);
4218
4214
  border-color: var(--gray-300);
4219
4215
  border-style: solid;
@@ -4226,24 +4222,24 @@ to {
4226
4222
  text-align: start;
4227
4223
  vertical-align: top;
4228
4224
  width: 7rem;
4229
- `;var hnt=t=>t?.type==="projectMapNode"&&!!(t.nodeId&&t.path&&t.projectMapId),QY=t=>typeof t?.type=="string"&&["url","tel","email"].includes(t.type)&&!!t.path,gnt=t=>t.startsWith("http://")||t.startsWith("https://")?"url":t.startsWith("mailto:")||t.includes("@")?"email":t.startsWith("tel:")||t.startsWith("+")?"tel":"url";function vnt(t){let e=null;if(!Am(t))return{node:e};let n=t.textContent;if(n===null||n==="")return{node:e};let r=t.getAttribute("data-link");if(r)try{r=JSON.parse(r)}catch{}let o=t.getAttribute("href"),i,a,l,c;if(r&&typeof r=="object"&&("path"in r&&typeof r.path=="string"&&(o=r.path),"type"in r&&typeof r.type=="string"&&(l=r.type),"projectMapId"in r&&typeof r.projectMapId=="string"&&(i=r.projectMapId),"nodeId"in r&&typeof r.nodeId=="string"&&(a=r.nodeId),"dynamicInputValues"in r&&typeof r.dynamicInputValues=="string"))try{c=JSON.parse(r.dynamicInputValues)}catch{}if(!o)return{node:null};l||(l=gnt(o)),l==="email"&&o.startsWith("mailto:")?o=o.replace("mailto:",""):l==="tel"&&o.startsWith("tel:")&&(o=o.replace("tel:",""));let d={type:l,path:o,projectMapId:i,nodeId:a,dynamicInputValues:c};return(hnt(d)||QY(d))&&(e=eZ(d)),{node:e}}var hZ=class zSe extends Zn{static getType(){return"link"}getLink(){return this.getLatest().__link}setLink(e){let n=this.getWritable();n.__link=e}static clone(e){return new zSe(e.__link,e.__key)}constructor(e,n){super(n),this.__link=e}static importJSON(e){let n=eZ(e.link);return n.setFormat(e.format),n.setIndent(e.indent),n.setDirection(e.direction),n}exportJSON(){return{...super.exportJSON(),link:this.getLink(),type:this.getType(),version:1}}createDOM(e){let n=document.createElement("a");return n.setAttribute("data-link",JSON.stringify(this.__link)),QY(this.__link)&&(this.__link.type==="url"?n.setAttribute("href",this.__link.path):this.__link.type==="tel"?n.setAttribute("href",`tel:${this.__link.path}`):this.__link.type==="email"&&n.setAttribute("href",`mailto:${this.__link.path}`)),Rt(n,e.theme.link),n}updateDOM(e,n){return c2e(e.__link,this.__link)||(n.setAttribute("data-link",JSON.stringify(this.__link)),QY(this.__link)&&(this.__link.type==="url"?n.setAttribute("href",this.__link.path):this.__link.type==="tel"?n.setAttribute("href",`tel:${this.__link.path}`):this.__link.type==="email"&&n.setAttribute("href",`mailto:${this.__link.path}`))),!1}static importDOM(){return{a:()=>({conversion:vnt,priority:1})}}insertNewAfter(e,n=!0){let r=this.getParentOrThrow().insertNewAfter(e,n);if(fe(r)){let o=eZ("nodeId"in this.__link?{nodeId:this.__link.nodeId,projectMapId:this.__link.projectMapId,path:this.__link.path,type:this.__link.type}:{path:this.__link.path,type:this.__link.type});return r.append(o),o}return null}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}};function eZ(t){return Tn(new hZ(t))}var aFt=Lr("REMOVE_LINK_NODE_COMMAND"),sFt=Lr("UPSERT_LINK_NODE_COMMAND"),lFt=Lr("OPEN_LINK_NODE_MODAL_COMMAND");var uFt=L`
4225
+ `;var gnt=t=>t?.type==="projectMapNode"&&!!(t.nodeId&&t.path&&t.projectMapId),QY=t=>typeof t?.type=="string"&&["url","tel","email"].includes(t.type)&&!!t.path,vnt=t=>t.startsWith("http://")||t.startsWith("https://")?"url":t.startsWith("mailto:")||t.includes("@")?"email":t.startsWith("tel:")||t.startsWith("+")?"tel":"url";function ynt(t){let e=null;if(!Am(t))return{node:e};let n=t.textContent;if(n===null||n==="")return{node:e};let r=t.getAttribute("data-link");if(r)try{r=JSON.parse(r)}catch{}let o=t.getAttribute("href"),i,a,l,c;if(r&&typeof r=="object"&&("path"in r&&typeof r.path=="string"&&(o=r.path),"type"in r&&typeof r.type=="string"&&(l=r.type),"projectMapId"in r&&typeof r.projectMapId=="string"&&(i=r.projectMapId),"nodeId"in r&&typeof r.nodeId=="string"&&(a=r.nodeId),"dynamicInputValues"in r&&typeof r.dynamicInputValues=="string"))try{c=JSON.parse(r.dynamicInputValues)}catch{}if(!o)return{node:null};l||(l=vnt(o)),l==="email"&&o.startsWith("mailto:")?o=o.replace("mailto:",""):l==="tel"&&o.startsWith("tel:")&&(o=o.replace("tel:",""));let d={type:l,path:o,projectMapId:i,nodeId:a,dynamicInputValues:c};return(gnt(d)||QY(d))&&(e=eZ(d)),{node:e}}var hZ=class zSe extends Zn{static getType(){return"link"}getLink(){return this.getLatest().__link}setLink(e){let n=this.getWritable();n.__link=e}static clone(e){return new zSe(e.__link,e.__key)}constructor(e,n){super(n),this.__link=e}static importJSON(e){let n=eZ(e.link);return n.setFormat(e.format),n.setIndent(e.indent),n.setDirection(e.direction),n}exportJSON(){return{...super.exportJSON(),link:this.getLink(),type:this.getType(),version:1}}createDOM(e){let n=document.createElement("a");return n.setAttribute("data-link",JSON.stringify(this.__link)),QY(this.__link)&&(this.__link.type==="url"?n.setAttribute("href",this.__link.path):this.__link.type==="tel"?n.setAttribute("href",`tel:${this.__link.path}`):this.__link.type==="email"&&n.setAttribute("href",`mailto:${this.__link.path}`)),Rt(n,e.theme.link),n}updateDOM(e,n){return c2e(e.__link,this.__link)||(n.setAttribute("data-link",JSON.stringify(this.__link)),QY(this.__link)&&(this.__link.type==="url"?n.setAttribute("href",this.__link.path):this.__link.type==="tel"?n.setAttribute("href",`tel:${this.__link.path}`):this.__link.type==="email"&&n.setAttribute("href",`mailto:${this.__link.path}`))),!1}static importDOM(){return{a:()=>({conversion:ynt,priority:1})}}insertNewAfter(e,n=!0){let r=this.getParentOrThrow().insertNewAfter(e,n);if(fe(r)){let o=eZ("nodeId"in this.__link?{nodeId:this.__link.nodeId,projectMapId:this.__link.projectMapId,path:this.__link.path,type:this.__link.type}:{path:this.__link.path,type:this.__link.type});return r.append(o),o}return null}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}};function eZ(t){return Tn(new hZ(t))}var iFt=Lr("REMOVE_LINK_NODE_COMMAND"),aFt=Lr("UPSERT_LINK_NODE_COMMAND"),sFt=Lr("OPEN_LINK_NODE_MODAL_COMMAND");var lFt=L`
4230
4226
  position: absolute;
4231
4227
  z-index: 11;
4232
- `,cFt=L`
4228
+ `,uFt=L`
4233
4229
  ${wet};
4234
4230
  ${Eet};
4235
4231
  align-items: center;
4236
4232
  display: flex;
4237
- `,dFt=L`
4233
+ `,cFt=L`
4238
4234
  ${iZ}
4239
4235
  ${aZ}
4240
- `;var ynt=L`
4236
+ `;var bnt=L`
4241
4237
  position: absolute;
4242
4238
  transform: translate(calc(-100% - 1px), 1px);
4243
- `,bnt=(0,Fh.forwardRef)((t,e)=>{let{tableCellEl:n,positioningAnchorEl:r,...o}=t,[i,a]=(0,Fh.useState)({x:0,y:0});return(0,Fh.useLayoutEffect)(()=>{let l=n.getBoundingClientRect(),c=r.getBoundingClientRect(),d=l.right-c.left+r.scrollLeft,f=l.top-c.top+r.scrollTop;a({x:d,y:f})},[n,r]),W(SSe,{ref:e,css:[ynt,{top:i.y,left:i.x}],size:"xs",buttonType:"unimportant",...o,children:W(rl,{icon:"chevron-down",size:"1rem",iconColor:"currentColor"})})});bnt.displayName="TableActionMenuTrigger";var hFt=L`
4239
+ `,xnt=(0,Fh.forwardRef)((t,e)=>{let{tableCellEl:n,positioningAnchorEl:r,...o}=t,[i,a]=(0,Fh.useState)({x:0,y:0});return(0,Fh.useLayoutEffect)(()=>{let l=n.getBoundingClientRect(),c=r.getBoundingClientRect(),d=l.right-c.left+r.scrollLeft,f=l.top-c.top+r.scrollTop;a({x:d,y:f})},[n,r]),W(SSe,{ref:e,css:[bnt,{top:i.y,left:i.x}],size:"xs",buttonType:"unimportant",...o,children:W(rl,{icon:"chevron-down",size:"1rem",iconColor:"currentColor"})})});xnt.displayName="TableActionMenuTrigger";var mFt=L`
4244
4240
  position: absolute;
4245
4241
  z-index: var(--z-10);
4246
- `;var yFt=L`
4242
+ `;var vFt=L`
4247
4243
  ${Cc}
4248
4244
  background: var(--gray-50);
4249
4245
  border-radius: var(--rounded-base);
@@ -4256,7 +4252,7 @@ to {
4256
4252
  position: sticky;
4257
4253
  top: calc(var(--spacing-sm) * -2);
4258
4254
  z-index: 10;
4259
- `,bFt=L`
4255
+ `,yFt=L`
4260
4256
  display: flex;
4261
4257
  flex-shrink: 0;
4262
4258
  gap: var(--spacing-xs);
@@ -4272,7 +4268,7 @@ to {
4272
4268
  top: 4px;
4273
4269
  width: 1px;
4274
4270
  }
4275
- `,xFt=L`
4271
+ `,bFt=L`
4276
4272
  align-items: center;
4277
4273
  appearance: none;
4278
4274
  border: 0;
@@ -4285,16 +4281,16 @@ to {
4285
4281
  justify-content: center;
4286
4282
  min-width: 32px;
4287
4283
  padding: 0 var(--spacing-sm);
4288
- `,CFt=L`
4284
+ `,xFt=L`
4289
4285
  background: var(--gray-200);
4290
- `,SFt=L`
4286
+ `,CFt=L`
4291
4287
  justify-content: space-between;
4292
4288
  min-width: 7rem;
4293
- `,wFt=L`
4289
+ `,SFt=L`
4294
4290
  color: inherit;
4295
- `,EFt=L`
4291
+ `,wFt=L`
4296
4292
  margin-left: var(--spacing-xs);
4297
- `;var TFt=L`
4293
+ `;var EFt=L`
4298
4294
  position: relative;
4299
4295
 
4300
4296
  &::before {
@@ -4309,11 +4305,11 @@ to {
4309
4305
  right: var(--spacing-sm);
4310
4306
  z-index: 2;
4311
4307
  }
4312
- `,_Ft=L`
4308
+ `,TFt=L`
4313
4309
  display: flex;
4314
4310
  flex-flow: column;
4315
4311
  flex-grow: 1;
4316
- `,DFt=L`
4312
+ `,_Ft=L`
4317
4313
  ${Cc}
4318
4314
  background: var(--white);
4319
4315
  border-radius: var(--rounded-sm);
@@ -4344,14 +4340,14 @@ to {
4344
4340
  min-height: calc(3rem + (2 * var(--spacing-sm)));
4345
4341
  max-height: unset;
4346
4342
  }
4347
- `,$Ft=L`
4343
+ `,DFt=L`
4348
4344
  overflow: hidden;
4349
4345
  pointer-events: none;
4350
4346
 
4351
4347
  & > * {
4352
4348
  pointer-events: auto;
4353
4349
  }
4354
- `,NFt=L`
4350
+ `,$Ft=L`
4355
4351
  color: var(--gray-500);
4356
4352
  font-style: italic;
4357
4353
  /* 1px is added to make sure caret is clearly visible when field is focused
@@ -4361,7 +4357,7 @@ to {
4361
4357
  position: absolute;
4362
4358
  top: calc(1rem + var(--spacing-sm));
4363
4359
  user-select: none;
4364
- `,LFt=L`
4360
+ `,NFt=L`
4365
4361
  min-height: 100%;
4366
4362
  flex-grow: 1;
4367
4363
 
@@ -4369,7 +4365,7 @@ to {
4369
4365
  &:focus-within {
4370
4366
  outline: none;
4371
4367
  }
4372
- `;var MFt=[Lde,Ode,Pde,Mde,Nde,Rde,...Ade];var RFt=(0,gZ.forwardRef)(({defaultOption:t,options:e,...n},r)=>{let{shellProps:o,innerProps:i}=uC(n);return W(cC,{...o,children:W(Cnt,{options:e,defaultOption:t,...i,ref:r})})}),Cnt=(0,gZ.forwardRef)(({defaultOption:t,options:e,...n},r)=>{let{id:o,label:i,hiddenLabel:a}=lC();return Me("select",{css:[KE,Itt],id:o,"aria-label":a&&typeof i=="string"?i:void 0,ref:r,...n,children:[t?W("option",{value:"",children:t}):null,e.map(l=>{var c;return W("option",{value:(c=l.value)!=null?c:l.label,children:l.label},l.label)})]})}),kFt=(0,vZ.forwardRef)((t,e)=>{let{shellProps:n,innerProps:r}=uC(t);return W(cC,{"data-testid":"parameter-textarea",...n,children:W(Snt,{ref:e,...r})})}),Snt=(0,vZ.forwardRef)(({...t},e)=>{let{id:n,label:r,hiddenLabel:o}=lC();return W("textarea",{css:[KE,jtt],id:n,ref:e,"aria-label":o&&typeof r=="string"?r:void 0,...t})}),IFt=(0,yZ.forwardRef)((t,e)=>{let{shellProps:n,innerProps:r}=uC(t);return W(cC,{...n,children:W(wnt,{ref:e,...r})})}),wnt=(0,yZ.forwardRef)(({children:t,...e},n)=>{let{id:r,label:o}=lC();return Me("label",{css:Ftt,children:[W("input",{css:Btt,type:e.type,id:r,ref:n,...e}),W("span",{css:ztt,children:o}),t]})});var BFt=L`
4368
+ `;var LFt=[Lde,Ode,Pde,Mde,Nde,Rde,...Ade];var OFt=(0,gZ.forwardRef)(({defaultOption:t,options:e,...n},r)=>{let{shellProps:o,innerProps:i}=uC(n);return W(cC,{...o,children:W(Snt,{options:e,defaultOption:t,...i,ref:r})})}),Snt=(0,gZ.forwardRef)(({defaultOption:t,options:e,...n},r)=>{let{id:o,label:i,hiddenLabel:a}=lC();return Me("select",{css:[KE,Ftt],id:o,"aria-label":a&&typeof i=="string"?i:void 0,ref:r,...n,children:[t?W("option",{value:"",children:t}):null,e.map(l=>{var c;return W("option",{value:(c=l.value)!=null?c:l.label,children:l.label},l.label)})]})}),AFt=(0,vZ.forwardRef)((t,e)=>{let{shellProps:n,innerProps:r}=uC(t);return W(cC,{"data-testid":"parameter-textarea",...n,children:W(wnt,{ref:e,...r})})}),wnt=(0,vZ.forwardRef)(({...t},e)=>{let{id:n,label:r,hiddenLabel:o}=lC();return W("textarea",{css:[KE,Utt],id:n,ref:e,"aria-label":o&&typeof r=="string"?r:void 0,...t})}),PFt=(0,yZ.forwardRef)((t,e)=>{let{shellProps:n,innerProps:r}=uC(t);return W(cC,{...n,children:W(Ent,{ref:e,...r})})}),Ent=(0,yZ.forwardRef)(({children:t,...e},n)=>{let{id:r,label:o}=lC();return Me("label",{css:Btt,children:[W("input",{css:ztt,type:e.type,id:r,ref:n,...e}),W("span",{css:Vtt,children:o}),t]})}),FFt=L`
4373
4369
  background: var(--gray-50);
4374
4370
  margin-block: var(--spacing-sm);
4375
4371
  position: relative;
@@ -4377,7 +4373,7 @@ to {
4377
4373
  height: 1rem;
4378
4374
  border-radius: var(--rounded-sm);
4379
4375
  border: solid 1px var(--gray-300);
4380
- `,zFt={primary:L`
4376
+ `,BFt={primary:L`
4381
4377
  --progress-color: var(--accent-light);
4382
4378
  `,secondary:L`
4383
4379
  --progress-color: var(--accent-alt-light);
@@ -4390,9 +4386,9 @@ to {
4390
4386
  to {
4391
4387
  background-position: 64px 0;
4392
4388
  }
4393
- `,VFt=L`
4389
+ `,zFt=L`
4394
4390
  background-color: var(--progress-color);
4395
- `,HFt=L`
4391
+ `,VFt=L`
4396
4392
  background-image: linear-gradient(
4397
4393
  45deg,
4398
4394
  var(--progress-color) 25%,
@@ -4405,23 +4401,23 @@ to {
4405
4401
  );
4406
4402
  background-size: 64px 64px;
4407
4403
  animation: ${Tnt} 1s linear infinite;
4408
- `,jFt=L`
4404
+ `,HFt=L`
4409
4405
  position: absolute;
4410
4406
  inset: 0;
4411
4407
  transition: transform var(--duration-fast) var(--timing-ease-out);
4412
4408
  transform-origin: 0 center;
4413
- `;var KFt=L`
4409
+ `;var UFt=L`
4414
4410
  display: flex;
4415
4411
  flex-direction: column;
4416
4412
  gap: var(--spacing-sm);
4417
4413
  list-style-type: none;
4418
- `,WFt=L`
4414
+ `,KFt=L`
4419
4415
  display: flex;
4420
4416
  gap: var(--spacing-base);
4421
4417
  align-items: center;
4422
- `;var YFt=L`
4418
+ `;var GFt=L`
4423
4419
  position: relative;
4424
- `,ZFt=L`
4420
+ `,YFt=L`
4425
4421
  position: absolute;
4426
4422
  inset: 0;
4427
4423
  z-index: 1;
@@ -4448,15 +4444,15 @@ to {
4448
4444
  transform-origin: right;
4449
4445
  background: linear-gradient(to left, var(--background-color) 10%, transparent);
4450
4446
  }
4451
- `,qFt=L`
4447
+ `,ZFt=L`
4452
4448
  &::before {
4453
4449
  opacity: 1;
4454
4450
  }
4455
- `,JFt=L`
4451
+ `,qFt=L`
4456
4452
  &::after {
4457
4453
  opacity: 1;
4458
4454
  }
4459
- `,XFt=L`
4455
+ `,JFt=L`
4460
4456
  overflow-y: auto;
4461
4457
  scroll-behavior: smooth;
4462
4458
  scrollbar-width: none;
@@ -4464,7 +4460,7 @@ to {
4464
4460
  width: 0px;
4465
4461
  height: 0px;
4466
4462
  }
4467
- `,QFt=L`
4463
+ `,XFt=L`
4468
4464
  --segmented-control-rounded-value: var(--rounded-base);
4469
4465
  --segmented-control-border-width: 1px;
4470
4466
  --segmented-control-selected-color: var(--brand-secondary-3);
@@ -4482,40 +4478,40 @@ to {
4482
4478
  gap: var(--segmented-control-border-width);
4483
4479
  border-radius: calc(var(--segmented-control-rounded-value) + var(--segmented-control-border-width));
4484
4480
  font-size: var(--fs-xs);
4485
- `,eBt=L`
4481
+ `,QFt=L`
4486
4482
  flex-direction: column;
4487
4483
  --segmented-control-first-border-radius: var(--segmented-control-rounded-value)
4488
4484
  var(--segmented-control-rounded-value) 0 0;
4489
4485
  --segmented-control-last-border-radius: 0 0 var(--segmented-control-rounded-value)
4490
4486
  var(--segmented-control-rounded-value);
4491
- `,tBt=L`
4487
+ `,eBt=L`
4492
4488
  &:first-of-type label {
4493
4489
  border-radius: var(--segmented-control-first-border-radius);
4494
4490
  }
4495
4491
  &:last-of-type label {
4496
4492
  border-radius: var(--segmented-control-last-border-radius);
4497
4493
  }
4498
- `,nBt=L`
4494
+ `,tBt=L`
4499
4495
  ${MXe}
4500
- `;var rBt=L`
4496
+ `;var nBt=L`
4501
4497
  padding-inline: 0.5em;
4502
- `,oBt=L`
4498
+ `,rBt=L`
4503
4499
  opacity: 0.5;
4504
- `,iBt=L`
4500
+ `,oBt=L`
4505
4501
  display: flex;
4506
4502
  align-items: center;
4507
4503
  justify-content: center;
4508
4504
  gap: var(--spacing-sm);
4509
4505
  height: 100%;
4510
- `,aBt=L`
4506
+ `,iBt=L`
4511
4507
  white-space: nowrap;
4512
4508
  `;var Dnt=No`
4513
4509
  from { opacity: 0.1; }
4514
4510
  to { opacity: 0.025; }
4515
- `,lBt=L`
4511
+ `,sBt=L`
4516
4512
  animation: ${Dnt} 1s ease-out infinite alternate;
4517
4513
  background-color: var(--gray-900);
4518
- `;var cBt=L`
4514
+ `;var uBt=L`
4519
4515
  --color: #00b4ff;
4520
4516
  --speed: 5s;
4521
4517
  --red: rgb(218, 63, 50);
@@ -5045,7 +5041,7 @@ to {
5045
5041
  flex-direction: row;
5046
5042
  `,znt=L`
5047
5043
  flex-direction: row-reverse;
5048
- `,pBt=(0,NL.forwardRef)(({label:t,infoText:e,toggleText:n,children:r,switchSize:o="base",alignment:i="left",...a},l)=>{let c=e,{SwitchInputContainerAlignmentStyles:d,SwitchInputCheckedDirection:f,SwitchInputLabelAlignment:m}=(0,NL.useMemo)(()=>i==="left"?{SwitchInputContainerAlignmentStyles:Bnt,SwitchInputCheckedDirection:Lnt,SwitchInputLabelAlignment:Rnt(o)}:{SwitchInputContainerAlignmentStyles:znt,SwitchInputCheckedDirection:Mnt,SwitchInputLabelAlignment:Ant(o)},[i,o]);return e&&n&&(c=a.checked?n:e),Me(Ws,{children:[Me("label",{css:[$nt,d,f,a.disabled?Ont:void 0],children:[W("input",{type:"checkbox",css:[Nnt(o),f],...a,ref:l}),W("span",{css:[knt(o),m],children:t})]}),c?W("p",{css:[Fnt,i==="left"?Pnt(o):Int(o)],children:c}):null,r]})}),Vnt=({cellPadding:t="var(--spacing-sm)"})=>L`
5044
+ `,fBt=(0,NL.forwardRef)(({label:t,infoText:e,toggleText:n,children:r,switchSize:o="base",alignment:i="left",...a},l)=>{let c=e,{SwitchInputContainerAlignmentStyles:d,SwitchInputCheckedDirection:f,SwitchInputLabelAlignment:m}=(0,NL.useMemo)(()=>i==="left"?{SwitchInputContainerAlignmentStyles:Bnt,SwitchInputCheckedDirection:Lnt,SwitchInputLabelAlignment:Rnt(o)}:{SwitchInputContainerAlignmentStyles:znt,SwitchInputCheckedDirection:Mnt,SwitchInputLabelAlignment:Ant(o)},[i,o]);return e&&n&&(c=a.checked?n:e),Me(Ws,{children:[Me("label",{css:[$nt,d,f,a.disabled?Ont:void 0],children:[W("input",{type:"checkbox",css:[Nnt(o),f],...a,ref:l}),W("span",{css:[knt(o),m],children:t})]}),c?W("p",{css:[Fnt,i==="left"?Pnt(o):Int(o)],children:c}):null,r]})}),Vnt=({cellPadding:t="var(--spacing-sm)"})=>L`
5049
5045
  border-bottom: 1px solid var(--gray-400);
5050
5046
  border-collapse: collapse;
5051
5047
  min-width: 100%;
@@ -5075,7 +5071,7 @@ to {
5075
5071
  font-weight: var(--fw-regular);
5076
5072
  line-height: 1.2;
5077
5073
  }
5078
- `,hBt=L`
5074
+ `,mBt=L`
5079
5075
  max-width: calc(100vw - var(--spacing-md) * 2);
5080
5076
  overflow-x: auto;
5081
5077
  ${Cc}
@@ -5091,7 +5087,7 @@ to {
5091
5087
  white-space: initial;
5092
5088
  }
5093
5089
  }
5094
- `;var vBt=Bh.forwardRef(({children:t,cellPadding:e,...n},r)=>W("table",{ref:r,css:Vnt({cellPadding:e}),...n,children:t})),yBt=Bh.forwardRef(({children:t,...e},n)=>W("thead",{ref:n,css:Hnt,...e,children:t})),bBt=Bh.forwardRef(({children:t,...e},n)=>W("tbody",{ref:n,...e,children:t})),xBt=Bh.forwardRef(({children:t,...e},n)=>W("tfoot",{ref:n,...e,children:t})),CBt=Bh.forwardRef(({children:t,...e},n)=>W("tr",{ref:n,css:jnt,...e,children:t})),SBt=Bh.forwardRef(({children:t,...e},n)=>W("th",{ref:n,css:Unt,...e,children:t})),wBt=Bh.forwardRef(({children:t,...e},n)=>W("td",{ref:n,...e,children:t})),TBt=L`
5090
+ `;var gBt=Bh.forwardRef(({children:t,cellPadding:e,...n},r)=>W("table",{ref:r,css:Vnt({cellPadding:e}),...n,children:t})),vBt=Bh.forwardRef(({children:t,...e},n)=>W("thead",{ref:n,css:Hnt,...e,children:t})),yBt=Bh.forwardRef(({children:t,...e},n)=>W("tbody",{ref:n,...e,children:t})),bBt=Bh.forwardRef(({children:t,...e},n)=>W("tfoot",{ref:n,...e,children:t})),xBt=Bh.forwardRef(({children:t,...e},n)=>W("tr",{ref:n,css:jnt,...e,children:t})),CBt=Bh.forwardRef(({children:t,...e},n)=>W("th",{ref:n,css:Unt,...e,children:t})),SBt=Bh.forwardRef(({children:t,...e},n)=>W("td",{ref:n,...e,children:t})),EBt=L`
5095
5091
  align-items: center;
5096
5092
  border: 0;
5097
5093
  height: 2.5rem;
@@ -5107,11 +5103,11 @@ to {
5107
5103
  &[aria-selected='true'] {
5108
5104
  box-shadow: inset 0 -2px 0 var(--brand-secondary-3);
5109
5105
  }
5110
- `,_Bt=L`
5106
+ `,TBt=L`
5111
5107
  display: flex;
5112
5108
  gap: var(--spacing-base);
5113
5109
  border-bottom: 1px solid var(--gray-300);
5114
- `;var $Bt=L`
5110
+ `;var DBt=L`
5115
5111
  align-items: center;
5116
5112
  align-self: center;
5117
5113
  color: var(--gray-500);
@@ -5126,29 +5122,29 @@ to {
5126
5122
  content: '';
5127
5123
  display: block;
5128
5124
  }
5129
- `,NBt=L`
5125
+ `,$Bt=L`
5130
5126
  font-size: var(--fs-sm);
5131
5127
  &:before {
5132
5128
  width: var(--fs-xs);
5133
5129
  height: var(--fs-xs);
5134
5130
  }
5135
- `,LBt=L`
5131
+ `,NBt=L`
5136
5132
  font-size: var(--fs-xs);
5137
5133
  &:before {
5138
5134
  width: var(--fs-xxs);
5139
5135
  height: var(--fs-xxs);
5140
5136
  }
5141
- `,MBt=L`
5137
+ `,LBt=L`
5142
5138
  &:before {
5143
5139
  background: var(--white);
5144
5140
  box-shadow: inset 0 0 0 0.125rem var(--accent-dark);
5145
5141
  }
5146
- `,OBt=L`
5142
+ `,MBt=L`
5147
5143
  &:before {
5148
5144
  background: linear-gradient(to right, var(--white) 50%, var(--accent-dark) 50% 100%);
5149
5145
  box-shadow: inset 0 0 0 0.125rem var(--accent-dark);
5150
5146
  }
5151
- `,RBt=L`
5147
+ `,OBt=L`
5152
5148
  color: var(--error);
5153
5149
  &:before {
5154
5150
  /* TODO: replace this with an svg icon */
@@ -5160,28 +5156,28 @@ to {
5160
5156
  var(--error) 59%
5161
5157
  );
5162
5158
  }
5163
- `,ABt=L`
5159
+ `,RBt=L`
5164
5160
  &:before {
5165
5161
  background: var(--accent-dark);
5166
5162
  }
5167
- `,kBt=L`
5163
+ `,ABt=L`
5168
5164
  &:before {
5169
5165
  background: var(--brand-secondary-5);
5170
5166
  }
5171
- `,PBt=L`
5167
+ `,kBt=L`
5172
5168
  &:before {
5173
5169
  background: var(--gray-800);
5174
5170
  }
5175
- `,IBt=L`
5171
+ `,PBt=L`
5176
5172
  &:before {
5177
5173
  background: var(--error);
5178
5174
  }
5179
- `;await er();function GSe(t){let e=Ole({nodes:[pd,fd,hZ,X1,Q1,Mae,Sfe,Cfe,wfe,Mf]});return e.update(()=>{Lae("skip-dom-selection"),$de(t,kde)},{discrete:!0}),e.getEditorState().toJSON()}function YSe({twee:t,nodeId:e,propertyId:n,propertyType:r,locale:o,propertyEdit:i,conditionIndex:a=-1}){let l=t.getNodeById(e);if(!l)throw new Error(`Node with ID ${e} not found`);if(i.action==="clearValue")t.updateNodeProperty({nodeId:e,property:n,value:null,source:"ai",locale:o,conditionIndex:-1});else if(i.action==="resetOverride")t.resetPatternPropertyOverride(e,n,o);else if(i.action==="setValue"){let c=Ynt({twee:t,targetNode:l,propertyId:n,propertyType:r,propertyEdit:i}),d=t.getNodeProperty(e,n);if(!o&&d?.locales)throw new Error(`The ${n} property is localized in ${Object.keys(d.locales).join(", ")}, but no locale was provided when setting its value. Please provide an explicit locale.`);t.updateNodeProperty({nodeId:e,property:n,value:()=>c,source:"ai",locale:o,conditionIndex:a,type:r})}}var Ynt=({twee:t,targetNode:e,propertyId:n,propertyType:r,propertyEdit:o})=>{if(r==="richText")return GSe(o.newValue??"");if(r==="number")return Number(o.newValue);if(n===Knt){if(Gnt(e.value.type))throw new Error("Enrichment tags are not allowed in system components.");if(t.getParentInfo(e.nodeId)?.parentId===Wnt)throw new Error("Enrichment tags are not allowed in personalization variants.")}return o.treatNewValueAsJson?JSON.parse(o.newValue):o.newValue};async function LL({twee:t,slotUpdates:e,propertyUpdates:n,localeUpdates:r,nameUpdate:o,slugUpdate:i,descriptionUpdate:a,currentEditorLocale:l,referenceData:c}){let d=[];o&&(t.updateRootNode({update:{_name:o}}),d.push({summary:"Updated name",success:!0})),i&&(t.updateRootNode({update:{_slug:i}}),d.push({summary:"Updated slug",success:!0})),a&&(t.updateRootMetadata({description:a}),d.push({summary:"Updated description",success:!0}));let f=await c.fetchDefinitions();await qnt({slotUpdates:e,twee:t,definitions:f,referenceData:c,results:d});let m=d.some(g=>!g.success);return e.deletedComponentsInSlots?.forEach(g=>{m?d.push({summary:`Skipped deleting component ${g} because previous actions failed`,success:!1}):(t.deleteNode(g,!1),d.push({summary:`Deleted component ${g}`,success:!0}))}),m=d.some(g=>!g.success),e.moveComponentsInSlots?.forEach(g=>{m?d.push({summary:`Skipped moving component ${g.componentId} because previous actions failed`,success:!1}):(t.moveNode({movedNodeId:g.componentId,parentNodeId:g.newParentComponentId,parentSlot:g.newSlotName,targetIndexInSlot:g.newSlotIndex}),d.push({summary:`Moved component ${g.componentId} to ${g.newParentComponentId} in slot ${g.newSlotName} at index ${g.newSlotIndex}`,success:!0}))}),m=d.some(g=>!g.success),e.duplicateComponentsInSlots?.forEach(g=>{m?d.push({summary:`Skipped duplicating component ${g} because previous actions failed`,success:!1}):(t.duplicateNode(g,c.resolvePatternData),d.push({summary:`Duplicated component ${g}`,success:!0}))}),m=d.some(g=>!g.success),r?.enableLocales?.forEach(g=>{m?d.push({summary:`Skipped enabling locale ${g} because previous actions failed`,success:!1}):(t.enableLocale(g),d.push({summary:`Enabled locale ${g}`,success:!0}))}),m=d.some(g=>!g.success),r?.disableLocales?.forEach(g=>{m?d.push({summary:`Skipped disabling locale ${g} because previous actions failed`,success:!1}):(t.disableLocale(g),d.push({summary:`Disabled locale ${g}`,success:!0}))}),m=d.some(g=>!g.success),m?n.length>0&&d.push({summary:`Skipped ${n.length} property updates because previous actions failed`,success:!1}):(await Jnt({propertyUpdates:n,twee:t,currentEditorLocale:l,referenceData:c,definitions:f,results:d})).forEach(y=>{if(!y.result.success)return;let b="componentId"in y.update?y.update.componentId:t.rootNodeId,C=qte({twee:t,nodeId:b,currentEditorLocale:y.currentLocale,definition:y.propertyDefinition}),S=(t.getNodeById(t.rootNodeId)?.value)._locales??[];if(C&&!S.includes(C)){d.push({summary:`The ${C} locale is not enabled on this entity. Please enable it before setting values in this locale.`,success:!1});return}if(y.result.action!=="nothing")try{YSe({twee:t,nodeId:b,propertyId:y.propertyDefinition.id,propertyType:y.propertyDefinition.type,locale:C,propertyEdit:y.result}),d.push({summary:`Updated value of ${y.propertyDefinition.id} on ${b}${C?` in ${C}`:""}`,success:!0})}catch(w){d.push({summary:`Failed to update value of ${y.propertyDefinition.id} on ${b}${C?` in ${C}`:""}: ${w instanceof Error?w.message:"Unknown error"}`,success:!1})}if("overridable"in y.update&&y.update.overridable!==void 0){let w=y.update.overridable;t.updateNode({nodeId:b,updateComponent:E=>{E._overridability??={},E._overridability.parameters??={},E._overridability.parameters[y.propertyDefinition.id]=w}}),d.push({summary:`Updated overridability for ${b}`,success:!0})}}),{success:d.every(g=>g.success),actionsTaken:d}}async function qnt({slotUpdates:t,twee:e,definitions:n,referenceData:r,results:o}){(await Promise.allSettled(t.newComponentsInSlots?.map(async a=>{let l=e.getNodeById(a.parentComponentId);if(!l)throw new Error(`Parent component with ID ${a.parentComponentId} not found`);let c=n[l.value.type];if(!c)throw new Error(`Definition for parent component type ${l.value.type} not found`);let d=c.slots?.find(h=>h.id===a.slotName);if(!d)throw new Error(`Slot ${a.slotName} not found on component type ${l.value.type}`);let f=Mk({twee:e,parentSlotDefinition:d,nodeId:a.parentComponentId,componentDefinitionsIndex:n});if(!f)throw new Error(`Can't find allowed components inherited slot for ${a.slotName}`);let m=Yte(f);if(a.instanceType==="component"){if(!a.componentType)throw new Error("componentType is required when inserting a component instance");if(!Lk({type:a.componentType},m,!1))throw new Error(`Component type ${a.componentType} is not allowed in slot ${a.slotName}`);e.insertNode({node:{type:a.componentType},overrideNodeId:a.newComponentInstanceUuid,parentNodeId:a.parentComponentId,parentSlot:a.slotName,targetIndexInSlot:a.slotIndex}),o.push({summary:`Inserted component ${a.componentType} in slot ${a.slotName} ${a.slotIndex!==void 0?`at index ${a.slotIndex}`:""}`,success:!0})}else{if(!a.componentPatternId)throw new Error("componentPatternId is required when inserting a component pattern instance");let h=await r.resolvePatternData(a.componentPatternId);if(!h)throw new Error(`Pattern definition with ID ${a.componentPatternId} not found`);if(!Lk({type:h.type,_pattern:a.componentPatternId},m,!1))throw new Error(`Pattern ${a.componentPatternId} is not allowed in slot ${a.slotName}`);e.insertPattern({pattern:h,patternInstanceId:a.newComponentInstanceUuid,parentNodeId:a.parentComponentId,parentSlot:a.slotName,targetIndexInSlot:a.slotIndex}),o.push({summary:`Inserted pattern ${h._name} in slot ${a.slotName} ${a.slotIndex!==void 0?`at index ${a.slotIndex}`:""}`,success:!0})}})??[])).forEach((a,l)=>{if(a.status==="rejected"){let c=t.newComponentsInSlots?.[l];console.error("Error inserting component",a.reason),o.push({summary:`Failed to insert component ${c?.newComponentInstanceUuid}: ${"message"in a.reason?a.reason.message:"Unknown error"}`,success:!1})}})}async function Jnt({propertyUpdates:t,twee:e,currentEditorLocale:n,referenceData:r,definitions:o,results:i}){if(t.length===0)return[];let[a,l]=await Promise.all([r.fetchProjectGuidance(),r.getToolClient()]),c=await Promise.allSettled(t.map(async d=>(async()=>{let f="componentId"in d?d.componentId:e.rootNodeId,m=e.getNodeById(f);if(!m)throw new Error(`Component instance with ID ${f} not found`);let h=o[m.value.type];if(!h)throw new Error(`Definition with ID ${m.value.type} not found`);let g="fieldId"in d?d.fieldId:d.parameterId,y=h.parameters?.find(E=>E.id===g),b=d.locale??n,C=y??{id:g,type:"unknown"};if(d.editInstructions===void 0)return{result:{success:!0,newValue:"",treatNewValueAsJson:!1,action:"nothing"},update:d,propertyDefinition:C};if(d.editInstructions==="")return{result:{success:!0,newValue:"",treatNewValueAsJson:!1,action:"clearValue"},update:d,propertyDefinition:C};if(!y)throw new Error(`Property with ID ${g} not found`);let S=Znt({property:e.getNodeProperty(f,g),locale:b,conditionIndex:-1}),w=await l.invoke("createPropertyEdit",{edit:d.editInstructions,propertyDefinition:{id:g,name:y.name,type:y.type,guidance:y.guidance,typeConfig:y.typeConfig},outputLocale:b,documentContext:void 0,currentValue:S,projectGuidance:a,componentGuidance:h.description});if(!w.success)throw new Error(w.summary??"Failed to edit property");return{result:w,update:d,propertyDefinition:y,currentLocale:b}})()));return c.forEach((d,f)=>{if(d.status==="rejected"){let m=t[f],h="fieldId"in m?m.fieldId:m.parameterId;i.push({summary:`Failed to edit property ${h}: ${"message"in d.reason?d.reason.message:"Unknown error"}`,success:!1})}}),c.filter(d=>d.status==="fulfilled").map(d=>d.value)}import{CANVAS_BLOCK_PARAM_TYPE as Sc,CANVAS_ENRICHMENT_TAG_PARAM as O4e,CANVAS_LOCALE_TAG_PARAM as JE,CANVAS_LOCALIZATION_SLOT as OZ,CANVAS_LOCALIZATION_TYPE as Frt,CANVAS_PERSONALIZATION_PARAM as XE,CANVAS_PERSONALIZE_SLOT as R4e,CANVAS_SLOT_SECTION_SLOT as Brt,CANVAS_SLOT_SECTION_TYPE as RZ,CANVAS_TEST_SLOT as A4e,CANVAS_TEST_VARIANT_PARAM as k4e,CANVAS_VIZ_CONTROL_PARAM as u0,convertToBindExpression as zrt,createVariableReference as Vrt,getEffectivePropertyValue as P4e,walkNodeTree as c0}from"@uniformdev/canvas";var ZSe=Object.prototype.hasOwnProperty;function YE(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--&&YE(t[r],e[r]););return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(ZSe.call(t,n)&&++r&&!ZSe.call(e,n)||!(n in e)||!YE(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}var d0=J(bZ(),1),F4e=J(e4e(),1);import{produce as To}from"immer";import rrt from"crypto";var OL=new Uint8Array(256),ML=OL.length;function xZ(){return ML>OL.length-16&&(rrt.randomFillSync(OL),ML=0),OL.slice(ML,ML+=16)}var ua=[];for(let t=0;t<256;++t)ua.push((t+256).toString(16).slice(1));function t4e(t,e=0){return ua[t[e+0]]+ua[t[e+1]]+ua[t[e+2]]+ua[t[e+3]]+"-"+ua[t[e+4]]+ua[t[e+5]]+"-"+ua[t[e+6]]+ua[t[e+7]]+"-"+ua[t[e+8]]+ua[t[e+9]]+"-"+ua[t[e+10]]+ua[t[e+11]]+ua[t[e+12]]+ua[t[e+13]]+ua[t[e+14]]+ua[t[e+15]]}import ort from"crypto";var CZ={randomUUID:ort.randomUUID};function irt(t,e,n){if(CZ.randomUUID&&!e&&!t)return CZ.randomUUID();t=t||{};let r=t.random||(t.rng||xZ)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(let o=0;o<16;++o)e[n+o]=r[o];return e}return t4e(r)}var Ba=irt;import{bindVariablesToObject as lrt}from"@uniformdev/canvas";var ZE="Untitled",a4e=60;function s4e({value:t,isNew:e,contentType:n}){let{result:r}=lrt({value:t,handleBinding:()=>"{token}",variables:{}}),o=n.entryName??"",i=(n.fields??[]).find(a=>a.id===o);if(typeof r=="string"){if(i?.type==="image")return r.length>0?`Image: ${crt(r)}`:`${ZE} image`;if(r.length>0)return i?.type==="date"?frt(r)?prt(r):"Invalid date":l0(r)}else{if(typeof r=="number"||typeof r=="boolean")return r.toString();if(typeof r<"u"&&r!==null){if(i?.type==="link")return urt(r);if(Pte(r))return l0($k(r.root));if(i?.type==="datetime"&&r){let a=r;return a.datetime&&l4e(a.datetime)?mrt(a.datetime):"Invalid datetime"}else return l0(hrt(r).description)}}return e?`New entry: ${n.name}`:ZE}function urt(t){return t?t.type==="projectMapNode"?t.path.length>0?`Link to ${l0(t.path)}`:`Link to project map node (${t.nodeId})`:t.path.length>0?`Link to ${l0(t.path)}`:`${ZE} link`:`${ZE} link`}function crt(t){try{let{pathname:e,hostname:n}=new URL(t),r=e.split("/").filter(o=>o);return r.length>2?`/${r[0]}/.../${r[r.length-1]} (${l0(n)})`:`${e} (${l0(n)})`}catch{return t}}function l0(t){let e=t.split(" ").filter(i=>i).reverse();if(e.length<1)return ZE;let n="",r=e.pop(),o=()=>n.length+(r?.length??0)+(n.length>0?1:0);for(;r&&o()<a4e;)n+=n.length>0?` ${r}`:r,r=e.pop();return n.length<1?`${t.slice(0,a4e)}...`:e.length>0?`${n}...`:n}var drt=/^[1-9][0-9]{3}-[0-1][0-9]-[0-3][0-9]$/;function frt(t){return drt.test(t)?l4e(t):!1}function l4e(t){let e=new Date(t);return e instanceof Date&&!isNaN(Number(e))}function prt(t){return new Date(t).toLocaleDateString()}function mrt(t){return new Date(t).toLocaleString()}function hrt(t){let e=EZ(t);return e?{description:e,named:!0}:{description:grt(t).valuePreview,named:!1}}function grt(t){if(typeof t>"u")return{valueIcon:"close-o",valuePreview:"undefined"};if(t===null)return{valueIcon:"close-o",valuePreview:"null"};if(Array.isArray(t))return{valuePreview:`array with ${t.length} item${t.length!==1?"s":""}`,valueIcon:"list"};if(typeof t=="boolean")return{valuePreview:t.toString(),valueIcon:t?"check-r":"close-r"};if(typeof t=="number"||typeof t=="bigint")return{valuePreview:t.toString(10),valueIcon:"number-input"};if(typeof t=="object"){let e=Object.keys(t);return{valuePreview:`object with ${e.length} ${e.length!==1?"properties":"property"}`,valueIcon:"shape-hexagon"}}return{valuePreview:t,valueIcon:"text-input"}}var vrt=["displayName","name","_name","title","heading","label","parameters","fields","properties","entry","slug","_slug","alt","alt_description","description","results","items","entries","hits","value","id","objectID","identifier"];function EZ(t){if(typeof t=="string")return t;if(typeof t=="number")return t.toString(10);if(typeof t=="boolean")return t.toString();if(typeof t!="object"||t===null)return;if(Array.isArray(t)){if(t.length===0)return;let r=EZ(t[0]);return r?t.length===1?r:`${r} and ${t.length-1} other${t.length>2?"s":""}`:void 0}let n=t;for(let r of vrt)if(r in n){let o=EZ(n[r]);if(o)return o}}import{CANVAS_SLOT_SECTION_SLOT as yrt,walkNodeTree as brt}from"@uniformdev/canvas";var qE="|";function RL(t,e){if(!t)return e??Ba();let n=t.split(qE),r=(e??Ba()).split(qE);return n.at(-1)===r[0]&&n.pop(),n.concat(r).join(qE)}function c4e(t){let e=t.indexOf(qE);if(e<0)throw new Error(`Cannot remove pattern instance ID from ${t}`);return t.substring(e+1)}function AL(t,e,n=!1){brt(t,({node:r,actions:{setDescendantsContext:o},context:i})=>{let a=!n&&!i?.currentParentPatternInstanceId,l="_pattern"in r&&!!r._pattern;if(i?.currentParentPatternInstanceId){let d=RL(i.currentParentPatternInstanceId,r._id);r._id=d}let c=i?.currentParentPatternInstanceId;l&&(c=r._id),"_overrides"in r&&r._overrides&&u4e(r._overrides,c,a),"_patternOverrides"in r&&r._patternOverrides&&u4e(r._patternOverrides,c,a),l&&o({currentParentPatternInstanceId:r._id})},{initialContext:{currentParentPatternInstanceId:e}})}var u4e=(t,e,n)=>{Object.entries(t).forEach(([r,o])=>{let i=n?r:RL(e,r);Object.entries(o.slots??{}).forEach(([a,l])=>{l.forEach(c=>{let{partOfNestedPattern:d}=kL(r??"");AL(c,a===yrt&&!d?void 0:e,!0)})}),i&&(delete t[r],t[i]=o)})};function kL(t){let e=t.split(qE);return e.length===1?{partOfPattern:void 0,partOfNestedPattern:void 0}:e.length===2?{partOfPattern:e[0],partOfNestedPattern:void 0}:{partOfPattern:e[0],partOfNestedPattern:e[e.length-2]}}import{CANVAS_SLOT_SECTION_SLOT as g4e}from"@uniformdev/canvas";import{CANVAS_VIZ_CONTROL_PARAM as wrt}from"@uniformdev/canvas";import{CANVAS_ENRICHMENT_TAG_PARAM as d4e,CANVAS_INTENT_TAG_PARAM as xrt,CANVAS_LOCALE_TAG_PARAM as Crt,CANVAS_PERSONALIZATION_PARAM as f4e,CANVAS_TEST_VARIANT_PARAM as Srt,CANVAS_VIZ_CONTROL_PARAM as p4e}from"@uniformdev/canvas";var m4e=[{id:xrt,name:"Intent Tag",type:"intentTag"},{id:Crt,name:"Locale Visibility",type:"localeSelect"},{id:f4e,name:"Personalization Criteria",type:f4e},{id:d4e,name:"Enrichment Tags",type:d4e,helpText:"Seeing this component will increase a visitor's score in these enrichments."},{id:Srt,name:"A/B Test",type:"testVariant"},{id:p4e,name:"Visibility Control",type:p4e}];var Ert=m4e.reduce((t,e)=>(e.id===wrt||t.add(e.id),t),new Set);function fC(t,e){return Ert.has(e)?"yes":t?.parameters?.[e]??"no"}function TZ(t,e){e&&Object.entries(e).forEach(([n,r])=>{let o=t[n];if((r.parameters||o?.parameters)&&(t[n]??={},t[n].parameters={...r?.parameters,...o?.parameters}),(r.dataResources||o?.dataResources)&&(t[n]??={},t[n].dataResources={...r?.dataResources,...o?.dataResources}),r.slots||o?.slots){t[n]??={};let i=Object.entries(o?.slots??{}).reduce((a,[l,c])=>(a[l]&&Array.isArray(a[l])?a[l]=[...c,...a[l]]:a[l]=c,a),r.slots??{});t[n].slots=i}(r.variant!==void 0||o?.variant!==void 0)&&(t[n]=t[n]??{},t[n].variant=o?.variant??r?.variant)})}function h4e({applyOverrideToNode:t}){let e=new Set,n={};return{visitNode(r){e.add(r._id),TZ(n,r._overrides),TZ(n,r._patternOverrides);let o=n[r._id];o&&(o.parameters&&Object.keys(o.parameters).forEach(i=>{fC(r._overridability,i)==="no"&&(console.log(`[Override] Cleaned override from ${r._id} parameter ${i} because it is not overridable`),delete n[r._id].parameters?.[i])}),o.dataResources&&Object.keys(o.dataResources).forEach(i=>{r._patternDataResources?.[i]?.isPatternParameter||(console.log(`[Override] Cleaned override from ${r._id} data resource ${i} because it is not overridable`),delete n[r._id].dataResources?.[i])}),o.variant!==void 0&&(r._overridability?.variants||delete o.variant),t({node:r,overrides:o}))},overrides:n}}function _Z(t){let{beforeApplyParameterOverride:e,beforeApplyDataResourceOverride:n}=t??{};return h4e({applyOverrideToNode({node:r,overrides:o}){if(Object.entries(o.parameters??{}).map(([i,a])=>{r.parameters=r.parameters??{},e?.(r,i,a,r.parameters[i]);let l=r.parameters[i]??={type:a.type};a.locales||a.localesConditions?(l.locales??={},delete l.value,delete l.conditions,new Set([...Object.keys(a.locales??{}),...Object.keys(a.localesConditions??{})]).forEach(f=>{delete l.locales?.[f],delete l.localesConditions?.[f];let m=a.locales?.[f],h=a.localesConditions?.[f];m!=null&&(l.locales??={},l.locales[f]=m),h!=null&&(l.localesConditions??={},l.localesConditions[f]=h)}),l.locales&&Object.keys(l.locales).length===0&&delete l.locales,l.localesConditions&&Object.keys(l.localesConditions).length===0&&delete l.localesConditions):(delete l.locales,delete l.localesConditions,delete l.conditions,delete l.value,a.value!==null&&a.value!==void 0&&(l.value=a.value,l.connectedData=a.connectedData),a.conditions!==null&&a.conditions!==void 0&&(l.conditions=a.conditions)),!l.locales&&!l.localesConditions&&!l.conditions&&l.value===void 0&&delete r.parameters[i]}),Object.entries(o.dataResources??{}).forEach(([i,a])=>{n?.(r,i,a,r._dataResources?.[i]),r._dataResources??={},r._dataResources[i]=a}),o.variant!==void 0&&(r.variant=o.variant),o.slots){r.slots??={};let i=Object.keys(o.slots)[0];r.slots[g4e]??=[],r.slots[g4e]=[...o.slots[i]??[]]}}})}import{CANVAS_SLOT_SECTION_SLOT as Trt,CANVAS_SLOT_SECTION_TYPE as _rt}from"@uniformdev/canvas";var v4e=({preserveOwnSlotSections:t=!1,preserveChildrenSlotSections:e=!1}={})=>n=>{if(n.node.type!==_rt)return;let{partOfPattern:r,partOfNestedPattern:o}=kL(n.node._id??"");!r&&!o&&t||r&&!o&&e||Drt(n)},Drt=({node:t,type:e,actions:n})=>{e!=="entry"&&(n.insertAfter(t.slots?.[Trt]??[]),n.remove())};import{walkNodeTree as Lrt}from"@uniformdev/canvas";import{produce as Mrt}from"immer";import{CANVAS_SLOT_SECTION_SLOT as y4e,walkNodeTree as $rt}from"@uniformdev/canvas";import{produce as Nrt}from"immer";function b4e(t,e,n,r=Ba()){if(!t._pattern)throw new Error("Not a pattern");let o={};return $rt(t,({node:i,ancestorsAndSelf:a,actions:l})=>{let c=i._id,d=e[c];if(a.length===1)i._id=r;else{let m=a[0];m.type!=="slot"||m.parentSlot!==y4e?(i._id=c4e(c),i._id=RL(r,i._id)):(l.replace({...o[c],_id:o[c]._id}),l.stopProcessingDescendants())}if(d){let m=Nrt(d,h=>{h.slots&&Object.entries(h.slots).forEach(([g,y])=>{if(g!==y4e)throw new Error("Only slot section items are supported for duplication");y.forEach((b,C)=>{if(!b._id)return;let S=PL(b,e,n);o[b._id]=S,y[C]=S})})});n?.(i._id,m,c)}}),r}function PL(t,e,n){return Mrt(t,r=>{Lrt(r,({type:o,node:i,actions:{stopProcessingDescendants:a}})=>{o==="component"&&i._pattern?(b4e(i,e,n),a()):i._id=Ba()})})}function IL({locale:t,conditionIndex:e,property:n}){if(t===void 0)if(e<0){if(delete n.value,!n.conditions?.length)return!1}else n.conditions?.splice(e,1);else e<0?delete n.locales?.[t]:n.localesConditions?.[t]?.splice(e,1);if(n.localesConditions){for(let[r,o]of Object.entries(n.localesConditions))if(o.length===0){delete n.localesConditions[r];break}Object.keys(n.localesConditions).length===0&&delete n.localesConditions}return n.locales&&Object.keys(n.locales).length===0&&delete n.locales,n.conditions&&n.conditions.length===0&&delete n.conditions,!!(n.value!==void 0||n.locales||n.conditions||n.localesConditions)}function DZ({locale:t,conditionIndex:e,conditionDefinition:n,property:r,newPropertyValue:o}){t===void 0?e<0?r.value=o:(r.conditions??=[],x4e(r.conditions,e,n,o)):e<0?(r.locales??={},r.locales[t]=o):(r.localesConditions??={},r.localesConditions[t]??=[],x4e(r.localesConditions[t],e,n,o))}function x4e(t,e,n,r){if(e<0)throw new Error("Condition index must be greater than or equal to 0");let o=t[e];t[e]={when:n??o?.when??{clauses:[]},value:r===void 0?null:r,id:o?.id??Ort(t)}}function Ort(t){let e=new Set(t.map(r=>r.id)),n=0;for(;e.has(n);)n++;return n}function C4e(t){let e=!1,n={};return"_pattern"in t&&t._patternDataResources&&Object.entries(t._patternDataResources).forEach(([r,o])=>{e=!0,n[r]={...o,source:"patternDataResource"}}),t._dataResources&&Object.entries(t._dataResources).forEach(([r,o])=>{n[r]?n[r].isPatternParameter&&(e=!0,n[r]={...o,source:"dataResource"}):(e=!0,n[r]={...o,source:"dataResource"})}),e?n:void 0}import{CANVAS_DRAFT_STATE as Rrt,convertEntryToPutEntry as MVt,getPropertiesValue as AVt}from"@uniformdev/canvas";function S4e(t){let{fields:e,entryName:n,type:r="contentType",thumbnailField:o,...i}=t;return{...i,titleParameter:n,thumbnailParameter:o,parameters:e,canBeComposition:r==="block",permissions:t.permissions,useTeamPermissions:t.useTeamPermissions??!0,workflowId:t.workflowId}}function w4e(t){return{id:t.id,name:t.name,entryName:t.titleParameter,thumbnailField:t.thumbnailParameter,fields:t.parameters,icon:t.icon,description:t.description,slugSettings:t.slugSettings,type:t.canBeComposition?"block":"contentType",created:t.created,updated:t.updated,permissions:t.permissions,useTeamPermissions:t.useTeamPermissions,workflowId:t.workflowId||void 0}}function FL(t){let{entry:{fields:e,...n},...r}=t;return{created:"",modified:"",composition:{_id:"",...n,_name:t.entry._name??"Untitled",parameters:e,_overridability:t.entry._overridability,_overrides:t.entry._overrides,_pattern:t.entry._pattern,_patternError:t.entry._patternError},pattern:!!t.pattern,previewImageUrl:t.entry._thumbnail,...r}}function E4e(t,e,n,r,o,i,a){let l=a??e.projectId;if(!l)throw new Error("projectId is required in currentEntry or explicitly");return{created:"",modified:"",...e,projectId:l,state:r??e.state??Rrt,releaseId:o??e.releaseId,workflowId:n?.workflowId??e.workflowId,workflowStageId:n?.workflowStageId??e.workflowStageId,editionId:i,editionName:n?.editionName??e.editionName,editionPriority:n?.editionPriority??e.editionPriority,entry:{type:t.type,_id:t._id,...e.entry,_thumbnail:n?.previewImageUrl??void 0,_name:t._name,_slug:t._slug??"",fields:t.parameters,_dataResources:t._dataResources,_pattern:t._pattern,_patternError:t._patternError,_overridability:t._overridability,_overrides:t._overrides,_locales:t._locales,_author:t._author,_authorSubject:t._authorSubject,_creator:t._creator,_creatorSubject:t._creatorSubject,_patternDataResources:t._patternDataResources}}}function $Z(t,e){let{parameters:n,...r}=t;return{...r,_id:e??r._id??"unknown",fields:n}}function NZ(t){let{fields:e,...n}=t;return{...n,parameters:e}}import{CANVAS_VIZ_LOCALE_RULE as Art}from"@uniformdev/canvas";import{produce as krt}from"immer";function T4e(t,e,n){let r=krt(t.criteria,o=>_4e(o,e,n));return r&&{...t,criteria:r}}function _4e(t,e,n){if(!t)return t;let r=!1;for(let o of t.clauses)if("clauses"in o){let i=_4e(o,e,n);if(i===null){if(t.op!=="|")return null;t.clauses.splice(t.clauses.indexOf(o),1),r=!0}else i!==void 0&&(t.clauses[t.clauses.indexOf(o)]=i,r=!0)}else if(o.rule===Art){let i=Array.isArray(o.value)?o.value:[o.value],a=i.includes(e),l=i.includes(n);if(!a&&!l||a&&l)continue;if(i.length===1&&l&&!a)return null;a&&!l&&(o.value=i.concat(n),r=!0)}return r?t:void 0}var D4e=J(bZ(),1);function LZ(t,e){try{return(0,D4e.get)(t,e)}catch{return}}function MZ(t,e,n=0){let r=t.slice(n*4,n*4+4);if(!r)throw new Error("Failed to generate a default variation name");return`${e.startsWith("$")?e.slice(1):e}-${r}`}import{CANVAS_VIZ_LOCALE_RULE as Prt}from"@uniformdev/canvas";import{produce as Irt}from"immer";function $4e(t,e){let n=Irt(t.criteria,r=>N4e(r,e));return n&&{...t,criteria:n}}function N4e(t,e){if(!t)return t;for(let n=t.clauses.length-1;n>=0;n--){let r=t.clauses[n];if("clauses"in r){let o=N4e(r,e);if(o)t.clauses[n]=o;else if(t.clauses.splice(n,1),o===null&&t.op!=="|")return null}else if(r.rule===Prt){let o=Array.isArray(r.value)?r.value:[r.value],i=o.indexOf(e);if(i!==-1)if(Array.isArray(r.value)&&r.value.length>1)o.splice(i,1);else if(r.op.startsWith("!"))t.clauses.splice(n,1);else return null}}if(t.clauses.length!==0)return t}function L4e(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)})}}}function M4e(t,e){let n=L4e();if(process.env.NODE_ENV==="development"&&!e){let r=new Error().stack?.split(`
5175
+ `;await er();function GSe(t){let e=Ole({nodes:[pd,fd,hZ,X1,Q1,Mae,Sfe,Cfe,wfe,Mf]});return e.update(()=>{Lae("skip-dom-selection"),$de(t,kde)},{discrete:!0}),e.getEditorState().toJSON()}function YSe({twee:t,nodeId:e,propertyId:n,propertyType:r,locale:o,propertyEdit:i,conditionIndex:a=-1}){let l=t.getNodeById(e);if(!l)throw new Error(`Node with ID ${e} not found`);if(i.action==="clearValue")t.updateNodeProperty({nodeId:e,property:n,value:null,source:"ai",locale:o,conditionIndex:-1});else if(i.action==="resetOverride")t.resetPatternPropertyOverride(e,n,o);else if(i.action==="setValue"){let c=Ynt({twee:t,targetNode:l,propertyId:n,propertyType:r,propertyEdit:i}),d=t.getNodeProperty(e,n);if(!o&&d?.locales)throw new Error(`The ${n} property is localized in ${Object.keys(d.locales).join(", ")}, but no locale was provided when setting its value. Please provide an explicit locale.`);t.updateNodeProperty({nodeId:e,property:n,value:()=>c,source:"ai",locale:o,conditionIndex:a,type:r})}}var Ynt=({twee:t,targetNode:e,propertyId:n,propertyType:r,propertyEdit:o})=>{if(r==="richText")return GSe(o.newValue??"");if(r==="number")return Number(o.newValue);if(n===Knt){if(Gnt(e.value.type))throw new Error("Enrichment tags are not allowed in system components.");if(t.getParentInfo(e.nodeId)?.parentId===Wnt)throw new Error("Enrichment tags are not allowed in personalization variants.")}return o.treatNewValueAsJson?JSON.parse(o.newValue):o.newValue};async function LL({twee:t,slotUpdates:e,propertyUpdates:n,localeUpdates:r,nameUpdate:o,slugUpdate:i,descriptionUpdate:a,currentEditorLocale:l,referenceData:c}){let d=[];o&&(t.updateRootNode({update:{_name:o}}),d.push({summary:"Updated name",success:!0})),i&&(t.updateRootNode({update:{_slug:i}}),d.push({summary:"Updated slug",success:!0})),a&&(t.updateRootMetadata({description:a}),d.push({summary:"Updated description",success:!0}));let f=await c.fetchDefinitions();await qnt({slotUpdates:e,twee:t,definitions:f,referenceData:c,results:d});let m=d.some(g=>!g.success);return e.deletedComponentsInSlots?.forEach(g=>{m?d.push({summary:`Skipped deleting component ${g} because previous actions failed`,success:!1}):(t.deleteNode(g,!1),d.push({summary:`Deleted component ${g}`,success:!0}))}),m=d.some(g=>!g.success),e.moveComponentsInSlots?.forEach(g=>{m?d.push({summary:`Skipped moving component ${g.componentId} because previous actions failed`,success:!1}):(t.moveNode({movedNodeId:g.componentId,parentNodeId:g.newParentComponentId,parentSlot:g.newSlotName,targetIndexInSlot:g.newSlotIndex}),d.push({summary:`Moved component ${g.componentId} to ${g.newParentComponentId} in slot ${g.newSlotName} at index ${g.newSlotIndex}`,success:!0}))}),m=d.some(g=>!g.success),e.duplicateComponentsInSlots?.forEach(g=>{m?d.push({summary:`Skipped duplicating component ${g} because previous actions failed`,success:!1}):(t.duplicateNode(g,c.resolvePatternData),d.push({summary:`Duplicated component ${g}`,success:!0}))}),m=d.some(g=>!g.success),r?.enableLocales?.forEach(g=>{m?d.push({summary:`Skipped enabling locale ${g} because previous actions failed`,success:!1}):(t.enableLocale(g),d.push({summary:`Enabled locale ${g}`,success:!0}))}),m=d.some(g=>!g.success),r?.disableLocales?.forEach(g=>{m?d.push({summary:`Skipped disabling locale ${g} because previous actions failed`,success:!1}):(t.disableLocale(g),d.push({summary:`Disabled locale ${g}`,success:!0}))}),m=d.some(g=>!g.success),m?n.length>0&&d.push({summary:`Skipped ${n.length} property updates because previous actions failed`,success:!1}):(await Jnt({propertyUpdates:n,twee:t,currentEditorLocale:l,referenceData:c,definitions:f,results:d})).forEach(y=>{if(!y.result.success)return;let b="componentId"in y.update?y.update.componentId:t.rootNodeId,C=qte({twee:t,nodeId:b,currentEditorLocale:y.currentLocale,definition:y.propertyDefinition}),S=(t.getNodeById(t.rootNodeId)?.value)._locales??[];if(C&&!S.includes(C)){d.push({summary:`The ${C} locale is not enabled on this entity. Please enable it before setting values in this locale.`,success:!1});return}if(y.result.action!=="nothing")try{YSe({twee:t,nodeId:b,propertyId:y.propertyDefinition.id,propertyType:y.propertyDefinition.type,locale:C,propertyEdit:y.result}),d.push({summary:`Updated value of ${y.propertyDefinition.id} on ${b}${C?` in ${C}`:""}`,success:!0})}catch(w){d.push({summary:`Failed to update value of ${y.propertyDefinition.id} on ${b}${C?` in ${C}`:""}: ${w instanceof Error?w.message:"Unknown error"}`,success:!1})}if("overridable"in y.update&&y.update.overridable!==void 0){let w=y.update.overridable;t.updateNode({nodeId:b,updateComponent:E=>{E._overridability??={},E._overridability.parameters??={},E._overridability.parameters[y.propertyDefinition.id]=w}}),d.push({summary:`Updated overridability for ${b}`,success:!0})}}),{success:d.every(g=>g.success),actionsTaken:d}}async function qnt({slotUpdates:t,twee:e,definitions:n,referenceData:r,results:o}){(await Promise.allSettled(t.newComponentsInSlots?.map(async a=>{let l=e.getNodeById(a.parentComponentId);if(!l)throw new Error(`Parent component with ID ${a.parentComponentId} not found`);let c=n[l.value.type];if(!c)throw new Error(`Definition for parent component type ${l.value.type} not found`);let d=c.slots?.find(h=>h.id===a.slotName);if(!d)throw new Error(`Slot ${a.slotName} not found on component type ${l.value.type}`);let f=Mk({twee:e,parentSlotDefinition:d,nodeId:a.parentComponentId,componentDefinitionsIndex:n});if(!f)throw new Error(`Can't find allowed components inherited slot for ${a.slotName}`);let m=Yte(f);if(a.instanceType==="component"){if(!a.componentType)throw new Error("componentType is required when inserting a component instance");if(!Lk({type:a.componentType},m,!1))throw new Error(`Component type ${a.componentType} is not allowed in slot ${a.slotName}`);e.insertNode({node:{type:a.componentType},overrideNodeId:a.newComponentInstanceUuid,parentNodeId:a.parentComponentId,parentSlot:a.slotName,targetIndexInSlot:a.slotIndex}),o.push({summary:`Inserted component ${a.componentType} in slot ${a.slotName} ${a.slotIndex!==void 0?`at index ${a.slotIndex}`:""}`,success:!0})}else{if(!a.componentPatternId)throw new Error("componentPatternId is required when inserting a component pattern instance");let h=await r.resolvePatternData(a.componentPatternId);if(!h)throw new Error(`Pattern definition with ID ${a.componentPatternId} not found`);if(!Lk({type:h.type,_pattern:a.componentPatternId},m,!1))throw new Error(`Pattern ${a.componentPatternId} is not allowed in slot ${a.slotName}`);e.insertPattern({pattern:h,patternInstanceId:a.newComponentInstanceUuid,parentNodeId:a.parentComponentId,parentSlot:a.slotName,targetIndexInSlot:a.slotIndex}),o.push({summary:`Inserted pattern ${h._name} in slot ${a.slotName} ${a.slotIndex!==void 0?`at index ${a.slotIndex}`:""}`,success:!0})}})??[])).forEach((a,l)=>{if(a.status==="rejected"){let c=t.newComponentsInSlots?.[l];console.error("Error inserting component",a.reason),o.push({summary:`Failed to insert component ${c?.newComponentInstanceUuid}: ${"message"in a.reason?a.reason.message:"Unknown error"}`,success:!1})}})}async function Jnt({propertyUpdates:t,twee:e,currentEditorLocale:n,referenceData:r,definitions:o,results:i}){if(t.length===0)return[];let[a,l]=await Promise.all([r.fetchProjectGuidance(),r.getToolClient()]),c=await Promise.allSettled(t.map(async d=>(async()=>{let f="componentId"in d?d.componentId:e.rootNodeId,m=e.getNodeById(f);if(!m)throw new Error(`Component instance with ID ${f} not found`);let h=o[m.value.type];if(!h)throw new Error(`Definition with ID ${m.value.type} not found`);let g="fieldId"in d?d.fieldId:d.parameterId,y=h.parameters?.find(E=>E.id===g),b=d.locale??n,C=y??{id:g,type:"unknown"};if(d.editInstructions===void 0)return{result:{success:!0,newValue:"",treatNewValueAsJson:!1,action:"nothing"},update:d,propertyDefinition:C};if(d.editInstructions==="")return{result:{success:!0,newValue:"",treatNewValueAsJson:!1,action:"clearValue"},update:d,propertyDefinition:C};if(!y)throw new Error(`Property with ID ${g} not found`);let S=Znt({property:e.getNodeProperty(f,g),locale:b,conditionIndex:-1}),w=await l.invoke("createPropertyEdit",{edit:d.editInstructions,propertyDefinition:{id:g,name:y.name,type:y.type,guidance:y.guidance,typeConfig:y.typeConfig},outputLocale:b,documentContext:void 0,currentValue:S,projectGuidance:a,componentGuidance:h.description});if(!w.success)throw new Error(w.summary??"Failed to edit property");return{result:w,update:d,propertyDefinition:y,currentLocale:b}})()));return c.forEach((d,f)=>{if(d.status==="rejected"){let m=t[f],h="fieldId"in m?m.fieldId:m.parameterId;i.push({summary:`Failed to edit property ${h}: ${"message"in d.reason?d.reason.message:"Unknown error"}`,success:!1})}}),c.filter(d=>d.status==="fulfilled").map(d=>d.value)}import{CANVAS_BLOCK_PARAM_TYPE as Sc,CANVAS_ENRICHMENT_TAG_PARAM as O4e,CANVAS_LOCALE_TAG_PARAM as JE,CANVAS_LOCALIZATION_SLOT as OZ,CANVAS_LOCALIZATION_TYPE as Frt,CANVAS_PERSONALIZATION_PARAM as XE,CANVAS_PERSONALIZE_SLOT as R4e,CANVAS_SLOT_SECTION_SLOT as Brt,CANVAS_SLOT_SECTION_TYPE as RZ,CANVAS_TEST_SLOT as A4e,CANVAS_TEST_VARIANT_PARAM as k4e,CANVAS_VIZ_CONTROL_PARAM as u0,convertToBindExpression as zrt,createVariableReference as Vrt,getEffectivePropertyValue as P4e,walkNodeTree as c0}from"@uniformdev/canvas";var ZSe=Object.prototype.hasOwnProperty;function YE(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--&&YE(t[r],e[r]););return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(ZSe.call(t,n)&&++r&&!ZSe.call(e,n)||!(n in e)||!YE(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}var d0=J(bZ(),1),F4e=J(e4e(),1);import{produce as To}from"immer";import rrt from"crypto";var OL=new Uint8Array(256),ML=OL.length;function xZ(){return ML>OL.length-16&&(rrt.randomFillSync(OL),ML=0),OL.slice(ML,ML+=16)}var ua=[];for(let t=0;t<256;++t)ua.push((t+256).toString(16).slice(1));function t4e(t,e=0){return ua[t[e+0]]+ua[t[e+1]]+ua[t[e+2]]+ua[t[e+3]]+"-"+ua[t[e+4]]+ua[t[e+5]]+"-"+ua[t[e+6]]+ua[t[e+7]]+"-"+ua[t[e+8]]+ua[t[e+9]]+"-"+ua[t[e+10]]+ua[t[e+11]]+ua[t[e+12]]+ua[t[e+13]]+ua[t[e+14]]+ua[t[e+15]]}import ort from"crypto";var CZ={randomUUID:ort.randomUUID};function irt(t,e,n){if(CZ.randomUUID&&!e&&!t)return CZ.randomUUID();t=t||{};let r=t.random||(t.rng||xZ)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(let o=0;o<16;++o)e[n+o]=r[o];return e}return t4e(r)}var Ba=irt;import{bindVariablesToObject as lrt}from"@uniformdev/canvas";var ZE="Untitled",a4e=60;function s4e({value:t,isNew:e,contentType:n}){let{result:r}=lrt({value:t,handleBinding:()=>"{token}",variables:{}}),o=n.entryName??"",i=(n.fields??[]).find(a=>a.id===o);if(typeof r=="string"){if(i?.type==="image")return r.length>0?`Image: ${crt(r)}`:`${ZE} image`;if(r.length>0)return i?.type==="date"?frt(r)?prt(r):"Invalid date":l0(r)}else{if(typeof r=="number"||typeof r=="boolean")return r.toString();if(typeof r<"u"&&r!==null){if(i?.type==="link")return urt(r);if(Pte(r))return l0($k(r.root));if(i?.type==="datetime"&&r){let a=r;return a.datetime&&l4e(a.datetime)?mrt(a.datetime):"Invalid datetime"}else return l0(hrt(r).description)}}return e?`New entry: ${n.name}`:ZE}function urt(t){return t?t.type==="projectMapNode"?t.path.length>0?`Link to ${l0(t.path)}`:`Link to project map node (${t.nodeId})`:t.path.length>0?`Link to ${l0(t.path)}`:`${ZE} link`:`${ZE} link`}function crt(t){try{let{pathname:e,hostname:n}=new URL(t),r=e.split("/").filter(o=>o);return r.length>2?`/${r[0]}/.../${r[r.length-1]} (${l0(n)})`:`${e} (${l0(n)})`}catch{return t}}function l0(t){let e=t.split(" ").filter(i=>i).reverse();if(e.length<1)return ZE;let n="",r=e.pop(),o=()=>n.length+(r?.length??0)+(n.length>0?1:0);for(;r&&o()<a4e;)n+=n.length>0?` ${r}`:r,r=e.pop();return n.length<1?`${t.slice(0,a4e)}...`:e.length>0?`${n}...`:n}var drt=/^[1-9][0-9]{3}-[0-1][0-9]-[0-3][0-9]$/;function frt(t){return drt.test(t)?l4e(t):!1}function l4e(t){let e=new Date(t);return e instanceof Date&&!isNaN(Number(e))}function prt(t){return new Date(t).toLocaleDateString()}function mrt(t){return new Date(t).toLocaleString()}function hrt(t){let e=EZ(t);return e?{description:e,named:!0}:{description:grt(t).valuePreview,named:!1}}function grt(t){if(typeof t>"u")return{valueIcon:"close-o",valuePreview:"undefined"};if(t===null)return{valueIcon:"close-o",valuePreview:"null"};if(Array.isArray(t))return{valuePreview:`array with ${t.length} item${t.length!==1?"s":""}`,valueIcon:"list"};if(typeof t=="boolean")return{valuePreview:t.toString(),valueIcon:t?"check-r":"close-r"};if(typeof t=="number"||typeof t=="bigint")return{valuePreview:t.toString(10),valueIcon:"number-input"};if(typeof t=="object"){let e=Object.keys(t);return{valuePreview:`object with ${e.length} ${e.length!==1?"properties":"property"}`,valueIcon:"shape-hexagon"}}return{valuePreview:t,valueIcon:"text-input"}}var vrt=["displayName","name","_name","title","heading","label","parameters","fields","properties","entry","slug","_slug","alt","alt_description","description","results","items","entries","hits","value","id","objectID","identifier"];function EZ(t){if(typeof t=="string")return t;if(typeof t=="number")return t.toString(10);if(typeof t=="boolean")return t.toString();if(typeof t!="object"||t===null)return;if(Array.isArray(t)){if(t.length===0)return;let r=EZ(t[0]);return r?t.length===1?r:`${r} and ${t.length-1} other${t.length>2?"s":""}`:void 0}let n=t;for(let r of vrt)if(r in n){let o=EZ(n[r]);if(o)return o}}import{CANVAS_SLOT_SECTION_SLOT as yrt,walkNodeTree as brt}from"@uniformdev/canvas";var qE="|";function RL(t,e){if(!t)return e??Ba();let n=t.split(qE),r=(e??Ba()).split(qE);return n.at(-1)===r[0]&&n.pop(),n.concat(r).join(qE)}function c4e(t){let e=t.indexOf(qE);if(e<0)throw new Error(`Cannot remove pattern instance ID from ${t}`);return t.substring(e+1)}function AL(t,e,n=!1){brt(t,({node:r,actions:{setDescendantsContext:o},context:i})=>{let a=!n&&!i?.currentParentPatternInstanceId,l="_pattern"in r&&!!r._pattern;if(i?.currentParentPatternInstanceId){let d=RL(i.currentParentPatternInstanceId,r._id);r._id=d}let c=i?.currentParentPatternInstanceId;l&&(c=r._id),"_overrides"in r&&r._overrides&&u4e(r._overrides,c,a),"_patternOverrides"in r&&r._patternOverrides&&u4e(r._patternOverrides,c,a),l&&o({currentParentPatternInstanceId:r._id})},{initialContext:{currentParentPatternInstanceId:e}})}var u4e=(t,e,n)=>{Object.entries(t).forEach(([r,o])=>{let i=n?r:RL(e,r);Object.entries(o.slots??{}).forEach(([a,l])=>{l.forEach(c=>{let{partOfNestedPattern:d}=kL(r??"");AL(c,a===yrt&&!d?void 0:e,!0)})}),i&&(delete t[r],t[i]=o)})};function kL(t){let e=t.split(qE);return e.length===1?{partOfPattern:void 0,partOfNestedPattern:void 0}:e.length===2?{partOfPattern:e[0],partOfNestedPattern:void 0}:{partOfPattern:e[0],partOfNestedPattern:e[e.length-2]}}import{CANVAS_SLOT_SECTION_SLOT as g4e}from"@uniformdev/canvas";import{CANVAS_VIZ_CONTROL_PARAM as wrt}from"@uniformdev/canvas";import{CANVAS_ENRICHMENT_TAG_PARAM as d4e,CANVAS_INTENT_TAG_PARAM as xrt,CANVAS_LOCALE_TAG_PARAM as Crt,CANVAS_PERSONALIZATION_PARAM as f4e,CANVAS_TEST_VARIANT_PARAM as Srt,CANVAS_VIZ_CONTROL_PARAM as p4e}from"@uniformdev/canvas";var m4e=[{id:xrt,name:"Intent Tag",type:"intentTag"},{id:Crt,name:"Locale Visibility",type:"localeSelect"},{id:f4e,name:"Personalization Criteria",type:f4e},{id:d4e,name:"Enrichment Tags",type:d4e,helpText:"Seeing this component will increase a visitor's score in these enrichments."},{id:Srt,name:"A/B Test",type:"testVariant"},{id:p4e,name:"Visibility Control",type:p4e}];var Ert=m4e.reduce((t,e)=>(e.id===wrt||t.add(e.id),t),new Set);function fC(t,e){return Ert.has(e)?"yes":t?.parameters?.[e]??"no"}function TZ(t,e){e&&Object.entries(e).forEach(([n,r])=>{let o=t[n];if((r.parameters||o?.parameters)&&(t[n]??={},t[n].parameters={...r?.parameters,...o?.parameters}),(r.dataResources||o?.dataResources)&&(t[n]??={},t[n].dataResources={...r?.dataResources,...o?.dataResources}),r.slots||o?.slots){t[n]??={};let i=Object.entries(o?.slots??{}).reduce((a,[l,c])=>(a[l]&&Array.isArray(a[l])?a[l]=[...c,...a[l]]:a[l]=c,a),r.slots??{});t[n].slots=i}(r.variant!==void 0||o?.variant!==void 0)&&(t[n]=t[n]??{},t[n].variant=o?.variant??r?.variant)})}function h4e({applyOverrideToNode:t}){let e=new Set,n={};return{visitNode(r){e.add(r._id),TZ(n,r._overrides),TZ(n,r._patternOverrides);let o=n[r._id];o&&(o.parameters&&Object.keys(o.parameters).forEach(i=>{fC(r._overridability,i)==="no"&&(console.log(`[Override] Cleaned override from ${r._id} parameter ${i} because it is not overridable`),delete n[r._id].parameters?.[i])}),o.dataResources&&Object.keys(o.dataResources).forEach(i=>{r._patternDataResources?.[i]?.isPatternParameter||(console.log(`[Override] Cleaned override from ${r._id} data resource ${i} because it is not overridable`),delete n[r._id].dataResources?.[i])}),o.variant!==void 0&&(r._overridability?.variants||delete o.variant),t({node:r,overrides:o}))},overrides:n}}function _Z(t){let{beforeApplyParameterOverride:e,beforeApplyDataResourceOverride:n}=t??{};return h4e({applyOverrideToNode({node:r,overrides:o}){if(Object.entries(o.parameters??{}).map(([i,a])=>{r.parameters=r.parameters??{},e?.(r,i,a,r.parameters[i]);let l=r.parameters[i]??={type:a.type};a.locales||a.localesConditions?(l.locales??={},delete l.value,delete l.conditions,new Set([...Object.keys(a.locales??{}),...Object.keys(a.localesConditions??{})]).forEach(f=>{delete l.locales?.[f],delete l.localesConditions?.[f];let m=a.locales?.[f],h=a.localesConditions?.[f];m!=null&&(l.locales??={},l.locales[f]=m),h!=null&&(l.localesConditions??={},l.localesConditions[f]=h)}),l.locales&&Object.keys(l.locales).length===0&&delete l.locales,l.localesConditions&&Object.keys(l.localesConditions).length===0&&delete l.localesConditions):(delete l.locales,delete l.localesConditions,delete l.conditions,delete l.value,a.value!==null&&a.value!==void 0&&(l.value=a.value,l.connectedData=a.connectedData),a.conditions!==null&&a.conditions!==void 0&&(l.conditions=a.conditions)),!l.locales&&!l.localesConditions&&!l.conditions&&l.value===void 0&&delete r.parameters[i]}),Object.entries(o.dataResources??{}).forEach(([i,a])=>{n?.(r,i,a,r._dataResources?.[i]),r._dataResources??={},r._dataResources[i]=a}),o.variant!==void 0&&(r.variant=o.variant),o.slots){r.slots??={};let i=Object.keys(o.slots)[0];r.slots[g4e]??=[],r.slots[g4e]=[...o.slots[i]??[]]}}})}import{CANVAS_SLOT_SECTION_SLOT as Trt,CANVAS_SLOT_SECTION_TYPE as _rt}from"@uniformdev/canvas";var v4e=({preserveOwnSlotSections:t=!1,preserveChildrenSlotSections:e=!1}={})=>n=>{if(n.node.type!==_rt)return;let{partOfPattern:r,partOfNestedPattern:o}=kL(n.node._id??"");!r&&!o&&t||r&&!o&&e||Drt(n)},Drt=({node:t,type:e,actions:n})=>{e!=="entry"&&(n.insertAfter(t.slots?.[Trt]??[]),n.remove())};import{walkNodeTree as Lrt}from"@uniformdev/canvas";import{produce as Mrt}from"immer";import{CANVAS_SLOT_SECTION_SLOT as y4e,walkNodeTree as $rt}from"@uniformdev/canvas";import{produce as Nrt}from"immer";function b4e(t,e,n,r=Ba()){if(!t._pattern)throw new Error("Not a pattern");let o={};return $rt(t,({node:i,ancestorsAndSelf:a,actions:l})=>{let c=i._id,d=e[c];if(a.length===1)i._id=r;else{let m=a[0];m.type!=="slot"||m.parentSlot!==y4e?(i._id=c4e(c),i._id=RL(r,i._id)):(l.replace({...o[c],_id:o[c]._id}),l.stopProcessingDescendants())}if(d){let m=Nrt(d,h=>{h.slots&&Object.entries(h.slots).forEach(([g,y])=>{if(g!==y4e)throw new Error("Only slot section items are supported for duplication");y.forEach((b,C)=>{if(!b._id)return;let S=PL(b,e,n);o[b._id]=S,y[C]=S})})});n?.(i._id,m,c)}}),r}function PL(t,e,n){return Mrt(t,r=>{Lrt(r,({type:o,node:i,actions:{stopProcessingDescendants:a}})=>{o==="component"&&i._pattern?(b4e(i,e,n),a()):i._id=Ba()})})}function IL({locale:t,conditionIndex:e,property:n}){if(t===void 0)if(e<0){if(delete n.value,!n.conditions?.length)return!1}else n.conditions?.splice(e,1);else e<0?delete n.locales?.[t]:n.localesConditions?.[t]?.splice(e,1);if(n.localesConditions){for(let[r,o]of Object.entries(n.localesConditions))if(o.length===0){delete n.localesConditions[r];break}Object.keys(n.localesConditions).length===0&&delete n.localesConditions}return n.locales&&Object.keys(n.locales).length===0&&delete n.locales,n.conditions&&n.conditions.length===0&&delete n.conditions,!!(n.value!==void 0||n.locales||n.conditions||n.localesConditions)}function DZ({locale:t,conditionIndex:e,conditionDefinition:n,property:r,newPropertyValue:o}){t===void 0?e<0?r.value=o:(r.conditions??=[],x4e(r.conditions,e,n,o)):e<0?(r.locales??={},r.locales[t]=o):(r.localesConditions??={},r.localesConditions[t]??=[],x4e(r.localesConditions[t],e,n,o))}function x4e(t,e,n,r){if(e<0)throw new Error("Condition index must be greater than or equal to 0");let o=t[e];t[e]={when:n??o?.when??{clauses:[]},value:r===void 0?null:r,id:o?.id??Ort(t)}}function Ort(t){let e=new Set(t.map(r=>r.id)),n=0;for(;e.has(n);)n++;return n}function C4e(t){let e=!1,n={};return"_pattern"in t&&t._patternDataResources&&Object.entries(t._patternDataResources).forEach(([r,o])=>{e=!0,n[r]={...o,source:"patternDataResource"}}),t._dataResources&&Object.entries(t._dataResources).forEach(([r,o])=>{n[r]?n[r].isPatternParameter&&(e=!0,n[r]={...o,source:"dataResource"}):(e=!0,n[r]={...o,source:"dataResource"})}),e?n:void 0}import{CANVAS_DRAFT_STATE as Rrt,convertEntryToPutEntry as LVt,getPropertiesValue as RVt}from"@uniformdev/canvas";function S4e(t){let{fields:e,entryName:n,type:r="contentType",thumbnailField:o,...i}=t;return{...i,titleParameter:n,thumbnailParameter:o,parameters:e,canBeComposition:r==="block",permissions:t.permissions,useTeamPermissions:t.useTeamPermissions??!0,workflowId:t.workflowId}}function w4e(t){return{id:t.id,name:t.name,entryName:t.titleParameter,thumbnailField:t.thumbnailParameter,fields:t.parameters,icon:t.icon,description:t.description,slugSettings:t.slugSettings,type:t.canBeComposition?"block":"contentType",created:t.created,updated:t.updated,permissions:t.permissions,useTeamPermissions:t.useTeamPermissions,workflowId:t.workflowId||void 0}}function FL(t){let{entry:{fields:e,...n},...r}=t;return{created:"",modified:"",composition:{_id:"",...n,_name:t.entry._name??"Untitled",parameters:e,_overridability:t.entry._overridability,_overrides:t.entry._overrides,_pattern:t.entry._pattern,_patternError:t.entry._patternError},pattern:!!t.pattern,previewImageUrl:t.entry._thumbnail,...r}}function E4e(t,e,n,r,o,i,a){let l=a??e.projectId;if(!l)throw new Error("projectId is required in currentEntry or explicitly");return{created:"",modified:"",...e,projectId:l,state:r??e.state??Rrt,releaseId:o??e.releaseId,workflowId:n?.workflowId??e.workflowId,workflowStageId:n?.workflowStageId??e.workflowStageId,editionId:i,editionName:n?.editionName??e.editionName,editionPriority:n?.editionPriority??e.editionPriority,entry:{type:t.type,_id:t._id,...e.entry,_thumbnail:n?.previewImageUrl??void 0,_name:t._name,_slug:t._slug??"",fields:t.parameters,_dataResources:t._dataResources,_pattern:t._pattern,_patternError:t._patternError,_overridability:t._overridability,_overrides:t._overrides,_locales:t._locales,_author:t._author,_authorSubject:t._authorSubject,_creator:t._creator,_creatorSubject:t._creatorSubject,_patternDataResources:t._patternDataResources}}}function $Z(t,e){let{parameters:n,...r}=t;return{...r,_id:e??r._id??"unknown",fields:n}}function NZ(t){let{fields:e,...n}=t;return{...n,parameters:e}}import{CANVAS_VIZ_LOCALE_RULE as Art}from"@uniformdev/canvas";import{produce as krt}from"immer";function T4e(t,e,n){let r=krt(t.criteria,o=>_4e(o,e,n));return r&&{...t,criteria:r}}function _4e(t,e,n){if(!t)return t;let r=!1;for(let o of t.clauses)if("clauses"in o){let i=_4e(o,e,n);if(i===null){if(t.op!=="|")return null;t.clauses.splice(t.clauses.indexOf(o),1),r=!0}else i!==void 0&&(t.clauses[t.clauses.indexOf(o)]=i,r=!0)}else if(o.rule===Art){let i=Array.isArray(o.value)?o.value:[o.value],a=i.includes(e),l=i.includes(n);if(!a&&!l||a&&l)continue;if(i.length===1&&l&&!a)return null;a&&!l&&(o.value=i.concat(n),r=!0)}return r?t:void 0}var D4e=J(bZ(),1);function LZ(t,e){try{return(0,D4e.get)(t,e)}catch{return}}function MZ(t,e,n=0){let r=t.slice(n*4,n*4+4);if(!r)throw new Error("Failed to generate a default variation name");return`${e.startsWith("$")?e.slice(1):e}-${r}`}import{CANVAS_VIZ_LOCALE_RULE as Prt}from"@uniformdev/canvas";import{produce as Irt}from"immer";function $4e(t,e){let n=Irt(t.criteria,r=>N4e(r,e));return n&&{...t,criteria:n}}function N4e(t,e){if(!t)return t;for(let n=t.clauses.length-1;n>=0;n--){let r=t.clauses[n];if("clauses"in r){let o=N4e(r,e);if(o)t.clauses[n]=o;else if(t.clauses.splice(n,1),o===null&&t.op!=="|")return null}else if(r.rule===Prt){let o=Array.isArray(r.value)?r.value:[r.value],i=o.indexOf(e);if(i!==-1)if(Array.isArray(r.value)&&r.value.length>1)o.splice(i,1);else if(r.op.startsWith("!"))t.clauses.splice(n,1);else return null}}if(t.clauses.length!==0)return t}function L4e(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)})}}}function M4e(t,e){let n=L4e();if(process.env.NODE_ENV==="development"&&!e){let r=new Error().stack?.split(`
5180
5176
  `).slice(2).join(`
5181
5177
  `).trimStart();n.on("*",(o,i)=>{console.debug(`\u26A1\uFE0F ${t}:${String(o)}`,{args:i,stack:r,subs:n.all.get(String(o))?.length??0})})}return n}var wu=(0,F4e.default)(),Hrt=!0,jrt="Twee",Vh=class t{#e={};rootNodeId;#r={};#o={};#n;#i={};#t=M4e(jrt,Hrt);#u;#c;#h;#d;#s;#a;#y;constructor(e,n){let{metadata:r,startDirty:o}=n||{};this.#s=r??{},this.#a={_name:e?._name??"",_slug:e?._slug??null},this.#d=!o,this.#y=n?.temp_disableDataResourceOverrideCreation??!1;let i=To(e,a=>{this.#v({composition:a,ignoreRootOverrides:!0,preserveChildrenSlotSections:!0}),delete a._author,delete a._authorSubject,delete a._creator,delete a._creatorSubject});this.rootNodeId=i._id??Ba(),this.#u=this.rootNodeId,this.#l({componentTree:i,nodeId:this.rootNodeId}),this.#n=i._overrides??{}}events=this.#t;exportTree(e){return this.exportSubtree(this.rootNodeId,e)}exportMetadata(){return this.#s}exportRootNodeMetadata(){return this.#a}get pristine(){return this.#d}set pristine(e){this.#d!==e&&(this.#d=e,this.#t.emit("pristineChanged",{pristine:e}))}get selectedBlockIdStack(){return this.#c}set selectedBlockIdStack(e){this.#c=e,this.#t.emit("selectedBlockChanged",{selectedBlockIds:this.#c})}get selectedNodeId(){return this.#u}set selectedNodeId(e){this.#u!==e&&(this.#u=e,this.selectedParameterId=void 0,this.#t.emit("selectedNodeChanged",{selectedNodeId:e}))}get selectedParameterId(){return this.#h}set selectedParameterId(e){this.#h!==e&&(this.#h=e,this.#t.emit("selectedParameterChanged",{selectedParameterId:e}))}pushSelectedBlockId(e){this.selectedBlockIdStack=this.selectedBlockIdStack??[],this.selectedBlockIdStack?.push(e),this.#t.emit("selectedBlockChanged",{selectedBlockIds:this.selectedBlockIdStack})}popSelectedBlockId(){this.#c?.pop(),this.#t.emit("selectedBlockChanged",{selectedBlockIds:this.selectedBlockIdStack})}getNodeById(e){return this.#e[e]}getNodesIndex(){return this.#e}getBlockNodeValueById(e){return $Z(this.exportSubtree(e),e)}getNodeChildren(e){let n=this.#r[e];if(n)return n}getNodeProperty(e,n){return LZ(this.#o,[e,n])}getNodeProperties(e){return this.#o[e]??{}}insertNode({node:e,parentNodeId:n,parentSlot:r,targetIndexInSlot:o,overrideNodeId:i}){let a=i??Ba(),l={nodeId:a,parentId:n,value:t.#T(e),isExpandedInUI:!0,propertyValueLocalizability:{}};return this.#w({node:l,parentNodeId:n,parentSlot:r,targetIndexInSlot:o}),this.#m({nodeId:a,destinationParentId:n,destinationSlotName:r}),this.pristine=!1,this.#t.emit("nodeChanged",{changedNode:l,oldValue:void 0,type:"new"}),this.#t.emit("childrenChanged",{parentId:n,slotOrBlockName:r,newChildIds:this.#r[n][r],type:"slot"}),a}upsertBlockNode({nodeId:e,property:n,index:r,entry:o}){let i=this.#E({nodeId:e,property:n,index:r,entry:o});return this.pristine=!1,this.#t.emit("childrenChanged",{parentId:e,slotOrBlockName:n,newChildIds:this.#o[e]?.[n]?.value,type:"block"}),i}updateRootMetadata(e){let n={...this.#s};this.#s={...this.#s,...e},this.pristine=!1,this.#t.emit("metadataChanged",{metadata:this.#s,oldValue:n})}updateRootNode({update:e,doNotSetDirty:n}){let r={...this.#a};this.#a={...this.#a,...e},n||(this.pristine=!1),this.#t.emit("rootNodeMetadataChanged",{metadata:this.#a,oldValue:r})}insertPattern({parentNodeId:e,parentSlot:n,pattern:r,targetIndexInSlot:o,patternInstanceId:i}){let a=i??Ba();if(this.#e[a])throw new Error(`Node with ID '${a}' already exists. Pattern nodes must have unique IDs.`);let l=this.#x(r,a,!1);return this.#f({nodeId:l,parentNodeId:e,parentSlot:n,targetIndexInSlot:o}),this.#m({nodeId:l,destinationParentId:e,destinationSlotName:n}),this.pristine=!1,this.visitNodeAndDescendants(l,c=>{this.#t.emit("nodeChanged",{changedNode:c,oldValue:void 0,type:"new"})}),this.#t.emit("childrenChanged",{parentId:e,slotOrBlockName:n,newChildIds:this.#r[e][n],type:"slot"}),l}unlinkPattern(e){let n=this.#e[e];if(!n)throw new Error(`Node ${e} does not exist`);if(!n.value._pattern)throw new Error(`Node ${e} is not a pattern`);let r=n.value._patternDataResources||n.value._dataResources,o=C4e(n.value),i=l=>{l.partOfNestedPattern||(this.updateNode({nodeId:l.nodeId,updateComponent:c=>{delete c._pattern,delete c._patternError,delete c._overrides},updateMetadata:c=>{delete c.partOfPattern,delete c.partOfNestedPattern},doNotSetDirty:!0,ignoreOverrides:!0}),this.#n[l.nodeId]&&(this.#n=To(this.#n,c=>{delete c[l.nodeId]})))};this.visitNodeAndDescendants(e,i);let a=l=>{l.partOfNestedPattern&&this.updateNode({nodeId:l.nodeId,updateMetadata:c=>{c.partOfPattern=c.partOfNestedPattern,delete c.partOfNestedPattern},doNotSetDirty:!0,ignoreOverrides:!0})};this.visitNodeAndDescendants(e,a),r&&(this.updateNode({nodeId:this.rootNodeId,updateDataResources:l=>Object.entries(o??{}).filter(([c])=>!(c in(l??{}))).map(([c,d])=>{let{source:f,...m}=d;return{type:"set",name:c,value:m}})}),this.updateNode({nodeId:n.nodeId,updateComponent:l=>{delete l._patternDataResources},updateDataResources:"removeAll",doNotSetDirty:!0,ignoreOverrides:!0})),this.pristine=!1}convertToPattern({existingNodeId:e,pattern:n}){let r=this.#e[e],o=r?.parentId;if(!r)throw new Error(`Node ${e} does not exist`);let i=this.#x(n,e,!0);this.#e[i]=To(this.#e[i],l=>{l.parentId=o}),this.pristine=!1;let a=this.#e[i];this.#t.emit("nodeChanged",{changedNode:a,oldValue:r,type:"new"}),Object.entries(this.#r[i]??{}).forEach(([l,c])=>{this.#t.emit("childrenChanged",{newChildIds:c,parentId:i,slotOrBlockName:l,type:"slot"})})}copyNodeToClipboard(e){let n=this.exportSubtree(e,{keepPatternData:!1}),r=this.exportSubtree(e,{keepPatternData:!0}),o=[];c0(r,({node:l})=>{l._id&&o.push(l._id)}),c0(n,({node:l})=>{l._id&&(l._overrides&&delete l._overrides,"_name"in l&&delete l._name,"_slug"in l&&delete l._slug)});let i=this.#g(),a=Object.entries(i??{}).reduce((l,[c,d])=>(o.some(f=>c.includes(f))&&(l[c]=d),l),{});return{format:"uniform/copied-component-subtree-1.0",componentData:n,overrides:Object.keys(a).length?a:void 0,pasteAs:this.getNodeById(e)?.isBlock?"block":void 0}}async pasteNodeFromClipboard({parentNodeId:e,parentSlot:n,targetIndexInParent:r,clipboard:o,resolvePattern:i}){let a=wu(o),l=async d=>{d._pattern&&c.push((async()=>{let f=await i(d._pattern);if(!f){console.debug(`Pasted pattern ${d._pattern} not found, skipping`);return}let m=this.#C(f,d._id);Object.assign(d,m)})())},c=[];return c0(a.componentData,({node:d})=>{l(d)}),a.overrides&&Object.values(a.overrides).forEach(d=>{d.slots&&Object.values(d.slots).forEach(f=>{f.forEach(m=>{c0(m,({node:h})=>{l(h)})})})}),await Promise.all(c),this.#_(a.componentData,{parentId:e,parentName:n,parentType:o.pasteAs==="block"?"block":"slot",targetIndexInParent:r},a.overrides)}enableLocale(e){this.updateNode({nodeId:this.rootNodeId,updateComponent:n=>{let r=n;r._locales??=[];let o=[...new Set([...r._locales,...Array.isArray(e)?e:[e]])];r._locales=o}})}disableLocale(e){this.updateNode({nodeId:this.rootNodeId,updateComponent:o=>{let i=o;i._locales=i._locales?.filter(a=>a!==e)}});let n=[],r=o=>{this.getNodeProperty(o.nodeId,JE)?.value===e&&!o.partOfPattern&&n.push(o.nodeId);let a=this.getNodeProperties(o.nodeId);Object.entries(a).forEach(([c,d])=>{let f=d;c!==u0&&(o.partOfPattern?this.isPatternPropertyOverridden(o.nodeId,c,e)&&this.resetPatternPropertyOverride(o.nodeId,c,e):(f?.localesConditions?.[e]?.forEach((m,h)=>{this.updateNodeProperty({nodeId:o.nodeId,property:c,value:void 0,source:"other",locale:e,conditionIndex:h,conditionDefinition:null})}),f?.locales?.[e]!==void 0&&this.updateNodeProperty({nodeId:o.nodeId,property:c,value:void 0,source:"other",locale:e,conditionIndex:-1})))});let l=this.getNodeProperty(o.nodeId,u0);if(l?.value){let c=$4e(l.value,e);c===null?n.push(o.nodeId):this.updateNodeProperty({nodeId:o.nodeId,property:u0,value:c?()=>c:void 0,source:"other",locale:void 0,conditionIndex:-1})}};this.visitNodeAndDescendants(this.rootNodeId,r),n.forEach(o=>{this.deleteNode(o)})}copyValuesToLocalePlan({sourceLocale:e,destinationLocale:n,doNotCopyDescendants:r=!1,startingNodeId:o=this.rootNodeId,specificPropertyId:i}){let a=new Map,l=d=>{if(d.value.type===Frt&&!d.partOfPattern){let m=this.getNodeChildren(d.nodeId)?.[OZ]??[],h=m.map(b=>this.getNodeProperty(b,JE)),g=h.findIndex(b=>b?.value===n);if(g>=0){let b=m[g];zh(a,b).actions.push({type:"deleteLocalizedNode"})}let y=h.findIndex(b=>b?.value===e);if(y>=0){let b=m[y];zh(a,b).actions.push({type:"duplicateLocalizedNode",targetIndexInSlot:g})}}if(a.get(d.nodeId)?.actions.some(m=>m.type==="deleteLocalizedNode"))return;let f=i?{[i]:this.getNodeProperty(d.nodeId,i)}:this.getNodeProperties(d.nodeId);Object.entries(f).forEach(([m,h])=>{if(h===void 0)return;let g=!d.partOfPattern,y=fC(d.value._overridability,m)==="yes";if(!(g||y))return;if(m===u0){let $=T4e(h.value,e,n);$===null?zh(a,d.nodeId).actions.push({type:"deleteLocalizedNode"}):$&&zh(a,d.nodeId).actions.push({type:"updateVisibilityCriteria",targetValue:$})}let C=h.locales?.[e],S=h.locales?.[n];(!C||!S||!YE(C,S))&&(C!==void 0?zh(a,d.nodeId).actions.push({type:"copyPropertyValue",propertyId:m,sourceValue:C,targetValue:S,conditionIndex:-1}):S!==void 0&&zh(a,d.nodeId).actions.push({type:"deletePropertyValue",propertyId:m,sourceValue:C,targetValue:S,conditionIndex:-1}));let w=h.localesConditions?.[e],E=h.localesConditions?.[n];w?.forEach(($,O)=>{let M=h.localesConditions?.[n]?.[O];(!$||!M||!YE($,M))&&zh(a,d.nodeId).actions.push({type:"copyPropertyValue",propertyId:m,sourceValue:$.value,targetValue:M,conditionIndex:O,conditionDefinition:$.when})});let _=w?.length??0,N=E?.length??0;if(_<N){let $=zh(a,d.nodeId);for(let O=_;O<N;O++)$.actions.push({type:"deletePropertyValue",propertyId:m,sourceValue:w?.[O],targetValue:E?.[O],conditionIndex:O})}})},c=this.#e[o];if(!c)throw new Error(`Node ${o} does not exist`);return l(c),!i&&!r&&this.visitDescendants(c.nodeId,l),{nodePlans:Array.from(a.values()),sourceLocale:e,destinationLocale:n}}async copyValuesToLocaleExecute({resolvePattern:e,plan:{sourceLocale:n,destinationLocale:r,nodePlans:o}}){let i=`copyLocaleExecute: ${r}`;console.time(i);for(let{nodeId:a,actions:l}of o)for(let c of l)switch(c.type){case"copyPropertyValue":{this.updateNodeProperty({nodeId:a,property:c.propertyId,source:"other",locale:r,value:()=>c.sourceValue,type:this.getNodeProperty(a,c.propertyId)?.type,conditionIndex:c.conditionIndex,conditionDefinition:c.conditionDefinition});break}case"deletePropertyValue":{this.updateNodeProperty({nodeId:a,property:c.propertyId,source:"other",locale:r,value:void 0,conditionIndex:c.conditionIndex,conditionDefinition:null});break}case"deleteLocalizedNode":{this.deleteNode(a);break}case"duplicateLocalizedNode":{let d=await this.duplicateNode(a,e);this.updateNodeProperty({nodeId:d,locale:void 0,conditionIndex:-1,type:"localeSelect",property:JE,source:"other",value:()=>r});let f=this.copyValuesToLocalePlan({sourceLocale:n,destinationLocale:r,startingNodeId:d});this.copyValuesToLocaleExecute({plan:f,resolvePattern:e}),c.targetIndexInSlot!==void 0&&this.moveNode({movedNodeId:d,parentNodeId:this.#e[a].parentId,parentSlot:OZ,targetIndexInSlot:c.targetIndexInSlot});break}case"updateVisibilityCriteria":{this.updateNodeProperty({nodeId:a,property:u0,source:"other",locale:void 0,conditionIndex:-1,value:()=>c.targetValue});break}default:throw new Error(`Unhandled action type ${c.type}`)}console.timeEnd(i)}updateNode({nodeId:e,updateComponent:n,updateDataResources:r,updateMetadata:o,doNotSetDirty:i,ignoreOverrides:a}){let l=this.#e[e];if(!l)throw new Error(`Update target node ID ${e} did not exist!`);let c=To(l,h=>{if(o&&(o(h),h.nodeId=e,h.value=l.value,h.parentId=l.parentId),n){if(n(h.value),"slots"in h.value)throw new Error("Do not set `slots` on a Twee node, insert child nodes instead.");if("parameters"in h.value)throw new Error("Do not set `parameters` on a Twee node, use updateProperties option instead.")}if(r){let g=typeof r=="function"?r(h.value._dataResources):r;if(g==="removeAll")delete h.value._dataResources;else for(let y of g){let b=this.#y||a?!1:h.nodeId!==this.rootNodeId&&h.value._pattern;switch(y.type){case"set":b&&(this.#n=To(this.#n,C=>{C[e]??={},C[e].dataResources??={},C[e].dataResources[y.name]=y.value})),h.value._dataResources??={},h.value._dataResources[y.name]=y.value;break;case"remove":b&&(this.#n=To(this.#n,C=>{delete C[e]?.dataResources?.[y.name]})),delete h.value._dataResources?.[y.name];break;case"reset":{let C=this.#i[e]?.dataResources?.[y.name];h.value._dataResources&&(C&&Object.keys(C).length>0?h.value._dataResources[y.name]=C:delete h.value._dataResources[y.name]),this.#n=To(this.#n,S=>{delete S[e]?.dataResources?.[y.name]})}break;default:throw new Error(`Unhandled data resource action ${y?.type}`)}}}}),d=!!(l.partOfPattern&&!l.value._patternError),f=l.value.variant!==c.value.variant,m=l.value._overridability?.variants??!1;!a&&d&&f&&m&&(this.#n=To(this.#n,h=>{h[e]??={},h[e].variant=c.value.variant})),this.#e[e]=c,i||(this.pristine=!1),this.#t.emit("nodeChanged",{changedNode:c,type:"update",oldValue:l})}updateNodeProperty({nodeId:e,property:n,value:r,source:o,locale:i,type:a,doNotSetDirty:l=!1,ignoreOverrides:c=!1,conditionIndex:d,conditionDefinition:f}){let m=this.#e[e];if(!m)throw new Error(`Update target node ID ${e} did not exist!`);if(d<0&&f)throw new Error("Condition definition provided for non-conditional value");let h=!!(m.partOfPattern&&!m.value._patternError),g=[e,n],y=LZ(this.#o,g);if(!y&&r==null)return;let b=P4e({locale:i,property:y,conditionIndex:d}),C=i?y?.localesConditions?.[i]?.[d]:y?.conditions?.[d],S=typeof r=="function"?To(b,$=>r($)):r,w=a??y?.type;if(!w)throw new Error(`Cannot add parameter ${n} to node ${e} without specifying a type`);let E={...y,type:w},_=!1;E=To(E,$=>{S===void 0&&d<0?_=!IL({locale:i,property:$,conditionIndex:d}):f===null&&d>=0?_=!IL({locale:i,property:$,conditionIndex:d}):DZ({locale:i,property:$,newPropertyValue:S,conditionIndex:d,conditionDefinition:f??C?.when??{clauses:[]}})}),_&&(E=void 0);let N=h&&fC(m.value._overridability,n)==="yes";if(h&&!N&&!c)throw new Error(`Cannot override parameter ${n} on node ${e} because it is not marked as overridable on the pattern (${m.partOfPattern})`);if(N&&(this.#i[e]?.parameters?.[n]||(this.#i=To(this.#i,O=>{O[e]??={parameters:{},dataResources:{}},O[e].parameters[n]=y??null}))),!c&&N){let $=this.#n[e]?.parameters?.[n];this.#n=To(this.#n,O=>{let A=S==null||E===void 0?null:S,k=$??{type:E?.type??y?.type??"unknown",value:y?.value,conditions:y?.conditions,locales:i&&y?.locales?.[i]?{[i]:y.locales[i]}:void 0,localesConditions:i&&y?.localesConditions?.[i]?{[i]:y.localesConditions[i]}:void 0},F=To(k,U=>{f===null&&d>=0?IL({locale:i,property:U,conditionIndex:d}):DZ({locale:i,property:U,newPropertyValue:A,conditionIndex:d,conditionDefinition:f??C?.when??{clauses:[]}})});(0,d0.set)(O,`/${e}/parameters/${n}`,F)}),$||this.#t.emit("propertyOverrideCreated",{nodeId:e,property:n})}S===null?(0,d0.remove)(this.#o,g):(this.#o[e]??={},(0,d0.set)(this.#o,g,E)),l||(this.pristine=!1),this.#t.emit("nodeParameterChanged",{nodeId:e,parameter:n,locale:i,conditionIndex:d,value:E,previousValue:y,type:r?y?"update":"new":"delete",conditionDefinition:f,source:o})}isPatternPropertyOverridden(e,n,r,o){let i=this.getNodeById(e);if(!i||fC(i.value._overridability,n)==="no")return!1;let a=this.#n[e]?.parameters?.[n];return a?r?(o===void 0||o===!0)&&a.localesConditions?.[r]!==void 0||(o===void 0||o===!1)&&a.locales?.[r]!==void 0:(o===void 0||o===!0)&&a.conditions!==void 0||(o===void 0||o===!1)&&a.value!==void 0:!1}getPatternPropertyOverrideDefaultValue(e,n,r){let o=this.#i[e]?.parameters?.[n];if(!o)return{exists:!1};if(r&&o.locales?.[r])return{exists:!0,value:o,sourceLocale:r};if(o.value)return{exists:!0,value:o,sourceLocale:void 0};let i=Object.keys(o.locales??{})[0];return i?{exists:!0,value:o,sourceLocale:i}:{exists:!1}}resetPatternPropertyOverride(e,n,r){let o=[-1];this.#n=To(this.#n,a=>{let l=a[e]?.parameters?.[n];if(l)if(r){delete l.locales?.[r];let c=l.localesConditions?.[r];c&&(c.forEach((d,f)=>{o.push(f)}),delete l.localesConditions?.[r]),l.locales&&Object.keys(l.locales).length===0&&delete l.locales,l.localesConditions&&Object.keys(l.localesConditions).length===0&&delete l.localesConditions,Object.keys(l.locales??{}).length===0&&Object.keys(l.localesConditions??{}).length===0&&delete a[e]?.parameters?.[n]}else{let c=l.conditions;c&&c.forEach((d,f)=>{o.push(f)}),delete a[e].parameters?.[n]}});let i=this.getPatternPropertyOverrideDefaultValue(e,n,r);!i.exists||i.value===null?this.updateNodeProperty({nodeId:e,property:n,value:void 0,source:"reset",locale:r,ignoreOverrides:!0,doNotSetDirty:!1,conditionIndex:-1}):o.forEach(a=>{let l=P4e({locale:i.sourceLocale,property:i.value,conditionIndex:a,strict:!0});this.updateNodeProperty({nodeId:e,property:n,value:l===void 0?void 0:()=>l,source:"reset",locale:r,type:i.value?.type,ignoreOverrides:!0,doNotSetDirty:!1,conditionIndex:a,conditionDefinition:(r?i.value?.localesConditions?.[r]?.[a]?.when:i.value?.conditions?.[a]?.when)??null})}),this.#t.emit("propertyOverrideReset",{nodeId:e,property:n,usedPatternDefault:i!==void 0})}async duplicateNode(e,n){let r=this.getParentInfo(e);if(!r)throw new Error("Cannot duplicate root node or parentless block");let o=this.copyNodeToClipboard(e);return await this.pasteNodeFromClipboard({parentNodeId:r.parentId,parentSlot:r.parentName,resolvePattern:n,targetIndexInParent:r.targetIndexInParent+1,clipboard:o})}moveNode({movedNodeId:e,parentNodeId:n,parentSlot:r,targetIndexInSlot:o}){if(!this.#e[e])throw new Error(`Cannot move node ${e} - it does not exist`);let a=this.getParentInfo(e);if(!a)throw new Error("Cannot move root node");this.#r[a.parentId][a.parentName].splice(a.targetIndexInParent,1),this.#b(a.parentId,e),this.#f({nodeId:e,parentNodeId:n,parentSlot:r,targetIndexInSlot:o}),this.#m({nodeId:e,destinationParentId:n,destinationSlotName:r,sourceSlotName:a.parentName}),this.pristine=!1,this.#t.emit("childrenChanged",{parentId:n,slotOrBlockName:r,newChildIds:this.#r[n][r],type:"slot"}),this.#t.emit("childrenChanged",{parentId:a.parentId,slotOrBlockName:a.parentName,newChildIds:this.#r[a.parentId][a.parentName],type:"slot"})}deleteNode(e,n){let r=this.getParentInfo(e);if(!r&&!n)throw new Error("Cannot delete root node");r&&!n&&(this.#r[r.parentId][r.parentName].splice(r.targetIndexInParent,1),this.#r[r.parentId][r.parentName].length===0&&delete this.#r[r.parentId][r.parentName],this.selectedNodeId===e&&(this.selectedNodeId=r.parentId),this.#b(r.parentId,e),this.#t.emit("childrenChanged",{parentId:r.parentId,slotOrBlockName:r.parentName,newChildIds:this.#r[r.parentId][r.parentName]??[],type:"slot"})),delete this.#e[e],this.#t.emit("nodeDeleted",{deletedNodeId:e}),this.pristine=!1}#b(e,n){this.#n=To(this.#n,r=>{let o=r[e]?.slots;o&&Object.keys(o).forEach(i=>{o[i]=o[i].filter(({_id:a})=>a!==n),o[i].length===0&&delete o[i]})})}#g(){if(Object.keys(this.#n).length>0){let e=wu(this.#n);return Object.entries(e).forEach(([r,o])=>{let i=!0;if(!this.#e[r]){delete e[r];return}if(o.parameters){let a=Object.entries(o.parameters);a.forEach(([l,c])=>{let d=I4e(c);d?(o.parameters[l]=d,i=!1):delete o.parameters[l]}),a.length===0&&delete o.parameters}o.slots&&Object.entries(o.slots).forEach(([l,c])=>{if(c.length){let d=c.filter(f=>f._id).map(f=>this.exportSubtree(f._id));d?(o.slots[l]=d,i=!1):delete o.slots[l]}else delete o.slots[l]}),o.variant!==void 0&&(i=!1),o.dataResources&&Object.keys(o.dataResources).length>0&&(i=!1),i&&delete e[r]}),Object.keys(e).length===0&&(e=void 0),e}}exportSubtree(e,n){let{keepPatternData:r=!1}=n??{},o=this.#e[e];if(!o)throw new Error(`Node ${e} to export is not found`);let i=wu(o);if(e===this.rootNodeId){let c=this.#g();c?i.value._overrides=c:delete i.value._overrides;let d=i.value;d._name=this.#a._name,this.#a._slug&&(d._slug=this.#a._slug)}let a=[i],l=new Set;for(;a.length>0;){let c=a.pop();if(l.has(c.nodeId))throw new Error("Circular reference detected in the composition tree with node ID "+c.nodeId);if(l.add(c.nodeId),c.value._id=c.nodeId,!r&&(delete c.value._patternDataResources,delete c.value._patternOverrides,c.value._pattern&&c.value._dataResources)){let m=!1;Object.keys(c.value._dataResources).forEach(h=>{i.value._overrides?.[c.nodeId]?.dataResources?.[h]?delete c.value._dataResources[h]:m=!0}),m||delete c.value._dataResources}let d=this.#o[c.nodeId];if(d&&(r||!c.partOfPattern)){let m={},h=!1;Object.entries(d).forEach(([g,y])=>{if(y?.type===Sc&&Array.isArray(y.value)){let b=y.value,C=[];b.forEach(S=>{let w=this.exportSubtree(S,n);C.push($Z(w,S))}),m[g]={value:C,type:Sc},h=!0}else{let b=I4e(y);b&&(m[g]=b,h=!0)}}),h&&(c.value.parameters=m)}let f=this.#r[c.nodeId];!f||c.partOfPattern&&!r||Object.entries(f).forEach(([m,h])=>{h.forEach((g,y)=>{let b=this.#e[g];if(!b)throw new Error("Insanity detected.");let C=wu(b),S=c.value;S.slots=S.slots||{},(0,d0.set)(c,["value","slots",m,y.toString(10)],C.value),a.push(C)})})}return i.value}#w({parentNodeId:e,parentSlot:n,targetIndexInSlot:r,node:o}){if(!this.#e[e])throw new Error("Parent ID to insert under did not exist!");if(this.#e[o.nodeId])throw new Error(`Node with ID '${o.nodeId}' already exists. Nodes must have unique IDs.`);this.#e[o.nodeId]=o,this.#f({nodeId:o.nodeId,parentNodeId:e,parentSlot:n,targetIndexInSlot:r})}#f({nodeId:e,parentNodeId:n,parentSlot:r,targetIndexInSlot:o}){let i=this.#e[n],a=this.#r[n]??={},l=a[r]??=[];typeof o<"u"?l.splice(o,0,e):l.push(e),i?.value.type===RZ&&(this.#n=To(this.#n,c=>{c[n]=c[n]??{},c[n].slots={[Brt]:l.map(d=>({_id:d,type:this.#e[d].value.type}))}})),this.#e[e]=To(this.#e[e],c=>{c.parentId=n})}#E({nodeId:e,property:n,index:r,entry:o}){let i=this.getNodeById(e);if(!i)throw new Error("Node doesn't exist");let l={nodeId:o._id??Ba(),value:{type:o.type,_dataResources:o._dataResources},isBlock:!0,parentId:e,propertyValueLocalizability:{}},c=this.getNodeProperty(i.nodeId,n);if(c&&c.type!==Sc)throw new Error("Parameter already exists and isn't a block parameter");let d=this.#e[l.nodeId];this.#e[l.nodeId]=l;let f=wu(this.getNodeProperty(i.nodeId,n)?.value?.filter(m=>this.getNodeById(m))??[]);if(typeof r<"u"){if(r<0)throw new Error("parameter index cannot be less than 0");let m=-1;if(f.forEach((h,g)=>{h===l.nodeId&&(m=g)}),r>f.length+(m===-1?1:0))throw new Error(`Parameter index ${r} outside current index bounds.`);m>-1&&m!==r&&(f=f.filter(h=>h!==l.nodeId),f.splice(r,0,l.nodeId))}else f.push(l.nodeId);return Object.entries(o?.fields??{}).forEach(([m,h])=>{if(h.type===Sc&&Array.isArray(h.value)){let g=h.value,y=[];g.forEach(b=>{this.#l({nodeId:l.nodeId,componentTree:NZ(b)}),y.push(b._id)}),this.updateNodeProperty({nodeId:l.nodeId,property:m,type:h.type,value:()=>y,source:"other",locale:void 0,conditionIndex:-1})}else this.updateNodeProperty({nodeId:l.nodeId,property:m,type:h.type,value:()=>h.value,source:"other",locale:void 0,conditionIndex:-1})}),this.updateNodeProperty({nodeId:i.nodeId,property:n,type:Sc,value:()=>f,source:"other",locale:void 0,conditionIndex:-1}),this.#t.emit("nodeChanged",{changedNode:i,oldValue:void 0,type:d?"update":"new"}),this.#t.emit("nodeParameterChanged",{nodeId:i.nodeId,parameter:n,previousValue:c,source:"other",type:d?"update":"new",locale:void 0,conditionIndex:-1,conditionDefinition:void 0,value:{type:Sc,value:f}}),{blockIds:f}}#l({componentTree:e,nodeId:n,partOfPattern:r,partOfNestedPattern:o,resetUids:i,isBlock:a,allowReplacement:l}){let{slots:c,parameters:d,_id:f,_overrides:m,...h}=e,g=r??h._pattern,y=h._pattern&&h._pattern!==g?h._pattern:o,b=n??(i?void 0:f)??Ba();if(this.#e[b]&&!l)throw new Error(`Node with ID '${b}' already exists. Nodes must have unique IDs.`);let C={nodeId:b,value:h,partOfPattern:g,partOfNestedPattern:y,isBlock:a,propertyValueLocalizability:Object.entries(d??{}).reduce((S,[w,E])=>(S[w]=q_({definition:void 0,currentValue:E,lastUserChoice:void 0}),S),{})};return g&&(C.partOfPattern=g),this.#e[C.nodeId]=C,d&&Object.entries(d).forEach(([S,w])=>{let{connectedData:E,..._}=w,N=E?Vrt(zrt(E)):w.value;if(w?.type===Sc&&Array.isArray(N)){let $=N,O=[];$?.forEach(M=>{let A={...M,_id:i?Ba():M._id??Ba()};if(this.#e[A._id])throw new Error(`Block node with ID '${A._id}' already exists. Block nodes must have unique IDs.`);return O.push(A._id),this.#e[A._id]={nodeId:A._id,value:{type:Sc},propertyValueLocalizability:{}},this.#l({componentTree:NZ(A),nodeId:A._id,allowReplacement:!0}),this.#e[A._id].isBlock=!0,this.#e[A._id].parentId=C.nodeId,this.#e[A._id]}),N=O}this.#o[C.nodeId]=this.#o[C.nodeId]??{},(0,d0.set)(this.#o,[C.nodeId,S],{..._,value:N})}),c&&Object.entries(c).forEach(([S,w])=>{let E=w.map(_=>{if(this.#e[_._id??""]?.isBlock)return;let N=this.#l({componentTree:_,partOfPattern:h.type===RZ?void 0:g,partOfNestedPattern:h.type===RZ?void 0:y,resetUids:i});return this.#e[N].parentId=C.nodeId,N});this.#r[C.nodeId]=this.#r[C.nodeId]??{},this.#r[C.nodeId][S]=E.filter(_=>_)}),C.nodeId}#x(e,n,r){let o=this.#C(e,n);return this.#l({componentTree:o,nodeId:n,allowReplacement:r})}#C(e,n){let r=wu(e);return this.#v({composition:r}),AL(r,n),r._pattern=e._id,delete r._id,delete r._name,delete r._slug,delete r._overrides,delete r._locales,delete r._author,delete r._authorSubject,delete r._creator,delete r._creatorSubject,r._dataResources&&(r._patternDataResources=wu(r._dataResources),delete r._dataResources),r}getParentInfo(e){let{parentId:n,isBlock:r}=this.#e[e]??{};if(!n)return;let o=this.#e[n];if(o)if(r)for(let[i,a]of Object.entries(this.#o[n]??{})){if(a?.type!==Sc)continue;let l=Array.isArray(a.value)?a.value:[],c=l.indexOf(e);if(c>=0)return{value:o.value,parentId:n,parentName:i,targetIndexInParent:c,parentChildIds:l,parentType:"block"}}else{let i=this.#r[n];if(!i&&!r)throw new Error("Sanity failed; parent had no children!");for(let[a,l]of Object.entries(i??{})){let c=l.indexOf(e);if(c>=0)return{value:o.value,parentId:n,parentName:a,targetIndexInParent:c,parentChildIds:l,parentType:"slot"}}return}}static#T(e){return To(e,r=>{delete r.slots,delete r.parameters})}#_(e,n,r){let i={...this.#g(),...r},a;if(this.#n=To(this.#n,c=>{this.#i=To(this.#i,d=>{a=PL(e,i,(f,m,h)=>{c[f]=m,d[f]=this.#i[h]})})}),!a)throw new Error("Failed to duplicate component");a=To(a,c=>{c._overrides=wu(this.#n),this.#v({composition:c,preserveChildrenSlotSections:!0})});let l=this.#l({componentTree:a,isBlock:n.parentType==="block"});if(n.parentType==="block"){let c=this.getNodeProperty(n.parentId,n.parentName)?.value??[],d=[...c.slice(0,n.targetIndexInParent),l,...c.slice(n.targetIndexInParent)];this.updateNodeProperty({nodeId:n.parentId,property:n.parentName,type:Sc,value:()=>d,locale:void 0,conditionIndex:-1,source:"other"}),this.#e[l].parentId=n.parentId,this.#t.emit("nodeChanged",{changedNode:this.getNodeById(l),type:"new",oldValue:void 0}),this.#t.emit("childrenChanged",{parentId:n.parentId,slotOrBlockName:n.parentName,newChildIds:d,type:"block"})}else{this.#f({nodeId:l,parentNodeId:n.parentId,parentSlot:n.parentName,targetIndexInSlot:n.targetIndexInParent}),this.#m({nodeId:l,destinationParentId:n.parentId,destinationSlotName:n.parentName}),this.#t.emit("childrenChanged",{parentId:n.parentId,slotOrBlockName:n.parentName,newChildIds:this.#r[n.parentId][n.parentName],type:"slot"});let c=d=>{this.#t.emit("nodeChanged",{changedNode:d,type:"new",oldValue:void 0})};this.visitNodeAndDescendants(l,c)}return this.pristine=!1,l}#v({composition:e,ignoreRootOverrides:n,preserveChildrenSlotSections:r}){this.#i=To(this.#i,i=>{let a=_Z({beforeApplyParameterOverride(d,f,m){i[d._id]??={parameters:{},dataResources:{}},i[d._id].parameters[f]=wu(m)},beforeApplyDataResourceOverride(d,f,m){d._dataResources?.[f]?.ignorePatternParameterDefault||(i[d._id]??={parameters:{},dataResources:{}},i[d._id].dataResources[f]=wu(m))}}),l=_Z({beforeApplyParameterOverride(d,f,m,h){i[d._id]?.parameters[f]||(i[d._id]??={parameters:{},dataResources:{}},i[d._id].parameters[f]=wu(h??null))},beforeApplyDataResourceOverride(d,f,m,h){d._dataResources?.[f]?.ignorePatternParameterDefault||i[d._id]?.dataResources[f]||(i[d._id]??={parameters:{},dataResources:{}},i[d._id].dataResources[f]=wu(h))}});if(n){let{_overrides:d,...f}=e;c0(f,({node:m})=>{a.visitNode(m)})}let c=n?l:a;c0(e,({node:d})=>{c.visitNode(d)})});let o=v4e({preserveOwnSlotSections:!0,preserveChildrenSlotSections:r});c0(e,i=>{o(i)})}visitNodeAndDescendants(e,n){let r=this.getNodeById(e);if(!r)throw new Error("Insanity detected.");n(r),this.visitDescendants(e,n)}visitDescendants(e,n){let r=this.#p(e,new Set);for(let o of r)n(...o)}async visitDescendantsAsync(e,n){let r=this.#p(e,new Set);for(let o of r)await n(...o)}*#p(e,n){let r=this.#e[e],o=this.#r[e]??{},i=Object.entries(this.#o[e]??{}).filter(([,a])=>a?.type===Sc)??[];if(!r)throw new Error("Insanity detected.");n.add(e);for(let[a,l]of i){let c=l.value??[];for(let d=0;d<c.length;d++){let f=c[d],m=this.#e[f];if(m){if(n.has(f)){console.error(`Detected parent/child cycle in composition, ID ${f} exists more than once. The traversal of descendants will be aborted for the cycle subtree.`);continue}yield[m,r,a,d];for(let h of this.#p(f,n))yield h}}}for(let[a,l]of Object.entries(o))for(let c=0;c<l.length;c++){let d=l[c],f=this.#e[d];if(f){if(n.has(d)){console.error(`Detected parent/child cycle in composition, ID ${d} exists more than once. The traversal of descendants will be aborted for the cycle subtree.`);continue}yield[f,r,a,c];for(let m of this.#p(d,n))yield m}}}#m({nodeId:e,destinationParentId:n,destinationSlotName:r,sourceSlotName:o}){let i=r,a=o===R4e,l=i===R4e,c=o===A4e,d=i===A4e,f=i===OZ,m=this.getNodeProperty(e,O4e);l&&m&&this.updateNodeProperty({nodeId:e,property:O4e,value:void 0,source:"other",locale:void 0,conditionIndex:-1});let h=this.getNodeProperty(e,XE);!l&&h&&this.updateNodeProperty({nodeId:e,property:XE,value:void 0,source:"other",locale:void 0,conditionIndex:-1}),l&&!a&&this.#S({nodeId:e,siblingIds:this.getNodeChildren(n)?.[r]??[],selectExistingName:b=>this.getNodeProperty(b,XE)?.value?.name,setName:b=>this.updateNodeProperty({nodeId:e,property:XE,value:C=>C&&typeof C=="object"&&C!==null?{...C,name:b}:{name:b,crit:[]},source:"other",locale:void 0,conditionIndex:-1,type:XE})}),d&&!c&&this.#S({nodeId:e,siblingIds:this.getNodeChildren(n)?.[r]??[],selectExistingName:b=>this.getNodeProperty(b,k4e)?.value?.id,setName:b=>this.updateNodeProperty({nodeId:e,property:k4e,value:C=>C&&typeof C=="object"&&C!==null?{...C,id:b}:{id:b},source:"other",locale:void 0,conditionIndex:-1,type:"testVariant"})});let g=this.getNodeProperty(e,JE);!f&&g&&this.updateNodeProperty({nodeId:e,property:JE,value:void 0,source:"other",locale:void 0,conditionIndex:-1});let y=this.getNodeProperty(e,u0);(l||f||d)&&y&&this.updateNodeProperty({nodeId:e,property:u0,value:void 0,source:"other",locale:void 0,conditionIndex:-1})}#S({nodeId:e,siblingIds:n,selectExistingName:r,setName:o}){let i=r(e),a=m=>n.some(h=>h===e?!1:r(h)===m),l=i&&a(i);if(i&&!l)return;let c=this.getNodeById(e)?.value.type;if(!c)throw new Error("Insanity detected.");let d=0,f=MZ(e,c,d);do f=MZ(e,c,d),d++;while(a(f));o(f)}};function I4e(t){return t?.value===void 0&&!t?.conditions&&!t?.locales&&!t?.localesConditions?null:t}function zh(t,e){return Urt(t,e,()=>({nodeId:e,actions:[]}))}function Urt(t,e,n){return t.has(e)||t.set(e,n()),t.get(e)}import{CANVAS_DRAFT_STATE as kZ,CanvasClient as Yrt}from"@uniformdev/canvas";function B4e(t){return t.reduce((e,n)=>(e[n._id]={id:n._id,type:n.type,name:n._name},e),{})}import{CANVAS_DRAFT_STATE as j4e,CanvasClient as AZ,ContentClient as U4e,ProjectClient as K4e}from"@uniformdev/canvas";var z4e=J(i4e());var V4e=(0,z4e.default)(6),BL=class t extends Error{constructor(n,r,o,i,a,l){super(`${n}
5182
- ${i}${a?" "+a:""} (${r} ${o}${l?` Request ID: ${l}`:""})`);this.errorMessage=n;this.fetchMethod=r;this.fetchUri=o;this.statusCode=i;this.statusText=a;this.requestId=l;Object.setPrototypeOf(this,t.prototype)}};var zL=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??V4e,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,l=await Krt(()=>o(e.toString(),{...n,signal:i,headers:{...n?.headers,...r}}));if(!l.ok){let c="";try{let d=await l.text();try{let f=JSON.parse(d);f.errorMessage?c=Array.isArray(f.errorMessage)?f.errorMessage.join(", "):f.errorMessage:c=d}catch{c=d}}catch{c="General error"}throw new BL(c,n?.method??"GET",e.toString(),l.status,l.statusText,t.getRequestId(l))}return n?.expectNoContent?{response:l,body:null}:{response:l,body:await l.json()}})}createUrl(e,n,r){let o=new URL(`${r??this.options.apiHost}${e}`);return Object.entries(n??{}).forEach(([i,a])=>{typeof a<"u"&&a!==null&&o.searchParams.append(i,Array.isArray(a)?a.join(","):a?.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 Krt(t){let n=5,r;for(;n>0&&(r=await t(),r.status===429);){let o=0;try{let l=r.clone(),c=l.headers.get("date"),d=c?new Date(c).getTime():void 0,m=(await l.json())?.info?.reset;typeof d=="number"&&typeof m=="number"&&(o=Math.max(0,Math.min(Math.round(1.1*(m-d)),1e4)))}catch{}let i=Math.pow(2,5-n)*333,a=i+Math.round(Math.random()*(i/2))*(Math.random()>.5?1:-1);await new Promise(l=>setTimeout(l,o+a)),n-=1}return r}var VL=class extends zL{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:a,userAgent:l}=this.telemetryContext;i&&(r["x-thread-id"]=i),a&&(r["x-uniform-client"]=a),l&&(r["user-agent"]=l)}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 H4e={name:"@uniformdev/uniform-mcp",version:"20.26.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"},sideEffects:!1,scripts:{build:"tsup",dev:"tsup --watch",clean:"rimraf dist",test:"vitest",lint:'eslint "src/**/*.{js,ts,tsx}"',format:'prettier --write "src/**/*.{js,ts,tsx}"',mcp:"node dist/index.mjs"},dependencies:{"@modelcontextprotocol/sdk":"^1.12.0","@uniformdev/canvas":"workspace:*","fast-json-patch":"^3.1.1",immer:"10.1.1",zod:"3.23.8"},files:["/dist"],publishConfig:{access:"public"},devDependencies:{"@uniformdev/design-system":"workspace:*","@uniformdev/files":"workspace:*","@uniformdev/mesh-edgehancer-sdk":"workspace:*","@uniformdev/richtext":"workspace:*",vitest:"^3.1.4"}};function QE(){return new VL({...pt,apiHost:pt.aiApiHost,telemetryContext:{userAgent:`uniform-mcp/${H4e.version}`,uniformClient:"mcp"}})}function W4e(){let t,e,n;return{fetchProjectGuidance:async()=>(t!==void 0||(t=(await new K4e(pt).get({projectId:pt.projectId}))?.guidance),t),fetchDefinitions:async()=>{if(e!==void 0)return e;let o=await new AZ(pt).getComponentDefinitions({limit:1e3,includeSystem:!0});return e=Object.fromEntries(o.componentDefinitions.map(i=>[i.id,i])),e},fetchPatterns:async()=>{if(n!==void 0)return n;let o=await new AZ(pt).getCompositionList({limit:1e3,pattern:!0,patternType:"component",resolveData:!1,skipPatternResolution:!0,skipOverridesResolution:!0,state:j4e});return n=B4e(o.compositions.map(i=>i.composition)),n},resolvePatternData:async r=>(await new AZ(pt).getCompositionById({compositionId:r,state:j4e,skipPatternResolution:!1,skipOverridesResolution:!0,withComponentIDs:!0,skipDataResolution:!0,withWorkflowDefinition:!0,releaseId:void 0}))?.composition,getToolClient:async()=>QE()}}function G4e(){let t,e;return{fetchProjectGuidance:async()=>(t!==void 0||(t=(await new K4e(pt).get({projectId:pt.projectId}))?.guidance),t),fetchDefinitions:async()=>{if(e!==void 0)return e;let r=await new U4e(pt).getContentTypes({limit:1e3});return e=Object.fromEntries(r.contentTypes.map(o=>[o.id,S4e(o)])),e},fetchPatterns:async()=>({}),resolvePatternData:async n=>{let o=(await new U4e(pt).getEntries({entryIDs:[n],skipPatternResolution:!1,skipOverridesResolution:!0,withComponentIDs:!0,skipDataResolution:!0,withWorkflowDefinition:!0,releaseId:void 0}))?.entries[0];return FL(o).composition},getToolClient:async()=>QE()}}import{LocaleClient as Grt}from"@uniformdev/canvas";async function HL(t){if(!t||t.length===0)return;let r=(await new Grt(pt).get()).results.map(i=>i.locale),o=t.filter(i=>!r.includes(i));if(o.length>0)throw new Error(`The following locales are not registered in your project: ${o.join(", ")}`)}async function jL({action:t,id:e,instructions:n,isPattern:r,patternId:o,getEditUrl:i}){let a=new Yrt(pt),l,c,d=t==="update"?e:void 0,f={success:!0,actionsTaken:[]};if(t==="create"){if(!n)throw new Error("Instructions are required for create");if(!n.name)throw new Error("Name is required for create");if(!n.type)throw new Error("Type is required for create");if(!o)l=new Vh({_id:e,_name:n.name,type:n.type,_overridability:{hideLockedParameters:!0}});else{let m={composition:{_id:e,_name:n.name,type:n.type,_pattern:o},projectId:pt.projectId,state:kZ,pattern:!1};await a.updateComposition(m),d=e}}if(d){if(c=await a.getCompositionById({compositionId:e,state:kZ,skipDataResolution:!0,skipPatternResolution:!1,withComponentIDs:!0,skipOverridesResolution:!0}),!c)throw new Error("Composition not found");l=new Vh(c.composition)}if(t==="delete"&&await a.removeComposition({compositionId:e}),l){await HL(n?.localeUpdates?.enableLocales),f=await LL({twee:l,descriptionUpdate:void 0,slugUpdate:void 0,nameUpdate:n?.name,propertyUpdates:n?.parameterUpdates??[],localeUpdates:n?.localeUpdates,slotUpdates:n??{newComponentsInSlots:[],deletedComponentsInSlots:[]},currentEditorLocale:void 0,referenceData:W4e()});let m=l.exportTree(),h=l.exportMetadata(),g={composition:m,projectId:pt.projectId,state:kZ,pattern:r,releaseId:c?.releaseId,editionId:c?.editionId,...h};await a.updateComposition(g)}return{content:[{type:"text",text:JSON.stringify({...f,editUrl:i(e)},null,2)}]}}function UL(t){return`${pt.baseWebUrl}/dashboards/canvas/edit/${t}`}async function KL(t,e){return await QE().invoke("createFilterExpression",{...t,entityType:e})}var Zrt={action:PZ.enum(["create","update","delete"]).describe("The action to perform"),id:PZ.string().uuid().describe("UUID of the composition instance to create, update, or delete"),patternId:PZ.string().uuid().describe("Composition pattern ID to create the composition from. Omit when not creating, or when creating a composition without a composition pattern.").optional(),instructions:Ute.describe("Modification instructions for the composition. Omit for delete.").optional()};function Y4e(t){t.tool("compositionAction","Creates, updates, or deletes a Uniform Composition",Zrt,async e=>await jL({...e,isPattern:!1,getEditUrl:UL,patternId:e.patternId}))}import{z as Uo}from"zod";var qrt=Uo.object({field:Uo.string(),operator:Uo.string(),value:Uo.string().or(Uo.array(Uo.string()))}),Jrt=Uo.object({filter:Uo.array(qrt),error:Uo.string().describe("An error message if the filter expression could not be created, otherwise an empty string"),sort:Uo.array(Uo.enum(["created_at_ASC","created_at_DESC","updated_at_ASC","updated_at_DESC","author_ASC","author_DESC","creator_ASC","creator_DESC","name_ASC","name_DESC","slug_ASC","slug_DESC"])),limit:Uo.number().min(1).max(100),offset:Uo.number().min(0),keyword:Uo.string(),locale:Uo.string().optional()}),vp=Uo.object({searchExpressionPrompt:Uo.string().describe(`Describe what you are looking for, for example "created by me in the last week" or "type is article and headline contains breaking news" or "keyword search for breaking news".
5178
+ ${i}${a?" "+a:""} (${r} ${o}${l?` Request ID: ${l}`:""})`);this.errorMessage=n;this.fetchMethod=r;this.fetchUri=o;this.statusCode=i;this.statusText=a;this.requestId=l;Object.setPrototypeOf(this,t.prototype)}};var zL=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??V4e,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,l=await Krt(()=>o(e.toString(),{...n,signal:i,headers:{...n?.headers,...r}}));if(!l.ok){let c="";try{let d=await l.text();try{let f=JSON.parse(d);f.errorMessage?c=Array.isArray(f.errorMessage)?f.errorMessage.join(", "):f.errorMessage:c=d}catch{c=d}}catch{c="General error"}throw new BL(c,n?.method??"GET",e.toString(),l.status,l.statusText,t.getRequestId(l))}return n?.expectNoContent?{response:l,body:null}:{response:l,body:await l.json()}})}createUrl(e,n,r){let o=new URL(`${r??this.options.apiHost}${e}`);return Object.entries(n??{}).forEach(([i,a])=>{typeof a<"u"&&a!==null&&o.searchParams.append(i,Array.isArray(a)?a.join(","):a?.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 Krt(t){let n=5,r;for(;n>0&&(r=await t(),r.status===429);){let o=0;try{let l=r.clone(),c=l.headers.get("date"),d=c?new Date(c).getTime():void 0,m=(await l.json())?.info?.reset;typeof d=="number"&&typeof m=="number"&&(o=Math.max(0,Math.min(Math.round(1.1*(m-d)),1e4)))}catch{}let i=Math.pow(2,5-n)*333,a=i+Math.round(Math.random()*(i/2))*(Math.random()>.5?1:-1);await new Promise(l=>setTimeout(l,o+a)),n-=1}return r}var VL=class extends zL{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:a,userAgent:l}=this.telemetryContext;i&&(r["x-thread-id"]=i),a&&(r["x-uniform-client"]=a),l&&(r["user-agent"]=l)}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 H4e={name:"@uniformdev/uniform-mcp",version:"20.26.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"},sideEffects:!1,scripts:{build:"tsup",dev:"tsup --watch",clean:"rimraf dist",test:"vitest",lint:'eslint "src/**/*.{js,ts,tsx}"',format:'prettier --write "src/**/*.{js,ts,tsx}"',mcp:"node dist/index.mjs"},dependencies:{"@modelcontextprotocol/sdk":"^1.12.0","@uniformdev/canvas":"workspace:*","fast-json-patch":"^3.1.1",immer:"10.1.1",zod:"3.23.8"},files:["/dist"],publishConfig:{access:"public"},devDependencies:{"@uniformdev/design-system":"workspace:*","@uniformdev/files":"workspace:*","@uniformdev/mesh-edgehancer-sdk":"workspace:*","@uniformdev/richtext":"workspace:*",vitest:"^3.1.4"}};function QE(){return new VL({...pt,apiHost:pt.aiApiHost,telemetryContext:{userAgent:`uniform-mcp/${H4e.version}`,uniformClient:"mcp"}})}function W4e(){let t,e,n;return{fetchProjectGuidance:async()=>(t!==void 0||(t=(await new K4e(pt).get({projectId:pt.projectId}))?.guidance),t),fetchDefinitions:async()=>{if(e!==void 0)return e;let o=await new AZ(pt).getComponentDefinitions({limit:1e3,includeSystem:!0});return e=Object.fromEntries(o.componentDefinitions.map(i=>[i.id,i])),e},fetchPatterns:async()=>{if(n!==void 0)return n;let o=await new AZ(pt).getCompositionList({limit:1e3,pattern:!0,patternType:"component",resolveData:!1,skipPatternResolution:!0,skipOverridesResolution:!0,state:j4e});return n=B4e(o.compositions.map(i=>i.composition)),n},resolvePatternData:async r=>(await new AZ(pt).getCompositionById({compositionId:r,state:j4e,skipPatternResolution:!1,skipOverridesResolution:!0,withComponentIDs:!0,skipDataResolution:!0,withWorkflowDefinition:!0,releaseId:void 0}))?.composition,getToolClient:async()=>QE()}}function G4e(){let t,e;return{fetchProjectGuidance:async()=>(t!==void 0||(t=(await new K4e(pt).get({projectId:pt.projectId}))?.guidance),t),fetchDefinitions:async()=>{if(e!==void 0)return e;let r=await new U4e(pt).getContentTypes({limit:1e3});return e=Object.fromEntries(r.contentTypes.map(o=>[o.id,S4e(o)])),e},fetchPatterns:async()=>({}),resolvePatternData:async n=>{let o=(await new U4e(pt).getEntries({entryIDs:[n],skipPatternResolution:!1,skipOverridesResolution:!0,withComponentIDs:!0,skipDataResolution:!0,withWorkflowDefinition:!0,releaseId:void 0}))?.entries[0];return FL(o).composition},getToolClient:async()=>QE()}}import{LocaleClient as Grt}from"@uniformdev/canvas";async function HL(t){if(!t||t.length===0)return;let r=(await new Grt(pt).get()).results.map(i=>i.locale),o=t.filter(i=>!r.includes(i));if(o.length>0)throw new Error(`The following locales are not registered in your project: ${o.join(", ")}`)}async function jL({action:t,id:e,instructions:n,isPattern:r,patternId:o,getEditUrl:i}){let a=new Yrt(pt),l,c,d=t==="update"?e:void 0,f={success:!0,actionsTaken:[]};if(t==="create"){if(!n)throw new Error("Instructions are required for create");if(!n.name)throw new Error("Name is required for create");if(!n.type)throw new Error("Type is required for create");if(!o)l=new Vh({_id:e,_name:n.name,type:n.type,_overridability:{hideLockedParameters:!0}});else{let m={composition:{_id:e,_name:n.name,type:n.type,_pattern:o},projectId:pt.projectId,state:kZ,pattern:!1};await a.updateComposition(m),d=e}}if(d){if(c=await a.getCompositionById({compositionId:e,state:kZ,skipDataResolution:!0,skipPatternResolution:!1,withComponentIDs:!0,skipOverridesResolution:!0}),!c)throw new Error("Composition not found");l=new Vh(c.composition)}if(t==="delete"&&await a.removeComposition({compositionId:e}),l){await HL(n?.localeUpdates?.enableLocales),f=await LL({twee:l,descriptionUpdate:void 0,slugUpdate:void 0,nameUpdate:n?.name,propertyUpdates:n?.parameterUpdates??[],localeUpdates:n?.localeUpdates,slotUpdates:n??{newComponentsInSlots:[],deletedComponentsInSlots:[]},currentEditorLocale:void 0,referenceData:W4e()});let m=l.exportTree(),h=l.exportMetadata(),g={composition:m,projectId:pt.projectId,state:kZ,pattern:r,releaseId:c?.releaseId,editionId:c?.editionId,...h};await a.updateComposition(g)}return{content:[{type:"text",text:JSON.stringify({...f,editUrl:i(e)},null,2)}]}}function UL(t){return`${pt.baseWebUrl}/dashboards/canvas/edit/${t}`}async function KL(t,e){return await QE().invoke("createFilterExpression",{...t,entityType:e})}var Zrt={action:PZ.enum(["create","update","delete"]).describe("The action to perform"),id:PZ.string().uuid().describe("UUID of the composition instance to create, update, or delete"),patternId:PZ.string().uuid().describe("Composition pattern ID to create the composition from. Omit when not creating, or when creating a composition without a composition pattern.").optional(),instructions:Ute.describe("Modification instructions for the composition. Omit for delete.").optional()};function Y4e(t){t.tool("compositionAction","Creates, updates, or deletes a Uniform Composition",Zrt,async e=>await jL({...e,isPattern:!1,getEditUrl:UL,patternId:e.patternId}))}import{z as Uo}from"zod";var qrt=Uo.object({field:Uo.string(),operator:Uo.string(),value:Uo.string().or(Uo.array(Uo.string()))}),Jrt=Uo.object({filter:Uo.array(qrt),error:Uo.string().describe("An error message if the filter expression could not be created, otherwise an empty string"),sort:Uo.array(Uo.enum(["created_at_ASC","created_at_DESC","updated_at_ASC","updated_at_DESC","author_ASC","author_DESC","creator_ASC","creator_DESC","name_ASC","name_DESC","slug_ASC","slug_DESC"])),limit:Uo.number().min(1).max(100),offset:Uo.number().min(0),keyword:Uo.string(),locale:Uo.string().optional()}),vp=Uo.object({searchExpressionPrompt:Uo.string().describe(`Describe what you are looking for, for example "created by me in the last week" or "type is article and headline contains breaking news" or "keyword search for breaking news".
5183
5179
  You can specify multiple criteria (AND only).
5184
- You can filter by date, number, or string properties on the definition, as well as name, created, modified, author, slug, enabled locales, type, and publish status.`),username:Uo.string().describe("The username of the current user. If you do not know the username, use an empty string"),locale:Uo.string().describe("The current locale. If there is no current locale, use an empty string")}),djt={displayName:"Create filter expression",description:"Creates a Uniform search filter expression for searching entries, patterns, or compositions from a user prompt. Meant to be a callable tool only.",inputSchema:vp.extend({entityType:Uo.enum(["composition","entry","componentPattern","compositionPattern","entryPattern"]).describe("The entity type we are creating a filter for")}),outputSchema:Jrt,runsAt:"server",timeout:10,callable:!0};import{z as Sit}from"zod";var yp=class extends Error{},WL=class extends yp{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},GL=class extends yp{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},YL=class extends yp{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},wc=class extends yp{},pC=class extends yp{constructor(e){super(`Invalid unit ${e}`)}},Ko=class extends yp{},Ec=class extends yp{constructor(){super("Zone is an abstract class")}};var ze="numeric",Tc="short",Pl="long",Hh={year:ze,month:ze,day:ze},eT={year:ze,month:Tc,day:ze},IZ={year:ze,month:Tc,day:ze,weekday:Tc},tT={year:ze,month:Pl,day:ze},nT={year:ze,month:Pl,day:ze,weekday:Pl},rT={hour:ze,minute:ze},oT={hour:ze,minute:ze,second:ze},iT={hour:ze,minute:ze,second:ze,timeZoneName:Tc},aT={hour:ze,minute:ze,second:ze,timeZoneName:Pl},sT={hour:ze,minute:ze,hourCycle:"h23"},lT={hour:ze,minute:ze,second:ze,hourCycle:"h23"},uT={hour:ze,minute:ze,second:ze,hourCycle:"h23",timeZoneName:Tc},cT={hour:ze,minute:ze,second:ze,hourCycle:"h23",timeZoneName:Pl},dT={year:ze,month:ze,day:ze,hour:ze,minute:ze},fT={year:ze,month:ze,day:ze,hour:ze,minute:ze,second:ze},pT={year:ze,month:Tc,day:ze,hour:ze,minute:ze},mT={year:ze,month:Tc,day:ze,hour:ze,minute:ze,second:ze},FZ={year:ze,month:Tc,day:ze,weekday:Tc,hour:ze,minute:ze},hT={year:ze,month:Pl,day:ze,hour:ze,minute:ze,timeZoneName:Tc},gT={year:ze,month:Pl,day:ze,hour:ze,minute:ze,second:ze,timeZoneName:Tc},vT={year:ze,month:Pl,day:ze,weekday:Pl,hour:ze,minute:ze,timeZoneName:Pl},yT={year:ze,month:Pl,day:ze,weekday:Pl,hour:ze,minute:ze,second:ze,timeZoneName:Pl};var ol=class{get type(){throw new Ec}get name(){throw new Ec}get ianaName(){return this.name}get isUniversal(){throw new Ec}offsetName(e,n){throw new Ec}formatOffset(e,n){throw new Ec}offset(e){throw new Ec}equals(e){throw new Ec}get isValid(){throw new Ec}};var BZ=null,jh=class t extends ol{static get instance(){return BZ===null&&(BZ=new t),BZ}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return qL(e,n,r)}formatOffset(e,n){return Uh(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}};var XL={};function Xrt(t){return XL[t]||(XL[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),XL[t]}var Qrt={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function eot(t,e){let n=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,i,a,l,c,d,f]=r;return[a,o,i,l,c,d,f]}function tot(t,e){let n=t.formatToParts(e),r=[];for(let o=0;o<n.length;o++){let{type:i,value:a}=n[o],l=Qrt[i];i==="era"?r[l]=a:Ot(l)||(r[l]=parseInt(a,10))}return r}var JL={},za=class t extends ol{static create(e){return JL[e]||(JL[e]=new t(e)),JL[e]}static resetCache(){JL={},XL={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=t.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return qL(e,n,r,this.name)}formatOffset(e,n){return Uh(this.offset(e),n)}offset(e){let n=new Date(e);if(isNaN(n))return NaN;let r=Xrt(this.name),[o,i,a,l,c,d,f]=r.formatToParts?tot(r,n):eot(r,n);l==="BC"&&(o=-Math.abs(o)+1);let h=mC({year:o,month:i,day:a,hour:c===24?0:c,minute:d,second:f,millisecond:0}),g=+n,y=g%1e3;return g-=y>=0?y:1e3+y,(h-g)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}};var Z4e={};function not(t,e={}){let n=JSON.stringify([t,e]),r=Z4e[n];return r||(r=new Intl.ListFormat(t,e),Z4e[n]=r),r}var zZ={};function VZ(t,e={}){let n=JSON.stringify([t,e]),r=zZ[n];return r||(r=new Intl.DateTimeFormat(t,e),zZ[n]=r),r}var HZ={};function rot(t,e={}){let n=JSON.stringify([t,e]),r=HZ[n];return r||(r=new Intl.NumberFormat(t,e),HZ[n]=r),r}var jZ={};function oot(t,e={}){let{base:n,...r}=e,o=JSON.stringify([t,r]),i=jZ[o];return i||(i=new Intl.RelativeTimeFormat(t,e),jZ[o]=i),i}var bT=null;function iot(){return bT||(bT=new Intl.DateTimeFormat().resolvedOptions().locale,bT)}var q4e={};function aot(t){let e=q4e[t];if(!e){let n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,q4e[t]=e}return e}function sot(t){let e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));let n=t.indexOf("-u-");if(n===-1)return[t];{let r,o;try{r=VZ(t).resolvedOptions(),o=t}catch{let c=t.substring(0,n);r=VZ(c).resolvedOptions(),o=c}let{numberingSystem:i,calendar:a}=r;return[o,i,a]}}function lot(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function uot(t){let e=[];for(let n=1;n<=12;n++){let r=gn.utc(2009,n,1);e.push(t(r))}return e}function cot(t){let e=[];for(let n=1;n<=7;n++){let r=gn.utc(2016,11,13+n);e.push(t(r))}return e}function QL(t,e,n,r){let o=t.listingMode();return o==="error"?null:o==="en"?n(e):r(e)}function dot(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}var UZ=class{constructor(e,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;let{padTo:o,floor:i,...a}=r;if(!n||Object.keys(a).length>0){let l={useGrouping:!1,...r};r.padTo>0&&(l.minimumIntegerDigits=r.padTo),this.inf=rot(e,l)}}format(e){if(this.inf){let n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{let n=this.floor?Math.floor(e):hC(e,3);return ho(n,this.padTo)}}},KZ=class{constructor(e,n,r){this.opts=r,this.originalZone=void 0;let o;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){let a=-1*(e.offset/60),l=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;e.offset!==0&&za.create(l).valid?(o=l,this.dt=e):(o="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,o=e.zone.name):(o="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);let i={...this.opts};i.timeZone=i.timeZone||o,this.dtf=VZ(n,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(n=>{if(n.type==="timeZoneName"){let r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},WZ=class{constructor(e,n,r){this.opts={style:"long",...r},!n&&eM()&&(this.rtf=oot(e,r))}format(e,n){return this.rtf?this.rtf.format(e,n):J4e(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}},fot={firstDay:1,minimalDays:4,weekend:[6,7]},Jn=class t{static fromOpts(e){return t.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,r,o,i=!1){let a=e||Vn.defaultLocale,l=a||(i?"en-US":iot()),c=n||Vn.defaultNumberingSystem,d=r||Vn.defaultOutputCalendar,f=xT(o)||Vn.defaultWeekSettings;return new t(l,c,d,f,a)}static resetCache(){bT=null,zZ={},HZ={},jZ={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:r,weekSettings:o}={}){return t.create(e,n,r,o)}constructor(e,n,r,o,i){let[a,l,c]=sot(e);this.locale=a,this.numberingSystem=n||l||null,this.outputCalendar=r||c||null,this.weekSettings=o,this.intl=lot(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=dot(this)),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:t.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,xT(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return QL(this,e,GZ,()=>{let r=n?{month:e,day:"numeric"}:{month:e},o=n?"format":"standalone";return this.monthsCache[o][e]||(this.monthsCache[o][e]=uot(i=>this.extract(i,r,"month"))),this.monthsCache[o][e]})}weekdays(e,n=!1){return QL(this,e,YZ,()=>{let r=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},o=n?"format":"standalone";return this.weekdaysCache[o][e]||(this.weekdaysCache[o][e]=cot(i=>this.extract(i,r,"weekday"))),this.weekdaysCache[o][e]})}meridiems(){return QL(this,void 0,()=>ZZ,()=>{if(!this.meridiemCache){let e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[gn.utc(2016,11,13,9),gn.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return QL(this,e,qZ,()=>{let n={era:e};return this.eraCache[e]||(this.eraCache[e]=[gn.utc(-40,1,1),gn.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[e]})}extract(e,n,r){let o=this.dtFormatter(e,n),i=o.formatToParts(),a=i.find(l=>l.type.toLowerCase()===r);return a?a.value:null}numberFormatter(e={}){return new UZ(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new KZ(e,this.intl,n)}relFormatter(e={}){return new WZ(this.intl,this.isEnglish(),e)}listFormatter(e={}){return not(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:tM()?aot(this.locale):fot}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}};var XZ=null,Hi=class t extends ol{static get utcInstance(){return XZ===null&&(XZ=new t(0)),XZ}static instance(e){return e===0?t.utcInstance:new t(e)}static parseSpecifier(e){if(e){let n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new t(f0(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Uh(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Uh(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return Uh(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}};var gC=class extends ol{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function _c(t,e){let n;if(Ot(t)||t===null)return e;if(t instanceof ol)return t;if(X4e(t)){let r=t.toLowerCase();return r==="default"?e:r==="local"||r==="system"?jh.instance:r==="utc"||r==="gmt"?Hi.utcInstance:Hi.parseSpecifier(r)||za.create(t)}else return Bd(t)?Hi.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new gC(t)}var Q4e=()=>Date.now(),e3e="system",t3e=null,n3e=null,r3e=null,o3e=60,i3e,a3e=null,Vn=class{static get now(){return Q4e}static set now(e){Q4e=e}static set defaultZone(e){e3e=e}static get defaultZone(){return _c(e3e,jh.instance)}static get defaultLocale(){return t3e}static set defaultLocale(e){t3e=e}static get defaultNumberingSystem(){return n3e}static set defaultNumberingSystem(e){n3e=e}static get defaultOutputCalendar(){return r3e}static set defaultOutputCalendar(e){r3e=e}static get defaultWeekSettings(){return a3e}static set defaultWeekSettings(e){a3e=xT(e)}static get twoDigitCutoffYear(){return o3e}static set twoDigitCutoffYear(e){o3e=e%100}static get throwOnInvalid(){return i3e}static set throwOnInvalid(e){i3e=e}static resetCaches(){Jn.resetCache(),za.resetCache()}};var ji=class{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}};var s3e=[0,31,59,90,120,151,181,212,243,273,304,334],l3e=[0,31,60,91,121,152,182,213,244,274,305,335];function Eu(t,e){return new ji("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function nM(t,e,n){let r=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);let o=r.getUTCDay();return o===0?7:o}function u3e(t,e,n){return n+(m0(t)?l3e:s3e)[e-1]}function c3e(t,e){let n=m0(t)?l3e:s3e,r=n.findIndex(i=>i<e),o=e-n[r];return{month:r+1,day:o}}function rM(t,e){return(t-e+7)%7+1}function CT(t,e=4,n=1){let{year:r,month:o,day:i}=t,a=u3e(r,o,i),l=rM(nM(r,o,i),n),c=Math.floor((a-l+14-e)/7),d;return c<1?(d=r-1,c=p0(d,e,n)):c>p0(r,e,n)?(d=r+1,c=1):d=r,{weekYear:d,weekNumber:c,weekday:l,...wT(t)}}function QZ(t,e=4,n=1){let{weekYear:r,weekNumber:o,weekday:i}=t,a=rM(nM(r,1,e),n),l=Kh(r),c=o*7+i-a-7+e,d;c<1?(d=r-1,c+=Kh(d)):c>l?(d=r+1,c-=Kh(r)):d=r;let{month:f,day:m}=c3e(d,c);return{year:d,month:f,day:m,...wT(t)}}function oM(t){let{year:e,month:n,day:r}=t,o=u3e(e,n,r);return{year:e,ordinal:o,...wT(t)}}function eq(t){let{year:e,ordinal:n}=t,{month:r,day:o}=c3e(e,n);return{year:e,month:r,day:o,...wT(t)}}function tq(t,e){if(!Ot(t.localWeekday)||!Ot(t.localWeekNumber)||!Ot(t.localWeekYear)){if(!Ot(t.weekday)||!Ot(t.weekNumber)||!Ot(t.weekYear))throw new wc("Cannot mix locale-based week fields with ISO-based week fields");return Ot(t.localWeekday)||(t.weekday=t.localWeekday),Ot(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),Ot(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function d3e(t,e=4,n=1){let r=ST(t.weekYear),o=Il(t.weekNumber,1,p0(t.weekYear,e,n)),i=Il(t.weekday,1,7);return r?o?i?!1:Eu("weekday",t.weekday):Eu("week",t.weekNumber):Eu("weekYear",t.weekYear)}function f3e(t){let e=ST(t.year),n=Il(t.ordinal,1,Kh(t.year));return e?n?!1:Eu("ordinal",t.ordinal):Eu("year",t.year)}function nq(t){let e=ST(t.year),n=Il(t.month,1,12),r=Il(t.day,1,vC(t.year,t.month));return e?n?r?!1:Eu("day",t.day):Eu("month",t.month):Eu("year",t.year)}function rq(t){let{hour:e,minute:n,second:r,millisecond:o}=t,i=Il(e,0,23)||e===24&&n===0&&r===0&&o===0,a=Il(n,0,59),l=Il(r,0,59),c=Il(o,0,999);return i?a?l?c?!1:Eu("millisecond",o):Eu("second",r):Eu("minute",n):Eu("hour",e)}function Ot(t){return typeof t>"u"}function Bd(t){return typeof t=="number"}function ST(t){return typeof t=="number"&&t%1===0}function X4e(t){return typeof t=="string"}function m3e(t){return Object.prototype.toString.call(t)==="[object Date]"}function eM(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function tM(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function h3e(t){return Array.isArray(t)?t:[t]}function oq(t,e,n){if(t.length!==0)return t.reduce((r,o)=>{let i=[e(o),o];return r&&n(r[0],i[0])===r[0]?r:i},null)[1]}function g3e(t,e){return e.reduce((n,r)=>(n[r]=t[r],n),{})}function Wh(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function xT(t){if(t==null)return null;if(typeof t!="object")throw new Ko("Week settings must be an object");if(!Il(t.firstDay,1,7)||!Il(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!Il(e,1,7)))throw new Ko("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function Il(t,e,n){return ST(t)&&t>=e&&t<=n}function pot(t,e){return t-e*Math.floor(t/e)}function ho(t,e=2){let n=t<0,r;return n?r="-"+(""+-t).padStart(e,"0"):r=(""+t).padStart(e,"0"),r}function bp(t){if(!(Ot(t)||t===null||t===""))return parseInt(t,10)}function Gh(t){if(!(Ot(t)||t===null||t===""))return parseFloat(t)}function ET(t){if(!(Ot(t)||t===null||t==="")){let e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function hC(t,e,n=!1){let r=10**e;return(n?Math.trunc:Math.round)(t*r)/r}function m0(t){return t%4===0&&(t%100!==0||t%400===0)}function Kh(t){return m0(t)?366:365}function vC(t,e){let n=pot(e-1,12)+1,r=t+(e-n)/12;return n===2?m0(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function mC(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function p3e(t,e,n){return-rM(nM(t,1,e),n)+e-1}function p0(t,e=4,n=1){let r=p3e(t,e,n),o=p3e(t+1,e,n);return(Kh(t)-r+o)/7}function TT(t){return t>99?t:t>Vn.twoDigitCutoffYear?1900+t:2e3+t}function qL(t,e,n,r=null){let o=new Date(t),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(i.timeZone=r);let a={timeZoneName:e,...i},l=new Intl.DateTimeFormat(n,a).formatToParts(o).find(c=>c.type.toLowerCase()==="timezonename");return l?l.value:null}function f0(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);let r=parseInt(e,10)||0,o=n<0||Object.is(n,-0)?-r:r;return n*60+o}function iq(t){let e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new Ko(`Invalid unit value ${t}`);return e}function yC(t,e){let n={};for(let r in t)if(Wh(t,r)){let o=t[r];if(o==null)continue;n[e(r)]=iq(o)}return n}function Uh(t,e){let n=Math.trunc(Math.abs(t/60)),r=Math.trunc(Math.abs(t%60)),o=t>=0?"+":"-";switch(e){case"short":return`${o}${ho(n,2)}:${ho(r,2)}`;case"narrow":return`${o}${n}${r>0?`:${r}`:""}`;case"techie":return`${o}${ho(n,2)}${ho(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function wT(t){return g3e(t,["hour","minute","second","millisecond"])}var mot=["January","February","March","April","May","June","July","August","September","October","November","December"],aq=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],hot=["J","F","M","A","M","J","J","A","S","O","N","D"];function GZ(t){switch(t){case"narrow":return[...hot];case"short":return[...aq];case"long":return[...mot];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var sq=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],lq=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],got=["M","T","W","T","F","S","S"];function YZ(t){switch(t){case"narrow":return[...got];case"short":return[...lq];case"long":return[...sq];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var ZZ=["AM","PM"],vot=["Before Christ","Anno Domini"],yot=["BC","AD"],bot=["B","A"];function qZ(t){switch(t){case"narrow":return[...bot];case"short":return[...yot];case"long":return[...vot];default:return null}}function v3e(t){return ZZ[t.hour<12?0:1]}function y3e(t,e){return YZ(e)[t.weekday-1]}function b3e(t,e){return GZ(e)[t.month-1]}function x3e(t,e){return qZ(e)[t.year<0?0:1]}function J4e(t,e,n="always",r=!1){let o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&i){let m=t==="days";switch(e){case 1:return m?"tomorrow":`next ${o[t][0]}`;case-1:return m?"yesterday":`last ${o[t][0]}`;case 0:return m?"today":`this ${o[t][0]}`;default:}}let a=Object.is(e,-0)||e<0,l=Math.abs(e),c=l===1,d=o[t],f=r?c?d[1]:d[2]||d[1]:c?o[t][0]:t;return a?`${l} ${f} ago`:`in ${l} ${f}`}function C3e(t,e){let n="";for(let r of t)r.literal?n+=r.val:n+=e(r.val);return n}var xot={D:Hh,DD:eT,DDD:tT,DDDD:nT,t:rT,tt:oT,ttt:iT,tttt:aT,T:sT,TT:lT,TTT:uT,TTTT:cT,f:dT,ff:pT,fff:hT,ffff:vT,F:fT,FF:mT,FFF:gT,FFFF:yT},Ui=class t{static create(e,n={}){return new t(e,n)}static parseFormat(e){let n=null,r="",o=!1,i=[];for(let a=0;a<e.length;a++){let l=e.charAt(a);l==="'"?(r.length>0&&i.push({literal:o||/^\s+$/.test(r),val:r}),n=null,r="",o=!o):o||l===n?r+=l:(r.length>0&&i.push({literal:/^\s+$/.test(r),val:r}),r=l,n=l)}return r.length>0&&i.push({literal:o||/^\s+$/.test(r),val:r}),i}static macroTokenToFormatOpts(e){return xot[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return ho(e,n);let r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,n){let r=this.loc.listingMode()==="en",o=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(g,y)=>this.loc.extract(e,g,y),a=g=>e.isOffsetFixed&&e.offset===0&&g.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,g.format):"",l=()=>r?v3e(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),c=(g,y)=>r?b3e(e,g):i(y?{month:g}:{month:g,day:"numeric"},"month"),d=(g,y)=>r?y3e(e,g):i(y?{weekday:g}:{weekday:g,month:"long",day:"numeric"},"weekday"),f=g=>{let y=t.macroTokenToFormatOpts(g);return y?this.formatWithSystemDefault(e,y):g},m=g=>r?x3e(e,g):i({era:g},"era"),h=g=>{switch(g){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return l();case"d":return o?i({day:"numeric"},"day"):this.num(e.day);case"dd":return o?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return d("short",!0);case"cccc":return d("long",!0);case"ccccc":return d("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return d("short",!1);case"EEEE":return d("long",!1);case"EEEEE":return d("narrow",!1);case"L":return o?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return o?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return o?i({month:"numeric"},"month"):this.num(e.month);case"MM":return o?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return o?i({year:"numeric"},"year"):this.num(e.year);case"yy":return o?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return o?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return o?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return m("short");case"GG":return m("long");case"GGGGG":return m("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(g)}};return C3e(t.parseFormat(n),h)}formatDurationFromString(e,n){let r=c=>{switch(c[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},o=c=>d=>{let f=r(d);return f?this.num(c.get(f),d.length):d},i=t.parseFormat(n),a=i.reduce((c,{literal:d,val:f})=>d?c:c.concat(f),[]),l=e.shiftTo(...a.map(r).filter(c=>c));return C3e(i,o(l))}};var w3e=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function xC(...t){let e=t.reduce((n,r)=>n+r.source,"");return RegExp(`^${e}$`)}function CC(...t){return e=>t.reduce(([n,r,o],i)=>{let[a,l,c]=i(e,o);return[{...n,...a},l||r,c]},[{},null,1]).slice(0,2)}function SC(t,...e){if(t==null)return[null,null];for(let[n,r]of e){let o=n.exec(t);if(o)return r(o)}return[null,null]}function E3e(...t){return(e,n)=>{let r={},o;for(o=0;o<t.length;o++)r[t[o]]=bp(e[n+o]);return[r,null,n+o]}}var T3e=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Cot=`(?:${T3e.source}?(?:\\[(${w3e.source})\\])?)?`,uq=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,_3e=RegExp(`${uq.source}${Cot}`),cq=RegExp(`(?:T${_3e.source})?`),Sot=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,wot=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Eot=/(\d{4})-?(\d{3})/,Tot=E3e("weekYear","weekNumber","weekDay"),_ot=E3e("year","ordinal"),Dot=/(\d{4})-(\d\d)-(\d\d)/,D3e=RegExp(`${uq.source} ?(?:${T3e.source}|(${w3e.source}))?`),$ot=RegExp(`(?: ${D3e.source})?`);function bC(t,e,n){let r=t[e];return Ot(r)?n:bp(r)}function Not(t,e){return[{year:bC(t,e),month:bC(t,e+1,1),day:bC(t,e+2,1)},null,e+3]}function wC(t,e){return[{hours:bC(t,e,0),minutes:bC(t,e+1,0),seconds:bC(t,e+2,0),milliseconds:ET(t[e+3])},null,e+4]}function _T(t,e){let n=!t[e]&&!t[e+1],r=f0(t[e+1],t[e+2]),o=n?null:Hi.instance(r);return[{},o,e+3]}function DT(t,e){let n=t[e]?za.create(t[e]):null;return[{},n,e+1]}var Lot=RegExp(`^T?${uq.source}$`),Mot=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Oot(t){let[e,n,r,o,i,a,l,c,d]=t,f=e[0]==="-",m=c&&c[0]==="-",h=(g,y=!1)=>g!==void 0&&(y||g&&f)?-g:g;return[{years:h(Gh(n)),months:h(Gh(r)),weeks:h(Gh(o)),days:h(Gh(i)),hours:h(Gh(a)),minutes:h(Gh(l)),seconds:h(Gh(c),c==="-0"),milliseconds:h(ET(d),m)}]}var Rot={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function dq(t,e,n,r,o,i,a){let l={year:e.length===2?TT(bp(e)):bp(e),month:aq.indexOf(n)+1,day:bp(r),hour:bp(o),minute:bp(i)};return a&&(l.second=bp(a)),t&&(l.weekday=t.length>3?sq.indexOf(t)+1:lq.indexOf(t)+1),l}var Aot=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function kot(t){let[,e,n,r,o,i,a,l,c,d,f,m]=t,h=dq(e,o,r,n,i,a,l),g;return c?g=Rot[c]:d?g=0:g=f0(f,m),[h,new Hi(g)]}function Pot(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var Iot=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Fot=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Bot=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function S3e(t){let[,e,n,r,o,i,a,l]=t;return[dq(e,o,r,n,i,a,l),Hi.utcInstance]}function zot(t){let[,e,n,r,o,i,a,l]=t;return[dq(e,l,n,r,o,i,a),Hi.utcInstance]}var Vot=xC(Sot,cq),Hot=xC(wot,cq),jot=xC(Eot,cq),Uot=xC(_3e),$3e=CC(Not,wC,_T,DT),Kot=CC(Tot,wC,_T,DT),Wot=CC(_ot,wC,_T,DT),Got=CC(wC,_T,DT);function N3e(t){return SC(t,[Vot,$3e],[Hot,Kot],[jot,Wot],[Uot,Got])}function L3e(t){return SC(Pot(t),[Aot,kot])}function M3e(t){return SC(t,[Iot,S3e],[Fot,S3e],[Bot,zot])}function O3e(t){return SC(t,[Mot,Oot])}var Yot=CC(wC);function R3e(t){return SC(t,[Lot,Yot])}var Zot=xC(Dot,$ot),qot=xC(D3e),Jot=CC(wC,_T,DT);function A3e(t){return SC(t,[Zot,$3e],[qot,Jot])}var k3e="Invalid Duration",I3e={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Xot={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...I3e},Tu=146097/400,EC=146097/4800,Qot={years:{quarters:4,months:12,weeks:Tu/7,days:Tu,hours:Tu*24,minutes:Tu*24*60,seconds:Tu*24*60*60,milliseconds:Tu*24*60*60*1e3},quarters:{months:3,weeks:Tu/28,days:Tu/4,hours:Tu*24/4,minutes:Tu*24*60/4,seconds:Tu*24*60*60/4,milliseconds:Tu*24*60*60*1e3/4},months:{weeks:EC/7,days:EC,hours:EC*24,minutes:EC*24*60,seconds:EC*24*60*60,milliseconds:EC*24*60*60*1e3},...I3e},h0=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],eit=h0.slice(0).reverse();function Yh(t,e,n=!1){let r={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new go(r)}function F3e(t,e){let n=e.milliseconds??0;for(let r of eit.slice(1))e[r]&&(n+=e[r]*t[r].milliseconds);return n}function P3e(t,e){let n=F3e(t,e)<0?-1:1;h0.reduceRight((r,o)=>{if(Ot(e[o]))return r;if(r){let i=e[r]*n,a=t[o][r],l=Math.floor(i/a);e[o]+=l*n,e[r]-=l*a*n}return o},null),h0.reduce((r,o)=>{if(Ot(e[o]))return r;if(r){let i=e[r]%1;e[r]-=i,e[o]+=i*t[r][o]}return o},null)}function tit(t){let e={};for(let[n,r]of Object.entries(t))r!==0&&(e[n]=r);return e}var go=class t{constructor(e){let n=e.conversionAccuracy==="longterm"||!1,r=n?Qot:Xot;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||Jn.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,n){return t.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new Ko(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new t({values:yC(e,t.normalizeUnit),loc:Jn.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(Bd(e))return t.fromMillis(e);if(t.isDuration(e))return e;if(typeof e=="object")return t.fromObject(e);throw new Ko(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){let[r]=O3e(e);return r?t.fromObject(r,n):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){let[r]=R3e(e);return r?t.fromObject(r,n):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new Ko("need to specify a reason the Duration is invalid");let r=e instanceof ji?e:new ji(e,n);if(Vn.throwOnInvalid)throw new YL(r);return new t({invalid:r})}static normalizeUnit(e){let n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new pC(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){let r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Ui.create(this.loc,r).formatDurationFromString(this,e):k3e}toHuman(e={}){if(!this.isValid)return k3e;let n=h0.map(r=>{let o=this.values[r];return Ot(o)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(o)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=hC(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;let n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},gn.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?F3e(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;let n=t.fromDurationLike(e),r={};for(let o of h0)(Wh(n.values,o)||Wh(this.values,o))&&(r[o]=n.get(o)+this.get(o));return Yh(this,{values:r},!0)}minus(e){if(!this.isValid)return this;let n=t.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;let n={};for(let r of Object.keys(this.values))n[r]=iq(e(this.values[r],r));return Yh(this,{values:n},!0)}get(e){return this[t.normalizeUnit(e)]}set(e){if(!this.isValid)return this;let n={...this.values,...yC(e,t.normalizeUnit)};return Yh(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:r,matrix:o}={}){let a={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:o,conversionAccuracy:r};return Yh(this,a)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return P3e(this.matrix,e),Yh(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=tit(this.normalize().shiftToAll().toObject());return Yh(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(a=>t.normalizeUnit(a));let n={},r={},o=this.toObject(),i;for(let a of h0)if(e.indexOf(a)>=0){i=a;let l=0;for(let d in r)l+=this.matrix[d][a]*r[d],r[d]=0;Bd(o[a])&&(l+=o[a]);let c=Math.trunc(l);n[a]=c,r[a]=(l*1e3-c*1e3)/1e3}else Bd(o[a])&&(r[a]=o[a]);for(let a in r)r[a]!==0&&(n[i]+=a===i?r[a]:r[a]/this.matrix[i][a]);return P3e(this.matrix,n),Yh(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let e={};for(let n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return Yh(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(r,o){return r===void 0||r===0?o===void 0||o===0:r===o}for(let r of h0)if(!n(this.values[r],e.values[r]))return!1;return!0}};var TC="Invalid Interval";function nit(t,e){return!t||!t.isValid?xp.invalid("missing or invalid start"):!e||!e.isValid?xp.invalid("missing or invalid end"):e<t?xp.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}var xp=class t{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,n=null){if(!e)throw new Ko("need to specify a reason the Interval is invalid");let r=e instanceof ji?e:new ji(e,n);if(Vn.throwOnInvalid)throw new GL(r);return new t({invalid:r})}static fromDateTimes(e,n){let r=_C(e),o=_C(n),i=nit(r,o);return i??new t({start:r,end:o})}static after(e,n){let r=go.fromDurationLike(n),o=_C(e);return t.fromDateTimes(o,o.plus(r))}static before(e,n){let r=go.fromDurationLike(n),o=_C(e);return t.fromDateTimes(o.minus(r),o)}static fromISO(e,n){let[r,o]=(e||"").split("/",2);if(r&&o){let i,a;try{i=gn.fromISO(r,n),a=i.isValid}catch{a=!1}let l,c;try{l=gn.fromISO(o,n),c=l.isValid}catch{c=!1}if(a&&c)return t.fromDateTimes(i,l);if(a){let d=go.fromISO(o,n);if(d.isValid)return t.after(i,d)}else if(c){let d=go.fromISO(r,n);if(d.isValid)return t.before(l,d)}}return t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",n){if(!this.isValid)return NaN;let r=this.start.startOf(e,n),o;return n?.useLocaleWeeks?o=this.end.reconfigure({locale:r.locale}):o=this.end,o=o.startOf(e,n),Math.floor(o.diff(r,e).get(e))+(o.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?t.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];let n=e.map(_C).filter(a=>this.contains(a)).sort((a,l)=>a.toMillis()-l.toMillis()),r=[],{s:o}=this,i=0;for(;o<this.e;){let a=n[i]||this.e,l=+a>+this.e?this.e:a;r.push(t.fromDateTimes(o,l)),o=l,i+=1}return r}splitBy(e){let n=go.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,o=1,i,a=[];for(;r<this.e;){let l=this.start.plus(n.mapUnits(c=>c*o));i=+l>+this.e?this.e:l,a.push(t.fromDateTimes(r,i)),r=i,o+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;let n=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return n>=r?null:t.fromDateTimes(n,r)}union(e){if(!this.isValid)return this;let n=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return t.fromDateTimes(n,r)}static merge(e){let[n,r]=e.sort((o,i)=>o.s-i.s).reduce(([o,i],a)=>i?i.overlaps(a)||i.abutsStart(a)?[o,i.union(a)]:[o.concat([i]),a]:[o,a],[[],null]);return r&&n.push(r),n}static xor(e){let n=null,r=0,o=[],i=e.map(c=>[{time:c.s,type:"s"},{time:c.e,type:"e"}]),a=Array.prototype.concat(...i),l=a.sort((c,d)=>c.time-d.time);for(let c of l)r+=c.type==="s"?1:-1,r===1?n=c.time:(n&&+n!=+c.time&&o.push(t.fromDateTimes(n,c.time)),n=null);return t.merge(o)}difference(...e){return t.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:TC}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=Hh,n={}){return this.isValid?Ui.create(this.s.loc.clone(n),e).formatInterval(this):TC}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:TC}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:TC}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:TC}toFormat(e,{separator:n=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:TC}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):go.invalid(this.invalidReason)}mapEndpoints(e){return t.fromDateTimes(e(this.s),e(this.e))}};var Cp=class{static hasDST(e=Vn.defaultZone){let n=gn.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return za.isValidZone(e)}static normalizeZone(e){return _c(e,Vn.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||Jn.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||Jn.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||Jn.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:r=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||Jn.create(n,r,i)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||Jn.create(n,r,i)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:r=null,locObj:o=null}={}){return(o||Jn.create(n,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:o=null}={}){return(o||Jn.create(n,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Jn.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return Jn.create(n,null,"gregory").eras(e)}static features(){return{relative:eM(),localeWeek:tM()}}};function B3e(t,e){let n=o=>o.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(e)-n(t);return Math.floor(go.fromMillis(r).as("days"))}function rit(t,e,n){let r=[["years",(c,d)=>d.year-c.year],["quarters",(c,d)=>d.quarter-c.quarter+(d.year-c.year)*4],["months",(c,d)=>d.month-c.month+(d.year-c.year)*12],["weeks",(c,d)=>{let f=B3e(c,d);return(f-f%7)/7}],["days",B3e]],o={},i=t,a,l;for(let[c,d]of r)n.indexOf(c)>=0&&(a=c,o[c]=d(t,e),l=i.plus(o),l>e?(o[c]--,t=i.plus(o),t>e&&(l=t,o[c]--,t=i.plus(o))):t=l);return[t,o,l,a]}function z3e(t,e,n,r){let[o,i,a,l]=rit(t,e,n),c=e-o,d=n.filter(m=>["hours","minutes","seconds","milliseconds"].indexOf(m)>=0);d.length===0&&(a<e&&(a=o.plus({[l]:1})),a!==o&&(i[l]=(i[l]||0)+c/(a-o)));let f=go.fromObject(i,r);return d.length>0?go.fromMillis(c,r).shiftTo(...d).plus(f):f}var fq={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},V3e={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},oit=fq.hanidec.replace(/[\[|\]]/g,"").split("");function H3e(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);if(t[n].search(fq.hanidec)!==-1)e+=oit.indexOf(t[n]);else for(let o in V3e){let[i,a]=V3e[o];r>=i&&r<=a&&(e+=r-i)}}return parseInt(e,10)}else return e}function _u({numberingSystem:t},e=""){return new RegExp(`${fq[t||"latn"]}${e}`)}var iit="missing Intl.DateTimeFormat.formatToParts support";function Hn(t,e=n=>n){return{regex:t,deser:([n])=>e(H3e(n))}}var ait="\xA0",K3e=`[ ${ait}]`,W3e=new RegExp(K3e,"g");function sit(t){return t.replace(/\./g,"\\.?").replace(W3e,K3e)}function j3e(t){return t.replace(/\./g,"").replace(W3e," ").toLowerCase()}function Dc(t,e){return t===null?null:{regex:RegExp(t.map(sit).join("|")),deser:([n])=>t.findIndex(r=>j3e(n)===j3e(r))+e}}function U3e(t,e){return{regex:t,deser:([,n,r])=>f0(n,r),groups:e}}function iM(t){return{regex:t,deser:([e])=>e}}function lit(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function uit(t,e){let n=_u(e),r=_u(e,"{2}"),o=_u(e,"{3}"),i=_u(e,"{4}"),a=_u(e,"{6}"),l=_u(e,"{1,2}"),c=_u(e,"{1,3}"),d=_u(e,"{1,6}"),f=_u(e,"{1,9}"),m=_u(e,"{2,4}"),h=_u(e,"{4,6}"),g=C=>({regex:RegExp(lit(C.val)),deser:([S])=>S,literal:!0}),b=(C=>{if(t.literal)return g(C);switch(C.val){case"G":return Dc(e.eras("short"),0);case"GG":return Dc(e.eras("long"),0);case"y":return Hn(d);case"yy":return Hn(m,TT);case"yyyy":return Hn(i);case"yyyyy":return Hn(h);case"yyyyyy":return Hn(a);case"M":return Hn(l);case"MM":return Hn(r);case"MMM":return Dc(e.months("short",!0),1);case"MMMM":return Dc(e.months("long",!0),1);case"L":return Hn(l);case"LL":return Hn(r);case"LLL":return Dc(e.months("short",!1),1);case"LLLL":return Dc(e.months("long",!1),1);case"d":return Hn(l);case"dd":return Hn(r);case"o":return Hn(c);case"ooo":return Hn(o);case"HH":return Hn(r);case"H":return Hn(l);case"hh":return Hn(r);case"h":return Hn(l);case"mm":return Hn(r);case"m":return Hn(l);case"q":return Hn(l);case"qq":return Hn(r);case"s":return Hn(l);case"ss":return Hn(r);case"S":return Hn(c);case"SSS":return Hn(o);case"u":return iM(f);case"uu":return iM(l);case"uuu":return Hn(n);case"a":return Dc(e.meridiems(),0);case"kkkk":return Hn(i);case"kk":return Hn(m,TT);case"W":return Hn(l);case"WW":return Hn(r);case"E":case"c":return Hn(n);case"EEE":return Dc(e.weekdays("short",!1),1);case"EEEE":return Dc(e.weekdays("long",!1),1);case"ccc":return Dc(e.weekdays("short",!0),1);case"cccc":return Dc(e.weekdays("long",!0),1);case"Z":case"ZZ":return U3e(new RegExp(`([+-]${l.source})(?::(${r.source}))?`),2);case"ZZZ":return U3e(new RegExp(`([+-]${l.source})(${r.source})?`),2);case"z":return iM(/[a-z_+-/]{1,256}?/i);case" ":return iM(/[^\S\n\r]/);default:return g(C)}})(t)||{invalidReason:iit};return b.token=t,b}var cit={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function dit(t,e,n){let{type:r,value:o}=t;if(r==="literal"){let c=/^\s+$/.test(o);return{literal:!c,val:c?" ":o}}let i=e[r],a=r;r==="hour"&&(e.hour12!=null?a=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?a="hour12":a="hour24":a=n.hour12?"hour12":"hour24");let l=cit[a];if(typeof l=="object"&&(l=l[i]),l)return{literal:!1,val:l}}function fit(t){return[`^${t.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,t]}function pit(t,e,n){let r=t.match(e);if(r){let o={},i=1;for(let a in n)if(Wh(n,a)){let l=n[a],c=l.groups?l.groups+1:1;!l.literal&&l.token&&(o[l.token.val[0]]=l.deser(r.slice(i,i+c))),i+=c}return[r,o]}else return[r,{}]}function mit(t){let e=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},n=null,r;return Ot(t.z)||(n=za.create(t.z)),Ot(t.Z)||(n||(n=new Hi(t.Z)),r=t.Z),Ot(t.q)||(t.M=(t.q-1)*3+1),Ot(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),Ot(t.u)||(t.S=ET(t.u)),[Object.keys(t).reduce((i,a)=>{let l=e(a);return l&&(i[l]=t[a]),i},{}),n,r]}var pq=null;function hit(){return pq||(pq=gn.fromMillis(1555555555555)),pq}function git(t,e){if(t.literal)return t;let n=Ui.macroTokenToFormatOpts(t.val),r=gq(n,e);return r==null||r.includes(void 0)?t:r}function mq(t,e){return Array.prototype.concat(...t.map(n=>git(n,e)))}function hq(t,e,n){let r=mq(Ui.parseFormat(n),t),o=r.map(a=>uit(a,t)),i=o.find(a=>a.invalidReason);if(i)return{input:e,tokens:r,invalidReason:i.invalidReason};{let[a,l]=fit(o),c=RegExp(a,"i"),[d,f]=pit(e,c,l),[m,h,g]=f?mit(f):[null,null,void 0];if(Wh(f,"a")&&Wh(f,"H"))throw new wc("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:r,regex:c,rawMatches:d,matches:f,result:m,zone:h,specificOffset:g}}}function G3e(t,e,n){let{result:r,zone:o,specificOffset:i,invalidReason:a}=hq(t,e,n);return[r,o,i,a]}function gq(t,e){if(!t)return null;let r=Ui.create(e,t).dtFormatter(hit()),o=r.formatToParts(),i=r.resolvedOptions();return o.map(a=>dit(a,t,i))}var vq="Invalid DateTime",Y3e=864e13;function aM(t){return new ji("unsupported zone",`the zone "${t.name}" is not supported`)}function yq(t){return t.weekData===null&&(t.weekData=CT(t.c)),t.weekData}function bq(t){return t.localWeekData===null&&(t.localWeekData=CT(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function g0(t,e){let n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new gn({...n,...e,old:n})}function twe(t,e,n){let r=t-e*60*1e3,o=n.offset(r);if(e===o)return[r,e];r-=(o-e)*60*1e3;let i=n.offset(r);return o===i?[r,o]:[t-Math.min(o,i)*60*1e3,Math.max(o,i)]}function sM(t,e){t+=e*60*1e3;let n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function uM(t,e,n){return twe(mC(t),e,n)}function Z3e(t,e){let n=t.o,r=t.c.year+Math.trunc(e.years),o=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,i={...t.c,year:r,month:o,day:Math.min(t.c.day,vC(r,o))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},a=go.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),l=mC(i),[c,d]=twe(l,n,t.zone);return a!==0&&(c+=a,d=t.zone.offset(c)),{ts:c,o:d}}function $T(t,e,n,r,o,i){let{setZone:a,zone:l}=n;if(t&&Object.keys(t).length!==0||e){let c=e||l,d=gn.fromObject(t,{...n,zone:c,specificOffset:i});return a?d:d.setZone(l)}else return gn.invalid(new ji("unparsable",`the input "${o}" can't be parsed as ${r}`))}function lM(t,e,n=!0){return t.isValid?Ui.create(Jn.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function xq(t,e){let n=t.c.year>9999||t.c.year<0,r="";return n&&t.c.year>=0&&(r+="+"),r+=ho(t.c.year,n?6:4),e?(r+="-",r+=ho(t.c.month),r+="-",r+=ho(t.c.day)):(r+=ho(t.c.month),r+=ho(t.c.day)),r}function q3e(t,e,n,r,o,i){let a=ho(t.c.hour);return e?(a+=":",a+=ho(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(a+=":")):a+=ho(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(a+=ho(t.c.second),(t.c.millisecond!==0||!r)&&(a+=".",a+=ho(t.c.millisecond,3))),o&&(t.isOffsetFixed&&t.offset===0&&!i?a+="Z":t.o<0?(a+="-",a+=ho(Math.trunc(-t.o/60)),a+=":",a+=ho(Math.trunc(-t.o%60))):(a+="+",a+=ho(Math.trunc(t.o/60)),a+=":",a+=ho(Math.trunc(t.o%60)))),i&&(a+="["+t.zone.ianaName+"]"),a}var nwe={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},vit={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},yit={ordinal:1,hour:0,minute:0,second:0,millisecond:0},rwe=["year","month","day","hour","minute","second","millisecond"],bit=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],xit=["year","ordinal","hour","minute","second","millisecond"];function Cit(t){let e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new pC(t);return e}function J3e(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Cit(t)}}function X3e(t,e){let n=_c(e.zone,Vn.defaultZone),r=Jn.fromObject(e),o=Vn.now(),i,a;if(Ot(t.year))i=o;else{for(let d of rwe)Ot(t[d])&&(t[d]=nwe[d]);let l=nq(t)||rq(t);if(l)return gn.invalid(l);let c=n.offset(o);[i,a]=uM(t,c,n)}return new gn({ts:i,zone:n,loc:r,o:a})}function Q3e(t,e,n){let r=Ot(n.round)?!0:n.round,o=(a,l)=>(a=hC(a,r||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(a,l)),i=a=>n.calendary?e.hasSame(t,a)?0:e.startOf(a).diff(t.startOf(a),a).get(a):e.diff(t,a).get(a);if(n.unit)return o(i(n.unit),n.unit);for(let a of n.units){let l=i(a);if(Math.abs(l)>=1)return o(l,a)}return o(t>e?-0:0,n.units[n.units.length-1])}function ewe(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}var gn=class t{constructor(e){let n=e.zone||Vn.defaultZone,r=e.invalid||(Number.isNaN(e.ts)?new ji("invalid input"):null)||(n.isValid?null:aM(n));this.ts=Ot(e.ts)?Vn.now():e.ts;let o=null,i=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[o,i]=[e.old.c,e.old.o];else{let l=n.offset(this.ts);o=sM(this.ts,l),r=Number.isNaN(o.year)?new ji("invalid input"):null,o=r?null:o,i=r?null:l}this._zone=n,this.loc=e.loc||Jn.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=o,this.o=i,this.isLuxonDateTime=!0}static now(){return new t({})}static local(){let[e,n]=ewe(arguments),[r,o,i,a,l,c,d]=n;return X3e({year:r,month:o,day:i,hour:a,minute:l,second:c,millisecond:d},e)}static utc(){let[e,n]=ewe(arguments),[r,o,i,a,l,c,d]=n;return e.zone=Hi.utcInstance,X3e({year:r,month:o,day:i,hour:a,minute:l,second:c,millisecond:d},e)}static fromJSDate(e,n={}){let r=m3e(e)?e.valueOf():NaN;if(Number.isNaN(r))return t.invalid("invalid input");let o=_c(n.zone,Vn.defaultZone);return o.isValid?new t({ts:r,zone:o,loc:Jn.fromObject(n)}):t.invalid(aM(o))}static fromMillis(e,n={}){if(Bd(e))return e<-Y3e||e>Y3e?t.invalid("Timestamp out of range"):new t({ts:e,zone:_c(n.zone,Vn.defaultZone),loc:Jn.fromObject(n)});throw new Ko(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(Bd(e))return new t({ts:e*1e3,zone:_c(n.zone,Vn.defaultZone),loc:Jn.fromObject(n)});throw new Ko("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};let r=_c(n.zone,Vn.defaultZone);if(!r.isValid)return t.invalid(aM(r));let o=Jn.fromObject(n),i=yC(e,J3e),{minDaysInFirstWeek:a,startOfWeek:l}=tq(i,o),c=Vn.now(),d=Ot(n.specificOffset)?r.offset(c):n.specificOffset,f=!Ot(i.ordinal),m=!Ot(i.year),h=!Ot(i.month)||!Ot(i.day),g=m||h,y=i.weekYear||i.weekNumber;if((g||f)&&y)throw new wc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&f)throw new wc("Can't mix ordinal dates with month/day");let b=y||i.weekday&&!g,C,S,w=sM(c,d);b?(C=bit,S=vit,w=CT(w,a,l)):f?(C=xit,S=yit,w=oM(w)):(C=rwe,S=nwe);let E=!1;for(let k of C){let F=i[k];Ot(F)?E?i[k]=S[k]:i[k]=w[k]:E=!0}let _=b?d3e(i,a,l):f?f3e(i):nq(i),N=_||rq(i);if(N)return t.invalid(N);let $=b?QZ(i,a,l):f?eq(i):i,[O,M]=uM($,d,r),A=new t({ts:O,zone:r,o:M,loc:o});return i.weekday&&g&&e.weekday!==A.weekday?t.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${A.toISO()}`):A}static fromISO(e,n={}){let[r,o]=N3e(e);return $T(r,o,n,"ISO 8601",e)}static fromRFC2822(e,n={}){let[r,o]=L3e(e);return $T(r,o,n,"RFC 2822",e)}static fromHTTP(e,n={}){let[r,o]=M3e(e);return $T(r,o,n,"HTTP",n)}static fromFormat(e,n,r={}){if(Ot(e)||Ot(n))throw new Ko("fromFormat requires an input string and a format");let{locale:o=null,numberingSystem:i=null}=r,a=Jn.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0}),[l,c,d,f]=G3e(a,e,n);return f?t.invalid(f):$T(l,c,r,`format ${n}`,e,d)}static fromString(e,n,r={}){return t.fromFormat(e,n,r)}static fromSQL(e,n={}){let[r,o]=A3e(e);return $T(r,o,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new Ko("need to specify a reason the DateTime is invalid");let r=e instanceof ji?e:new ji(e,n);if(Vn.throwOnInvalid)throw new WL(r);return new t({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){let r=gq(e,Jn.fromObject(n));return r?r.map(o=>o?o.val:null).join(""):null}static expandFormat(e,n={}){return mq(Ui.parseFormat(e),Jn.fromObject(n)).map(o=>o.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?yq(this).weekYear:NaN}get weekNumber(){return this.isValid?yq(this).weekNumber:NaN}get weekday(){return this.isValid?yq(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?bq(this).weekday:NaN}get localWeekNumber(){return this.isValid?bq(this).weekNumber:NaN}get localWeekYear(){return this.isValid?bq(this).weekYear:NaN}get ordinal(){return this.isValid?oM(this.c).ordinal:NaN}get monthShort(){return this.isValid?Cp.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Cp.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Cp.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Cp.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=864e5,n=6e4,r=mC(this.c),o=this.zone.offset(r-e),i=this.zone.offset(r+e),a=this.zone.offset(r-o*n),l=this.zone.offset(r-i*n);if(a===l)return[this];let c=r-a*n,d=r-l*n,f=sM(c,a),m=sM(d,l);return f.hour===m.hour&&f.minute===m.minute&&f.second===m.second&&f.millisecond===m.millisecond?[g0(this,{ts:c}),g0(this,{ts:d})]:[this]}get isInLeapYear(){return m0(this.year)}get daysInMonth(){return vC(this.year,this.month)}get daysInYear(){return this.isValid?Kh(this.year):NaN}get weeksInWeekYear(){return this.isValid?p0(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?p0(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:n,numberingSystem:r,calendar:o}=Ui.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:o}}toUTC(e=0,n={}){return this.setZone(Hi.instance(e),n)}toLocal(){return this.setZone(Vn.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(e=_c(e,Vn.defaultZone),e.equals(this.zone))return this;if(e.isValid){let o=this.ts;if(n||r){let i=e.offset(this.ts),a=this.toObject();[o]=uM(a,i,e)}return g0(this,{ts:o,zone:e})}else return t.invalid(aM(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:r}={}){let o=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:r});return g0(this,{loc:o})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let n=yC(e,J3e),{minDaysInFirstWeek:r,startOfWeek:o}=tq(n,this.loc),i=!Ot(n.weekYear)||!Ot(n.weekNumber)||!Ot(n.weekday),a=!Ot(n.ordinal),l=!Ot(n.year),c=!Ot(n.month)||!Ot(n.day),d=l||c,f=n.weekYear||n.weekNumber;if((d||a)&&f)throw new wc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&a)throw new wc("Can't mix ordinal dates with month/day");let m;i?m=QZ({...CT(this.c,r,o),...n},r,o):Ot(n.ordinal)?(m={...this.toObject(),...n},Ot(n.day)&&(m.day=Math.min(vC(m.year,m.month),m.day))):m=eq({...oM(this.c),...n});let[h,g]=uM(m,this.o,this.zone);return g0(this,{ts:h,o:g})}plus(e){if(!this.isValid)return this;let n=go.fromDurationLike(e);return g0(this,Z3e(this,n))}minus(e){if(!this.isValid)return this;let n=go.fromDurationLike(e).negate();return g0(this,Z3e(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;let r={},o=go.normalizeUnit(e);switch(o){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break;case"milliseconds":break}if(o==="weeks")if(n){let i=this.loc.getStartOfWeek(),{weekday:a}=this;a<i&&(r.weekNumber=this.weekNumber-1),r.weekday=i}else r.weekday=1;if(o==="quarters"){let i=Math.ceil(this.month/3);r.month=(i-1)*3+1}return this.set(r)}endOf(e,n){return this.isValid?this.plus({[e]:1}).startOf(e,n).minus(1):this}toFormat(e,n={}){return this.isValid?Ui.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):vq}toLocaleString(e=Hh,n={}){return this.isValid?Ui.create(this.loc.clone(n),e).formatDateTime(this):vq}toLocaleParts(e={}){return this.isValid?Ui.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:o=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;let a=e==="extended",l=xq(this,a);return l+="T",l+=q3e(this,a,n,r,o,i),l}toISODate({format:e="extended"}={}){return this.isValid?xq(this,e==="extended"):null}toISOWeekDate(){return lM(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:o=!1,extendedZone:i=!1,format:a="extended"}={}){return this.isValid?(o?"T":"")+q3e(this,a==="extended",n,e,r,i):null}toRFC2822(){return lM(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return lM(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?xq(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let o="HH:mm:ss.SSS";return(n||e)&&(r&&(o+=" "),n?o+="z":e&&(o+="ZZ")),lM(this,o,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():vq}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",r={}){if(!this.isValid||!e.isValid)return go.invalid("created by diffing an invalid DateTime");let o={locale:this.locale,numberingSystem:this.numberingSystem,...r},i=h3e(n).map(go.normalizeUnit),a=e.valueOf()>this.valueOf(),l=a?this:e,c=a?e:this,d=z3e(l,c,i,o);return a?d.negate():d}diffNow(e="milliseconds",n={}){return this.diff(t.now(),e,n)}until(e){return this.isValid?xp.fromDateTimes(this,e):this}hasSame(e,n,r){if(!this.isValid)return!1;let o=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(n,r)<=o&&o<=i.endOf(n,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;let n=e.base||t.fromObject({},{zone:this.zone}),r=e.padding?this<n?-e.padding:e.padding:0,o=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(o=e.unit,i=void 0),Q3e(n,this.plus(r),{...e,numeric:"always",units:o,unit:i})}toRelativeCalendar(e={}){return this.isValid?Q3e(e.base||t.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(t.isDateTime))throw new Ko("min requires all arguments be DateTimes");return oq(e,n=>n.valueOf(),Math.min)}static max(...e){if(!e.every(t.isDateTime))throw new Ko("max requires all arguments be DateTimes");return oq(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,r={}){let{locale:o=null,numberingSystem:i=null}=r,a=Jn.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});return hq(a,e,n)}static fromStringExplain(e,n,r={}){return t.fromFormatExplain(e,n,r)}static get DATE_SHORT(){return Hh}static get DATE_MED(){return eT}static get DATE_MED_WITH_WEEKDAY(){return IZ}static get DATE_FULL(){return tT}static get DATE_HUGE(){return nT}static get TIME_SIMPLE(){return rT}static get TIME_WITH_SECONDS(){return oT}static get TIME_WITH_SHORT_OFFSET(){return iT}static get TIME_WITH_LONG_OFFSET(){return aT}static get TIME_24_SIMPLE(){return sT}static get TIME_24_WITH_SECONDS(){return lT}static get TIME_24_WITH_SHORT_OFFSET(){return uT}static get TIME_24_WITH_LONG_OFFSET(){return cT}static get DATETIME_SHORT(){return dT}static get DATETIME_SHORT_WITH_SECONDS(){return fT}static get DATETIME_MED(){return pT}static get DATETIME_MED_WITH_SECONDS(){return mT}static get DATETIME_MED_WITH_WEEKDAY(){return FZ}static get DATETIME_FULL(){return hT}static get DATETIME_FULL_WITH_SECONDS(){return gT}static get DATETIME_HUGE(){return vT}static get DATETIME_HUGE_WITH_SECONDS(){return yT}};function _C(t){if(gn.isDateTime(t))return t;if(t&&t.valueOf&&Bd(t.valueOf()))return gn.fromJSDate(t);if(t&&typeof t=="object")return gn.fromObject(t);throw new Ko(`Unknown datetime argument: ${t}, of type ${typeof t}`)}function cM(t){return t.reduce((e,{field:n,operator:r,value:o})=>{if(!n||!r)return e;if(n==="updated_at"&&(n="modified"),n==="created_at"&&(n="created"),r==="def")return{...e,[`${n}[def]`]:"true"};if(r==="ndef")return{...e,[`${n}[def]`]:"false"};if(r==="checked")return{...e,[`${n}[eq]`]:"true"};if(r==="nchecked")return{...e,[`${n}[eq]`]:"false"};if(typeof o>"u"||o===null||o===""||Array.isArray(o)&&o.length<1)return e;if(r==="between"||r==="sys-date-between")if(Array.isArray(o)&&o.length===2){if(r==="between")return{...e,[`${n}[gte]`]:o[0],[`${n}[lte]`]:o[1]};{let i=gn.fromISO(o[0],{zone:"system"}).setZone("utc").toISO(),a=gn.fromISO(o[1],{zone:"system"}).plus({day:1}).setZone("utc").toISO();return i&&a?{...e,[`${n}[gte]`]:i,[`${n}[lt]`]:a}:e}}else return e;if(r==="sys-date-eq")if(typeof o=="string"){let i=gn.fromISO(o,{zone:"system"}).setZone("utc").toISO(),a=gn.fromISO(o,{zone:"system"}).plus({day:1}).setZone("utc").toISO();return i&&a?{...e,[`${n}[gte]`]:i,[`${n}[lt]`]:a}:e}else return e;if(r==="sys-date-gt")if(typeof o=="string"){let i=gn.fromISO(o,{zone:"system"}).plus({day:1}).setZone("utc").toISO();return i?{...e,[`${n}[gte]`]:i}:e}else return e;if(r==="sys-date-gte")if(typeof o=="string"){let i=gn.fromISO(o,{zone:"system"}).setZone("utc").toISO();return i?{...e,[`${n}[gte]`]:i}:e}else return e;if(r==="sys-date-lt")if(typeof o=="string"){let i=gn.fromISO(o,{zone:"system"}).setZone("utc").toISO();return i?{...e,[`${n}[lt]`]:i}:e}else return e;if(r==="sys-date-lte")if(typeof o=="string"){let i=gn.fromISO(o,{zone:"system"}).plus({day:1}).setZone("utc").toISO();return i?{...e,[`${n}[lt]`]:i}:e}else return e;if(r==="starts"&&typeof o=="string")return{...e,[`${n}[starts]`]:o.replaceAll(/[^a-zA-Z0-9_.\s-]/g,"").toLowerCase()};if(n==="workflowStageId"){let i=t.some(a=>a.field==="workflowId");if(r==="eq"||r==="neq"){let a=[];return Array.isArray(o)?a=o.map(c=>c.split("_")[1]):a=o.split("_"),{...e,...i?{}:{"workflowId[eq]":a[0]},[`${n}[${r}]`]:a[1]}}if(Array.isArray(o)){let a=o.map(d=>{let f=d.split("_")[0],m=d.split("_")[1];return{workflowId:f,workflowStage:m}}),l=a.map(d=>d.workflowId).join(","),c=a.map(d=>d.workflowStage).join(",");return{...e,...i?{}:{[`workflowId[${r}]`]:l},[`${n}[${r}]`]:c}}}return{...e,[`${n}[${r}]`]:Array.isArray(o)?o.join(","):o}},{})}import{CANVAS_DRAFT_STATE as owe,CanvasClient as iwe}from"@uniformdev/canvas";async function dM({instanceType:t,searchExpressionPrompt:e,username:n,locale:r,getEditUrl:o}){let i=new iwe(pt),a=await KL({searchExpressionPrompt:e,username:n,locale:r},t),{limit:l,offset:c,keyword:d,sort:f,filter:m}=a,g=(await i.getCompositionList({patternType:t==="composition"?void 0:t==="componentPattern"?"component":"composition",pattern:t!=="composition",resolveData:!1,withComponentIDs:!0,skipOverridesResolution:!0,limit:l,offset:c,search:d,filters:m?cM(m):void 0,orderBy:Array.isArray(f)?f:f?[f]:void 0,locale:r,skipPatternResolution:!0,state:owe})).compositions.map(y=>({id:y.composition._id,name:y.composition._name,componentType:y.composition.type,editUrl:o(y.composition._id)}));return{content:[{type:"text",text:JSON.stringify({results:g,criteria:a},null,2)}]}}async function fM({id:t}){let n=await new iwe(pt).getCompositionById({skipDataResolution:!0,withComponentIDs:!0,skipOverridesResolution:!0,skipPatternResolution:!1,compositionId:t,state:owe});return{content:[{type:"text",text:JSON.stringify(n,null,2)}]}}var wit={id:Sit.string()};function awe(t){t.tool("compositionList","Lists available Uniform compositions",vp.shape,async e=>await dM({...e,instanceType:"composition",getEditUrl:UL})),t.tool("compositionGet","Gets the full contents of a Uniform composition",wit,async e=>await fM(e))}import{ContentClient as Eit}from"@uniformdev/canvas";import{z as uwe}from"zod";import{z as NT}from"zod";var swe=NT.object({name:NT.string().describe('Title-cased display name of the component. Ex: "Hero"'),id:NT.string().describe("Public ID of the content type, the camelCase version of name, using only alphanumeric characters"),description:NT.string().describe("Describe the purpose of the content type in 1-2 sentences."),fields:NT.array(U_).describe("The fields of the content type. The key is the publicId of the field.").optional()});function lwe(t){let e=t.fields?.find(r=>r.type==="asset"&&typeof r.typeConfig=="object"&&r.typeConfig!==null&&"allowedTypes"in r.typeConfig&&Array.isArray(r.typeConfig.allowedTypes)&&r.typeConfig.allowedTypes?.includes("image"))?.id,n=t.fields?.find(r=>r.type==="text")?.id;return{...t,thumbnailField:e,entryName:n}}function pM(t){return`${pt.baseWebUrl}/dashboards/canvas/content-types/${t}`}var Tit={action:uwe.enum(["create","update","delete"]).describe("The action to perform"),publicId:uwe.string().describe("Public ID of the component, the camelCase version of name, using only alphanumeric characters"),contentType:swe.describe("Full content type definition to create. Omit for update or delete.").optional(),patches:H_.describe("JSON patch to apply to the existing component definition. Omit for create or delete.").optional()};function cwe(t){t.tool("contentTypeAction","Creates, updates, or deletes a Uniform Content Type definition",Tit,async({publicId:e,action:n,contentType:r,patches:o})=>{let i=new Eit(pt),a=!1;if(n==="create"){if(!r)throw new Error("Content type definition is required for create");let l=lwe(r);l.fields&&(a=Sy(l.fields),wy(l.fields)),await i.upsertContentType({contentType:l})}if(n==="update"){if(!o)throw new Error("Patches are required for update");let c=(await i.getContentTypes()).contentTypes.find(m=>m.id===e);if(!c)throw new Error(`Content Type with public ID ${e} does not exist, try creating it instead`);let d=c.fields?.filter(m=>m.type==="richText").map(m=>m.id),f=V_(c,o);if(f.fields){a=Sy(f.fields);let m=f.fields?.filter(h=>h.type==="richText").map(h=>h.id).filter(h=>!d?.includes(h));wy(f.fields,m)}await i.upsertContentType({contentType:f})}return n==="delete"&&await i.deleteContentType({contentTypeId:e}),{content:[{type:"text",text:JSON.stringify({success:!0,editUrl:pM(e),warning:a?"Issues with field group order were fixed. Ensure definition data is re-fetched before any future updates.":void 0},null,2)}]}})}import{ContentClient as dwe}from"@uniformdev/canvas";import{z as _it}from"zod";var Dit={id:_it.string()};function fwe(t){t.tool("contentTypeList","Lists all Uniform Content Type definitions",async()=>{let r=(await new dwe(pt).getContentTypes()).contentTypes.map(o=>({id:o.id,name:o.name,description:o.description,editUrl:pM(o.id)}));return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}),t.tool("contentTypeGet","Gets a Uniform Content Type definition details (fields, etc.)",Dit,async({id:e})=>{let o=(await new dwe(pt).getContentTypes()).contentTypes.find(i=>i.id===e);if(!o)throw new Error(`Content Type with ID ${e} not found`);return{content:[{type:"text",text:JSON.stringify(o,null,2)}]}})}function pwe(t){t.tool("createUuid","Creates a new random UUID",async()=>({content:[{type:"text",text:crypto.randomUUID()}]}))}import{z as Sq}from"zod";import{CANVAS_DRAFT_STATE as Cq,ContentClient as $it,convertEntryToPutEntry as Nit,getEffectivePropertyValue as Lit}from"@uniformdev/canvas";async function Mit(t,e,n){let o=(await e.fetchDefinitions())[t.entry.type];if(!o)throw new Error("insanity");let i=w4e(o),a;i.entryName&&(a=t.entry._overrides?.[t.entry._id].parameters?.[i.entryName]??t.entry.fields?.[i.entryName]);let l=Lit({conditionIndex:-1,locale:void 0,greedyLocaleMatching:!0,property:a}),c=s4e({value:l,isNew:n,contentType:i});t.entry._name=c}async function mM({action:t,id:e,instructions:n,isPattern:r,patternId:o,getEditUrl:i}){let a=new $it(pt),l,c,d=t==="update"?e:void 0,f={success:!0,actionsTaken:[]};if(t==="create"){if(!n)throw new Error("Instructions are required for create");if(!n.type)throw new Error("Type is required for create");o?(await a.upsertEntry({state:Cq,entry:{type:n.type,_id:e,fields:{},_pattern:o}}),d=e):l=new Vh({_id:e,_name:"New Entry",type:n.type,_overridability:{hideLockedParameters:!0}})}if(d){if(c=(await a.getEntries({entryIDs:[e],pattern:r,state:Cq,skipDataResolution:!0,skipPatternResolution:!1,withComponentIDs:!0,skipOverridesResolution:!0})).entries[0],!c)throw new Error("Entry not found");let m=FL(c);l=new Vh(m.composition)}if(t==="delete"&&await a.deleteEntry({entryId:e}),l){await HL(n?.localeUpdates?.enableLocales);let m=G4e();f=await LL({twee:l,descriptionUpdate:void 0,slugUpdate:n&&"slug"in n?n.slug:void 0,nameUpdate:n&&"name"in n?n.name:void 0,propertyUpdates:n?.fieldUpdates??[],slotUpdates:{},localeUpdates:n?.localeUpdates,currentEditorLocale:void 0,referenceData:m});let h=l.exportTree(),g=l.exportMetadata(),y=Nit(E4e(h,c??{projectId:pt.projectId,pattern:r},g,Cq,c?.releaseId,c?.editionId));r||await Mit(y,m,t==="create"),await a.upsertEntry(y)}return{content:[{type:"text",text:JSON.stringify({...f,editUrl:i(e)},null,2)}]}}function hM(t){return`${pt.baseWebUrl}/dashboards/canvas/entries/${t}`}var Oit={action:Sq.enum(["create","update","delete"]).describe("The action to perform"),id:Sq.string().uuid().describe("UUID of the entry to create, update, or delete"),patternId:Sq.string().uuid().describe("Entry pattern ID to create the entry from. Omit when not creating, or when creating an entry without an entry pattern.").optional(),instructions:Kte.describe("Modification instructions for the entry. Omit for delete.").optional()};function mwe(t){t.tool("entryAction","Creates, updates, or deletes a Uniform Entry",Oit,async e=>await mM({...e,isPattern:!1,getEditUrl:hM,patternId:e.patternId}))}import{z as Rit}from"zod";import{CANVAS_DRAFT_STATE as hwe,ContentClient as gwe}from"@uniformdev/canvas";async function gM({isPattern:t,searchExpressionPrompt:e,username:n,locale:r,getEditUrl:o}){let i=new gwe(pt),a=await KL({searchExpressionPrompt:e,username:n,locale:r},t?"entryPattern":"entry"),{limit:l,offset:c,keyword:d,sort:f,filter:m}=a,g=(await i.getEntries({limit:l,offset:c,pattern:t,skipDataResolution:!0,withTotalCount:!0,skipPatternResolution:!0,skipOverridesResolution:!0,state:hwe,search:d,filters:m?cM(m):void 0,orderBy:Array.isArray(f)?f:f?[f]:void 0,locale:r})).entries.map(y=>({id:y.entry._id,name:y.entry._name??"",contentType:y.entry.type,editUrl:o(y.entry._id)}));return{content:[{type:"text",text:JSON.stringify({results:g,criteria:a},null,2)}]}}async function vM({id:t,isPattern:e}){let r=await new gwe(pt).getEntries({skipDataResolution:!0,withComponentIDs:!0,skipOverridesResolution:!0,skipPatternResolution:!1,pattern:e,entryIDs:[t],state:hwe});if(r.entries.length===0)throw new Error(`Entry with ID ${t} not found`);return{content:[{type:"text",text:JSON.stringify(r.entries[0],null,2)}]}}var Ait={id:Rit.string()};function vwe(t){t.tool("entryList","Lists available Uniform entries",vp.shape,async e=>await gM({...e,isPattern:!1,getEditUrl:hM})),t.tool("entryGet","Gets the full contents of a Uniform entry",Ait,async e=>await vM({...e,isPattern:!1}))}import{z as ywe}from"zod";function yM(t){return`${pt.baseWebUrl}/dashboards/canvas/entry-patterns/${t}`}var kit={action:ywe.enum(["create","update","delete"]).describe("The action to perform"),id:ywe.string().uuid().describe("UUID of the entry pattern to create, update, or delete"),instructions:Wte.describe("Modification instructions for the entry pattern. Omit for delete.").optional()};function bwe(t){t.tool("entryPatternAction","Creates, updates, or deletes a Uniform Entry Pattern",kit,async e=>await mM({...e,isPattern:!0,getEditUrl:yM,patternId:void 0}))}import{z as Pit}from"zod";var Iit={id:Pit.string()};function xwe(t){t.tool("entryPatternList","Lists available Uniform entry patterns",vp.shape,async e=>await gM({...e,isPattern:!0,getEditUrl:yM})),t.tool("entryPatternGet","Gets the full contents of a Uniform entry pattern",Iit,async e=>await vM({...e,isPattern:!0}))}import{ProjectClient as Fit}from"@uniformdev/canvas";async function Bit(){let t=await fetch(`${pt.apiHost}/api/v1/member-profile`,{headers:{"x-api-key":pt.apiKey,"Content-Type":"application/json"}});if(!t.ok)throw new Error(`Failed to fetch user profile: ${t.status} ${t.statusText}`);return(await t.json()).name}function Cwe(t){t.tool("getUniformEnvironment","Get the connected Uniform Project name, edit URL, and current user",{},async()=>{try{let e=new Fit(pt),[n,r]=await Promise.all([e.get({projectId:pt.projectId}),Bit()]),o={projectName:n.name,teamName:n.teamName,projectUrl:pt.baseWebUrl,currentIdentity:r};return{content:[{type:"text",text:JSON.stringify(o,null,2)}]}}catch(e){return{content:[{type:"text",text:JSON.stringify({error:"Failed to fetch project information",details:e instanceof Error?e.message:"Unknown error"},null,2)}]}}})}import{LocaleClient as zit}from"@uniformdev/canvas";function Swe(t){t.tool("localeList","Lists all registered Uniform locales",async()=>{let n=await new zit(pt).get();return{content:[{type:"text",text:JSON.stringify({locales:n.results,editUrl:`${pt.baseWebUrl}/settings/localization`},null,2)}]}})}import{z as wwe}from"zod";function bM(t){return`${pt.baseWebUrl}/dashboards/canvas/edit/${t}`}var Vit={action:wwe.enum(["create","update","delete"]).describe("The action to perform"),id:wwe.string().uuid().describe("UUID of the pattern instance to create, update, or delete"),instructions:jte.describe("Modification instructions for the pattern. Omit for delete.").optional()};function Ewe(t){t.tool("patternAction","Creates, updates, or deletes a Uniform Component Pattern or Composition Pattern",Vit,async e=>await jL({...e,isPattern:!0,getEditUrl:bM,patternId:void 0}))}import{z as Twe}from"zod";var Hit={instanceType:Twe.enum(["componentPattern","compositionPattern"]),...vp.shape},jit={id:Twe.string()};function _we(t){t.tool("patternList","Lists available Uniform component patterns or composition patterns",Hit,async e=>await dM({...e,getEditUrl:bM})),t.tool("patternGet","Gets the full contents of a Uniform component pattern or composition pattern",jit,async e=>await fM(e))}var Va=new Uit({name:"Uniform MCP",version:"1.0.0"});zte(Va);Hte(Va);cwe(Va);fwe(Va);mwe(Va);vwe(Va);xwe(Va);bwe(Va);_we(Va);Ewe(Va);Y4e(Va);awe(Va);pwe(Va);Cwe(Va);Swe(Va);var Wit=new Kit;await Va.connect(Wit);process.stderr.write(`Uniform MCP server started
5180
+ You can filter by date, number, or string properties on the definition, as well as name, created, modified, author, slug, enabled locales, type, and publish status.`),username:Uo.string().describe("The username of the current user. If you do not know the username, use an empty string"),locale:Uo.string().describe("The current locale. If there is no current locale, use an empty string")}),cjt={displayName:"Create filter expression",description:"Creates a Uniform search filter expression for searching entries, patterns, or compositions from a user prompt. Meant to be a callable tool only.",inputSchema:vp.extend({entityType:Uo.enum(["composition","entry","componentPattern","compositionPattern","entryPattern"]).describe("The entity type we are creating a filter for")}),outputSchema:Jrt,runsAt:"server",timeout:10,callable:!0};import{z as Sit}from"zod";var yp=class extends Error{},WL=class extends yp{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},GL=class extends yp{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},YL=class extends yp{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},wc=class extends yp{},pC=class extends yp{constructor(e){super(`Invalid unit ${e}`)}},Ko=class extends yp{},Ec=class extends yp{constructor(){super("Zone is an abstract class")}};var ze="numeric",Tc="short",Pl="long",Hh={year:ze,month:ze,day:ze},eT={year:ze,month:Tc,day:ze},IZ={year:ze,month:Tc,day:ze,weekday:Tc},tT={year:ze,month:Pl,day:ze},nT={year:ze,month:Pl,day:ze,weekday:Pl},rT={hour:ze,minute:ze},oT={hour:ze,minute:ze,second:ze},iT={hour:ze,minute:ze,second:ze,timeZoneName:Tc},aT={hour:ze,minute:ze,second:ze,timeZoneName:Pl},sT={hour:ze,minute:ze,hourCycle:"h23"},lT={hour:ze,minute:ze,second:ze,hourCycle:"h23"},uT={hour:ze,minute:ze,second:ze,hourCycle:"h23",timeZoneName:Tc},cT={hour:ze,minute:ze,second:ze,hourCycle:"h23",timeZoneName:Pl},dT={year:ze,month:ze,day:ze,hour:ze,minute:ze},fT={year:ze,month:ze,day:ze,hour:ze,minute:ze,second:ze},pT={year:ze,month:Tc,day:ze,hour:ze,minute:ze},mT={year:ze,month:Tc,day:ze,hour:ze,minute:ze,second:ze},FZ={year:ze,month:Tc,day:ze,weekday:Tc,hour:ze,minute:ze},hT={year:ze,month:Pl,day:ze,hour:ze,minute:ze,timeZoneName:Tc},gT={year:ze,month:Pl,day:ze,hour:ze,minute:ze,second:ze,timeZoneName:Tc},vT={year:ze,month:Pl,day:ze,weekday:Pl,hour:ze,minute:ze,timeZoneName:Pl},yT={year:ze,month:Pl,day:ze,weekday:Pl,hour:ze,minute:ze,second:ze,timeZoneName:Pl};var ol=class{get type(){throw new Ec}get name(){throw new Ec}get ianaName(){return this.name}get isUniversal(){throw new Ec}offsetName(e,n){throw new Ec}formatOffset(e,n){throw new Ec}offset(e){throw new Ec}equals(e){throw new Ec}get isValid(){throw new Ec}};var BZ=null,jh=class t extends ol{static get instance(){return BZ===null&&(BZ=new t),BZ}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return qL(e,n,r)}formatOffset(e,n){return Uh(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}};var XL={};function Xrt(t){return XL[t]||(XL[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),XL[t]}var Qrt={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function eot(t,e){let n=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,i,a,l,c,d,f]=r;return[a,o,i,l,c,d,f]}function tot(t,e){let n=t.formatToParts(e),r=[];for(let o=0;o<n.length;o++){let{type:i,value:a}=n[o],l=Qrt[i];i==="era"?r[l]=a:Ot(l)||(r[l]=parseInt(a,10))}return r}var JL={},za=class t extends ol{static create(e){return JL[e]||(JL[e]=new t(e)),JL[e]}static resetCache(){JL={},XL={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=t.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return qL(e,n,r,this.name)}formatOffset(e,n){return Uh(this.offset(e),n)}offset(e){let n=new Date(e);if(isNaN(n))return NaN;let r=Xrt(this.name),[o,i,a,l,c,d,f]=r.formatToParts?tot(r,n):eot(r,n);l==="BC"&&(o=-Math.abs(o)+1);let h=mC({year:o,month:i,day:a,hour:c===24?0:c,minute:d,second:f,millisecond:0}),g=+n,y=g%1e3;return g-=y>=0?y:1e3+y,(h-g)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}};var Z4e={};function not(t,e={}){let n=JSON.stringify([t,e]),r=Z4e[n];return r||(r=new Intl.ListFormat(t,e),Z4e[n]=r),r}var zZ={};function VZ(t,e={}){let n=JSON.stringify([t,e]),r=zZ[n];return r||(r=new Intl.DateTimeFormat(t,e),zZ[n]=r),r}var HZ={};function rot(t,e={}){let n=JSON.stringify([t,e]),r=HZ[n];return r||(r=new Intl.NumberFormat(t,e),HZ[n]=r),r}var jZ={};function oot(t,e={}){let{base:n,...r}=e,o=JSON.stringify([t,r]),i=jZ[o];return i||(i=new Intl.RelativeTimeFormat(t,e),jZ[o]=i),i}var bT=null;function iot(){return bT||(bT=new Intl.DateTimeFormat().resolvedOptions().locale,bT)}var q4e={};function aot(t){let e=q4e[t];if(!e){let n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,q4e[t]=e}return e}function sot(t){let e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));let n=t.indexOf("-u-");if(n===-1)return[t];{let r,o;try{r=VZ(t).resolvedOptions(),o=t}catch{let c=t.substring(0,n);r=VZ(c).resolvedOptions(),o=c}let{numberingSystem:i,calendar:a}=r;return[o,i,a]}}function lot(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function uot(t){let e=[];for(let n=1;n<=12;n++){let r=gn.utc(2009,n,1);e.push(t(r))}return e}function cot(t){let e=[];for(let n=1;n<=7;n++){let r=gn.utc(2016,11,13+n);e.push(t(r))}return e}function QL(t,e,n,r){let o=t.listingMode();return o==="error"?null:o==="en"?n(e):r(e)}function dot(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}var UZ=class{constructor(e,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;let{padTo:o,floor:i,...a}=r;if(!n||Object.keys(a).length>0){let l={useGrouping:!1,...r};r.padTo>0&&(l.minimumIntegerDigits=r.padTo),this.inf=rot(e,l)}}format(e){if(this.inf){let n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{let n=this.floor?Math.floor(e):hC(e,3);return ho(n,this.padTo)}}},KZ=class{constructor(e,n,r){this.opts=r,this.originalZone=void 0;let o;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){let a=-1*(e.offset/60),l=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;e.offset!==0&&za.create(l).valid?(o=l,this.dt=e):(o="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,o=e.zone.name):(o="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);let i={...this.opts};i.timeZone=i.timeZone||o,this.dtf=VZ(n,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(n=>{if(n.type==="timeZoneName"){let r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},WZ=class{constructor(e,n,r){this.opts={style:"long",...r},!n&&eM()&&(this.rtf=oot(e,r))}format(e,n){return this.rtf?this.rtf.format(e,n):J4e(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}},fot={firstDay:1,minimalDays:4,weekend:[6,7]},Jn=class t{static fromOpts(e){return t.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,r,o,i=!1){let a=e||Vn.defaultLocale,l=a||(i?"en-US":iot()),c=n||Vn.defaultNumberingSystem,d=r||Vn.defaultOutputCalendar,f=xT(o)||Vn.defaultWeekSettings;return new t(l,c,d,f,a)}static resetCache(){bT=null,zZ={},HZ={},jZ={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:r,weekSettings:o}={}){return t.create(e,n,r,o)}constructor(e,n,r,o,i){let[a,l,c]=sot(e);this.locale=a,this.numberingSystem=n||l||null,this.outputCalendar=r||c||null,this.weekSettings=o,this.intl=lot(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=dot(this)),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:t.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,xT(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return QL(this,e,GZ,()=>{let r=n?{month:e,day:"numeric"}:{month:e},o=n?"format":"standalone";return this.monthsCache[o][e]||(this.monthsCache[o][e]=uot(i=>this.extract(i,r,"month"))),this.monthsCache[o][e]})}weekdays(e,n=!1){return QL(this,e,YZ,()=>{let r=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},o=n?"format":"standalone";return this.weekdaysCache[o][e]||(this.weekdaysCache[o][e]=cot(i=>this.extract(i,r,"weekday"))),this.weekdaysCache[o][e]})}meridiems(){return QL(this,void 0,()=>ZZ,()=>{if(!this.meridiemCache){let e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[gn.utc(2016,11,13,9),gn.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return QL(this,e,qZ,()=>{let n={era:e};return this.eraCache[e]||(this.eraCache[e]=[gn.utc(-40,1,1),gn.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[e]})}extract(e,n,r){let o=this.dtFormatter(e,n),i=o.formatToParts(),a=i.find(l=>l.type.toLowerCase()===r);return a?a.value:null}numberFormatter(e={}){return new UZ(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new KZ(e,this.intl,n)}relFormatter(e={}){return new WZ(this.intl,this.isEnglish(),e)}listFormatter(e={}){return not(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:tM()?aot(this.locale):fot}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}};var XZ=null,Hi=class t extends ol{static get utcInstance(){return XZ===null&&(XZ=new t(0)),XZ}static instance(e){return e===0?t.utcInstance:new t(e)}static parseSpecifier(e){if(e){let n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new t(f0(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Uh(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Uh(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return Uh(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}};var gC=class extends ol{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function _c(t,e){let n;if(Ot(t)||t===null)return e;if(t instanceof ol)return t;if(X4e(t)){let r=t.toLowerCase();return r==="default"?e:r==="local"||r==="system"?jh.instance:r==="utc"||r==="gmt"?Hi.utcInstance:Hi.parseSpecifier(r)||za.create(t)}else return Bd(t)?Hi.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new gC(t)}var Q4e=()=>Date.now(),e3e="system",t3e=null,n3e=null,r3e=null,o3e=60,i3e,a3e=null,Vn=class{static get now(){return Q4e}static set now(e){Q4e=e}static set defaultZone(e){e3e=e}static get defaultZone(){return _c(e3e,jh.instance)}static get defaultLocale(){return t3e}static set defaultLocale(e){t3e=e}static get defaultNumberingSystem(){return n3e}static set defaultNumberingSystem(e){n3e=e}static get defaultOutputCalendar(){return r3e}static set defaultOutputCalendar(e){r3e=e}static get defaultWeekSettings(){return a3e}static set defaultWeekSettings(e){a3e=xT(e)}static get twoDigitCutoffYear(){return o3e}static set twoDigitCutoffYear(e){o3e=e%100}static get throwOnInvalid(){return i3e}static set throwOnInvalid(e){i3e=e}static resetCaches(){Jn.resetCache(),za.resetCache()}};var ji=class{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}};var s3e=[0,31,59,90,120,151,181,212,243,273,304,334],l3e=[0,31,60,91,121,152,182,213,244,274,305,335];function Eu(t,e){return new ji("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function nM(t,e,n){let r=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);let o=r.getUTCDay();return o===0?7:o}function u3e(t,e,n){return n+(m0(t)?l3e:s3e)[e-1]}function c3e(t,e){let n=m0(t)?l3e:s3e,r=n.findIndex(i=>i<e),o=e-n[r];return{month:r+1,day:o}}function rM(t,e){return(t-e+7)%7+1}function CT(t,e=4,n=1){let{year:r,month:o,day:i}=t,a=u3e(r,o,i),l=rM(nM(r,o,i),n),c=Math.floor((a-l+14-e)/7),d;return c<1?(d=r-1,c=p0(d,e,n)):c>p0(r,e,n)?(d=r+1,c=1):d=r,{weekYear:d,weekNumber:c,weekday:l,...wT(t)}}function QZ(t,e=4,n=1){let{weekYear:r,weekNumber:o,weekday:i}=t,a=rM(nM(r,1,e),n),l=Kh(r),c=o*7+i-a-7+e,d;c<1?(d=r-1,c+=Kh(d)):c>l?(d=r+1,c-=Kh(r)):d=r;let{month:f,day:m}=c3e(d,c);return{year:d,month:f,day:m,...wT(t)}}function oM(t){let{year:e,month:n,day:r}=t,o=u3e(e,n,r);return{year:e,ordinal:o,...wT(t)}}function eq(t){let{year:e,ordinal:n}=t,{month:r,day:o}=c3e(e,n);return{year:e,month:r,day:o,...wT(t)}}function tq(t,e){if(!Ot(t.localWeekday)||!Ot(t.localWeekNumber)||!Ot(t.localWeekYear)){if(!Ot(t.weekday)||!Ot(t.weekNumber)||!Ot(t.weekYear))throw new wc("Cannot mix locale-based week fields with ISO-based week fields");return Ot(t.localWeekday)||(t.weekday=t.localWeekday),Ot(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),Ot(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function d3e(t,e=4,n=1){let r=ST(t.weekYear),o=Il(t.weekNumber,1,p0(t.weekYear,e,n)),i=Il(t.weekday,1,7);return r?o?i?!1:Eu("weekday",t.weekday):Eu("week",t.weekNumber):Eu("weekYear",t.weekYear)}function f3e(t){let e=ST(t.year),n=Il(t.ordinal,1,Kh(t.year));return e?n?!1:Eu("ordinal",t.ordinal):Eu("year",t.year)}function nq(t){let e=ST(t.year),n=Il(t.month,1,12),r=Il(t.day,1,vC(t.year,t.month));return e?n?r?!1:Eu("day",t.day):Eu("month",t.month):Eu("year",t.year)}function rq(t){let{hour:e,minute:n,second:r,millisecond:o}=t,i=Il(e,0,23)||e===24&&n===0&&r===0&&o===0,a=Il(n,0,59),l=Il(r,0,59),c=Il(o,0,999);return i?a?l?c?!1:Eu("millisecond",o):Eu("second",r):Eu("minute",n):Eu("hour",e)}function Ot(t){return typeof t>"u"}function Bd(t){return typeof t=="number"}function ST(t){return typeof t=="number"&&t%1===0}function X4e(t){return typeof t=="string"}function m3e(t){return Object.prototype.toString.call(t)==="[object Date]"}function eM(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function tM(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function h3e(t){return Array.isArray(t)?t:[t]}function oq(t,e,n){if(t.length!==0)return t.reduce((r,o)=>{let i=[e(o),o];return r&&n(r[0],i[0])===r[0]?r:i},null)[1]}function g3e(t,e){return e.reduce((n,r)=>(n[r]=t[r],n),{})}function Wh(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function xT(t){if(t==null)return null;if(typeof t!="object")throw new Ko("Week settings must be an object");if(!Il(t.firstDay,1,7)||!Il(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!Il(e,1,7)))throw new Ko("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function Il(t,e,n){return ST(t)&&t>=e&&t<=n}function pot(t,e){return t-e*Math.floor(t/e)}function ho(t,e=2){let n=t<0,r;return n?r="-"+(""+-t).padStart(e,"0"):r=(""+t).padStart(e,"0"),r}function bp(t){if(!(Ot(t)||t===null||t===""))return parseInt(t,10)}function Gh(t){if(!(Ot(t)||t===null||t===""))return parseFloat(t)}function ET(t){if(!(Ot(t)||t===null||t==="")){let e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function hC(t,e,n=!1){let r=10**e;return(n?Math.trunc:Math.round)(t*r)/r}function m0(t){return t%4===0&&(t%100!==0||t%400===0)}function Kh(t){return m0(t)?366:365}function vC(t,e){let n=pot(e-1,12)+1,r=t+(e-n)/12;return n===2?m0(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function mC(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function p3e(t,e,n){return-rM(nM(t,1,e),n)+e-1}function p0(t,e=4,n=1){let r=p3e(t,e,n),o=p3e(t+1,e,n);return(Kh(t)-r+o)/7}function TT(t){return t>99?t:t>Vn.twoDigitCutoffYear?1900+t:2e3+t}function qL(t,e,n,r=null){let o=new Date(t),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(i.timeZone=r);let a={timeZoneName:e,...i},l=new Intl.DateTimeFormat(n,a).formatToParts(o).find(c=>c.type.toLowerCase()==="timezonename");return l?l.value:null}function f0(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);let r=parseInt(e,10)||0,o=n<0||Object.is(n,-0)?-r:r;return n*60+o}function iq(t){let e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new Ko(`Invalid unit value ${t}`);return e}function yC(t,e){let n={};for(let r in t)if(Wh(t,r)){let o=t[r];if(o==null)continue;n[e(r)]=iq(o)}return n}function Uh(t,e){let n=Math.trunc(Math.abs(t/60)),r=Math.trunc(Math.abs(t%60)),o=t>=0?"+":"-";switch(e){case"short":return`${o}${ho(n,2)}:${ho(r,2)}`;case"narrow":return`${o}${n}${r>0?`:${r}`:""}`;case"techie":return`${o}${ho(n,2)}${ho(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function wT(t){return g3e(t,["hour","minute","second","millisecond"])}var mot=["January","February","March","April","May","June","July","August","September","October","November","December"],aq=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],hot=["J","F","M","A","M","J","J","A","S","O","N","D"];function GZ(t){switch(t){case"narrow":return[...hot];case"short":return[...aq];case"long":return[...mot];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var sq=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],lq=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],got=["M","T","W","T","F","S","S"];function YZ(t){switch(t){case"narrow":return[...got];case"short":return[...lq];case"long":return[...sq];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var ZZ=["AM","PM"],vot=["Before Christ","Anno Domini"],yot=["BC","AD"],bot=["B","A"];function qZ(t){switch(t){case"narrow":return[...bot];case"short":return[...yot];case"long":return[...vot];default:return null}}function v3e(t){return ZZ[t.hour<12?0:1]}function y3e(t,e){return YZ(e)[t.weekday-1]}function b3e(t,e){return GZ(e)[t.month-1]}function x3e(t,e){return qZ(e)[t.year<0?0:1]}function J4e(t,e,n="always",r=!1){let o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&i){let m=t==="days";switch(e){case 1:return m?"tomorrow":`next ${o[t][0]}`;case-1:return m?"yesterday":`last ${o[t][0]}`;case 0:return m?"today":`this ${o[t][0]}`;default:}}let a=Object.is(e,-0)||e<0,l=Math.abs(e),c=l===1,d=o[t],f=r?c?d[1]:d[2]||d[1]:c?o[t][0]:t;return a?`${l} ${f} ago`:`in ${l} ${f}`}function C3e(t,e){let n="";for(let r of t)r.literal?n+=r.val:n+=e(r.val);return n}var xot={D:Hh,DD:eT,DDD:tT,DDDD:nT,t:rT,tt:oT,ttt:iT,tttt:aT,T:sT,TT:lT,TTT:uT,TTTT:cT,f:dT,ff:pT,fff:hT,ffff:vT,F:fT,FF:mT,FFF:gT,FFFF:yT},Ui=class t{static create(e,n={}){return new t(e,n)}static parseFormat(e){let n=null,r="",o=!1,i=[];for(let a=0;a<e.length;a++){let l=e.charAt(a);l==="'"?(r.length>0&&i.push({literal:o||/^\s+$/.test(r),val:r}),n=null,r="",o=!o):o||l===n?r+=l:(r.length>0&&i.push({literal:/^\s+$/.test(r),val:r}),r=l,n=l)}return r.length>0&&i.push({literal:o||/^\s+$/.test(r),val:r}),i}static macroTokenToFormatOpts(e){return xot[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return ho(e,n);let r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,n){let r=this.loc.listingMode()==="en",o=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(g,y)=>this.loc.extract(e,g,y),a=g=>e.isOffsetFixed&&e.offset===0&&g.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,g.format):"",l=()=>r?v3e(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),c=(g,y)=>r?b3e(e,g):i(y?{month:g}:{month:g,day:"numeric"},"month"),d=(g,y)=>r?y3e(e,g):i(y?{weekday:g}:{weekday:g,month:"long",day:"numeric"},"weekday"),f=g=>{let y=t.macroTokenToFormatOpts(g);return y?this.formatWithSystemDefault(e,y):g},m=g=>r?x3e(e,g):i({era:g},"era"),h=g=>{switch(g){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return l();case"d":return o?i({day:"numeric"},"day"):this.num(e.day);case"dd":return o?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return d("short",!0);case"cccc":return d("long",!0);case"ccccc":return d("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return d("short",!1);case"EEEE":return d("long",!1);case"EEEEE":return d("narrow",!1);case"L":return o?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return o?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return o?i({month:"numeric"},"month"):this.num(e.month);case"MM":return o?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return o?i({year:"numeric"},"year"):this.num(e.year);case"yy":return o?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return o?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return o?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return m("short");case"GG":return m("long");case"GGGGG":return m("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(g)}};return C3e(t.parseFormat(n),h)}formatDurationFromString(e,n){let r=c=>{switch(c[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},o=c=>d=>{let f=r(d);return f?this.num(c.get(f),d.length):d},i=t.parseFormat(n),a=i.reduce((c,{literal:d,val:f})=>d?c:c.concat(f),[]),l=e.shiftTo(...a.map(r).filter(c=>c));return C3e(i,o(l))}};var w3e=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function xC(...t){let e=t.reduce((n,r)=>n+r.source,"");return RegExp(`^${e}$`)}function CC(...t){return e=>t.reduce(([n,r,o],i)=>{let[a,l,c]=i(e,o);return[{...n,...a},l||r,c]},[{},null,1]).slice(0,2)}function SC(t,...e){if(t==null)return[null,null];for(let[n,r]of e){let o=n.exec(t);if(o)return r(o)}return[null,null]}function E3e(...t){return(e,n)=>{let r={},o;for(o=0;o<t.length;o++)r[t[o]]=bp(e[n+o]);return[r,null,n+o]}}var T3e=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Cot=`(?:${T3e.source}?(?:\\[(${w3e.source})\\])?)?`,uq=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,_3e=RegExp(`${uq.source}${Cot}`),cq=RegExp(`(?:T${_3e.source})?`),Sot=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,wot=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Eot=/(\d{4})-?(\d{3})/,Tot=E3e("weekYear","weekNumber","weekDay"),_ot=E3e("year","ordinal"),Dot=/(\d{4})-(\d\d)-(\d\d)/,D3e=RegExp(`${uq.source} ?(?:${T3e.source}|(${w3e.source}))?`),$ot=RegExp(`(?: ${D3e.source})?`);function bC(t,e,n){let r=t[e];return Ot(r)?n:bp(r)}function Not(t,e){return[{year:bC(t,e),month:bC(t,e+1,1),day:bC(t,e+2,1)},null,e+3]}function wC(t,e){return[{hours:bC(t,e,0),minutes:bC(t,e+1,0),seconds:bC(t,e+2,0),milliseconds:ET(t[e+3])},null,e+4]}function _T(t,e){let n=!t[e]&&!t[e+1],r=f0(t[e+1],t[e+2]),o=n?null:Hi.instance(r);return[{},o,e+3]}function DT(t,e){let n=t[e]?za.create(t[e]):null;return[{},n,e+1]}var Lot=RegExp(`^T?${uq.source}$`),Mot=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Oot(t){let[e,n,r,o,i,a,l,c,d]=t,f=e[0]==="-",m=c&&c[0]==="-",h=(g,y=!1)=>g!==void 0&&(y||g&&f)?-g:g;return[{years:h(Gh(n)),months:h(Gh(r)),weeks:h(Gh(o)),days:h(Gh(i)),hours:h(Gh(a)),minutes:h(Gh(l)),seconds:h(Gh(c),c==="-0"),milliseconds:h(ET(d),m)}]}var Rot={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function dq(t,e,n,r,o,i,a){let l={year:e.length===2?TT(bp(e)):bp(e),month:aq.indexOf(n)+1,day:bp(r),hour:bp(o),minute:bp(i)};return a&&(l.second=bp(a)),t&&(l.weekday=t.length>3?sq.indexOf(t)+1:lq.indexOf(t)+1),l}var Aot=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function kot(t){let[,e,n,r,o,i,a,l,c,d,f,m]=t,h=dq(e,o,r,n,i,a,l),g;return c?g=Rot[c]:d?g=0:g=f0(f,m),[h,new Hi(g)]}function Pot(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var Iot=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Fot=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Bot=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function S3e(t){let[,e,n,r,o,i,a,l]=t;return[dq(e,o,r,n,i,a,l),Hi.utcInstance]}function zot(t){let[,e,n,r,o,i,a,l]=t;return[dq(e,l,n,r,o,i,a),Hi.utcInstance]}var Vot=xC(Sot,cq),Hot=xC(wot,cq),jot=xC(Eot,cq),Uot=xC(_3e),$3e=CC(Not,wC,_T,DT),Kot=CC(Tot,wC,_T,DT),Wot=CC(_ot,wC,_T,DT),Got=CC(wC,_T,DT);function N3e(t){return SC(t,[Vot,$3e],[Hot,Kot],[jot,Wot],[Uot,Got])}function L3e(t){return SC(Pot(t),[Aot,kot])}function M3e(t){return SC(t,[Iot,S3e],[Fot,S3e],[Bot,zot])}function O3e(t){return SC(t,[Mot,Oot])}var Yot=CC(wC);function R3e(t){return SC(t,[Lot,Yot])}var Zot=xC(Dot,$ot),qot=xC(D3e),Jot=CC(wC,_T,DT);function A3e(t){return SC(t,[Zot,$3e],[qot,Jot])}var k3e="Invalid Duration",I3e={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Xot={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...I3e},Tu=146097/400,EC=146097/4800,Qot={years:{quarters:4,months:12,weeks:Tu/7,days:Tu,hours:Tu*24,minutes:Tu*24*60,seconds:Tu*24*60*60,milliseconds:Tu*24*60*60*1e3},quarters:{months:3,weeks:Tu/28,days:Tu/4,hours:Tu*24/4,minutes:Tu*24*60/4,seconds:Tu*24*60*60/4,milliseconds:Tu*24*60*60*1e3/4},months:{weeks:EC/7,days:EC,hours:EC*24,minutes:EC*24*60,seconds:EC*24*60*60,milliseconds:EC*24*60*60*1e3},...I3e},h0=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],eit=h0.slice(0).reverse();function Yh(t,e,n=!1){let r={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new go(r)}function F3e(t,e){let n=e.milliseconds??0;for(let r of eit.slice(1))e[r]&&(n+=e[r]*t[r].milliseconds);return n}function P3e(t,e){let n=F3e(t,e)<0?-1:1;h0.reduceRight((r,o)=>{if(Ot(e[o]))return r;if(r){let i=e[r]*n,a=t[o][r],l=Math.floor(i/a);e[o]+=l*n,e[r]-=l*a*n}return o},null),h0.reduce((r,o)=>{if(Ot(e[o]))return r;if(r){let i=e[r]%1;e[r]-=i,e[o]+=i*t[r][o]}return o},null)}function tit(t){let e={};for(let[n,r]of Object.entries(t))r!==0&&(e[n]=r);return e}var go=class t{constructor(e){let n=e.conversionAccuracy==="longterm"||!1,r=n?Qot:Xot;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||Jn.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,n){return t.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new Ko(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new t({values:yC(e,t.normalizeUnit),loc:Jn.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(Bd(e))return t.fromMillis(e);if(t.isDuration(e))return e;if(typeof e=="object")return t.fromObject(e);throw new Ko(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){let[r]=O3e(e);return r?t.fromObject(r,n):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){let[r]=R3e(e);return r?t.fromObject(r,n):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new Ko("need to specify a reason the Duration is invalid");let r=e instanceof ji?e:new ji(e,n);if(Vn.throwOnInvalid)throw new YL(r);return new t({invalid:r})}static normalizeUnit(e){let n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new pC(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){let r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Ui.create(this.loc,r).formatDurationFromString(this,e):k3e}toHuman(e={}){if(!this.isValid)return k3e;let n=h0.map(r=>{let o=this.values[r];return Ot(o)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(o)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=hC(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;let n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},gn.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?F3e(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;let n=t.fromDurationLike(e),r={};for(let o of h0)(Wh(n.values,o)||Wh(this.values,o))&&(r[o]=n.get(o)+this.get(o));return Yh(this,{values:r},!0)}minus(e){if(!this.isValid)return this;let n=t.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;let n={};for(let r of Object.keys(this.values))n[r]=iq(e(this.values[r],r));return Yh(this,{values:n},!0)}get(e){return this[t.normalizeUnit(e)]}set(e){if(!this.isValid)return this;let n={...this.values,...yC(e,t.normalizeUnit)};return Yh(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:r,matrix:o}={}){let a={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:o,conversionAccuracy:r};return Yh(this,a)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return P3e(this.matrix,e),Yh(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=tit(this.normalize().shiftToAll().toObject());return Yh(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(a=>t.normalizeUnit(a));let n={},r={},o=this.toObject(),i;for(let a of h0)if(e.indexOf(a)>=0){i=a;let l=0;for(let d in r)l+=this.matrix[d][a]*r[d],r[d]=0;Bd(o[a])&&(l+=o[a]);let c=Math.trunc(l);n[a]=c,r[a]=(l*1e3-c*1e3)/1e3}else Bd(o[a])&&(r[a]=o[a]);for(let a in r)r[a]!==0&&(n[i]+=a===i?r[a]:r[a]/this.matrix[i][a]);return P3e(this.matrix,n),Yh(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let e={};for(let n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return Yh(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(r,o){return r===void 0||r===0?o===void 0||o===0:r===o}for(let r of h0)if(!n(this.values[r],e.values[r]))return!1;return!0}};var TC="Invalid Interval";function nit(t,e){return!t||!t.isValid?xp.invalid("missing or invalid start"):!e||!e.isValid?xp.invalid("missing or invalid end"):e<t?xp.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}var xp=class t{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,n=null){if(!e)throw new Ko("need to specify a reason the Interval is invalid");let r=e instanceof ji?e:new ji(e,n);if(Vn.throwOnInvalid)throw new GL(r);return new t({invalid:r})}static fromDateTimes(e,n){let r=_C(e),o=_C(n),i=nit(r,o);return i??new t({start:r,end:o})}static after(e,n){let r=go.fromDurationLike(n),o=_C(e);return t.fromDateTimes(o,o.plus(r))}static before(e,n){let r=go.fromDurationLike(n),o=_C(e);return t.fromDateTimes(o.minus(r),o)}static fromISO(e,n){let[r,o]=(e||"").split("/",2);if(r&&o){let i,a;try{i=gn.fromISO(r,n),a=i.isValid}catch{a=!1}let l,c;try{l=gn.fromISO(o,n),c=l.isValid}catch{c=!1}if(a&&c)return t.fromDateTimes(i,l);if(a){let d=go.fromISO(o,n);if(d.isValid)return t.after(i,d)}else if(c){let d=go.fromISO(r,n);if(d.isValid)return t.before(l,d)}}return t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",n){if(!this.isValid)return NaN;let r=this.start.startOf(e,n),o;return n?.useLocaleWeeks?o=this.end.reconfigure({locale:r.locale}):o=this.end,o=o.startOf(e,n),Math.floor(o.diff(r,e).get(e))+(o.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?t.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];let n=e.map(_C).filter(a=>this.contains(a)).sort((a,l)=>a.toMillis()-l.toMillis()),r=[],{s:o}=this,i=0;for(;o<this.e;){let a=n[i]||this.e,l=+a>+this.e?this.e:a;r.push(t.fromDateTimes(o,l)),o=l,i+=1}return r}splitBy(e){let n=go.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,o=1,i,a=[];for(;r<this.e;){let l=this.start.plus(n.mapUnits(c=>c*o));i=+l>+this.e?this.e:l,a.push(t.fromDateTimes(r,i)),r=i,o+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;let n=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return n>=r?null:t.fromDateTimes(n,r)}union(e){if(!this.isValid)return this;let n=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return t.fromDateTimes(n,r)}static merge(e){let[n,r]=e.sort((o,i)=>o.s-i.s).reduce(([o,i],a)=>i?i.overlaps(a)||i.abutsStart(a)?[o,i.union(a)]:[o.concat([i]),a]:[o,a],[[],null]);return r&&n.push(r),n}static xor(e){let n=null,r=0,o=[],i=e.map(c=>[{time:c.s,type:"s"},{time:c.e,type:"e"}]),a=Array.prototype.concat(...i),l=a.sort((c,d)=>c.time-d.time);for(let c of l)r+=c.type==="s"?1:-1,r===1?n=c.time:(n&&+n!=+c.time&&o.push(t.fromDateTimes(n,c.time)),n=null);return t.merge(o)}difference(...e){return t.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:TC}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=Hh,n={}){return this.isValid?Ui.create(this.s.loc.clone(n),e).formatInterval(this):TC}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:TC}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:TC}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:TC}toFormat(e,{separator:n=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:TC}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):go.invalid(this.invalidReason)}mapEndpoints(e){return t.fromDateTimes(e(this.s),e(this.e))}};var Cp=class{static hasDST(e=Vn.defaultZone){let n=gn.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return za.isValidZone(e)}static normalizeZone(e){return _c(e,Vn.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||Jn.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||Jn.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||Jn.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:r=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||Jn.create(n,r,i)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||Jn.create(n,r,i)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:r=null,locObj:o=null}={}){return(o||Jn.create(n,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:o=null}={}){return(o||Jn.create(n,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Jn.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return Jn.create(n,null,"gregory").eras(e)}static features(){return{relative:eM(),localeWeek:tM()}}};function B3e(t,e){let n=o=>o.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(e)-n(t);return Math.floor(go.fromMillis(r).as("days"))}function rit(t,e,n){let r=[["years",(c,d)=>d.year-c.year],["quarters",(c,d)=>d.quarter-c.quarter+(d.year-c.year)*4],["months",(c,d)=>d.month-c.month+(d.year-c.year)*12],["weeks",(c,d)=>{let f=B3e(c,d);return(f-f%7)/7}],["days",B3e]],o={},i=t,a,l;for(let[c,d]of r)n.indexOf(c)>=0&&(a=c,o[c]=d(t,e),l=i.plus(o),l>e?(o[c]--,t=i.plus(o),t>e&&(l=t,o[c]--,t=i.plus(o))):t=l);return[t,o,l,a]}function z3e(t,e,n,r){let[o,i,a,l]=rit(t,e,n),c=e-o,d=n.filter(m=>["hours","minutes","seconds","milliseconds"].indexOf(m)>=0);d.length===0&&(a<e&&(a=o.plus({[l]:1})),a!==o&&(i[l]=(i[l]||0)+c/(a-o)));let f=go.fromObject(i,r);return d.length>0?go.fromMillis(c,r).shiftTo(...d).plus(f):f}var fq={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},V3e={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},oit=fq.hanidec.replace(/[\[|\]]/g,"").split("");function H3e(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);if(t[n].search(fq.hanidec)!==-1)e+=oit.indexOf(t[n]);else for(let o in V3e){let[i,a]=V3e[o];r>=i&&r<=a&&(e+=r-i)}}return parseInt(e,10)}else return e}function _u({numberingSystem:t},e=""){return new RegExp(`${fq[t||"latn"]}${e}`)}var iit="missing Intl.DateTimeFormat.formatToParts support";function Hn(t,e=n=>n){return{regex:t,deser:([n])=>e(H3e(n))}}var ait="\xA0",K3e=`[ ${ait}]`,W3e=new RegExp(K3e,"g");function sit(t){return t.replace(/\./g,"\\.?").replace(W3e,K3e)}function j3e(t){return t.replace(/\./g,"").replace(W3e," ").toLowerCase()}function Dc(t,e){return t===null?null:{regex:RegExp(t.map(sit).join("|")),deser:([n])=>t.findIndex(r=>j3e(n)===j3e(r))+e}}function U3e(t,e){return{regex:t,deser:([,n,r])=>f0(n,r),groups:e}}function iM(t){return{regex:t,deser:([e])=>e}}function lit(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function uit(t,e){let n=_u(e),r=_u(e,"{2}"),o=_u(e,"{3}"),i=_u(e,"{4}"),a=_u(e,"{6}"),l=_u(e,"{1,2}"),c=_u(e,"{1,3}"),d=_u(e,"{1,6}"),f=_u(e,"{1,9}"),m=_u(e,"{2,4}"),h=_u(e,"{4,6}"),g=C=>({regex:RegExp(lit(C.val)),deser:([S])=>S,literal:!0}),b=(C=>{if(t.literal)return g(C);switch(C.val){case"G":return Dc(e.eras("short"),0);case"GG":return Dc(e.eras("long"),0);case"y":return Hn(d);case"yy":return Hn(m,TT);case"yyyy":return Hn(i);case"yyyyy":return Hn(h);case"yyyyyy":return Hn(a);case"M":return Hn(l);case"MM":return Hn(r);case"MMM":return Dc(e.months("short",!0),1);case"MMMM":return Dc(e.months("long",!0),1);case"L":return Hn(l);case"LL":return Hn(r);case"LLL":return Dc(e.months("short",!1),1);case"LLLL":return Dc(e.months("long",!1),1);case"d":return Hn(l);case"dd":return Hn(r);case"o":return Hn(c);case"ooo":return Hn(o);case"HH":return Hn(r);case"H":return Hn(l);case"hh":return Hn(r);case"h":return Hn(l);case"mm":return Hn(r);case"m":return Hn(l);case"q":return Hn(l);case"qq":return Hn(r);case"s":return Hn(l);case"ss":return Hn(r);case"S":return Hn(c);case"SSS":return Hn(o);case"u":return iM(f);case"uu":return iM(l);case"uuu":return Hn(n);case"a":return Dc(e.meridiems(),0);case"kkkk":return Hn(i);case"kk":return Hn(m,TT);case"W":return Hn(l);case"WW":return Hn(r);case"E":case"c":return Hn(n);case"EEE":return Dc(e.weekdays("short",!1),1);case"EEEE":return Dc(e.weekdays("long",!1),1);case"ccc":return Dc(e.weekdays("short",!0),1);case"cccc":return Dc(e.weekdays("long",!0),1);case"Z":case"ZZ":return U3e(new RegExp(`([+-]${l.source})(?::(${r.source}))?`),2);case"ZZZ":return U3e(new RegExp(`([+-]${l.source})(${r.source})?`),2);case"z":return iM(/[a-z_+-/]{1,256}?/i);case" ":return iM(/[^\S\n\r]/);default:return g(C)}})(t)||{invalidReason:iit};return b.token=t,b}var cit={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function dit(t,e,n){let{type:r,value:o}=t;if(r==="literal"){let c=/^\s+$/.test(o);return{literal:!c,val:c?" ":o}}let i=e[r],a=r;r==="hour"&&(e.hour12!=null?a=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?a="hour12":a="hour24":a=n.hour12?"hour12":"hour24");let l=cit[a];if(typeof l=="object"&&(l=l[i]),l)return{literal:!1,val:l}}function fit(t){return[`^${t.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,t]}function pit(t,e,n){let r=t.match(e);if(r){let o={},i=1;for(let a in n)if(Wh(n,a)){let l=n[a],c=l.groups?l.groups+1:1;!l.literal&&l.token&&(o[l.token.val[0]]=l.deser(r.slice(i,i+c))),i+=c}return[r,o]}else return[r,{}]}function mit(t){let e=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},n=null,r;return Ot(t.z)||(n=za.create(t.z)),Ot(t.Z)||(n||(n=new Hi(t.Z)),r=t.Z),Ot(t.q)||(t.M=(t.q-1)*3+1),Ot(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),Ot(t.u)||(t.S=ET(t.u)),[Object.keys(t).reduce((i,a)=>{let l=e(a);return l&&(i[l]=t[a]),i},{}),n,r]}var pq=null;function hit(){return pq||(pq=gn.fromMillis(1555555555555)),pq}function git(t,e){if(t.literal)return t;let n=Ui.macroTokenToFormatOpts(t.val),r=gq(n,e);return r==null||r.includes(void 0)?t:r}function mq(t,e){return Array.prototype.concat(...t.map(n=>git(n,e)))}function hq(t,e,n){let r=mq(Ui.parseFormat(n),t),o=r.map(a=>uit(a,t)),i=o.find(a=>a.invalidReason);if(i)return{input:e,tokens:r,invalidReason:i.invalidReason};{let[a,l]=fit(o),c=RegExp(a,"i"),[d,f]=pit(e,c,l),[m,h,g]=f?mit(f):[null,null,void 0];if(Wh(f,"a")&&Wh(f,"H"))throw new wc("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:r,regex:c,rawMatches:d,matches:f,result:m,zone:h,specificOffset:g}}}function G3e(t,e,n){let{result:r,zone:o,specificOffset:i,invalidReason:a}=hq(t,e,n);return[r,o,i,a]}function gq(t,e){if(!t)return null;let r=Ui.create(e,t).dtFormatter(hit()),o=r.formatToParts(),i=r.resolvedOptions();return o.map(a=>dit(a,t,i))}var vq="Invalid DateTime",Y3e=864e13;function aM(t){return new ji("unsupported zone",`the zone "${t.name}" is not supported`)}function yq(t){return t.weekData===null&&(t.weekData=CT(t.c)),t.weekData}function bq(t){return t.localWeekData===null&&(t.localWeekData=CT(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function g0(t,e){let n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new gn({...n,...e,old:n})}function twe(t,e,n){let r=t-e*60*1e3,o=n.offset(r);if(e===o)return[r,e];r-=(o-e)*60*1e3;let i=n.offset(r);return o===i?[r,o]:[t-Math.min(o,i)*60*1e3,Math.max(o,i)]}function sM(t,e){t+=e*60*1e3;let n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function uM(t,e,n){return twe(mC(t),e,n)}function Z3e(t,e){let n=t.o,r=t.c.year+Math.trunc(e.years),o=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,i={...t.c,year:r,month:o,day:Math.min(t.c.day,vC(r,o))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},a=go.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),l=mC(i),[c,d]=twe(l,n,t.zone);return a!==0&&(c+=a,d=t.zone.offset(c)),{ts:c,o:d}}function $T(t,e,n,r,o,i){let{setZone:a,zone:l}=n;if(t&&Object.keys(t).length!==0||e){let c=e||l,d=gn.fromObject(t,{...n,zone:c,specificOffset:i});return a?d:d.setZone(l)}else return gn.invalid(new ji("unparsable",`the input "${o}" can't be parsed as ${r}`))}function lM(t,e,n=!0){return t.isValid?Ui.create(Jn.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function xq(t,e){let n=t.c.year>9999||t.c.year<0,r="";return n&&t.c.year>=0&&(r+="+"),r+=ho(t.c.year,n?6:4),e?(r+="-",r+=ho(t.c.month),r+="-",r+=ho(t.c.day)):(r+=ho(t.c.month),r+=ho(t.c.day)),r}function q3e(t,e,n,r,o,i){let a=ho(t.c.hour);return e?(a+=":",a+=ho(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(a+=":")):a+=ho(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(a+=ho(t.c.second),(t.c.millisecond!==0||!r)&&(a+=".",a+=ho(t.c.millisecond,3))),o&&(t.isOffsetFixed&&t.offset===0&&!i?a+="Z":t.o<0?(a+="-",a+=ho(Math.trunc(-t.o/60)),a+=":",a+=ho(Math.trunc(-t.o%60))):(a+="+",a+=ho(Math.trunc(t.o/60)),a+=":",a+=ho(Math.trunc(t.o%60)))),i&&(a+="["+t.zone.ianaName+"]"),a}var nwe={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},vit={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},yit={ordinal:1,hour:0,minute:0,second:0,millisecond:0},rwe=["year","month","day","hour","minute","second","millisecond"],bit=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],xit=["year","ordinal","hour","minute","second","millisecond"];function Cit(t){let e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new pC(t);return e}function J3e(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Cit(t)}}function X3e(t,e){let n=_c(e.zone,Vn.defaultZone),r=Jn.fromObject(e),o=Vn.now(),i,a;if(Ot(t.year))i=o;else{for(let d of rwe)Ot(t[d])&&(t[d]=nwe[d]);let l=nq(t)||rq(t);if(l)return gn.invalid(l);let c=n.offset(o);[i,a]=uM(t,c,n)}return new gn({ts:i,zone:n,loc:r,o:a})}function Q3e(t,e,n){let r=Ot(n.round)?!0:n.round,o=(a,l)=>(a=hC(a,r||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(a,l)),i=a=>n.calendary?e.hasSame(t,a)?0:e.startOf(a).diff(t.startOf(a),a).get(a):e.diff(t,a).get(a);if(n.unit)return o(i(n.unit),n.unit);for(let a of n.units){let l=i(a);if(Math.abs(l)>=1)return o(l,a)}return o(t>e?-0:0,n.units[n.units.length-1])}function ewe(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}var gn=class t{constructor(e){let n=e.zone||Vn.defaultZone,r=e.invalid||(Number.isNaN(e.ts)?new ji("invalid input"):null)||(n.isValid?null:aM(n));this.ts=Ot(e.ts)?Vn.now():e.ts;let o=null,i=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[o,i]=[e.old.c,e.old.o];else{let l=n.offset(this.ts);o=sM(this.ts,l),r=Number.isNaN(o.year)?new ji("invalid input"):null,o=r?null:o,i=r?null:l}this._zone=n,this.loc=e.loc||Jn.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=o,this.o=i,this.isLuxonDateTime=!0}static now(){return new t({})}static local(){let[e,n]=ewe(arguments),[r,o,i,a,l,c,d]=n;return X3e({year:r,month:o,day:i,hour:a,minute:l,second:c,millisecond:d},e)}static utc(){let[e,n]=ewe(arguments),[r,o,i,a,l,c,d]=n;return e.zone=Hi.utcInstance,X3e({year:r,month:o,day:i,hour:a,minute:l,second:c,millisecond:d},e)}static fromJSDate(e,n={}){let r=m3e(e)?e.valueOf():NaN;if(Number.isNaN(r))return t.invalid("invalid input");let o=_c(n.zone,Vn.defaultZone);return o.isValid?new t({ts:r,zone:o,loc:Jn.fromObject(n)}):t.invalid(aM(o))}static fromMillis(e,n={}){if(Bd(e))return e<-Y3e||e>Y3e?t.invalid("Timestamp out of range"):new t({ts:e,zone:_c(n.zone,Vn.defaultZone),loc:Jn.fromObject(n)});throw new Ko(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(Bd(e))return new t({ts:e*1e3,zone:_c(n.zone,Vn.defaultZone),loc:Jn.fromObject(n)});throw new Ko("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};let r=_c(n.zone,Vn.defaultZone);if(!r.isValid)return t.invalid(aM(r));let o=Jn.fromObject(n),i=yC(e,J3e),{minDaysInFirstWeek:a,startOfWeek:l}=tq(i,o),c=Vn.now(),d=Ot(n.specificOffset)?r.offset(c):n.specificOffset,f=!Ot(i.ordinal),m=!Ot(i.year),h=!Ot(i.month)||!Ot(i.day),g=m||h,y=i.weekYear||i.weekNumber;if((g||f)&&y)throw new wc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&f)throw new wc("Can't mix ordinal dates with month/day");let b=y||i.weekday&&!g,C,S,w=sM(c,d);b?(C=bit,S=vit,w=CT(w,a,l)):f?(C=xit,S=yit,w=oM(w)):(C=rwe,S=nwe);let E=!1;for(let k of C){let F=i[k];Ot(F)?E?i[k]=S[k]:i[k]=w[k]:E=!0}let _=b?d3e(i,a,l):f?f3e(i):nq(i),N=_||rq(i);if(N)return t.invalid(N);let $=b?QZ(i,a,l):f?eq(i):i,[O,M]=uM($,d,r),A=new t({ts:O,zone:r,o:M,loc:o});return i.weekday&&g&&e.weekday!==A.weekday?t.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${A.toISO()}`):A}static fromISO(e,n={}){let[r,o]=N3e(e);return $T(r,o,n,"ISO 8601",e)}static fromRFC2822(e,n={}){let[r,o]=L3e(e);return $T(r,o,n,"RFC 2822",e)}static fromHTTP(e,n={}){let[r,o]=M3e(e);return $T(r,o,n,"HTTP",n)}static fromFormat(e,n,r={}){if(Ot(e)||Ot(n))throw new Ko("fromFormat requires an input string and a format");let{locale:o=null,numberingSystem:i=null}=r,a=Jn.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0}),[l,c,d,f]=G3e(a,e,n);return f?t.invalid(f):$T(l,c,r,`format ${n}`,e,d)}static fromString(e,n,r={}){return t.fromFormat(e,n,r)}static fromSQL(e,n={}){let[r,o]=A3e(e);return $T(r,o,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new Ko("need to specify a reason the DateTime is invalid");let r=e instanceof ji?e:new ji(e,n);if(Vn.throwOnInvalid)throw new WL(r);return new t({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){let r=gq(e,Jn.fromObject(n));return r?r.map(o=>o?o.val:null).join(""):null}static expandFormat(e,n={}){return mq(Ui.parseFormat(e),Jn.fromObject(n)).map(o=>o.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?yq(this).weekYear:NaN}get weekNumber(){return this.isValid?yq(this).weekNumber:NaN}get weekday(){return this.isValid?yq(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?bq(this).weekday:NaN}get localWeekNumber(){return this.isValid?bq(this).weekNumber:NaN}get localWeekYear(){return this.isValid?bq(this).weekYear:NaN}get ordinal(){return this.isValid?oM(this.c).ordinal:NaN}get monthShort(){return this.isValid?Cp.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Cp.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Cp.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Cp.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=864e5,n=6e4,r=mC(this.c),o=this.zone.offset(r-e),i=this.zone.offset(r+e),a=this.zone.offset(r-o*n),l=this.zone.offset(r-i*n);if(a===l)return[this];let c=r-a*n,d=r-l*n,f=sM(c,a),m=sM(d,l);return f.hour===m.hour&&f.minute===m.minute&&f.second===m.second&&f.millisecond===m.millisecond?[g0(this,{ts:c}),g0(this,{ts:d})]:[this]}get isInLeapYear(){return m0(this.year)}get daysInMonth(){return vC(this.year,this.month)}get daysInYear(){return this.isValid?Kh(this.year):NaN}get weeksInWeekYear(){return this.isValid?p0(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?p0(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:n,numberingSystem:r,calendar:o}=Ui.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:o}}toUTC(e=0,n={}){return this.setZone(Hi.instance(e),n)}toLocal(){return this.setZone(Vn.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(e=_c(e,Vn.defaultZone),e.equals(this.zone))return this;if(e.isValid){let o=this.ts;if(n||r){let i=e.offset(this.ts),a=this.toObject();[o]=uM(a,i,e)}return g0(this,{ts:o,zone:e})}else return t.invalid(aM(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:r}={}){let o=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:r});return g0(this,{loc:o})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let n=yC(e,J3e),{minDaysInFirstWeek:r,startOfWeek:o}=tq(n,this.loc),i=!Ot(n.weekYear)||!Ot(n.weekNumber)||!Ot(n.weekday),a=!Ot(n.ordinal),l=!Ot(n.year),c=!Ot(n.month)||!Ot(n.day),d=l||c,f=n.weekYear||n.weekNumber;if((d||a)&&f)throw new wc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&a)throw new wc("Can't mix ordinal dates with month/day");let m;i?m=QZ({...CT(this.c,r,o),...n},r,o):Ot(n.ordinal)?(m={...this.toObject(),...n},Ot(n.day)&&(m.day=Math.min(vC(m.year,m.month),m.day))):m=eq({...oM(this.c),...n});let[h,g]=uM(m,this.o,this.zone);return g0(this,{ts:h,o:g})}plus(e){if(!this.isValid)return this;let n=go.fromDurationLike(e);return g0(this,Z3e(this,n))}minus(e){if(!this.isValid)return this;let n=go.fromDurationLike(e).negate();return g0(this,Z3e(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;let r={},o=go.normalizeUnit(e);switch(o){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break;case"milliseconds":break}if(o==="weeks")if(n){let i=this.loc.getStartOfWeek(),{weekday:a}=this;a<i&&(r.weekNumber=this.weekNumber-1),r.weekday=i}else r.weekday=1;if(o==="quarters"){let i=Math.ceil(this.month/3);r.month=(i-1)*3+1}return this.set(r)}endOf(e,n){return this.isValid?this.plus({[e]:1}).startOf(e,n).minus(1):this}toFormat(e,n={}){return this.isValid?Ui.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):vq}toLocaleString(e=Hh,n={}){return this.isValid?Ui.create(this.loc.clone(n),e).formatDateTime(this):vq}toLocaleParts(e={}){return this.isValid?Ui.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:o=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;let a=e==="extended",l=xq(this,a);return l+="T",l+=q3e(this,a,n,r,o,i),l}toISODate({format:e="extended"}={}){return this.isValid?xq(this,e==="extended"):null}toISOWeekDate(){return lM(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:o=!1,extendedZone:i=!1,format:a="extended"}={}){return this.isValid?(o?"T":"")+q3e(this,a==="extended",n,e,r,i):null}toRFC2822(){return lM(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return lM(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?xq(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let o="HH:mm:ss.SSS";return(n||e)&&(r&&(o+=" "),n?o+="z":e&&(o+="ZZ")),lM(this,o,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():vq}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",r={}){if(!this.isValid||!e.isValid)return go.invalid("created by diffing an invalid DateTime");let o={locale:this.locale,numberingSystem:this.numberingSystem,...r},i=h3e(n).map(go.normalizeUnit),a=e.valueOf()>this.valueOf(),l=a?this:e,c=a?e:this,d=z3e(l,c,i,o);return a?d.negate():d}diffNow(e="milliseconds",n={}){return this.diff(t.now(),e,n)}until(e){return this.isValid?xp.fromDateTimes(this,e):this}hasSame(e,n,r){if(!this.isValid)return!1;let o=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(n,r)<=o&&o<=i.endOf(n,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;let n=e.base||t.fromObject({},{zone:this.zone}),r=e.padding?this<n?-e.padding:e.padding:0,o=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(o=e.unit,i=void 0),Q3e(n,this.plus(r),{...e,numeric:"always",units:o,unit:i})}toRelativeCalendar(e={}){return this.isValid?Q3e(e.base||t.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(t.isDateTime))throw new Ko("min requires all arguments be DateTimes");return oq(e,n=>n.valueOf(),Math.min)}static max(...e){if(!e.every(t.isDateTime))throw new Ko("max requires all arguments be DateTimes");return oq(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,r={}){let{locale:o=null,numberingSystem:i=null}=r,a=Jn.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});return hq(a,e,n)}static fromStringExplain(e,n,r={}){return t.fromFormatExplain(e,n,r)}static get DATE_SHORT(){return Hh}static get DATE_MED(){return eT}static get DATE_MED_WITH_WEEKDAY(){return IZ}static get DATE_FULL(){return tT}static get DATE_HUGE(){return nT}static get TIME_SIMPLE(){return rT}static get TIME_WITH_SECONDS(){return oT}static get TIME_WITH_SHORT_OFFSET(){return iT}static get TIME_WITH_LONG_OFFSET(){return aT}static get TIME_24_SIMPLE(){return sT}static get TIME_24_WITH_SECONDS(){return lT}static get TIME_24_WITH_SHORT_OFFSET(){return uT}static get TIME_24_WITH_LONG_OFFSET(){return cT}static get DATETIME_SHORT(){return dT}static get DATETIME_SHORT_WITH_SECONDS(){return fT}static get DATETIME_MED(){return pT}static get DATETIME_MED_WITH_SECONDS(){return mT}static get DATETIME_MED_WITH_WEEKDAY(){return FZ}static get DATETIME_FULL(){return hT}static get DATETIME_FULL_WITH_SECONDS(){return gT}static get DATETIME_HUGE(){return vT}static get DATETIME_HUGE_WITH_SECONDS(){return yT}};function _C(t){if(gn.isDateTime(t))return t;if(t&&t.valueOf&&Bd(t.valueOf()))return gn.fromJSDate(t);if(t&&typeof t=="object")return gn.fromObject(t);throw new Ko(`Unknown datetime argument: ${t}, of type ${typeof t}`)}function cM(t){return t.reduce((e,{field:n,operator:r,value:o})=>{if(!n||!r)return e;if(n==="updated_at"&&(n="modified"),n==="created_at"&&(n="created"),r==="def")return{...e,[`${n}[def]`]:"true"};if(r==="ndef")return{...e,[`${n}[def]`]:"false"};if(r==="checked")return{...e,[`${n}[eq]`]:"true"};if(r==="nchecked")return{...e,[`${n}[eq]`]:"false"};if(typeof o>"u"||o===null||o===""||Array.isArray(o)&&o.length<1)return e;if(r==="between"||r==="sys-date-between")if(Array.isArray(o)&&o.length===2){if(r==="between")return{...e,[`${n}[gte]`]:o[0],[`${n}[lte]`]:o[1]};{let i=gn.fromISO(o[0],{zone:"system"}).setZone("utc").toISO(),a=gn.fromISO(o[1],{zone:"system"}).plus({day:1}).setZone("utc").toISO();return i&&a?{...e,[`${n}[gte]`]:i,[`${n}[lt]`]:a}:e}}else return e;if(r==="sys-date-eq")if(typeof o=="string"){let i=gn.fromISO(o,{zone:"system"}).setZone("utc").toISO(),a=gn.fromISO(o,{zone:"system"}).plus({day:1}).setZone("utc").toISO();return i&&a?{...e,[`${n}[gte]`]:i,[`${n}[lt]`]:a}:e}else return e;if(r==="sys-date-gt")if(typeof o=="string"){let i=gn.fromISO(o,{zone:"system"}).plus({day:1}).setZone("utc").toISO();return i?{...e,[`${n}[gte]`]:i}:e}else return e;if(r==="sys-date-gte")if(typeof o=="string"){let i=gn.fromISO(o,{zone:"system"}).setZone("utc").toISO();return i?{...e,[`${n}[gte]`]:i}:e}else return e;if(r==="sys-date-lt")if(typeof o=="string"){let i=gn.fromISO(o,{zone:"system"}).setZone("utc").toISO();return i?{...e,[`${n}[lt]`]:i}:e}else return e;if(r==="sys-date-lte")if(typeof o=="string"){let i=gn.fromISO(o,{zone:"system"}).plus({day:1}).setZone("utc").toISO();return i?{...e,[`${n}[lt]`]:i}:e}else return e;if(r==="starts"&&typeof o=="string")return{...e,[`${n}[starts]`]:o.replaceAll(/[^a-zA-Z0-9_.\s-]/g,"").toLowerCase()};if(n==="workflowStageId"){let i=t.some(a=>a.field==="workflowId");if(r==="eq"||r==="neq"){let a=[];return Array.isArray(o)?a=o.map(c=>c.split("_")[1]):a=o.split("_"),{...e,...i?{}:{"workflowId[eq]":a[0]},[`${n}[${r}]`]:a[1]}}if(Array.isArray(o)){let a=o.map(d=>{let f=d.split("_")[0],m=d.split("_")[1];return{workflowId:f,workflowStage:m}}),l=a.map(d=>d.workflowId).join(","),c=a.map(d=>d.workflowStage).join(",");return{...e,...i?{}:{[`workflowId[${r}]`]:l},[`${n}[${r}]`]:c}}}return{...e,[`${n}[${r}]`]:Array.isArray(o)?o.join(","):o}},{})}import{CANVAS_DRAFT_STATE as owe,CanvasClient as iwe}from"@uniformdev/canvas";async function dM({instanceType:t,searchExpressionPrompt:e,username:n,locale:r,getEditUrl:o}){let i=new iwe(pt),a=await KL({searchExpressionPrompt:e,username:n,locale:r},t),{limit:l,offset:c,keyword:d,sort:f,filter:m}=a,g=(await i.getCompositionList({patternType:t==="composition"?void 0:t==="componentPattern"?"component":"composition",pattern:t!=="composition",resolveData:!1,withComponentIDs:!0,skipOverridesResolution:!0,limit:l,offset:c,search:d,filters:m?cM(m):void 0,orderBy:Array.isArray(f)?f:f?[f]:void 0,locale:r,skipPatternResolution:!0,state:owe})).compositions.map(y=>({id:y.composition._id,name:y.composition._name,componentType:y.composition.type,editUrl:o(y.composition._id)}));return{content:[{type:"text",text:JSON.stringify({results:g,criteria:a},null,2)}]}}async function fM({id:t}){let n=await new iwe(pt).getCompositionById({skipDataResolution:!0,withComponentIDs:!0,skipOverridesResolution:!0,skipPatternResolution:!1,compositionId:t,state:owe});return{content:[{type:"text",text:JSON.stringify(n,null,2)}]}}var wit={id:Sit.string()};function awe(t){t.tool("compositionList","Lists available Uniform compositions",vp.shape,async e=>await dM({...e,instanceType:"composition",getEditUrl:UL})),t.tool("compositionGet","Gets the full contents of a Uniform composition",wit,async e=>await fM(e))}import{ContentClient as Eit}from"@uniformdev/canvas";import{z as uwe}from"zod";import{z as NT}from"zod";var swe=NT.object({name:NT.string().describe('Title-cased display name of the component. Ex: "Hero"'),id:NT.string().describe("Public ID of the content type, the camelCase version of name, using only alphanumeric characters"),description:NT.string().describe("Describe the purpose of the content type in 1-2 sentences."),fields:NT.array(U_).describe("The fields of the content type. The key is the publicId of the field.").optional()});function lwe(t){let e=t.fields?.find(r=>r.type==="asset"&&typeof r.typeConfig=="object"&&r.typeConfig!==null&&"allowedTypes"in r.typeConfig&&Array.isArray(r.typeConfig.allowedTypes)&&r.typeConfig.allowedTypes?.includes("image"))?.id,n=t.fields?.find(r=>r.type==="text")?.id;return{...t,thumbnailField:e,entryName:n}}function pM(t){return`${pt.baseWebUrl}/dashboards/canvas/content-types/${t}`}var Tit={action:uwe.enum(["create","update","delete"]).describe("The action to perform"),publicId:uwe.string().describe("Public ID of the component, the camelCase version of name, using only alphanumeric characters"),contentType:swe.describe("Full content type definition to create. Omit for update or delete.").optional(),patches:H_.describe("JSON patch to apply to the existing component definition. Omit for create or delete.").optional()};function cwe(t){t.tool("contentTypeAction","Creates, updates, or deletes a Uniform Content Type definition",Tit,async({publicId:e,action:n,contentType:r,patches:o})=>{let i=new Eit(pt),a=!1;if(n==="create"){if(!r)throw new Error("Content type definition is required for create");let l=lwe(r);l.fields&&(a=Sy(l.fields),wy(l.fields)),await i.upsertContentType({contentType:l})}if(n==="update"){if(!o)throw new Error("Patches are required for update");let c=(await i.getContentTypes()).contentTypes.find(m=>m.id===e);if(!c)throw new Error(`Content Type with public ID ${e} does not exist, try creating it instead`);let d=c.fields?.filter(m=>m.type==="richText").map(m=>m.id),f=V_(c,o);if(f.fields){a=Sy(f.fields);let m=f.fields?.filter(h=>h.type==="richText").map(h=>h.id).filter(h=>!d?.includes(h));wy(f.fields,m)}await i.upsertContentType({contentType:f})}return n==="delete"&&await i.deleteContentType({contentTypeId:e}),{content:[{type:"text",text:JSON.stringify({success:!0,editUrl:pM(e),warning:a?"Issues with field group order were fixed. Ensure definition data is re-fetched before any future updates.":void 0},null,2)}]}})}import{ContentClient as dwe}from"@uniformdev/canvas";import{z as _it}from"zod";var Dit={id:_it.string()};function fwe(t){t.tool("contentTypeList","Lists all Uniform Content Type definitions",async()=>{let r=(await new dwe(pt).getContentTypes()).contentTypes.map(o=>({id:o.id,name:o.name,description:o.description,editUrl:pM(o.id)}));return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}),t.tool("contentTypeGet","Gets a Uniform Content Type definition details (fields, etc.)",Dit,async({id:e})=>{let o=(await new dwe(pt).getContentTypes()).contentTypes.find(i=>i.id===e);if(!o)throw new Error(`Content Type with ID ${e} not found`);return{content:[{type:"text",text:JSON.stringify(o,null,2)}]}})}function pwe(t){t.tool("createUuid","Creates a new random UUID",async()=>({content:[{type:"text",text:crypto.randomUUID()}]}))}import{z as Sq}from"zod";import{CANVAS_DRAFT_STATE as Cq,ContentClient as $it,convertEntryToPutEntry as Nit,getEffectivePropertyValue as Lit}from"@uniformdev/canvas";async function Mit(t,e,n){let o=(await e.fetchDefinitions())[t.entry.type];if(!o)throw new Error("insanity");let i=w4e(o),a;i.entryName&&(a=t.entry._overrides?.[t.entry._id].parameters?.[i.entryName]??t.entry.fields?.[i.entryName]);let l=Lit({conditionIndex:-1,locale:void 0,greedyLocaleMatching:!0,property:a}),c=s4e({value:l,isNew:n,contentType:i});t.entry._name=c}async function mM({action:t,id:e,instructions:n,isPattern:r,patternId:o,getEditUrl:i}){let a=new $it(pt),l,c,d=t==="update"?e:void 0,f={success:!0,actionsTaken:[]};if(t==="create"){if(!n)throw new Error("Instructions are required for create");if(!n.type)throw new Error("Type is required for create");o?(await a.upsertEntry({state:Cq,entry:{type:n.type,_id:e,fields:{},_pattern:o}}),d=e):l=new Vh({_id:e,_name:"New Entry",type:n.type,_overridability:{hideLockedParameters:!0}})}if(d){if(c=(await a.getEntries({entryIDs:[e],pattern:r,state:Cq,skipDataResolution:!0,skipPatternResolution:!1,withComponentIDs:!0,skipOverridesResolution:!0})).entries[0],!c)throw new Error("Entry not found");let m=FL(c);l=new Vh(m.composition)}if(t==="delete"&&await a.deleteEntry({entryId:e}),l){await HL(n?.localeUpdates?.enableLocales);let m=G4e();f=await LL({twee:l,descriptionUpdate:void 0,slugUpdate:n&&"slug"in n?n.slug:void 0,nameUpdate:n&&"name"in n?n.name:void 0,propertyUpdates:n?.fieldUpdates??[],slotUpdates:{},localeUpdates:n?.localeUpdates,currentEditorLocale:void 0,referenceData:m});let h=l.exportTree(),g=l.exportMetadata(),y=Nit(E4e(h,c??{projectId:pt.projectId,pattern:r},g,Cq,c?.releaseId,c?.editionId));r||await Mit(y,m,t==="create"),await a.upsertEntry(y)}return{content:[{type:"text",text:JSON.stringify({...f,editUrl:i(e)},null,2)}]}}function hM(t){return`${pt.baseWebUrl}/dashboards/canvas/entries/${t}`}var Oit={action:Sq.enum(["create","update","delete"]).describe("The action to perform"),id:Sq.string().uuid().describe("UUID of the entry to create, update, or delete"),patternId:Sq.string().uuid().describe("Entry pattern ID to create the entry from. Omit when not creating, or when creating an entry without an entry pattern.").optional(),instructions:Kte.describe("Modification instructions for the entry. Omit for delete.").optional()};function mwe(t){t.tool("entryAction","Creates, updates, or deletes a Uniform Entry",Oit,async e=>await mM({...e,isPattern:!1,getEditUrl:hM,patternId:e.patternId}))}import{z as Rit}from"zod";import{CANVAS_DRAFT_STATE as hwe,ContentClient as gwe}from"@uniformdev/canvas";async function gM({isPattern:t,searchExpressionPrompt:e,username:n,locale:r,getEditUrl:o}){let i=new gwe(pt),a=await KL({searchExpressionPrompt:e,username:n,locale:r},t?"entryPattern":"entry"),{limit:l,offset:c,keyword:d,sort:f,filter:m}=a,g=(await i.getEntries({limit:l,offset:c,pattern:t,skipDataResolution:!0,withTotalCount:!0,skipPatternResolution:!0,skipOverridesResolution:!0,state:hwe,search:d,filters:m?cM(m):void 0,orderBy:Array.isArray(f)?f:f?[f]:void 0,locale:r})).entries.map(y=>({id:y.entry._id,name:y.entry._name??"",contentType:y.entry.type,editUrl:o(y.entry._id)}));return{content:[{type:"text",text:JSON.stringify({results:g,criteria:a},null,2)}]}}async function vM({id:t,isPattern:e}){let r=await new gwe(pt).getEntries({skipDataResolution:!0,withComponentIDs:!0,skipOverridesResolution:!0,skipPatternResolution:!1,pattern:e,entryIDs:[t],state:hwe});if(r.entries.length===0)throw new Error(`Entry with ID ${t} not found`);return{content:[{type:"text",text:JSON.stringify(r.entries[0],null,2)}]}}var Ait={id:Rit.string()};function vwe(t){t.tool("entryList","Lists available Uniform entries",vp.shape,async e=>await gM({...e,isPattern:!1,getEditUrl:hM})),t.tool("entryGet","Gets the full contents of a Uniform entry",Ait,async e=>await vM({...e,isPattern:!1}))}import{z as ywe}from"zod";function yM(t){return`${pt.baseWebUrl}/dashboards/canvas/entry-patterns/${t}`}var kit={action:ywe.enum(["create","update","delete"]).describe("The action to perform"),id:ywe.string().uuid().describe("UUID of the entry pattern to create, update, or delete"),instructions:Wte.describe("Modification instructions for the entry pattern. Omit for delete.").optional()};function bwe(t){t.tool("entryPatternAction","Creates, updates, or deletes a Uniform Entry Pattern",kit,async e=>await mM({...e,isPattern:!0,getEditUrl:yM,patternId:void 0}))}import{z as Pit}from"zod";var Iit={id:Pit.string()};function xwe(t){t.tool("entryPatternList","Lists available Uniform entry patterns",vp.shape,async e=>await gM({...e,isPattern:!0,getEditUrl:yM})),t.tool("entryPatternGet","Gets the full contents of a Uniform entry pattern",Iit,async e=>await vM({...e,isPattern:!0}))}import{ProjectClient as Fit}from"@uniformdev/canvas";async function Bit(){let t=await fetch(`${pt.apiHost}/api/v1/member-profile`,{headers:{"x-api-key":pt.apiKey,"Content-Type":"application/json"}});if(!t.ok)throw new Error(`Failed to fetch user profile: ${t.status} ${t.statusText}`);return(await t.json()).name}function Cwe(t){t.tool("getUniformEnvironment","Get the connected Uniform Project name, edit URL, and current user",{},async()=>{try{let e=new Fit(pt),[n,r]=await Promise.all([e.get({projectId:pt.projectId}),Bit()]),o={projectName:n.name,teamName:n.teamName,projectUrl:pt.baseWebUrl,currentIdentity:r};return{content:[{type:"text",text:JSON.stringify(o,null,2)}]}}catch(e){return{content:[{type:"text",text:JSON.stringify({error:"Failed to fetch project information",details:e instanceof Error?e.message:"Unknown error"},null,2)}]}}})}import{LocaleClient as zit}from"@uniformdev/canvas";function Swe(t){t.tool("localeList","Lists all registered Uniform locales",async()=>{let n=await new zit(pt).get();return{content:[{type:"text",text:JSON.stringify({locales:n.results,editUrl:`${pt.baseWebUrl}/settings/localization`},null,2)}]}})}import{z as wwe}from"zod";function bM(t){return`${pt.baseWebUrl}/dashboards/canvas/edit/${t}`}var Vit={action:wwe.enum(["create","update","delete"]).describe("The action to perform"),id:wwe.string().uuid().describe("UUID of the pattern instance to create, update, or delete"),instructions:jte.describe("Modification instructions for the pattern. Omit for delete.").optional()};function Ewe(t){t.tool("patternAction","Creates, updates, or deletes a Uniform Component Pattern or Composition Pattern",Vit,async e=>await jL({...e,isPattern:!0,getEditUrl:bM,patternId:void 0}))}import{z as Twe}from"zod";var Hit={instanceType:Twe.enum(["componentPattern","compositionPattern"]),...vp.shape},jit={id:Twe.string()};function _we(t){t.tool("patternList","Lists available Uniform component patterns or composition patterns",Hit,async e=>await dM({...e,getEditUrl:bM})),t.tool("patternGet","Gets the full contents of a Uniform component pattern or composition pattern",jit,async e=>await fM(e))}var Va=new Uit({name:"Uniform MCP",version:"1.0.0"});zte(Va);Hte(Va);cwe(Va);fwe(Va);mwe(Va);vwe(Va);xwe(Va);bwe(Va);_we(Va);Ewe(Va);Y4e(Va);awe(Va);pwe(Va);Cwe(Va);Swe(Va);var Wit=new Kit;await Va.connect(Wit);process.stderr.write(`Uniform MCP server started
5185
5181
  `);
5186
5182
  /*! Bundled license information:
5187
5183