@cimulate/copilot-widget 1.30.1 → 1.30.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,7 +34,7 @@ Error generating stack: `+T.message+`
34
34
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
35
35
  `}),n}function wE(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function SE(e,t){const n=NO(e,t),r=n.one(e,void 0),s=yO(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:`
36
36
  `},s),a}function RO(e,t){return e&&"run"in e?function(n,r){return Ue(this,null,function*(){const s=SE(n,H({file:r},t));yield e.run(s,r)})}:function(n,r){return SE(n,H({file:r},e||t))}}function vE(e){if(e)throw e}var Bf,AE;function LO(){if(AE)return Bf;AE=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!m)return!1;var b;for(b in f);return typeof b=="undefined"||e.call(f,b)},u=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},c=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return Bf=function d(){var f,p,m,b,y,x,A=arguments[0],v=1,w=arguments.length,N=!1;for(typeof A=="boolean"&&(N=A,A=arguments[1]||{},v=2),(A==null||typeof A!="object"&&typeof A!="function")&&(A={});v<w;++v)if(f=arguments[v],f!=null)for(p in f)m=c(A,p),b=c(f,p),A!==b&&(N&&b&&(a(b)||(y=s(b)))?(y?(y=!1,x=m&&s(m)?m:[]):x=m&&a(m)?m:{},u(A,{name:p,newValue:d(N,x,b)})):typeof b!="undefined"&&u(A,{name:p,newValue:b}));return A},Bf}var DO=LO();const Uf=Je(DO);function Hf(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function MO(){const e=[],t={run:n,use:r};return t;function n(...s){let a=-1;const u=s.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);c(null,...s);function c(d,...f){const p=e[++a];let m=-1;if(d){u(d);return}for(;++m<s.length;)(f[m]===null||f[m]===void 0)&&(f[m]=s[m]);s=f,p?FO(p,c)(...f):u(null,...f)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function FO(e,t){let n;return r;function r(...u){const c=e.length>u.length;let d;c&&u.push(s);try{d=e.apply(this,u)}catch(f){const p=f;if(c&&n)throw p;return s(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(a,s):d instanceof Error?s(d):a(d))}function s(u,...c){n||(n=!0,t(u,...c))}function a(u){s(null,u)}}const xr={basename:BO,dirname:UO,extname:HO,join:jO,sep:"/"};function BO(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');pa(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let u=-1,c=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else u<0&&(a=!0,u=s+1),c>-1&&(e.codePointAt(s)===t.codePointAt(c--)?c<0&&(r=s):(c=-1,r=u));return n===r?r=u:r<0&&(r=e.length),e.slice(n,r)}function UO(e){if(pa(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function HO(e){pa(e);let t=e.length,n=-1,r=0,s=-1,a=0,u;for(;t--;){const c=e.codePointAt(t);if(c===47){if(u){r=t+1;break}continue}n<0&&(u=!0,n=t+1),c===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function jO(...e){let t=-1,n;for(;++t<e.length;)pa(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":$O(n)}function $O(e){pa(e);const t=e.codePointAt(0)===47;let n=zO(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function zO(e,t){let n="",r=0,s=-1,a=0,u=-1,c,d;for(;++u<=e.length;){if(u<e.length)c=e.codePointAt(u);else{if(c===47)break;c=47}if(c===47){if(!(s===u-1||a===1))if(s!==u-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),s=u,a=0;continue}}else if(n.length>0){n="",r=0,s=u,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,u):n=e.slice(s+1,u),r=u-s-1;s=u,a=0}else c===46&&a>-1?a++:a=-1}return n}function pa(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const VO={cwd:qO};function qO(){return"/"}function jf(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function YO(e){if(typeof e=="string")e=new URL(e);else if(!jf(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return WO(e)}function WO(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const $f=["history","path","basename","stem","extname","dirname"];class kE{constructor(t){let n;t?jf(t)?n={path:t}:typeof t=="string"||GO(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":VO.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<$f.length;){const a=$f[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let s;for(s in n)$f.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?xr.basename(this.path):void 0}set basename(t){Vf(t,"basename"),zf(t,"basename"),this.path=xr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?xr.dirname(this.path):void 0}set dirname(t){NE(this.basename,"dirname"),this.path=xr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?xr.extname(this.path):void 0}set extname(t){if(zf(t,"extname"),NE(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=xr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){jf(t)&&(t=YO(t)),Vf(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?xr.basename(this.path,this.extname):void 0}set stem(t){Vf(t,"stem"),zf(t,"stem"),this.path=xr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new on(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function zf(e,t){if(e&&e.includes(xr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+xr.sep+"`")}function Vf(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function NE(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function GO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const XO=(function(e){const r=this.constructor.prototype,s=r[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),QO={}.hasOwnProperty;class qf extends XO{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=MO()}copy(){const t=new qf;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Uf(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Gf("data",this.frozen),this.namespace[t]=n,this):QO.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Gf("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=pl(t),r=this.parser||this.Parser;return Yf("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Yf("process",this.parser||this.Parser),Wf("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,u){const c=pl(t),d=r.parse(c);r.run(d,c,function(p,m,b){if(p||!m||!b)return f(p);const y=m,x=r.stringify(y,b);ZO(x)?b.value=x:b.result=x,f(p,b)});function f(p,m){p||!m?u(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),Yf("processSync",this.parser||this.Parser),Wf("processSync",this.compiler||this.Compiler),this.process(t,s),OE("processSync","process",n),r;function s(a,u){n=!0,vE(a),r=u}}run(t,n,r){CE(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(u,c){const d=pl(n);s.run(t,d,f);function f(p,m,b){const y=m||t;p?c(p):u?u(y):r(void 0,y,b)}}}runSync(t,n){let r=!1,s;return this.run(t,n,a),OE("runSync","run",r),s;function a(u,c){vE(u),s=c,r=!0}}stringify(t,n){this.freeze();const r=pl(n),s=this.compiler||this.Compiler;return Wf("stringify",s),CE(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Gf("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...m]=f;d(p,m)}else u(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function u(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(f.plugins),f.settings&&(s.settings=Uf(!0,s.settings,f.settings))}function c(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const m=f[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let m=-1,b=-1;for(;++m<r.length;)if(r[m][0]===f){b=m;break}if(b===-1)r.push([f,...p]);else if(p.length>0){let[y,...x]=p;const A=r[b][1];Hf(A)&&Hf(y)&&(y=Uf(!0,A,y)),r[b]=[f,y,...x]}}}}const KO=new qf().freeze();function Yf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Wf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Gf(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function CE(e){if(!Hf(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function OE(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function pl(e){return JO(e)?e:new kE(e)}function JO(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ZO(e){return typeof e=="string"||eI(e)}function eI(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const tI="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",IE=[],PE={allowDangerousHtml:!0},nI=/^(https?|ircs?|mailto|xmpp)$/i,rI=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function RE(e){const t=iI(e),n=sI(e);return oI(t.runSync(t.parse(n),n),e)}function iI(e){const t=e.rehypePlugins||IE,n=e.remarkPlugins||IE,r=e.remarkRehypeOptions?H(H({},e.remarkRehypeOptions),PE):PE;return KO().use(U3).use(n).use(RO,r).use(t)}function sI(e){const t=e.children||"",n=new kE;return typeof t=="string"&&(n.value=t),n}function oI(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,a=t.disallowedElements,u=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||aI;for(const p of rI)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+tI+p.id,void 0);return hl(e,f),IN(e,{Fragment:_.Fragment,components:s,ignoreInvalidStyle:!0,jsx:_.jsx,jsxs:_.jsxs,passKeys:!0,passNode:!0});function f(p,m,b){if(p.type==="raw"&&b&&typeof m=="number")return u?b.children.splice(m,1):b.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let y;for(y in Sf)if(Object.hasOwn(Sf,y)&&Object.hasOwn(p.properties,y)){const x=p.properties[y],A=Sf[y];(A===null||A.includes(p.tagName))&&(p.properties[y]=d(String(x||""),y,p))}}if(p.type==="element"){let y=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!y&&r&&typeof m=="number"&&(y=!r(p,m,b)),y&&b&&typeof m=="number")return c&&p.children?b.children.splice(m,1,...p.children):b.children.splice(m,1),m}}}function aI(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||nI.test(e.slice(0,t))?e:""}const LE=/[#.]/g;function uI(e,t){const n=e||"",r={};let s=0,a,u;for(;s<n.length;){LE.lastIndex=s;const c=LE.exec(n),d=n.slice(s,c?c.index:n.length);d&&(a?a==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:u=d,s+=d.length),c&&(a=c[0],s++)}return{type:"element",tagName:u||t||"div",properties:r,children:[]}}function DE(e,t,n){const r=n?fI(n):void 0;function s(a,u,...c){let d;if(a==null){d={type:"root",children:[]};const f=u;c.unshift(f)}else{d=uI(a,t);const f=d.tagName.toLowerCase(),p=r?r.get(f):void 0;if(d.tagName=p||f,lI(u))c.unshift(u);else for(const[m,b]of Object.entries(u))cI(e,d.properties,m,b)}for(const f of c)Xf(d.children,f);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return s}function lI(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const s=t[r];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const a=s;for(const u of a)if(typeof u!="number"&&typeof u!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function cI(e,t,n,r){const s=tl(e,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?s.spaceSeparated?a=S1(r):s.commaSeparated?a=d1(r):s.commaOrSpaceSeparated?a=S1(d1(r).join(" ")):a=ME(s,s.property,r):Array.isArray(r)?a=[...r]:a=s.property==="style"?dI(r):String(r);if(Array.isArray(a)){const u=[];for(const c of a)u.push(ME(s,s.property,c));a=u}s.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[s.property]=a}}function Xf(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Xf(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Xf(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function ME(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||ra(n)===ra(t)))return!0}return n}function dI(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function fI(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const hI=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],pI=DE(ia,"div"),mI=DE(ii,"g",hI);function gI(e){const t=String(e),n=[];return{toOffset:s,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let u=0;for(;;){let c=n[u];if(c===void 0){const d=FE(t,n[u-1]);c=d===-1?t.length+1:d+1,n[u]=c}if(c>a)return{line:u+1,column:a-(u>0?n[u-1]:0)+1,offset:a};u++}}}function s(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const c=n[n.length-1],d=FE(t,c),f=d===-1?t.length+1:d+1;if(c===f)break;n.push(f)}const u=(a.line>1?n[a.line-2]:0)+a.column-1;if(u<n[a.line-1])return u}}}function FE(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
37
- `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Ki={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},BE={}.hasOwnProperty,EI=Object.prototype;function yI(e,t){const n=t||{};return Qf({file:n.file||void 0,location:!1,schema:n.space==="svg"?ii:ia,verbose:n.verbose||!1},e)}function Qf(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},ml(e,r,n),n}case"#document":case"#document-fragment":{const r=t,s="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:UE(e,t.childNodes),data:{quirksMode:s}},e.file&&e.location){const a=String(e.file),u=gI(a),c=u.toPoint(0),d=u.toPoint(a.length);n.position={start:c,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},ml(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},ml(e,r,n),n}default:return n=TI(e,t),n}}function UE(e,t){let n=-1;const r=[];for(;++n<t.length;){const s=Qf(e,t[n]);r.push(s)}return r}function TI(e,t){const n=e.schema;e.schema=t.namespaceURI===Ki.svg?ii:ia;let r=-1;const s={};for(;++r<t.attrs.length;){const c=t.attrs[r],d=(c.prefix?c.prefix+":":"")+c.name;BE.call(EI,d)||(s[d]=c.value)}const u=(e.schema.space==="svg"?mI:pI)(t.tagName,s,UE(e,t.childNodes));if(ml(e,t,u),u.tagName==="template"){const c=t,d=c.sourceCodeLocation,f=d&&d.startTag&&$s(d.startTag),p=d&&d.endTag&&$s(d.endTag),m=Qf(e,c.content);f&&p&&e.file&&(m.position={start:f.end,end:p.start}),u.content=m}return e.schema=n,u}function ml(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=bI(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function bI(e,t,n){const r=$s(n);if(t.type==="element"){const s=t.children[t.children.length-1];if(r&&!n.endTag&&s&&s.position&&s.position.end&&(r.end=Object.assign({},s.position.end)),e.verbose){const a={};let u;if(n.attrs)for(u in n.attrs)BE.call(n.attrs,u)&&(a[tl(e.schema,u).property]=$s(n.attrs[u]));n.startTag;const c=$s(n.startTag),d=n.endTag?$s(n.endTag):void 0,f={opening:c};d&&(f.closing=d),f.properties=a,t.data={position:f}}}return r}function $s(e){const t=HE({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=HE({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function HE(e){return e.line&&e.column?e:void 0}const jE={}.hasOwnProperty;function $E(e,t){const n=t||{};function r(s,...a){let u=r.invalid;const c=r.handlers;if(s&&jE.call(s,e)){const d=String(s[e]);u=jE.call(c,d)?c[d]:r.unknown}if(u)return u.call(this,s,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const xI={},_I={}.hasOwnProperty,zE=$E("type",{handlers:{root:SI,element:CI,text:kI,comment:NI,doctype:AI}});function wI(e,t){const r=(t||xI).space;return zE(e,r==="svg"?ii:ia)}function SI(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Kf(e.children,n,t),zs(e,n),n}function vI(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Kf(e.children,n,t),zs(e,n),n}function AI(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return zs(e,t),t}function kI(e){const t={nodeName:"#text",value:e.value,parentNode:null};return zs(e,t),t}function NI(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return zs(e,t),t}function CI(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=ii);const s=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&_I.call(e.properties,a)){const d=OI(r,a,e.properties[a]);d&&s.push(d)}}const u=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:s,namespaceURI:Ki[u],childNodes:[],parentNode:null};return c.childNodes=Kf(e.children,c,r),zs(e,c),e.tagName==="template"&&e.content&&(c.content=vI(e.content,r)),c}function OI(e,t,n){const r=tl(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?f1(n):v1(n));const s={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=s.name.indexOf(":");a<0?s.prefix="":(s.name=s.name.slice(a+1),s.prefix=r.attribute.slice(0,a)),s.namespace=Ki[r.space]}return s}function Kf(e,t,n){let r=-1;const s=[];if(e)for(;++r<e.length;){const a=zE(e[r],n);a.parentNode=t,s.push(a)}return s}function zs(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const II=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],PI=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),xt="�";var I;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(I||(I={}));const Sn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function VE(e){return e>=55296&&e<=57343}function RI(e){return e>=56320&&e<=57343}function LI(e,t){return(e-55296)*1024+9216+t}function qE(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function YE(e){return e>=64976&&e<=65007||PI.has(e)}var te;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(te||(te={}));const DI=65536;class MI{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=DI,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:s,offset:a}=this,u=s+n,c=a+n;return{code:t,startLine:r,endLine:r,startCol:u,endCol:u,startOffset:c,endOffset:c}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(RI(n))return this.pos++,this._addGap(),LI(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,I.EOF;return this._err(te.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;const r=this.html.charCodeAt(n);return r===I.CARRIAGE_RETURN?I.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;let t=this.html.charCodeAt(this.pos);return t===I.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,I.LINE_FEED):t===I.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,VE(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===I.LINE_FEED||t===I.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){qE(t)?this._err(te.controlCharacterInInputStream):YE(t)&&this._err(te.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Qe;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(Qe||(Qe={}));function WE(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const FI=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),BI=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function UI(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=BI.get(e))!==null&&t!==void 0?t:e}var Ht;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Ht||(Ht={}));const HI=32;var ai;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(ai||(ai={}));function Jf(e){return e>=Ht.ZERO&&e<=Ht.NINE}function jI(e){return e>=Ht.UPPER_A&&e<=Ht.UPPER_F||e>=Ht.LOWER_A&&e<=Ht.LOWER_F}function $I(e){return e>=Ht.UPPER_A&&e<=Ht.UPPER_Z||e>=Ht.LOWER_A&&e<=Ht.LOWER_Z||Jf(e)}function zI(e){return e===Ht.EQUALS||$I(e)}var jt;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(jt||(jt={}));var Ur;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ur||(Ur={}));class VI{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=jt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ur.Strict}startEntity(t){this.decodeMode=t,this.state=jt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case jt.EntityStart:return t.charCodeAt(n)===Ht.NUM?(this.state=jt.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=jt.NamedEntity,this.stateNamedEntity(t,n));case jt.NumericStart:return this.stateNumericStart(t,n);case jt.NumericDecimal:return this.stateNumericDecimal(t,n);case jt.NumericHex:return this.stateNumericHex(t,n);case jt.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|HI)===Ht.LOWER_X?(this.state=jt.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=jt.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,s){if(n!==r){const a=r-n;this.result=this.result*Math.pow(s,a)+Number.parseInt(t.substr(n,a),s),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(Jf(s)||jI(s))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(Jf(s))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Ht.SEMI)this.consumed+=1;else if(this.decodeMode===Ur.Strict)return 0;return this.emitCodePoint(UI(this.result),this.consumed),this.errors&&(t!==Ht.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let s=r[this.treeIndex],a=(s&ai.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const u=t.charCodeAt(n);if(this.treeIndex=qI(r,s,this.treeIndex+Math.max(1,a),u),this.treeIndex<0)return this.result===0||this.decodeMode===Ur.Attribute&&(a===0||zI(u))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&ai.VALUE_LENGTH)>>14,a!==0){if(u===Ht.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==Ur.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,s=(r[n]&ai.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[t]&~ai.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case jt.NamedEntity:return this.result!==0&&(this.decodeMode!==Ur.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case jt.NumericDecimal:return this.emitNumericEntity(0,2);case jt.NumericHex:return this.emitNumericEntity(0,3);case jt.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case jt.EntityStart:return 0}}}function qI(e,t,n,r){const s=(t&ai.BRANCH_LENGTH)>>7,a=t&ai.JUMP_TABLE;if(s===0)return a!==0&&r===a?n:-1;if(a){const d=r-a;return d<0||d>=s?-1:e[n+d]-1}let u=n,c=u+s-1;for(;u<=c;){const d=u+c>>>1,f=e[d];if(f<r)u=d+1;else if(f>r)c=d-1;else return e[d+s]}return-1}var ye;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(ye||(ye={}));var Ji;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Ji||(Ji={}));var qn;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(qn||(qn={}));var K;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(K||(K={}));var g;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(g||(g={}));const YI=new Map([[K.A,g.A],[K.ADDRESS,g.ADDRESS],[K.ANNOTATION_XML,g.ANNOTATION_XML],[K.APPLET,g.APPLET],[K.AREA,g.AREA],[K.ARTICLE,g.ARTICLE],[K.ASIDE,g.ASIDE],[K.B,g.B],[K.BASE,g.BASE],[K.BASEFONT,g.BASEFONT],[K.BGSOUND,g.BGSOUND],[K.BIG,g.BIG],[K.BLOCKQUOTE,g.BLOCKQUOTE],[K.BODY,g.BODY],[K.BR,g.BR],[K.BUTTON,g.BUTTON],[K.CAPTION,g.CAPTION],[K.CENTER,g.CENTER],[K.CODE,g.CODE],[K.COL,g.COL],[K.COLGROUP,g.COLGROUP],[K.DD,g.DD],[K.DESC,g.DESC],[K.DETAILS,g.DETAILS],[K.DIALOG,g.DIALOG],[K.DIR,g.DIR],[K.DIV,g.DIV],[K.DL,g.DL],[K.DT,g.DT],[K.EM,g.EM],[K.EMBED,g.EMBED],[K.FIELDSET,g.FIELDSET],[K.FIGCAPTION,g.FIGCAPTION],[K.FIGURE,g.FIGURE],[K.FONT,g.FONT],[K.FOOTER,g.FOOTER],[K.FOREIGN_OBJECT,g.FOREIGN_OBJECT],[K.FORM,g.FORM],[K.FRAME,g.FRAME],[K.FRAMESET,g.FRAMESET],[K.H1,g.H1],[K.H2,g.H2],[K.H3,g.H3],[K.H4,g.H4],[K.H5,g.H5],[K.H6,g.H6],[K.HEAD,g.HEAD],[K.HEADER,g.HEADER],[K.HGROUP,g.HGROUP],[K.HR,g.HR],[K.HTML,g.HTML],[K.I,g.I],[K.IMG,g.IMG],[K.IMAGE,g.IMAGE],[K.INPUT,g.INPUT],[K.IFRAME,g.IFRAME],[K.KEYGEN,g.KEYGEN],[K.LABEL,g.LABEL],[K.LI,g.LI],[K.LINK,g.LINK],[K.LISTING,g.LISTING],[K.MAIN,g.MAIN],[K.MALIGNMARK,g.MALIGNMARK],[K.MARQUEE,g.MARQUEE],[K.MATH,g.MATH],[K.MENU,g.MENU],[K.META,g.META],[K.MGLYPH,g.MGLYPH],[K.MI,g.MI],[K.MO,g.MO],[K.MN,g.MN],[K.MS,g.MS],[K.MTEXT,g.MTEXT],[K.NAV,g.NAV],[K.NOBR,g.NOBR],[K.NOFRAMES,g.NOFRAMES],[K.NOEMBED,g.NOEMBED],[K.NOSCRIPT,g.NOSCRIPT],[K.OBJECT,g.OBJECT],[K.OL,g.OL],[K.OPTGROUP,g.OPTGROUP],[K.OPTION,g.OPTION],[K.P,g.P],[K.PARAM,g.PARAM],[K.PLAINTEXT,g.PLAINTEXT],[K.PRE,g.PRE],[K.RB,g.RB],[K.RP,g.RP],[K.RT,g.RT],[K.RTC,g.RTC],[K.RUBY,g.RUBY],[K.S,g.S],[K.SCRIPT,g.SCRIPT],[K.SEARCH,g.SEARCH],[K.SECTION,g.SECTION],[K.SELECT,g.SELECT],[K.SOURCE,g.SOURCE],[K.SMALL,g.SMALL],[K.SPAN,g.SPAN],[K.STRIKE,g.STRIKE],[K.STRONG,g.STRONG],[K.STYLE,g.STYLE],[K.SUB,g.SUB],[K.SUMMARY,g.SUMMARY],[K.SUP,g.SUP],[K.TABLE,g.TABLE],[K.TBODY,g.TBODY],[K.TEMPLATE,g.TEMPLATE],[K.TEXTAREA,g.TEXTAREA],[K.TFOOT,g.TFOOT],[K.TD,g.TD],[K.TH,g.TH],[K.THEAD,g.THEAD],[K.TITLE,g.TITLE],[K.TR,g.TR],[K.TRACK,g.TRACK],[K.TT,g.TT],[K.U,g.U],[K.UL,g.UL],[K.SVG,g.SVG],[K.VAR,g.VAR],[K.WBR,g.WBR],[K.XMP,g.XMP]]);function Vs(e){var t;return(t=YI.get(e))!==null&&t!==void 0?t:g.UNKNOWN}const be=g,WI={[ye.HTML]:new Set([be.ADDRESS,be.APPLET,be.AREA,be.ARTICLE,be.ASIDE,be.BASE,be.BASEFONT,be.BGSOUND,be.BLOCKQUOTE,be.BODY,be.BR,be.BUTTON,be.CAPTION,be.CENTER,be.COL,be.COLGROUP,be.DD,be.DETAILS,be.DIR,be.DIV,be.DL,be.DT,be.EMBED,be.FIELDSET,be.FIGCAPTION,be.FIGURE,be.FOOTER,be.FORM,be.FRAME,be.FRAMESET,be.H1,be.H2,be.H3,be.H4,be.H5,be.H6,be.HEAD,be.HEADER,be.HGROUP,be.HR,be.HTML,be.IFRAME,be.IMG,be.INPUT,be.LI,be.LINK,be.LISTING,be.MAIN,be.MARQUEE,be.MENU,be.META,be.NAV,be.NOEMBED,be.NOFRAMES,be.NOSCRIPT,be.OBJECT,be.OL,be.P,be.PARAM,be.PLAINTEXT,be.PRE,be.SCRIPT,be.SECTION,be.SELECT,be.SOURCE,be.STYLE,be.SUMMARY,be.TABLE,be.TBODY,be.TD,be.TEMPLATE,be.TEXTAREA,be.TFOOT,be.TH,be.THEAD,be.TITLE,be.TR,be.TRACK,be.UL,be.WBR,be.XMP]),[ye.MATHML]:new Set([be.MI,be.MO,be.MN,be.MS,be.MTEXT,be.ANNOTATION_XML]),[ye.SVG]:new Set([be.TITLE,be.FOREIGN_OBJECT,be.DESC]),[ye.XLINK]:new Set,[ye.XML]:new Set,[ye.XMLNS]:new Set},Zf=new Set([be.H1,be.H2,be.H3,be.H4,be.H5,be.H6]);K.STYLE,K.SCRIPT,K.XMP,K.IFRAME,K.NOEMBED,K.NOFRAMES,K.PLAINTEXT;var R;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(R||(R={}));const Ct={DATA:R.DATA,RCDATA:R.RCDATA,RAWTEXT:R.RAWTEXT,SCRIPT_DATA:R.SCRIPT_DATA,PLAINTEXT:R.PLAINTEXT,CDATA_SECTION:R.CDATA_SECTION};function GI(e){return e>=I.DIGIT_0&&e<=I.DIGIT_9}function ma(e){return e>=I.LATIN_CAPITAL_A&&e<=I.LATIN_CAPITAL_Z}function XI(e){return e>=I.LATIN_SMALL_A&&e<=I.LATIN_SMALL_Z}function ui(e){return XI(e)||ma(e)}function GE(e){return ui(e)||GI(e)}function gl(e){return e+32}function XE(e){return e===I.SPACE||e===I.LINE_FEED||e===I.TABULATION||e===I.FORM_FEED}function QE(e){return XE(e)||e===I.SOLIDUS||e===I.GREATER_THAN_SIGN}function QI(e){return e===I.NULL?te.nullCharacterReference:e>1114111?te.characterReferenceOutsideUnicodeRange:VE(e)?te.surrogateCharacterReference:YE(e)?te.noncharacterCharacterReference:qE(e)||e===I.CARRIAGE_RETURN?te.controlCharacterReference:null}class KI{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=R.DATA,this.returnState=R.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new MI(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new VI(FI,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(te.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(te.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=QI(r);s&&this._err(s,1)}}:void 0)}_err(t,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Qe.START_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Qe.END_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:Qe.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:Qe.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(WE(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(te.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Vs(t.tagName),t.type===Qe.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(te.endTagWithAttributes),t.selfClosing&&this._err(te.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case Qe.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Qe.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Qe.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:Qe.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=XE(t)?Qe.WHITESPACE_CHARACTER:t===I.NULL?Qe.NULL_CHARACTER:Qe.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Qe.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=R.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Ur.Attribute:Ur.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===R.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===R.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===R.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case R.DATA:{this._stateData(t);break}case R.RCDATA:{this._stateRcdata(t);break}case R.RAWTEXT:{this._stateRawtext(t);break}case R.SCRIPT_DATA:{this._stateScriptData(t);break}case R.PLAINTEXT:{this._statePlaintext(t);break}case R.TAG_OPEN:{this._stateTagOpen(t);break}case R.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case R.TAG_NAME:{this._stateTagName(t);break}case R.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case R.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case R.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case R.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case R.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case R.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case R.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case R.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case R.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case R.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case R.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case R.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case R.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case R.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case R.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case R.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case R.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case R.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case R.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case R.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case R.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case R.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case R.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case R.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case R.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case R.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case R.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case R.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case R.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case R.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case R.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case R.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case R.BOGUS_COMMENT:{this._stateBogusComment(t);break}case R.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case R.COMMENT_START:{this._stateCommentStart(t);break}case R.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case R.COMMENT:{this._stateComment(t);break}case R.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case R.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case R.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case R.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case R.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case R.COMMENT_END:{this._stateCommentEnd(t);break}case R.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case R.DOCTYPE:{this._stateDoctype(t);break}case R.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case R.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case R.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case R.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case R.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case R.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case R.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case R.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case R.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case R.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case R.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case R.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case R.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case R.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case R.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case R.CDATA_SECTION:{this._stateCdataSection(t);break}case R.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case R.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case R.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case R.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case I.LESS_THAN_SIGN:{this.state=R.TAG_OPEN;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(te.unexpectedNullCharacter),this._emitCodePoint(t);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case I.AMPERSAND:{this._startCharacterReference();break}case I.LESS_THAN_SIGN:{this.state=R.RCDATA_LESS_THAN_SIGN;break}case I.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(xt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case I.LESS_THAN_SIGN:{this.state=R.RAWTEXT_LESS_THAN_SIGN;break}case I.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(xt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case I.LESS_THAN_SIGN:{this.state=R.SCRIPT_DATA_LESS_THAN_SIGN;break}case I.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(xt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case I.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(xt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(ui(t))this._createStartTagToken(),this.state=R.TAG_NAME,this._stateTagName(t);else switch(t){case I.EXCLAMATION_MARK:{this.state=R.MARKUP_DECLARATION_OPEN;break}case I.SOLIDUS:{this.state=R.END_TAG_OPEN;break}case I.QUESTION_MARK:{this._err(te.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=R.BOGUS_COMMENT,this._stateBogusComment(t);break}case I.EOF:{this._err(te.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(te.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=R.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(ui(t))this._createEndTagToken(),this.state=R.TAG_NAME,this._stateTagName(t);else switch(t){case I.GREATER_THAN_SIGN:{this._err(te.missingEndTagName),this.state=R.DATA;break}case I.EOF:{this._err(te.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(te.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=R.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=R.BEFORE_ATTRIBUTE_NAME;break}case I.SOLIDUS:{this.state=R.SELF_CLOSING_START_TAG;break}case I.GREATER_THAN_SIGN:{this.state=R.DATA,this.emitCurrentTagToken();break}case I.NULL:{this._err(te.unexpectedNullCharacter),n.tagName+=xt;break}case I.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(ma(t)?gl(t):t)}}_stateRcdataLessThanSign(t){t===I.SOLIDUS?this.state=R.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=R.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){ui(t)?(this.state=R.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=R.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=R.BEFORE_ATTRIBUTE_NAME,!1;case I.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=R.SELF_CLOSING_START_TAG,!1;case I.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=R.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=R.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===I.SOLIDUS?this.state=R.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=R.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){ui(t)?(this.state=R.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=R.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=R.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case I.SOLIDUS:{this.state=R.SCRIPT_DATA_END_TAG_OPEN;break}case I.EXCLAMATION_MARK:{this.state=R.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=R.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){ui(t)?(this.state=R.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=R.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=R.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===I.HYPHEN_MINUS?(this.state=R.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=R.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===I.HYPHEN_MINUS?(this.state=R.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=R.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case I.HYPHEN_MINUS:{this.state=R.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=R.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(xt);break}case I.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case I.HYPHEN_MINUS:{this.state=R.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=R.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.NULL:{this._err(te.unexpectedNullCharacter),this.state=R.SCRIPT_DATA_ESCAPED,this._emitChars(xt);break}case I.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=R.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case I.HYPHEN_MINUS:{this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=R.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.GREATER_THAN_SIGN:{this.state=R.SCRIPT_DATA,this._emitChars(">");break}case I.NULL:{this._err(te.unexpectedNullCharacter),this.state=R.SCRIPT_DATA_ESCAPED,this._emitChars(xt);break}case I.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=R.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===I.SOLIDUS?this.state=R.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ui(t)?(this._emitChars("<"),this.state=R.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=R.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){ui(t)?(this.state=R.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=R.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=R.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Sn.SCRIPT,!1)&&QE(this.preprocessor.peek(Sn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Sn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=R.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case I.HYPHEN_MINUS:{this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(xt);break}case I.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case I.HYPHEN_MINUS:{this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.NULL:{this._err(te.unexpectedNullCharacter),this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(xt);break}case I.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case I.HYPHEN_MINUS:{this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.GREATER_THAN_SIGN:{this.state=R.SCRIPT_DATA,this._emitChars(">");break}case I.NULL:{this._err(te.unexpectedNullCharacter),this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(xt);break}case I.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===I.SOLIDUS?(this.state=R.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Sn.SCRIPT,!1)&&QE(this.preprocessor.peek(Sn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Sn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=R.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.SOLIDUS:case I.GREATER_THAN_SIGN:case I.EOF:{this.state=R.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case I.EQUALS_SIGN:{this._err(te.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=R.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=R.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:case I.SOLIDUS:case I.GREATER_THAN_SIGN:case I.EOF:{this._leaveAttrName(),this.state=R.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case I.EQUALS_SIGN:{this._leaveAttrName(),this.state=R.BEFORE_ATTRIBUTE_VALUE;break}case I.QUOTATION_MARK:case I.APOSTROPHE:case I.LESS_THAN_SIGN:{this._err(te.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case I.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.name+=xt;break}default:this.currentAttr.name+=String.fromCodePoint(ma(t)?gl(t):t)}}_stateAfterAttributeName(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.SOLIDUS:{this.state=R.SELF_CLOSING_START_TAG;break}case I.EQUALS_SIGN:{this.state=R.BEFORE_ATTRIBUTE_VALUE;break}case I.GREATER_THAN_SIGN:{this.state=R.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=R.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{this.state=R.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this.state=R.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(te.missingAttributeValue),this.state=R.DATA,this.emitCurrentTagToken();break}default:this.state=R.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case I.QUOTATION_MARK:{this.state=R.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=xt;break}case I.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case I.APOSTROPHE:{this.state=R.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=xt;break}case I.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this._leaveAttrValue(),this.state=R.BEFORE_ATTRIBUTE_NAME;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=R.DATA,this.emitCurrentTagToken();break}case I.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=xt;break}case I.QUOTATION_MARK:case I.APOSTROPHE:case I.LESS_THAN_SIGN:case I.EQUALS_SIGN:case I.GRAVE_ACCENT:{this._err(te.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case I.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this._leaveAttrValue(),this.state=R.BEFORE_ATTRIBUTE_NAME;break}case I.SOLIDUS:{this._leaveAttrValue(),this.state=R.SELF_CLOSING_START_TAG;break}case I.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=R.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._err(te.missingWhitespaceBetweenAttributes),this.state=R.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case I.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=R.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._err(te.unexpectedSolidusInTag),this.state=R.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case I.GREATER_THAN_SIGN:{this.state=R.DATA,this.emitCurrentComment(n);break}case I.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case I.NULL:{this._err(te.unexpectedNullCharacter),n.data+=xt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Sn.DASH_DASH,!0)?(this._createCommentToken(Sn.DASH_DASH.length+1),this.state=R.COMMENT_START):this._consumeSequenceIfMatch(Sn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Sn.DOCTYPE.length+1),this.state=R.DOCTYPE):this._consumeSequenceIfMatch(Sn.CDATA_START,!0)?this.inForeignNode?this.state=R.CDATA_SECTION:(this._err(te.cdataInHtmlContent),this._createCommentToken(Sn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=R.BOGUS_COMMENT):this._ensureHibernation()||(this._err(te.incorrectlyOpenedComment),this._createCommentToken(2),this.state=R.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case I.HYPHEN_MINUS:{this.state=R.COMMENT_START_DASH;break}case I.GREATER_THAN_SIGN:{this._err(te.abruptClosingOfEmptyComment),this.state=R.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=R.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case I.HYPHEN_MINUS:{this.state=R.COMMENT_END;break}case I.GREATER_THAN_SIGN:{this._err(te.abruptClosingOfEmptyComment),this.state=R.DATA,this.emitCurrentComment(n);break}case I.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=R.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case I.HYPHEN_MINUS:{this.state=R.COMMENT_END_DASH;break}case I.LESS_THAN_SIGN:{n.data+="<",this.state=R.COMMENT_LESS_THAN_SIGN;break}case I.NULL:{this._err(te.unexpectedNullCharacter),n.data+=xt;break}case I.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case I.EXCLAMATION_MARK:{n.data+="!",this.state=R.COMMENT_LESS_THAN_SIGN_BANG;break}case I.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=R.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===I.HYPHEN_MINUS?this.state=R.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=R.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===I.HYPHEN_MINUS?this.state=R.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=R.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==I.GREATER_THAN_SIGN&&t!==I.EOF&&this._err(te.nestedComment),this.state=R.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case I.HYPHEN_MINUS:{this.state=R.COMMENT_END;break}case I.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=R.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case I.GREATER_THAN_SIGN:{this.state=R.DATA,this.emitCurrentComment(n);break}case I.EXCLAMATION_MARK:{this.state=R.COMMENT_END_BANG;break}case I.HYPHEN_MINUS:{n.data+="-";break}case I.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=R.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case I.HYPHEN_MINUS:{n.data+="--!",this.state=R.COMMENT_END_DASH;break}case I.GREATER_THAN_SIGN:{this._err(te.incorrectlyClosedComment),this.state=R.DATA,this.emitCurrentComment(n);break}case I.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=R.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=R.BEFORE_DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this.state=R.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case I.EOF:{this._err(te.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingWhitespaceBeforeDoctypeName),this.state=R.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(ma(t))this._createDoctypeToken(String.fromCharCode(gl(t))),this.state=R.DOCTYPE_NAME;else switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.NULL:{this._err(te.unexpectedNullCharacter),this._createDoctypeToken(xt),this.state=R.DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this._err(te.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=R.DATA;break}case I.EOF:{this._err(te.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=R.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=R.AFTER_DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this.state=R.DATA,this.emitCurrentDoctype(n);break}case I.NULL:{this._err(te.unexpectedNullCharacter),n.name+=xt;break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(ma(t)?gl(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.state=R.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Sn.PUBLIC,!1)?this.state=R.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Sn.SYSTEM,!1)?this.state=R.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(te.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=R.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=R.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.QUOTATION_MARK:{this._err(te.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=R.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(te.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=R.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(te.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=R.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=R.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{n.publicId="",this.state=R.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{n.publicId="",this.state=R.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(te.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=R.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=R.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case I.QUOTATION_MARK:{this.state=R.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.NULL:{this._err(te.unexpectedNullCharacter),n.publicId+=xt;break}case I.GREATER_THAN_SIGN:{this._err(te.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=R.DATA;break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case I.APOSTROPHE:{this.state=R.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.NULL:{this._err(te.unexpectedNullCharacter),n.publicId+=xt;break}case I.GREATER_THAN_SIGN:{this._err(te.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=R.DATA;break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=R.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case I.GREATER_THAN_SIGN:{this.state=R.DATA,this.emitCurrentDoctype(n);break}case I.QUOTATION_MARK:{this._err(te.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=R.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(te.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=R.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=R.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=R.DATA;break}case I.QUOTATION_MARK:{n.systemId="",this.state=R.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{n.systemId="",this.state=R.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=R.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=R.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.QUOTATION_MARK:{this._err(te.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=R.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(te.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=R.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(te.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=R.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=R.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{n.systemId="",this.state=R.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{n.systemId="",this.state=R.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(te.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=R.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=R.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case I.QUOTATION_MARK:{this.state=R.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.NULL:{this._err(te.unexpectedNullCharacter),n.systemId+=xt;break}case I.GREATER_THAN_SIGN:{this._err(te.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=R.DATA;break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case I.APOSTROPHE:{this.state=R.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.NULL:{this._err(te.unexpectedNullCharacter),n.systemId+=xt;break}case I.GREATER_THAN_SIGN:{this._err(te.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=R.DATA;break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=R.DATA;break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=R.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=R.DATA;break}case I.NULL:{this._err(te.unexpectedNullCharacter);break}case I.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case I.RIGHT_SQUARE_BRACKET:{this.state=R.CDATA_SECTION_BRACKET;break}case I.EOF:{this._err(te.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===I.RIGHT_SQUARE_BRACKET?this.state=R.CDATA_SECTION_END:(this._emitChars("]"),this.state=R.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case I.GREATER_THAN_SIGN:{this.state=R.DATA;break}case I.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=R.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(I.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&GE(this.preprocessor.peek(1))?R.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){GE(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===I.SEMICOLON&&this._err(te.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const KE=new Set([g.DD,g.DT,g.LI,g.OPTGROUP,g.OPTION,g.P,g.RB,g.RP,g.RT,g.RTC]),JE=new Set([...KE,g.CAPTION,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]),El=new Set([g.APPLET,g.CAPTION,g.HTML,g.MARQUEE,g.OBJECT,g.TABLE,g.TD,g.TEMPLATE,g.TH]),JI=new Set([...El,g.OL,g.UL]),ZI=new Set([...El,g.BUTTON]),ZE=new Set([g.ANNOTATION_XML,g.MI,g.MN,g.MO,g.MS,g.MTEXT]),ey=new Set([g.DESC,g.FOREIGN_OBJECT,g.TITLE]),eP=new Set([g.TR,g.TEMPLATE,g.HTML]),tP=new Set([g.TBODY,g.TFOOT,g.THEAD,g.TEMPLATE,g.HTML]),nP=new Set([g.TABLE,g.TEMPLATE,g.HTML]),rP=new Set([g.TD,g.TH]);class iP{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=g.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===g.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===ye.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const s=this._indexOf(t)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==ye.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Zf,ye.HTML)}popUntilTableCellPopped(){this.popUntilPopped(rP,ye.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(nP,ye.HTML)}clearBackToTableBodyContext(){this.clearBackTo(tP,ye.HTML)}clearBackToTableRowContext(){this.clearBackTo(eP,ye.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===g.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===g.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case ye.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case ye.SVG:{if(ey.has(s))return!1;break}case ye.MATHML:{if(ZE.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,El)}hasInListItemScope(t){return this.hasInDynamicScope(t,JI)}hasInButtonScope(t){return this.hasInDynamicScope(t,ZI)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case ye.HTML:{if(Zf.has(n))return!0;if(El.has(n))return!1;break}case ye.SVG:{if(ey.has(n))return!1;break}case ye.MATHML:{if(ZE.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ye.HTML)switch(this.tagIDs[n]){case t:return!0;case g.TABLE:case g.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===ye.HTML)switch(this.tagIDs[t]){case g.TBODY:case g.THEAD:case g.TFOOT:return!0;case g.TABLE:case g.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ye.HTML)switch(this.tagIDs[n]){case t:return!0;case g.OPTION:case g.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&KE.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&JE.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&JE.has(this.currentTagId);)this.pop()}}const eh=3;var _r;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(_r||(_r={}));const ty={type:_r.Marker};class sP{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],s=n.length,a=this.treeAdapter.getTagName(t),u=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const d=this.entries[c];if(d.type===_r.Marker)break;const{element:f}=d;if(this.treeAdapter.getTagName(f)===a&&this.treeAdapter.getNamespaceURI(f)===u){const p=this.treeAdapter.getAttrList(f);p.length===s&&r.push({idx:c,attrs:p})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<eh)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<eh)return;const s=new Map(n.map(u=>[u.name,u.value]));let a=0;for(let u=0;u<r.length;u++){const c=r[u];c.attrs.every(d=>s.get(d.name)===d.value)&&(a+=1,a>=eh&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(ty)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:_r.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:_r.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(ty);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===_r.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===_r.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===_r.Element&&n.element===t)}}const li={createDocument(){return{nodeName:"#document",mode:qn.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const s=e.childNodes.find(a=>a.nodeName==="#documentType");if(s)s.name=t,s.publicId=n,s.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};li.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(li.isTextNode(n)){n.value+=t;return}}li.appendChild(e,li.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&li.isTextNode(r)?r.value+=t:li.insertBefore(e,li.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation=H(H({},e.sourceCodeLocation),t)}},ny="html",oP="about:legacy-compat",aP="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",ry=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],uP=[...ry,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],lP=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),iy=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],cP=[...iy,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function sy(e,t){return t.some(n=>e.startsWith(n))}function dP(e){return e.name===ny&&e.publicId===null&&(e.systemId===null||e.systemId===oP)}function fP(e){if(e.name!==ny)return qn.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===aP)return qn.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),lP.has(n))return qn.QUIRKS;let r=t===null?uP:ry;if(sy(n,r))return qn.QUIRKS;if(r=t===null?iy:cP,sy(n,r))return qn.LIMITED_QUIRKS}return qn.NO_QUIRKS}const oy={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},hP="definitionurl",pP="definitionURL",mP=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),gP=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ye.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ye.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ye.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ye.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ye.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ye.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ye.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ye.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ye.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ye.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ye.XMLNS}]]),EP=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),yP=new Set([g.B,g.BIG,g.BLOCKQUOTE,g.BODY,g.BR,g.CENTER,g.CODE,g.DD,g.DIV,g.DL,g.DT,g.EM,g.EMBED,g.H1,g.H2,g.H3,g.H4,g.H5,g.H6,g.HEAD,g.HR,g.I,g.IMG,g.LI,g.LISTING,g.MENU,g.META,g.NOBR,g.OL,g.P,g.PRE,g.RUBY,g.S,g.SMALL,g.SPAN,g.STRONG,g.STRIKE,g.SUB,g.SUP,g.TABLE,g.TT,g.U,g.UL,g.VAR]);function TP(e){const t=e.tagID;return t===g.FONT&&e.attrs.some(({name:r})=>r===Ji.COLOR||r===Ji.SIZE||r===Ji.FACE)||yP.has(t)}function ay(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===hP){e.attrs[t].name=pP;break}}function uy(e){for(let t=0;t<e.attrs.length;t++){const n=mP.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function th(e){for(let t=0;t<e.attrs.length;t++){const n=gP.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function bP(e){const t=EP.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Vs(e.tagName))}function xP(e,t){return t===ye.MATHML&&(e===g.MI||e===g.MO||e===g.MN||e===g.MS||e===g.MTEXT)}function _P(e,t,n){if(t===ye.MATHML&&e===g.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Ji.ENCODING){const s=n[r].value.toLowerCase();return s===oy.TEXT_HTML||s===oy.APPLICATION_XML}}return t===ye.SVG&&(e===g.FOREIGN_OBJECT||e===g.DESC||e===g.TITLE)}function wP(e,t,n,r){return(!r||r===ye.HTML)&&_P(e,t,n)||(!r||r===ye.MATHML)&&xP(e,t)}const SP="hidden",vP=8,AP=3;var U;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(U||(U={}));const kP={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},ly=new Set([g.TABLE,g.TBODY,g.TFOOT,g.THEAD,g.TR]),cy={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:li,onParseError:null};class dy{constructor(t,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=U.INITIAL,this.originalInsertionMode=U.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options=H(H({},cy),t),this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n!=null?n:this.treeAdapter.createDocument(),this.tokenizer=new KI(this.options,this),this.activeFormattingElements=new sP(this.treeAdapter),this.fragmentContextID=r?Vs(this.treeAdapter.getTagName(r)):g.UNKNOWN,this._setContextModes(r!=null?r:this.document,this.fragmentContextID),this.openElements=new iP(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r=H(H({},cy),n);t!=null||(t=r.treeAdapter.createElement(K.TEMPLATE,ye.HTML,[]));const s=r.treeAdapter.createElement("documentmock",ye.HTML,[]),a=new this(r,s,t);return a.fragmentContextID===g.TEMPLATE&&a.tmplInsertionModeStack.unshift(U.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var s;if(!this.onParseError)return;const a=(s=t.location)!==null&&s!==void 0?s:kP,u={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(u)}onItemPush(t,n,r){var s,a;(a=(s=this.treeAdapter).onItemPush)===null||a===void 0||a.call(s,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,t,this.openElements.current),n){let a,u;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,u=this.fragmentContextID):{current:a,currentTagId:u}=this.openElements,this._setContextModes(a,u)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===ye.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,ye.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=U.TEXT}switchToPlaintextParsing(){this.insertionMode=U.TEXT,this.originalInsertionMode=U.IN_BODY,this.tokenizer.state=Ct.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===K.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ye.HTML))switch(this.fragmentContextID){case g.TITLE:case g.TEXTAREA:{this.tokenizer.state=Ct.RCDATA;break}case g.STYLE:case g.XMP:case g.IFRAME:case g.NOEMBED:case g.NOFRAMES:case g.NOSCRIPT:{this.tokenizer.state=Ct.RAWTEXT;break}case g.SCRIPT:{this.tokenizer.state=Ct.SCRIPT_DATA;break}case g.PLAINTEXT:{this.tokenizer.state=Ct.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),t.location){const u=this.treeAdapter.getChildNodes(this.document).find(c=>this.treeAdapter.isDocumentTypeNode(c));u&&this.treeAdapter.setNodeSourceCodeLocation(u,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&le(H({},n),{startTag:n});this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r!=null?r:this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,ye.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,ye.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(K.HTML,ye.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,g.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const s=this.treeAdapter.getChildNodes(n),a=r?s.lastIndexOf(r):s.length,u=s[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(u)){const{endLine:d,endCol:f,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(u,{endLine:d,endCol:f,endOffset:p})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(u,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(t),a=n.type===Qe.END_TAG&&s===n.tagName?{endTag:H({},r),endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===g.SVG&&this.treeAdapter.getTagName(n)===K.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ye.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===g.MGLYPH||t.tagID===g.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ye.HTML)}_processToken(t){switch(t.type){case Qe.CHARACTER:{this.onCharacter(t);break}case Qe.NULL_CHARACTER:{this.onNullCharacter(t);break}case Qe.COMMENT:{this.onComment(t);break}case Qe.DOCTYPE:{this.onDoctype(t);break}case Qe.START_TAG:{this._processStartTag(t);break}case Qe.END_TAG:{this.onEndTag(t);break}case Qe.EOF:{this.onEof(t);break}case Qe.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return wP(t,s,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===_r.Marker||this.openElements.contains(s.element)),r=n===-1?t-1:n-1;for(let s=r;s>=0;s--){const a=this.activeFormattingElements.entries[s];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=U.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(g.P),this.openElements.popUntilTagNamePopped(g.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case g.TR:{this.insertionMode=U.IN_ROW;return}case g.TBODY:case g.THEAD:case g.TFOOT:{this.insertionMode=U.IN_TABLE_BODY;return}case g.CAPTION:{this.insertionMode=U.IN_CAPTION;return}case g.COLGROUP:{this.insertionMode=U.IN_COLUMN_GROUP;return}case g.TABLE:{this.insertionMode=U.IN_TABLE;return}case g.BODY:{this.insertionMode=U.IN_BODY;return}case g.FRAMESET:{this.insertionMode=U.IN_FRAMESET;return}case g.SELECT:{this._resetInsertionModeForSelect(t);return}case g.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case g.HTML:{this.insertionMode=this.headElement?U.AFTER_HEAD:U.BEFORE_HEAD;return}case g.TD:case g.TH:{if(t>0){this.insertionMode=U.IN_CELL;return}break}case g.HEAD:{if(t>0){this.insertionMode=U.IN_HEAD;return}break}}this.insertionMode=U.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===g.TEMPLATE)break;if(r===g.TABLE){this.insertionMode=U.IN_SELECT_IN_TABLE;return}}this.insertionMode=U.IN_SELECT}_isElementCausesFosterParenting(t){return ly.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case g.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===ye.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case g.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return WI[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){r6(this,t);return}switch(this.insertionMode){case U.INITIAL:{ga(this,t);break}case U.BEFORE_HTML:{Ea(this,t);break}case U.BEFORE_HEAD:{ya(this,t);break}case U.IN_HEAD:{Ta(this,t);break}case U.IN_HEAD_NO_SCRIPT:{ba(this,t);break}case U.AFTER_HEAD:{xa(this,t);break}case U.IN_BODY:case U.IN_CAPTION:case U.IN_CELL:case U.IN_TEMPLATE:{hy(this,t);break}case U.TEXT:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:{sh(this,t);break}case U.IN_TABLE_TEXT:{xy(this,t);break}case U.IN_COLUMN_GROUP:{bl(this,t);break}case U.AFTER_BODY:{wl(this,t);break}case U.AFTER_AFTER_BODY:{Sl(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){n6(this,t);return}switch(this.insertionMode){case U.INITIAL:{ga(this,t);break}case U.BEFORE_HTML:{Ea(this,t);break}case U.BEFORE_HEAD:{ya(this,t);break}case U.IN_HEAD:{Ta(this,t);break}case U.IN_HEAD_NO_SCRIPT:{ba(this,t);break}case U.AFTER_HEAD:{xa(this,t);break}case U.TEXT:{this._insertCharacters(t);break}case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:{sh(this,t);break}case U.IN_COLUMN_GROUP:{bl(this,t);break}case U.AFTER_BODY:{wl(this,t);break}case U.AFTER_AFTER_BODY:{Sl(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){rh(this,t);return}switch(this.insertionMode){case U.INITIAL:case U.BEFORE_HTML:case U.BEFORE_HEAD:case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:case U.IN_BODY:case U.IN_TABLE:case U.IN_CAPTION:case U.IN_COLUMN_GROUP:case U.IN_TABLE_BODY:case U.IN_ROW:case U.IN_CELL:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:case U.IN_TEMPLATE:case U.IN_FRAMESET:case U.AFTER_FRAMESET:{rh(this,t);break}case U.IN_TABLE_TEXT:{Sa(this,t);break}case U.AFTER_BODY:{LP(this,t);break}case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:{DP(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case U.INITIAL:{MP(this,t);break}case U.BEFORE_HEAD:case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:{this._err(t,te.misplacedDoctype);break}case U.IN_TABLE_TEXT:{Sa(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,te.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?i6(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case U.INITIAL:{ga(this,t);break}case U.BEFORE_HTML:{FP(this,t);break}case U.BEFORE_HEAD:{UP(this,t);break}case U.IN_HEAD:{or(this,t);break}case U.IN_HEAD_NO_SCRIPT:{$P(this,t);break}case U.AFTER_HEAD:{VP(this,t);break}case U.IN_BODY:{un(this,t);break}case U.IN_TABLE:{qs(this,t);break}case U.IN_TABLE_TEXT:{Sa(this,t);break}case U.IN_CAPTION:{HR(this,t);break}case U.IN_COLUMN_GROUP:{oh(this,t);break}case U.IN_TABLE_BODY:{xl(this,t);break}case U.IN_ROW:{_l(this,t);break}case U.IN_CELL:{zR(this,t);break}case U.IN_SELECT:{Sy(this,t);break}case U.IN_SELECT_IN_TABLE:{qR(this,t);break}case U.IN_TEMPLATE:{WR(this,t);break}case U.AFTER_BODY:{XR(this,t);break}case U.IN_FRAMESET:{QR(this,t);break}case U.AFTER_FRAMESET:{JR(this,t);break}case U.AFTER_AFTER_BODY:{e6(this,t);break}case U.AFTER_AFTER_FRAMESET:{t6(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?s6(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case U.INITIAL:{ga(this,t);break}case U.BEFORE_HTML:{BP(this,t);break}case U.BEFORE_HEAD:{HP(this,t);break}case U.IN_HEAD:{jP(this,t);break}case U.IN_HEAD_NO_SCRIPT:{zP(this,t);break}case U.AFTER_HEAD:{qP(this,t);break}case U.IN_BODY:{Tl(this,t);break}case U.TEXT:{OR(this,t);break}case U.IN_TABLE:{_a(this,t);break}case U.IN_TABLE_TEXT:{Sa(this,t);break}case U.IN_CAPTION:{jR(this,t);break}case U.IN_COLUMN_GROUP:{$R(this,t);break}case U.IN_TABLE_BODY:{ah(this,t);break}case U.IN_ROW:{wy(this,t);break}case U.IN_CELL:{VR(this,t);break}case U.IN_SELECT:{vy(this,t);break}case U.IN_SELECT_IN_TABLE:{YR(this,t);break}case U.IN_TEMPLATE:{GR(this,t);break}case U.AFTER_BODY:{ky(this,t);break}case U.IN_FRAMESET:{KR(this,t);break}case U.AFTER_FRAMESET:{ZR(this,t);break}case U.AFTER_AFTER_BODY:{Sl(this,t);break}}}onEof(t){switch(this.insertionMode){case U.INITIAL:{ga(this,t);break}case U.BEFORE_HTML:{Ea(this,t);break}case U.BEFORE_HEAD:{ya(this,t);break}case U.IN_HEAD:{Ta(this,t);break}case U.IN_HEAD_NO_SCRIPT:{ba(this,t);break}case U.AFTER_HEAD:{xa(this,t);break}case U.IN_BODY:case U.IN_TABLE:case U.IN_CAPTION:case U.IN_COLUMN_GROUP:case U.IN_TABLE_BODY:case U.IN_ROW:case U.IN_CELL:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:{Ty(this,t);break}case U.TEXT:{IR(this,t);break}case U.IN_TABLE_TEXT:{Sa(this,t);break}case U.IN_TEMPLATE:{Ay(this,t);break}case U.AFTER_BODY:case U.IN_FRAMESET:case U.AFTER_FRAMESET:case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:{ih(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===I.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:case U.TEXT:case U.IN_COLUMN_GROUP:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:case U.IN_FRAMESET:case U.AFTER_FRAMESET:{this._insertCharacters(t);break}case U.IN_BODY:case U.IN_CAPTION:case U.IN_CELL:case U.IN_TEMPLATE:case U.AFTER_BODY:case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:{fy(this,t);break}case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:{sh(this,t);break}case U.IN_TABLE_TEXT:{by(this,t);break}}}}function NP(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):yy(e,t),n}function CP(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const s=e.openElements.items[r];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[r])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function OP(e,t,n){let r=t,s=e.openElements.getCommonAncestor(t);for(let a=0,u=s;u!==n;a++,u=s){s=e.openElements.getCommonAncestor(u);const c=e.activeFormattingElements.getElementEntry(u),d=c&&a>=AP;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(u)):(u=IP(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(u,r),r=u)}return r}function IP(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function PP(e,t,n){const r=e.treeAdapter.getTagName(t),s=Vs(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);s===g.TEMPLATE&&a===ye.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function RP(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,a=e.treeAdapter.createElement(s.tagName,r,s.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,s.tagID)}function nh(e,t){for(let n=0;n<vP;n++){const r=NP(e,t);if(!r)break;const s=CP(e,r);if(!s)break;e.activeFormattingElements.bookmark=r;const a=OP(e,s,r.element),u=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),u&&PP(e,u,a),RP(e,s,r)}}function rh(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function LP(e,t){e._appendCommentNode(t,e.openElements.items[0])}function DP(e,t){e._appendCommentNode(t,e.document)}function ih(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],u=e.treeAdapter.getNodeSourceCodeLocation(a);u&&!u.endTag&&e._setEndLocation(a,t)}}}}function MP(e,t){e._setDocumentType(t);const n=t.forceQuirks?qn.QUIRKS:fP(t);dP(t)||e._err(t,te.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=U.BEFORE_HTML}function ga(e,t){e._err(t,te.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,qn.QUIRKS),e.insertionMode=U.BEFORE_HTML,e._processToken(t)}function FP(e,t){t.tagID===g.HTML?(e._insertElement(t,ye.HTML),e.insertionMode=U.BEFORE_HEAD):Ea(e,t)}function BP(e,t){const n=t.tagID;(n===g.HTML||n===g.HEAD||n===g.BODY||n===g.BR)&&Ea(e,t)}function Ea(e,t){e._insertFakeRootElement(),e.insertionMode=U.BEFORE_HEAD,e._processToken(t)}function UP(e,t){switch(t.tagID){case g.HTML:{un(e,t);break}case g.HEAD:{e._insertElement(t,ye.HTML),e.headElement=e.openElements.current,e.insertionMode=U.IN_HEAD;break}default:ya(e,t)}}function HP(e,t){const n=t.tagID;n===g.HEAD||n===g.BODY||n===g.HTML||n===g.BR?ya(e,t):e._err(t,te.endTagWithoutMatchingOpenElement)}function ya(e,t){e._insertFakeElement(K.HEAD,g.HEAD),e.headElement=e.openElements.current,e.insertionMode=U.IN_HEAD,e._processToken(t)}function or(e,t){switch(t.tagID){case g.HTML:{un(e,t);break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:{e._appendElement(t,ye.HTML),t.ackSelfClosing=!0;break}case g.TITLE:{e._switchToTextParsing(t,Ct.RCDATA);break}case g.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Ct.RAWTEXT):(e._insertElement(t,ye.HTML),e.insertionMode=U.IN_HEAD_NO_SCRIPT);break}case g.NOFRAMES:case g.STYLE:{e._switchToTextParsing(t,Ct.RAWTEXT);break}case g.SCRIPT:{e._switchToTextParsing(t,Ct.SCRIPT_DATA);break}case g.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=U.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(U.IN_TEMPLATE);break}case g.HEAD:{e._err(t,te.misplacedStartTagForHeadElement);break}default:Ta(e,t)}}function jP(e,t){switch(t.tagID){case g.HEAD:{e.openElements.pop(),e.insertionMode=U.AFTER_HEAD;break}case g.BODY:case g.BR:case g.HTML:{Ta(e,t);break}case g.TEMPLATE:{Zi(e,t);break}default:e._err(t,te.endTagWithoutMatchingOpenElement)}}function Zi(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==g.TEMPLATE&&e._err(t,te.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,te.endTagWithoutMatchingOpenElement)}function Ta(e,t){e.openElements.pop(),e.insertionMode=U.AFTER_HEAD,e._processToken(t)}function $P(e,t){switch(t.tagID){case g.HTML:{un(e,t);break}case g.BASEFONT:case g.BGSOUND:case g.HEAD:case g.LINK:case g.META:case g.NOFRAMES:case g.STYLE:{or(e,t);break}case g.NOSCRIPT:{e._err(t,te.nestedNoscriptInHead);break}default:ba(e,t)}}function zP(e,t){switch(t.tagID){case g.NOSCRIPT:{e.openElements.pop(),e.insertionMode=U.IN_HEAD;break}case g.BR:{ba(e,t);break}default:e._err(t,te.endTagWithoutMatchingOpenElement)}}function ba(e,t){const n=t.type===Qe.EOF?te.openElementsLeftAfterEof:te.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=U.IN_HEAD,e._processToken(t)}function VP(e,t){switch(t.tagID){case g.HTML:{un(e,t);break}case g.BODY:{e._insertElement(t,ye.HTML),e.framesetOk=!1,e.insertionMode=U.IN_BODY;break}case g.FRAMESET:{e._insertElement(t,ye.HTML),e.insertionMode=U.IN_FRAMESET;break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:case g.NOFRAMES:case g.SCRIPT:case g.STYLE:case g.TEMPLATE:case g.TITLE:{e._err(t,te.abandonedHeadElementChild),e.openElements.push(e.headElement,g.HEAD),or(e,t),e.openElements.remove(e.headElement);break}case g.HEAD:{e._err(t,te.misplacedStartTagForHeadElement);break}default:xa(e,t)}}function qP(e,t){switch(t.tagID){case g.BODY:case g.HTML:case g.BR:{xa(e,t);break}case g.TEMPLATE:{Zi(e,t);break}default:e._err(t,te.endTagWithoutMatchingOpenElement)}}function xa(e,t){e._insertFakeElement(K.BODY,g.BODY),e.insertionMode=U.IN_BODY,yl(e,t)}function yl(e,t){switch(t.type){case Qe.CHARACTER:{hy(e,t);break}case Qe.WHITESPACE_CHARACTER:{fy(e,t);break}case Qe.COMMENT:{rh(e,t);break}case Qe.START_TAG:{un(e,t);break}case Qe.END_TAG:{Tl(e,t);break}case Qe.EOF:{Ty(e,t);break}}}function fy(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function hy(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function YP(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function WP(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function GP(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ye.HTML),e.insertionMode=U.IN_FRAMESET)}function XP(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ye.HTML)}function QP(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Zf.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ye.HTML)}function KP(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ye.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function JP(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ye.HTML),n||(e.formElement=e.openElements.current))}function ZP(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const s=e.openElements.tagIDs[r];if(n===g.LI&&s===g.LI||(n===g.DD||n===g.DT)&&(s===g.DD||s===g.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==g.ADDRESS&&s!==g.DIV&&s!==g.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ye.HTML)}function eR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ye.HTML),e.tokenizer.state=Ct.PLAINTEXT}function tR(e,t){e.openElements.hasInScope(g.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ye.HTML),e.framesetOk=!1}function nR(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(K.A);n&&(nh(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ye.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function rR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ye.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function iR(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(g.NOBR)&&(nh(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ye.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function sR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ye.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function oR(e,t){e.treeAdapter.getDocumentMode(e.document)!==qn.QUIRKS&&e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ye.HTML),e.framesetOk=!1,e.insertionMode=U.IN_TABLE}function py(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ye.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function my(e){const t=WE(e,Ji.TYPE);return t!=null&&t.toLowerCase()===SP}function aR(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ye.HTML),my(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function uR(e,t){e._appendElement(t,ye.HTML),t.ackSelfClosing=!0}function lR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._appendElement(t,ye.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function cR(e,t){t.tagName=K.IMG,t.tagID=g.IMG,py(e,t)}function dR(e,t){e._insertElement(t,ye.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Ct.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=U.TEXT}function fR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Ct.RAWTEXT)}function hR(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Ct.RAWTEXT)}function gy(e,t){e._switchToTextParsing(t,Ct.RAWTEXT)}function pR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ye.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===U.IN_TABLE||e.insertionMode===U.IN_CAPTION||e.insertionMode===U.IN_TABLE_BODY||e.insertionMode===U.IN_ROW||e.insertionMode===U.IN_CELL?U.IN_SELECT_IN_TABLE:U.IN_SELECT}function mR(e,t){e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ye.HTML)}function gR(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ye.HTML)}function ER(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(g.RTC),e._insertElement(t,ye.HTML)}function yR(e,t){e._reconstructActiveFormattingElements(),ay(t),th(t),t.selfClosing?e._appendElement(t,ye.MATHML):e._insertElement(t,ye.MATHML),t.ackSelfClosing=!0}function TR(e,t){e._reconstructActiveFormattingElements(),uy(t),th(t),t.selfClosing?e._appendElement(t,ye.SVG):e._insertElement(t,ye.SVG),t.ackSelfClosing=!0}function Ey(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ye.HTML)}function un(e,t){switch(t.tagID){case g.I:case g.S:case g.B:case g.U:case g.EM:case g.TT:case g.BIG:case g.CODE:case g.FONT:case g.SMALL:case g.STRIKE:case g.STRONG:{rR(e,t);break}case g.A:{nR(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{QP(e,t);break}case g.P:case g.DL:case g.OL:case g.UL:case g.DIV:case g.DIR:case g.NAV:case g.MAIN:case g.MENU:case g.ASIDE:case g.CENTER:case g.FIGURE:case g.FOOTER:case g.HEADER:case g.HGROUP:case g.DIALOG:case g.DETAILS:case g.ADDRESS:case g.ARTICLE:case g.SEARCH:case g.SECTION:case g.SUMMARY:case g.FIELDSET:case g.BLOCKQUOTE:case g.FIGCAPTION:{XP(e,t);break}case g.LI:case g.DD:case g.DT:{ZP(e,t);break}case g.BR:case g.IMG:case g.WBR:case g.AREA:case g.EMBED:case g.KEYGEN:{py(e,t);break}case g.HR:{lR(e,t);break}case g.RB:case g.RTC:{gR(e,t);break}case g.RT:case g.RP:{ER(e,t);break}case g.PRE:case g.LISTING:{KP(e,t);break}case g.XMP:{fR(e,t);break}case g.SVG:{TR(e,t);break}case g.HTML:{YP(e,t);break}case g.BASE:case g.LINK:case g.META:case g.STYLE:case g.TITLE:case g.SCRIPT:case g.BGSOUND:case g.BASEFONT:case g.TEMPLATE:{or(e,t);break}case g.BODY:{WP(e,t);break}case g.FORM:{JP(e,t);break}case g.NOBR:{iR(e,t);break}case g.MATH:{yR(e,t);break}case g.TABLE:{oR(e,t);break}case g.INPUT:{aR(e,t);break}case g.PARAM:case g.TRACK:case g.SOURCE:{uR(e,t);break}case g.IMAGE:{cR(e,t);break}case g.BUTTON:{tR(e,t);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{sR(e,t);break}case g.IFRAME:{hR(e,t);break}case g.SELECT:{pR(e,t);break}case g.OPTION:case g.OPTGROUP:{mR(e,t);break}case g.NOEMBED:case g.NOFRAMES:{gy(e,t);break}case g.FRAMESET:{GP(e,t);break}case g.TEXTAREA:{dR(e,t);break}case g.NOSCRIPT:{e.options.scriptingEnabled?gy(e,t):Ey(e,t);break}case g.PLAINTEXT:{eR(e,t);break}case g.COL:case g.TH:case g.TD:case g.TR:case g.HEAD:case g.FRAME:case g.TBODY:case g.TFOOT:case g.THEAD:case g.CAPTION:case g.COLGROUP:break;default:Ey(e,t)}}function bR(e,t){if(e.openElements.hasInScope(g.BODY)&&(e.insertionMode=U.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function xR(e,t){e.openElements.hasInScope(g.BODY)&&(e.insertionMode=U.AFTER_BODY,ky(e,t))}function _R(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function wR(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(g.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(g.FORM):n&&e.openElements.remove(n))}function SR(e){e.openElements.hasInButtonScope(g.P)||e._insertFakeElement(K.P,g.P),e._closePElement()}function vR(e){e.openElements.hasInListItemScope(g.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(g.LI),e.openElements.popUntilTagNamePopped(g.LI))}function AR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function kR(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function NR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function CR(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(K.BR,g.BR),e.openElements.pop(),e.framesetOk=!1}function yy(e,t){const n=t.tagName,r=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){const a=e.openElements.items[s],u=e.openElements.tagIDs[s];if(r===u&&(r!==g.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(a,u))break}}function Tl(e,t){switch(t.tagID){case g.A:case g.B:case g.I:case g.S:case g.U:case g.EM:case g.TT:case g.BIG:case g.CODE:case g.FONT:case g.NOBR:case g.SMALL:case g.STRIKE:case g.STRONG:{nh(e,t);break}case g.P:{SR(e);break}case g.DL:case g.UL:case g.OL:case g.DIR:case g.DIV:case g.NAV:case g.PRE:case g.MAIN:case g.MENU:case g.ASIDE:case g.BUTTON:case g.CENTER:case g.FIGURE:case g.FOOTER:case g.HEADER:case g.HGROUP:case g.DIALOG:case g.ADDRESS:case g.ARTICLE:case g.DETAILS:case g.SEARCH:case g.SECTION:case g.SUMMARY:case g.LISTING:case g.FIELDSET:case g.BLOCKQUOTE:case g.FIGCAPTION:{_R(e,t);break}case g.LI:{vR(e);break}case g.DD:case g.DT:{AR(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{kR(e);break}case g.BR:{CR(e);break}case g.BODY:{bR(e,t);break}case g.HTML:{xR(e,t);break}case g.FORM:{wR(e);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{NR(e,t);break}case g.TEMPLATE:{Zi(e,t);break}default:yy(e,t)}}function Ty(e,t){e.tmplInsertionModeStack.length>0?Ay(e,t):ih(e,t)}function OR(e,t){var n;t.tagID===g.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function IR(e,t){e._err(t,te.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function sh(e,t){if(e.openElements.currentTagId!==void 0&&ly.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=U.IN_TABLE_TEXT,t.type){case Qe.CHARACTER:{xy(e,t);break}case Qe.WHITESPACE_CHARACTER:{by(e,t);break}}else wa(e,t)}function PR(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ye.HTML),e.insertionMode=U.IN_CAPTION}function RR(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ye.HTML),e.insertionMode=U.IN_COLUMN_GROUP}function LR(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(K.COLGROUP,g.COLGROUP),e.insertionMode=U.IN_COLUMN_GROUP,oh(e,t)}function DR(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ye.HTML),e.insertionMode=U.IN_TABLE_BODY}function MR(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(K.TBODY,g.TBODY),e.insertionMode=U.IN_TABLE_BODY,xl(e,t)}function FR(e,t){e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function BR(e,t){my(t)?e._appendElement(t,ye.HTML):wa(e,t),t.ackSelfClosing=!0}function UR(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,ye.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function qs(e,t){switch(t.tagID){case g.TD:case g.TH:case g.TR:{MR(e,t);break}case g.STYLE:case g.SCRIPT:case g.TEMPLATE:{or(e,t);break}case g.COL:{LR(e,t);break}case g.FORM:{UR(e,t);break}case g.TABLE:{FR(e,t);break}case g.TBODY:case g.TFOOT:case g.THEAD:{DR(e,t);break}case g.INPUT:{BR(e,t);break}case g.CAPTION:{PR(e,t);break}case g.COLGROUP:{RR(e,t);break}default:wa(e,t)}}function _a(e,t){switch(t.tagID){case g.TABLE:{e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode());break}case g.TEMPLATE:{Zi(e,t);break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TBODY:case g.TD:case g.TFOOT:case g.TH:case g.THEAD:case g.TR:break;default:wa(e,t)}}function wa(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,yl(e,t),e.fosterParentingEnabled=n}function by(e,t){e.pendingCharacterTokens.push(t)}function xy(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Sa(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)wa(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const _y=new Set([g.CAPTION,g.COL,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]);function HR(e,t){const n=t.tagID;_y.has(n)?e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_TABLE,qs(e,t)):un(e,t)}function jR(e,t){const n=t.tagID;switch(n){case g.CAPTION:case g.TABLE:{e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_TABLE,n===g.TABLE&&_a(e,t));break}case g.BODY:case g.COL:case g.COLGROUP:case g.HTML:case g.TBODY:case g.TD:case g.TFOOT:case g.TH:case g.THEAD:case g.TR:break;default:Tl(e,t)}}function oh(e,t){switch(t.tagID){case g.HTML:{un(e,t);break}case g.COL:{e._appendElement(t,ye.HTML),t.ackSelfClosing=!0;break}case g.TEMPLATE:{or(e,t);break}default:bl(e,t)}}function $R(e,t){switch(t.tagID){case g.COLGROUP:{e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=U.IN_TABLE);break}case g.TEMPLATE:{Zi(e,t);break}case g.COL:break;default:bl(e,t)}}function bl(e,t){e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=U.IN_TABLE,e._processToken(t))}function xl(e,t){switch(t.tagID){case g.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,ye.HTML),e.insertionMode=U.IN_ROW;break}case g.TH:case g.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(K.TR,g.TR),e.insertionMode=U.IN_ROW,_l(e,t);break}case g.CAPTION:case g.COL:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE,qs(e,t));break}default:qs(e,t)}}function ah(e,t){const n=t.tagID;switch(t.tagID){case g.TBODY:case g.TFOOT:case g.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE);break}case g.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE,_a(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TD:case g.TH:case g.TR:break;default:_a(e,t)}}function _l(e,t){switch(t.tagID){case g.TH:case g.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,ye.HTML),e.insertionMode=U.IN_CELL,e.activeFormattingElements.insertMarker();break}case g.CAPTION:case g.COL:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,xl(e,t));break}default:qs(e,t)}}function wy(e,t){switch(t.tagID){case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY);break}case g.TABLE:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,ah(e,t));break}case g.TBODY:case g.TFOOT:case g.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(g.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,ah(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TD:case g.TH:break;default:_a(e,t)}}function zR(e,t){const n=t.tagID;_y.has(n)?(e.openElements.hasInTableScope(g.TD)||e.openElements.hasInTableScope(g.TH))&&(e._closeTableCell(),_l(e,t)):un(e,t)}function VR(e,t){const n=t.tagID;switch(n){case g.TD:case g.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_ROW);break}case g.TABLE:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),wy(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:break;default:Tl(e,t)}}function Sy(e,t){switch(t.tagID){case g.HTML:{un(e,t);break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._insertElement(t,ye.HTML);break}case g.OPTGROUP:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._insertElement(t,ye.HTML);break}case g.HR:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._appendElement(t,ye.HTML),t.ackSelfClosing=!0;break}case g.INPUT:case g.KEYGEN:case g.TEXTAREA:case g.SELECT:{e.openElements.hasInSelectScope(g.SELECT)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),t.tagID!==g.SELECT&&e._processStartTag(t));break}case g.SCRIPT:case g.TEMPLATE:{or(e,t);break}}}function vy(e,t){switch(t.tagID){case g.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===g.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===g.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop();break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop();break}case g.SELECT:{e.openElements.hasInSelectScope(g.SELECT)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode());break}case g.TEMPLATE:{Zi(e,t);break}}}function qR(e,t){const n=t.tagID;n===g.CAPTION||n===g.TABLE||n===g.TBODY||n===g.TFOOT||n===g.THEAD||n===g.TR||n===g.TD||n===g.TH?(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Sy(e,t)}function YR(e,t){const n=t.tagID;n===g.CAPTION||n===g.TABLE||n===g.TBODY||n===g.TFOOT||n===g.THEAD||n===g.TR||n===g.TD||n===g.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),e.onEndTag(t)):vy(e,t)}function WR(e,t){switch(t.tagID){case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:case g.NOFRAMES:case g.SCRIPT:case g.STYLE:case g.TEMPLATE:case g.TITLE:{or(e,t);break}case g.CAPTION:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.tmplInsertionModeStack[0]=U.IN_TABLE,e.insertionMode=U.IN_TABLE,qs(e,t);break}case g.COL:{e.tmplInsertionModeStack[0]=U.IN_COLUMN_GROUP,e.insertionMode=U.IN_COLUMN_GROUP,oh(e,t);break}case g.TR:{e.tmplInsertionModeStack[0]=U.IN_TABLE_BODY,e.insertionMode=U.IN_TABLE_BODY,xl(e,t);break}case g.TD:case g.TH:{e.tmplInsertionModeStack[0]=U.IN_ROW,e.insertionMode=U.IN_ROW,_l(e,t);break}default:e.tmplInsertionModeStack[0]=U.IN_BODY,e.insertionMode=U.IN_BODY,un(e,t)}}function GR(e,t){t.tagID===g.TEMPLATE&&Zi(e,t)}function Ay(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):ih(e,t)}function XR(e,t){t.tagID===g.HTML?un(e,t):wl(e,t)}function ky(e,t){var n;if(t.tagID===g.HTML){if(e.fragmentContext||(e.insertionMode=U.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===g.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else wl(e,t)}function wl(e,t){e.insertionMode=U.IN_BODY,yl(e,t)}function QR(e,t){switch(t.tagID){case g.HTML:{un(e,t);break}case g.FRAMESET:{e._insertElement(t,ye.HTML);break}case g.FRAME:{e._appendElement(t,ye.HTML),t.ackSelfClosing=!0;break}case g.NOFRAMES:{or(e,t);break}}}function KR(e,t){t.tagID===g.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==g.FRAMESET&&(e.insertionMode=U.AFTER_FRAMESET))}function JR(e,t){switch(t.tagID){case g.HTML:{un(e,t);break}case g.NOFRAMES:{or(e,t);break}}}function ZR(e,t){t.tagID===g.HTML&&(e.insertionMode=U.AFTER_AFTER_FRAMESET)}function e6(e,t){t.tagID===g.HTML?un(e,t):Sl(e,t)}function Sl(e,t){e.insertionMode=U.IN_BODY,yl(e,t)}function t6(e,t){switch(t.tagID){case g.HTML:{un(e,t);break}case g.NOFRAMES:{or(e,t);break}}}function n6(e,t){t.chars=xt,e._insertCharacters(t)}function r6(e,t){e._insertCharacters(t),e.framesetOk=!1}function Ny(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ye.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function i6(e,t){if(TP(t))Ny(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ye.MATHML?ay(t):r===ye.SVG&&(bP(t),uy(t)),th(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function s6(e,t){if(t.tagID===g.P||t.tagID===g.BR){Ny(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===ye.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}K.AREA,K.BASE,K.BASEFONT,K.BGSOUND,K.BR,K.COL,K.EMBED,K.FRAME,K.HR,K.IMG,K.INPUT,K.KEYGEN,K.LINK,K.META,K.PARAM,K.SOURCE,K.TRACK,K.WBR;const o6=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,a6=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Cy={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Oy(e,t){const n=E6(e),r=$E("type",{handlers:{root:u6,element:l6,text:c6,comment:Py,doctype:d6,raw:h6},unknown:p6}),s={parser:n?new dy(Cy):dy.getFragmentParser(void 0,Cy),handle(c){r(c,s)},stitches:!1,options:t||{}};r(e,s),Ys(s,br());const a=n?s.parser.document:s.parser.getFragment(),u=yI(a,{file:s.options.file});return s.stitches&&hl(u,"comment",function(c,d,f){const p=c;if(p.value.stitch&&f&&d!==void 0){const m=f.children;return m[d]=p.value.stitch,d}}),u.type==="root"&&u.children.length===1&&u.children[0].type===e.type?u.children[0]:u}function Iy(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function u6(e,t){Iy(e.children,t)}function l6(e,t){m6(e,t),Iy(e.children,t),g6(e,t)}function c6(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Qe.CHARACTER,chars:e.value,location:va(e)};Ys(t,br(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function d6(e,t){const n={type:Qe.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:va(e)};Ys(t,br(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function f6(e,t){t.stitches=!0;const n=y6(e);if("children"in e&&"children"in n){const r=Oy({type:"root",children:e.children},t.options);n.children=r.children}Py({type:"comment",value:{stitch:n}},t)}function Py(e,t){const n=e.value,r={type:Qe.COMMENT,data:n,location:va(e)};Ys(t,br(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function h6(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,Ry(t,br(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(o6,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function p6(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))f6(n,t);else{let r="";throw a6.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Ys(e,t){Ry(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Ct.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function Ry(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function m6(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Ct.PLAINTEXT)return;Ys(t,br(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:Ki.html;s===Ki.html&&n==="svg"&&(s=Ki.svg);const a=wI(le(H({},e),{children:[]}),{space:s===Ki.svg?"svg":"html"}),u={type:Qe.START_TAG,tagName:n,tagID:Vs(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:va(e)};t.parser.currentToken=u,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function g6(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&II.includes(n)||t.parser.tokenizer.state===Ct.PLAINTEXT)return;Ys(t,nl(e));const r={type:Qe.END_TAG,tagName:n,tagID:Vs(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:va(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Ct.RCDATA||t.parser.tokenizer.state===Ct.RAWTEXT||t.parser.tokenizer.state===Ct.SCRIPT_DATA)&&(t.parser.tokenizer.state=Ct.DATA)}function E6(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function va(e){const t=br(e)||{line:void 0,column:void 0,offset:void 0},n=nl(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function y6(e){return"children"in e?Qi(le(H({},e),{children:[]})):Qi(e)}function Ly(e){return function(t,n){return Oy(t,le(H({},e),{file:n}))}}const es=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Dy={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...es,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...es],h2:[["className","sr-only"]],img:[...es,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...es,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...es],table:[...es],ul:[...es,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},ci={}.hasOwnProperty;function T6(e,t){let n={type:"root",children:[]};const r={schema:t?H(H({},Dy),t):Dy,stack:[]},s=My(r,e);return s&&(Array.isArray(s)?s.length===1?n=s[0]:n.children=s:n=s),n}function My(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return b6(e,n);case"doctype":return x6(e,n);case"element":return _6(e,n);case"root":return w6(e,n);case"text":return S6(e,n)}}}function b6(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),a={type:"comment",value:r<0?n:n.slice(0,r)};return Aa(a,t),a}}function x6(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Aa(n,t),n}}function _6(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=Fy(e,t.children),s=v6(e,t.properties);e.stack.pop();let a=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&ci.call(e.schema.ancestors,n))){const c=e.schema.ancestors[n];let d=-1;for(a=!1;++d<c.length;)e.stack.includes(c[d])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const u={type:"element",tagName:n,properties:s,children:r};return Aa(u,t),u}function w6(e,t){const r={type:"root",children:Fy(e,t.children)};return Aa(r,t),r}function S6(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Aa(r,t),r}function Fy(e,t){const n=[];if(Array.isArray(t)){const r=t;let s=-1;for(;++s<r.length;){const a=My(e,r[s]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function v6(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,s=e.schema.required,a=r&&ci.call(r,n)?r[n]:void 0,u=r&&ci.call(r,"*")?r["*"]:void 0,c=t&&typeof t=="object"?t:{},d={};let f;for(f in c)if(ci.call(c,f)){const p=c[f];let m=By(e,Hy(a,f),f,p);m==null&&(m=By(e,Hy(u,f),f,p)),m!=null&&(d[f]=m)}if(s&&ci.call(s,n)){const p=s[n];for(f in p)ci.call(p,f)&&!ci.call(d,f)&&(d[f]=p[f])}return d}function By(e,t,n,r){return t?Array.isArray(r)?A6(e,t,n,r):Uy(e,t,n,r):void 0}function A6(e,t,n,r){let s=-1;const a=[];for(;++s<r.length;){const u=Uy(e,t,n,r[s]);(typeof u=="number"||typeof u=="string")&&a.push(u)}return a}function Uy(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&k6(e,n,r)){if(typeof t=="object"&&t.length>1){let s=!1,a=0;for(;++a<t.length;){const u=t[a];if(u&&typeof u=="object"&&"flags"in u){if(u.test(String(r))){s=!0;break}}else if(u===r){s=!0;break}}if(!s)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function k6(e,t,n){const r=e.schema.protocols&&ci.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const s=String(n),a=s.indexOf(":"),u=s.indexOf("?"),c=s.indexOf("#"),d=s.indexOf("/");if(a<0||d>-1&&a>d||u>-1&&a>u||c>-1&&a>c)return!0;let f=-1;for(;++f<r.length;){const p=r[f];if(a===p.length&&s.slice(0,p.length)===p)return!0}return!1}function Aa(e,t){const n=I1(t);t.data&&(e.data=Qi(t.data)),n&&(e.position=n)}function Hy(e,t){let n,r=-1;if(e)for(;++r<e.length;){const s=e[r],a=typeof s=="string"?s:s[0];if(a===t)return s;a==="data*"&&(n=s)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function N6(e){return function(t){return T6(t,e)}}const jy=({globalClassName:e,openLinksInNewTab:t,href:n,title:r,children:s})=>{const a=n?t?"_blank":"_self":void 0;return _.jsx("a",le(H(H({className:M(e,`${O}-link`)},n?{href:n,target:a}:{}),r?{title:r}:{}),{rel:"noopener noreferrer",children:s}))},C6=()=>{const{disclaimerText:e,disclaimerMarkdown:t,globalClassName:n}=at();return!e&&!t?null:_.jsx("div",{className:M(n,`${O}-disclaimer`),children:t?_.jsx(RE,{rehypePlugins:[Ly,N6],components:{ul:({children:r})=>_.jsx("ul",{className:M(n,`${O}-ul`),children:r}),ol:({children:r})=>_.jsx("ol",{className:M(n,`${O}-ol`),children:r}),li:({children:r})=>_.jsx("li",{className:M(n,`${O}-li`),children:r}),a:({href:r,title:s,children:a})=>_.jsx(jy,{globalClassName:n,openLinksInNewTab:!0,href:r,title:s,children:a}),img:({src:r,alt:s})=>_.jsx("img",{className:M(n,`${O}-disclaimer-image`),src:r,alt:s}),p:({children:r})=>_.jsx("p",{className:M(n,`${O}-disclaimer-text`),children:r}),span:({children:r})=>_.jsx("span",{className:M(n,`${O}-disclaimer-text-span`),children:r})},children:t}):_.jsx("p",{className:M(n,`${O}-disclaimer-text`),children:e})})},uh=({className:e,isLoading:t,componentType:n,onSubmit:r})=>{const{isConnected:s,sessionExpired:a}=sn(),{globalClassName:u,searchConfig:c,enableEscalationToAgent:d}=at(),f=B.useRef(null),p=t||!s&&!a,m=y=>{var A;y.preventDefault();const x=(((A=f.current)==null?void 0:A.value)||"").trim();x&&(f.current.value="",r(x))},b=()=>{r("Can you connect me to a human?")};return _.jsxs("div",{className:M(u,e,`cim-${n}-component`,`${O}-search-bar-wrapper`),children:[_.jsxs("form",{className:M(u,e,`cim-${n}-component`,`${O}-search-bar`),name:`${O}-search-form`,onSubmit:m,children:[_.jsx("input",{className:M(u,e,`cim-${n}-component`,`${O}-search-input`),type:"text",ref:f,placeholder:(c==null?void 0:c.placeholder)||"Ask us anything",name:`${O}-user-input`,disabled:p}),_.jsx(aN,{className:e,globalClassName:u,searchConfig:c,componentType:n,isLoading:p}),d&&_.jsx(ir,{className:M(u,`${O}-escalate-btn`),ariaLabel:"Connect to a human agent",title:"Connect to a human agent",disabled:p,onClick:b,icon:_.jsx(Xk,{})})]}),_.jsx(C6,{})]})};function O6(e){return ot({attr:{version:"1.1",viewBox:"0 0 17 17"},child:[{tag:"g",attr:{},child:[]},{tag:"path",attr:{d:"M17 16v1h-17v-1h17zM13.354 8.854l-0.707-0.707-3.646 3.646v-11.793h-1v11.794l-3.647-3.648-0.708 0.708 4.854 4.853 4.854-4.853z"},child:[]}]})(e)}function I6(e){return ot({attr:{version:"1.1",viewBox:"0 0 17 17"},child:[{tag:"g",attr:{},child:[]},{tag:"path",attr:{d:"M6 8h-6v-6h1v4.109c1.013-3.193 4.036-5.484 7.5-5.484 3.506 0 6.621 2.36 7.574 5.739l-0.963 0.271c-0.832-2.95-3.551-5.011-6.611-5.011-3.226 0.001-6.016 2.276-6.708 5.376h4.208v1zM11 9v1h4.208c-0.693 3.101-3.479 5.375-6.708 5.375-3.062 0-5.78-2.061-6.611-5.011l-0.963 0.271c0.952 3.379 4.067 5.739 7.574 5.739 3.459 0 6.475-2.28 7.5-5.482v4.108h1v-6h-6z"},child:[]}]})(e)}const $y=B.createContext({isOpen:!1}),lh=B.createContext(null),zy=B.createContext(null),Ws=()=>{var n,r;const e=B.useContext(lh),t=B.useContext(zy);return(r=(n=e==null?void 0:e.closeMenu)!=null?n:t==null?void 0:t.closeMenu)!=null?r:(()=>{})},Vy=({onClearChat:e,componentType:t})=>{const n=Ws(),r=()=>{e(),n()};return _.jsxs("button",{className:M(`${O}-overflow-menu-button`,"clear-chat-button",`cim-${t}-component`),onClick:r,children:[_.jsx(I6,{}),"Clear chat"]})},qy=({onDownloadTranscript:e,componentType:t})=>{const{logger:n}=at(),r=Ws(),[s,a]=B.useState(!1),u=()=>Ue(null,null,function*(){if(!s){a(!0);try{yield e(),r()}catch(c){n==null||n.error("Error downloading transcript:",c)}finally{a(!1)}}});return _.jsxs("button",{className:M(`${O}-overflow-menu-button`,"download-transcript-button",`cim-${t}-component`),onClick:u,disabled:s,children:[_.jsx(O6,{}),"Download transcript"]})};function P6(e){return e==null?[]:Array.isArray(e)?e:[e]}var R6=(e,...t)=>e.concat(t),L6=(e,...t)=>e.filter(n=>!t.includes(n)),D6=e=>Array.from(new Set(e));function Yy(e,t,n={}){const{step:r=1,loop:s=!0}=n,a=t+r,u=e.length,c=u-1;return t===-1?r>0?0:c:a<0?s?c:0:a>=u?s?0:t>u?u:t:a}function M6(e,t,n={}){const{step:r=1,loop:s=!0}=n;return Yy(e,t,{step:-r,loop:s})}var F6=e=>Array.isArray(e),Wy=e=>e!=null&&typeof e=="object",B6=e=>Wy(e)&&!F6(e),vl=e=>typeof e=="string",Gs=e=>typeof e=="function",U6=e=>e==null,H6=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),j6=e=>Object.prototype.toString.call(e),Gy=Function.prototype.toString,$6=Gy.call(Object),z6=e=>{if(!Wy(e)||j6(e)!="[object Object]"||Y6(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=H6(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Gy.call(n)==$6},V6=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,q6=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,Y6=e=>V6(e)||q6(e),W6=e=>e(),G6=()=>{},ch=(...e)=>(...t)=>{e.forEach(function(n){n==null||n(...t)})};function X6(e,t=0){let n=0,r=null;return((...s)=>{const a=Date.now(),u=a-n;u>=t?(r&&(clearTimeout(r),r=null),e(...s),n=a):r||(r=setTimeout(()=>{e(...s),n=Date.now(),r=null},t-u))})}var{min:Q6,max:K6}=Math,J6=e=>Number.isNaN(e),Z6=e=>J6(e)?0:e,Xy=(e,t,n)=>Q6(K6(Z6(e),t),n);function dh(e){if(!z6(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const s=e[r];s!==void 0&&(n[r]=dh(s))}return n}function fh(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function e4(e,t){if(e==null)throw new Error(t())}function t4(e,t,n){let r=[];for(const s of t)e[s]==null&&r.push(s);if(r.length>0)throw new Error(`[zag-js${` > ${n}`}] missing required props: ${r.join(", ")}`)}var n4=Object.defineProperty,r4=(e,t,n)=>t in e?n4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hh=(e,t,n)=>r4(e,typeof t!="symbol"?t+"":t,n),Qy=()=>{},Al=e=>typeof e=="object"&&e!==null,Xs=e=>e?"":void 0,Ky=e=>e?"true":void 0,i4=1,s4=9,o4=11,$t=e=>Al(e)&&e.nodeType===i4&&typeof e.nodeName=="string",kl=e=>Al(e)&&e.nodeType===s4,a4=e=>Al(e)&&e===e.window,Jy=e=>$t(e)?e.localName||"":"#document";function u4(e){return["html","body","#document"].includes(Jy(e))}var l4=e=>Al(e)&&e.nodeType!==void 0,ts=e=>l4(e)&&e.nodeType===o4&&"host"in e,c4=e=>$t(e)&&e.localName==="input",d4=e=>$t(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function ka(e){if(!e)return!1;const t=e.getRootNode();return Js(t)===e}var f4=/(textarea|select)/;function h4(e){if(e==null||!$t(e))return!1;try{return c4(e)&&e.selectionStart!=null||f4.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch(t){return!1}}function Qs(e,t){var r;if(!e||!t||!$t(e)||!$t(t))return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e===t||e.contains(t))return!0;if(n&&ts(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function wr(e){var t;return kl(e)?e:a4(e)?e.document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function p4(e){return wr(e).documentElement}function Ks(e){var t,n,r;return ts(e)?Ks(e.host):kl(e)?(t=e.defaultView)!=null?t:window:$t(e)&&(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window}function Js(e){let t=e.activeElement;for(;t!=null&&t.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n||n===t)break;t=n}return t}function m4(e){if(Jy(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ts(e)&&e.host||p4(e);return ts(t)?t.host:t}function ph(e){var n;let t;try{if(t=e.getRootNode({composed:!0}),kl(t)||ts(t))return t}catch(r){}return(n=e.ownerDocument)!=null?n:document}var mh=new WeakMap;function Zs(e){return mh.has(e)||mh.set(e,Ks(e).getComputedStyle(e)),mh.get(e)}var gh=new Set(["menu","listbox","dialog","grid","tree","region"]),g4=e=>gh.has(e),Zy=e=>{var t;return((t=e.getAttribute("aria-controls"))==null?void 0:t.split(" "))||[]};function eT(e,t){const n=new Set,r=ph(e),s=a=>{const u=a.querySelectorAll("[aria-controls]");for(const c of u){if(c.getAttribute("aria-expanded")!=="true")continue;const d=Zy(c);for(const f of d){if(!f||n.has(f))continue;n.add(f);const p=r.getElementById(f);if(p){const m=p.getAttribute("role"),b=p.getAttribute("aria-modal")==="true";if(m&&g4(m)&&!b&&(p===t||p.contains(t)||s(p)))return!0}}}return!1};return s(e)}function tT(e,t){const n=ph(e),r=new Set,s=a=>{const u=a.querySelectorAll("[aria-controls]");for(const c of u){if(c.getAttribute("aria-expanded")!=="true")continue;const d=Zy(c);for(const f of d){if(!f||r.has(f))continue;r.add(f);const p=n.getElementById(f);if(p){const m=p.getAttribute("role"),b=p.getAttribute("aria-modal")==="true";m&&gh.has(m)&&!b&&(t(p),s(p))}}}};s(e)}function E4(e){const t=new Set;return tT(e,n=>{e.contains(n)||t.add(n)}),Array.from(t)}function y4(e){const t=e.getAttribute("role");return!!(t&&gh.has(t))}function T4(e){return e.hasAttribute("aria-controls")&&e.getAttribute("aria-expanded")==="true"}function b4(e){var t;return T4(e)?!0:!!((t=e.querySelector)!=null&&t.call(e,'[aria-controls][aria-expanded="true"]'))}function x4(e){if(!e.id)return!1;const t=ph(e),n=CSS.escape(e.id),r=`[aria-controls~="${n}"][aria-expanded="true"], [aria-controls="${n}"][aria-expanded="true"]`;return!!(t.querySelector(r)&&y4(e))}var Eh=()=>typeof document!="undefined";function _4(){var t;const e=navigator.userAgentData;return(t=e==null?void 0:e.platform)!=null?t:navigator.platform}var yh=e=>Eh()&&e.test(_4()),w4=e=>Eh()&&e.test(navigator.vendor),nT=()=>Eh()&&!!navigator.maxTouchPoints,S4=()=>yh(/^iPhone/i),v4=()=>yh(/^iPad/i)||Th()&&navigator.maxTouchPoints>1,Nl=()=>S4()||v4(),A4=()=>Th()||Nl(),Th=()=>yh(/^Mac/i),k4=()=>A4()&&w4(/apple/i);function N4(e){var t,n,r,s;return(s=(t=e.composedPath)==null?void 0:t.call(e))!=null?s:(r=(n=e.nativeEvent)==null?void 0:n.composedPath)==null?void 0:r.call(n)}function ar(e){var n;const t=N4(e);return(n=t==null?void 0:t[0])!=null?n:e.target}var rT=e=>e.button===0,C4=e=>e.button===2||Th()&&e.ctrlKey&&e.button===0,O4=e=>"touches"in e&&e.touches.length>0,I4={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},iT={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function P4(e,t={}){var u;const{dir:n="ltr",orientation:r="horizontal"}=t;let s=e.key;return s=(u=I4[s])!=null?u:s,n==="rtl"&&r==="horizontal"&&s in iT&&(s=iT[s]),s}function sT(e,t="client"){const n=O4(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var zt=(e,t,n,r)=>{const s=typeof e=="function"?e():e;return s==null||s.addEventListener(t,n,r),()=>{s==null||s.removeEventListener(t,n,r)}},oT=e=>$t(e)&&e.tagName==="IFRAME",R4=/^(audio|video|details)$/;function aT(e){const t=e.getAttribute("tabindex");return t?parseInt(t,10):NaN}var L4=e=>!Number.isNaN(aT(e)),D4=e=>aT(e)<0;function M4(e,t){if(!t)return null;if(t===!0)return e.shadowRoot||null;const n=t(e);return(n===!0?e.shadowRoot:n)||null}function uT(e,t,n){const r=[...e],s=[...e],a=new Set,u=new Map;e.forEach((d,f)=>u.set(d,f));let c=0;for(;c<s.length;){const d=s[c++];if(!d||a.has(d))continue;a.add(d);const f=M4(d,t);if(f){const p=Array.from(f.querySelectorAll(Cl)).filter(n),m=u.get(d);if(m!==void 0){const b=m+1;r.splice(b,0,...p),p.forEach((y,x)=>{u.set(y,b+x)});for(let y=b+p.length;y<r.length;y++)u.set(r[y],y)}else{const b=r.length;r.push(...p),p.forEach((y,x)=>{u.set(y,b+x)})}s.push(...p)}}return r}var Cl="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type",lT=(e,t={})=>{if(!e)return[];const{includeContainer:n=!1,getShadowRoot:r}=t,s=Array.from(e.querySelectorAll(Cl));(n==!0||n=="if-empty"&&s.length===0)&&$t(e)&&Sr(e)&&s.unshift(e);const u=[];for(const c of s)if(Sr(c)){if(oT(c)&&c.contentDocument){const d=c.contentDocument.body;u.push(...lT(d,{getShadowRoot:r}));continue}u.push(c)}return r?uT(u,r,Sr):u};function Sr(e){return!$t(e)||e.closest("[inert]")?!1:e.matches(Cl)&&d4(e)}function eo(e,t={}){if(!e)return[];const{includeContainer:n,getShadowRoot:r}=t,s=Array.from(e.querySelectorAll(Cl));n&&ns(e)&&s.unshift(e);const a=[];for(const u of s)if(ns(u)){if(oT(u)&&u.contentDocument){const c=u.contentDocument.body;a.push(...eo(c,{getShadowRoot:r}));continue}a.push(u)}if(r){const u=uT(a,r,ns);return!u.length&&n?s:u}return!a.length&&n?s:a}function ns(e){return $t(e)&&e.tabIndex>0?!0:Sr(e)&&!D4(e)}function F4(e,t={}){const n=eo(e,t),r=n[0]||null,s=n[n.length-1]||null;return[r,s]}function B4(e,t={}){const{current:n,getShadowRoot:r}=t,s=eo(e,{getShadowRoot:r}),a=(e==null?void 0:e.ownerDocument)||document,u=n!=null?n:Js(a);if(!u)return null;const c=s.indexOf(u);return s[c+1]||null}function Na(e){return e.tabIndex<0&&(R4.test(e.localName)||h4(e))&&!L4(e)?0:e.tabIndex}function cT(e){const{root:t,getInitialEl:n,filter:r,enabled:s=!0}=e;if(!s)return;let a=null;if(a||(a=typeof n=="function"?n():n),a||(a=t==null?void 0:t.querySelector("[data-autofocus],[autofocus]")),!a){const u=eo(t);a=r?u.filter(r)[0]:u[0]}return a||t||void 0}var U4=class y2{constructor(){hh(this,"id",null),hh(this,"fn_cleanup"),hh(this,"cleanup",()=>{this.cancel()})}static create(){return new y2}request(t){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=t==null?void 0:t()})}cancel(){var t;this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),(t=this.fn_cleanup)==null||t.call(this),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function Mt(e){const t=U4.create();return t.request(e),t.cleanup}function dT(e){const t=new Set;function n(r){const s=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(s))}return n(()=>n(e)),function(){t.forEach(s=>s())}}function bh(e){const t=m4(e);return u4(t)?wr(t).body:$t(t)&&$4(t)?t:bh(t)}var H4=/auto|scroll|overlay|hidden|clip/,j4=new Set(["inline","contents"]);function $4(e){const t=Ks(e),{overflow:n,overflowX:r,overflowY:s,display:a}=t.getComputedStyle(e);return H4.test(n+s+r)&&!j4.has(a)}var to="default",xh="",Ol=new WeakMap;function z4(e={}){const{target:t,doc:n}=e,r=n!=null?n:document,s=r.documentElement;return Nl()?(to==="default"&&(xh=s.style.webkitUserSelect,s.style.webkitUserSelect="none"),to="disabled"):t&&(Ol.set(t,t.style.userSelect),t.style.userSelect="none"),()=>V4({target:t,doc:r})}function V4(e={}){const{target:t,doc:n}=e,s=(n!=null?n:document).documentElement;if(Nl()){if(to!=="disabled")return;to="restoring",setTimeout(()=>{dT(()=>{to==="restoring"&&(s.style.webkitUserSelect==="none"&&(s.style.webkitUserSelect=xh||""),xh="",to="default")})},300)}else if(t&&Ol.has(t)){const a=Ol.get(t);t.style.userSelect==="none"&&(t.style.userSelect=a!=null?a:""),t.getAttribute("style")===""&&t.removeAttribute("style"),Ol.delete(t)}}function q4(e={}){const u=e,{defer:t,target:n}=u,r=yn(u,["defer","target"]),s=t?Mt:c=>c(),a=[];return a.push(s(()=>{const c=typeof n=="function"?n():n;a.push(z4(le(H({},r),{target:c})))})),()=>{a.forEach(c=>c==null?void 0:c())}}function Y4(e,t){const{onPointerMove:n,onPointerUp:r}=t,s=c=>{const d=sT(c),f=Math.sqrt(fd(d.x,2)+fd(d.y,2)),p=c.pointerType==="touch"?10:5;if(!(f<p)){if(c.pointerType==="mouse"&&c.button===0){a(c);return}n({point:d,event:c})}},a=c=>{const d=sT(c);r({point:d,event:c})},u=[zt(e,"pointermove",s,!1),zt(e,"pointerup",a,!1),zt(e,"pointercancel",a,!1),zt(e,"contextmenu",a,!1),q4({doc:e})];return()=>{u.forEach(c=>c())}}function W4(e,t={}){const{triggerElement:n,onFocus:r,onFocusEnter:s,getShadowRoot:a}=t,u=(e==null?void 0:e.ownerDocument)||document,c=u.body;function d(f){if(f.key!=="Tab")return;let p=null;const[m,b]=F4(e,{includeContainer:!0,getShadowRoot:a}),y=B4(c,{current:n,getShadowRoot:a}),x=!m&&!b;f.shiftKey&&ka(y)?(s==null||s(),p=b):f.shiftKey&&(ka(m)||x)?p=n:!f.shiftKey&&ka(n)?(s==null||s(),p=m):!f.shiftKey&&(ka(b)||x)&&(p=y),p&&(f.preventDefault(),typeof r=="function"?r(p):p.focus())}return zt(u,"keydown",d,!0)}function G4(e,t){const c=t,{defer:n,triggerElement:r}=c,s=yn(c,["defer","triggerElement"]),a=n?Mt:d=>d(),u=[];return u.push(a(()=>{const d=typeof e=="function"?e():e,f=typeof r=="function"?r():r;u.push(W4(d,H({triggerElement:f},s)))})),()=>{u.forEach(d=>d==null?void 0:d())}}function X4(e,t){var n;return Array.from((n=e==null?void 0:e.querySelectorAll(t))!=null?n:[])}function Il(e,t){if(!e)return Qy;const n=Object.keys(t).reduce((r,s)=>(r[s]=e.style.getPropertyValue(s),r),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")}}function Q4(e,t,n){if(!e)return Qy;const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r),e.style.length===0&&e.removeAttribute("style")}}function K4(e,t,n){const{signal:r}=t;return[new Promise((u,c)=>{const d=setTimeout(()=>{c(new Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener("abort",()=>{clearTimeout(d),c(new Error("Promise aborted"))}),e.then(f=>{r.aborted||(clearTimeout(d),u(f))}).catch(f=>{r.aborted||(clearTimeout(d),c(f))})}),()=>t.abort()]}function J4(e,t){const{timeout:n,rootNode:r}=t,s=Ks(r),a=wr(r),u=new s.AbortController;return K4(new Promise(c=>{const d=e();if(d){c(d);return}const f=new s.MutationObserver(()=>{const p=e();p&&p.isConnected&&(f.disconnect(),c(p))});f.observe(a.body,{childList:!0,subtree:!0})}),u,n)}var Z4=(...e)=>e.map(t=>{var n;return(n=t==null?void 0:t.trim)==null?void 0:n.call(t)}).filter(Boolean).join(" "),eL=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,fT=e=>{const t={};let n;for(;n=eL.exec(e);)t[n[1]]=n[2];return t},tL=(e,t)=>{if(vl(e)){if(vl(t))return`${e};${t}`;e=fT(e)}else vl(t)&&(t=fT(t));return Object.assign({},e!=null?e:{},t!=null?t:{})};function Ft(...e){let t={};for(let n of e){if(!n)continue;for(let s in t){if(s.startsWith("on")&&typeof t[s]=="function"&&typeof n[s]=="function"){t[s]=ch(n[s],t[s]);continue}if(s==="className"||s==="class"){t[s]=Z4(t[s],n[s]);continue}if(s==="style"){t[s]=tL(t[s],n[s]);continue}t[s]=n[s]!==void 0?n[s]:t[s]}for(let s in n)t[s]===void 0&&(t[s]=n[s]);const r=Object.getOwnPropertySymbols(n);for(let s of r)t[s]=n[s]}return t}function pU(e){return e}var no=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(no||{}),_h="__init__";function nL(e){const t=()=>{var u,c;return(c=(u=e.getRootNode)==null?void 0:u.call(e))!=null?c:document},n=()=>wr(t()),r=()=>{var u;return(u=n().defaultView)!=null?u:window},s=()=>Js(t()),a=u=>t().getElementById(u);return le(H({},e),{getRootNode:t,getDoc:n,getWin:r,getActiveElement:s,isActiveElement:ka,getById:a})}function rL(e){return new Proxy({},{get(t,n){return n==="style"?r=>e({style:r}).style:e}})}var ro=()=>e=>Array.from(new Set(e)),hT=typeof globalThis.document!="undefined"?B.useLayoutEffect:B.useEffect;function Pl(e){var m,b;const t=(m=e().value)!=null?m:e().defaultValue,n=(b=e().isEqual)!=null?b:Object.is,[r]=B.useState(t),[s,a]=B.useState(r),u=e().value!==void 0,c=B.useRef(s);c.current=u?e().value:s;const d=B.useRef(c.current);hT(()=>{d.current=c.current},[s,e().value]);const f=y=>{var v,w;const x=d.current,A=Gs(y)?y(x):y;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:A,prev:x}),u||a(A),n(A,x)||(w=(v=e()).onChange)==null||w.call(v,A,x)};function p(){return u?e().value:s}return{initial:r,ref:c,get:p,set(y){(e().sync?Fs.flushSync:W6)(()=>f(y))},invoke(y,x){var A,v;(v=(A=e()).onChange)==null||v.call(A,y,x)},hash(y){var x,A,v;return(v=(A=(x=e()).hash)==null?void 0:A.call(x,y))!=null?v:String(y)}}}Pl.cleanup=e=>{B.useEffect(()=>e,[])},Pl.ref=e=>{const t=B.useRef(e);return{get:()=>t.current,set:n=>{t.current=n}}};function iL(e){const t=B.useRef(e);return{get(n){return t.current[n]},set(n,r){t.current[n]=r}}}var sL=(e,t)=>{const n=B.useRef(!1),r=B.useRef(!1);B.useEffect(()=>{if(n.current&&r.current)return t();r.current=!0},[...(e!=null?e:[]).map(s=>typeof s=="function"?s():s)]),B.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function Rl(e,t={}){var ae,oe,pe,ce,se,Ae;const n=B.useMemo(()=>{const{id:re,ids:Y,getRootNode:ie}=t;return nL({id:re,ids:Y,getRootNode:ie})},[t]),r=(...re)=>{e.debug&&console.log(...re)},s=(oe=(ae=e.props)==null?void 0:ae.call(e,{props:dh(t),scope:n}))!=null?oe:t,a=oL(s),u=(pe=e.context)==null?void 0:pe.call(e,{prop:a,bindable:Pl,scope:n,flush:mT,getContext(){return d},getComputed(){return X},getRefs(){return A},getEvent(){return y()}}),c=pT(u),d={get(re){var Y;return(Y=c.current)==null?void 0:Y[re].ref.current},set(re,Y){var ie;(ie=c.current)==null||ie[re].set(Y)},initial(re){var Y;return(Y=c.current)==null?void 0:Y[re].initial},hash(re){var ie,k;const Y=(ie=c.current)==null?void 0:ie[re].get();return(k=c.current)==null?void 0:k[re].hash(Y)}},f=B.useRef(new Map),p=B.useRef(null),m=B.useRef(null),b=B.useRef({type:""}),y=()=>le(H({},b.current),{current(){return b.current},previous(){return m.current}}),x=()=>le(H({},L),{matches(...re){return re.includes(L.ref.current)},hasTag(re){var Y,ie;return!!((ie=(Y=e.states[L.ref.current])==null?void 0:Y.tags)!=null&&ie.includes(re))}}),A=iL((se=(ce=e.refs)==null?void 0:ce.call(e,{prop:a,context:d}))!=null?se:{}),v=()=>({state:x(),context:d,event:y(),prop:a,send:z,action:w,guard:N,track:sL,refs:A,computed:X,flush:mT,scope:n,choose:j}),w=re=>{const Y=Gs(re)?re(v()):re;if(!Y)return;const ie=Y.map(k=>{var Z,P;const D=(P=(Z=e.implementations)==null?void 0:Z.actions)==null?void 0:P[k];return D||fh(`[zag-js] No implementation found for action "${JSON.stringify(k)}"`),D});for(const k of ie)k==null||k(v())},N=re=>{var Y,ie;return Gs(re)?re(v()):(ie=(Y=e.implementations)==null?void 0:Y.guards)==null?void 0:ie[re](v())},C=re=>{const Y=Gs(re)?re(v()):re;if(!Y)return;const ie=Y.map(D=>{var P,ke;const Z=(ke=(P=e.implementations)==null?void 0:P.effects)==null?void 0:ke[D];return Z||fh(`[zag-js] No implementation found for effect "${JSON.stringify(D)}"`),Z}),k=[];for(const D of ie){const Z=D==null?void 0:D(v());Z&&k.push(Z)}return()=>k.forEach(D=>D==null?void 0:D())},j=re=>P6(re).find(Y=>{let ie=!Y.guard;return vl(Y.guard)?ie=!!N(Y.guard):Gs(Y.guard)&&(ie=Y.guard(v())),ie}),X=re=>{e4(e.computed,()=>"[zag-js] No computed object found on machine");const Y=e.computed[re];return Y({context:d,event:y(),prop:a,refs:A,scope:n,computed:X})},L=Pl(()=>({defaultValue:e.initialState({prop:a}),onChange(re,Y){var k,D,Z,P;if(Y){const ke=f.current.get(Y);ke==null||ke(),f.current.delete(Y)}Y&&w((k=e.states[Y])==null?void 0:k.exit),w((D=p.current)==null?void 0:D.actions);const ie=C((Z=e.states[re])==null?void 0:Z.effects);if(ie&&f.current.set(re,ie),Y===_h){w(e.entry);const ke=C(e.effects);ke&&f.current.set(_h,ke)}w((P=e.states[re])==null?void 0:P.entry)}})),G=B.useRef(void 0),ne=B.useRef(no.NotStarted);hT(()=>{queueMicrotask(()=>{var D;const ie=ne.current===no.Started;ne.current=no.Started,r(ie?"rehydrating...":"initializing...");const k=(D=G.current)!=null?D:L.initial;L.invoke(k,ie?L.get():_h)});const re=f.current,Y=L.ref.current;return()=>{r("unmounting..."),G.current=Y,ne.current=no.Stopped,re.forEach(ie=>ie==null?void 0:ie()),f.current=new Map,p.current=null,queueMicrotask(()=>{w(e.exit)})}},[]);const de=()=>"ref"in L?L.ref.current:L.get(),z=re=>{queueMicrotask(()=>{var P,ke,Ce,ge,Le;if(ne.current!==no.Started)return;m.current=b.current,b.current=re;let Y=de();const ie=(Ce=(P=e.states[Y].on)==null?void 0:P[re.type])!=null?Ce:(ke=e.on)==null?void 0:ke[re.type],k=j(ie);if(!k)return;p.current=k;const D=(ge=k.target)!=null?ge:Y;r("transition",re.type,k.target||Y,`(${k.actions})`);const Z=D!==Y;Z?Fs.flushSync(()=>L.set(D)):k.reenter&&!Z?L.invoke(Y,Y):w((Le=k.actions)!=null?Le:[])})};return(Ae=e.watch)==null||Ae.call(e,v()),{state:x(),send:z,context:d,prop:a,scope:n,refs:A,computed:X,event:y(),getStatus:()=>ne.current}}function pT(e){const t=B.useRef(e);return t.current=e,t}function oL(e){const t=pT(e);return function(r){return t.current[r]}}function mT(e){queueMicrotask(()=>{Fs.flushSync(()=>e())})}var wh=rL(e=>e);function Ll(...e){return t=>{const n=[];for(const r of e)if(typeof r=="function"){const s=r(t);typeof s=="function"&&n.push(s)}else r&&(r.current=t);if(n.length)return()=>{for(const r of n)r()}}}function aL(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Sh=e=>{const t=B.memo(B.forwardRef((n,r)=>{const f=n,{asChild:s,children:a}=f,u=yn(f,["asChild","children"]);if(!s)return B.createElement(e,le(H({},u),{ref:r}),a);if(!B.isValidElement(a))return null;const c=B.Children.only(a),d=aL(c);return B.cloneElement(c,le(H({},Ft(u,c.props)),{ref:r?Ll(r,d):d}))}));return t.displayName=e.displayName||e.name,t},ln=(()=>{const e=new Map;return new Proxy(Sh,{apply(t,n,r){return Sh(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,Sh(r)),e.get(r)}})})();function uL(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function rs(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:s="Provider",errorMessage:a,defaultValue:u}=e,c=B.createContext(u);c.displayName=t;function d(){var p;const f=B.useContext(c);if(!f&&n){const m=new Error(a!=null?a:uL(r,s));throw m.name="ContextError",(p=Error.captureStackTrace)==null||p.call(Error,m,d),m}return f}return[c.Provider,d,c]}const[lL,vh]=rs({name:"PopoverContext",hookName:"usePopoverContext",providerName:"<PopoverProvider />"}),[gT,Ca]=rs({name:"PresenceContext",hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),ET=B.forwardRef((e,t)=>{const n=vh(),r=Ca(),s=Ft(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:_.jsx(ln.div,le(H({},s),{ref:Ll(r.ref,t)}))});ET.displayName="PopoverContent";const yT=B.forwardRef((e,t)=>{const n=vh(),r=Ca(),s=Ft(n.getPositionerProps(),e);return r.unmounted?null:_.jsx(ln.div,le(H({},s),{ref:t}))});yT.displayName="PopoverPositioner";const Oa=()=>(e,t)=>t.reduce((n,r)=>{const[s,a]=n,u=r;return a[u]!==void 0&&(s[u]=a[u]),delete a[u],[s,a]},[{},H({},e)]),TT=e=>Oa()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]);function cL(e,t){const{state:n,send:r,context:s}=e,a=n.matches("mounted","unmountSuspended");return{skip:!s.get("initial"),present:a,setNode(u){u&&r({type:"NODE.SET",node:u})},unmount(){r({type:"UNMOUNT"})}}}var dL={props({props:e}){return le(H({},e),{present:!!e.present})},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["clearInitial","cleanupNode"],watch({track:e,prop:t,send:n}){e([()=>t("present")],()=>{n({type:"PRESENCE.CHANGED"})})},on:{"NODE.SET":{actions:["setupNode"]},"PRESENCE.CHANGED":{actions:["setInitial","syncPresence"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},clearInitial:({context:e})=>{e.set("initial",!1)},invokeOnExitComplete:({prop:e})=>{var t;(t=e("onExitComplete"))==null||t()},setupNode:({refs:e,event:t})=>{e.get("node")!==t.node&&(e.set("node",t.node),e.set("styles",Zs(t.node)))},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{const s=r("present");if(s)return n({type:"MOUNT",src:"presence.changed"});const a=t.get("node");if(!s&&(a==null?void 0:a.ownerDocument.visibilityState)==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});Mt(()=>{var c,d;const u=Dl(t.get("styles"));e.set("unmountAnimationName",u),u==="none"||u===e.get("prevAnimationName")||((c=t.get("styles"))==null?void 0:c.display)==="none"||((d=t.get("styles"))==null?void 0:d.animationDuration)==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{Mt(()=>{e.set("prevAnimationName",Dl(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:r})=>{const s=t.get("node");if(!s)return;const a=d=>{var p,m,b;((b=(m=(p=d.composedPath)==null?void 0:p.call(d))==null?void 0:m[0])!=null?b:d.target)===s&&e.set("prevAnimationName",Dl(t.get("styles")))},u=d=>{const f=Dl(t.get("styles"));ar(d)===s&&f===e.get("unmountAnimationName")&&!r("present")&&n({type:"UNMOUNT",src:"animationend"})};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",u),s.addEventListener("animationend",u);const c=Il(s,{animationFillMode:"forwards"});return()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",u),s.removeEventListener("animationend",u),dT(()=>c())}}}}};function Dl(e){return(e==null?void 0:e.animationName)||"none"}ro()(["onExitComplete","present","immediate"]);function fL(e,t={}){const{sync:n=!1}=t,r=hL(e);return B.useCallback((...s)=>{var a;return n?queueMicrotask(()=>{var u;return(u=r.current)==null?void 0:u.call(r,...s)}):(a=r.current)==null?void 0:a.call(r,...s)},[n,r])}function hL(e){const t=B.useRef(e);return t.current=e,t}const Ah=(e={})=>{const b=e,{lazyMount:t,unmountOnExit:n,present:r,skipAnimationOnMount:s=!1}=b,a=yn(b,["lazyMount","unmountOnExit","present","skipAnimationOnMount"]),u=B.useRef(!1),c=le(H({},a),{present:r,onExitComplete:fL(e.onExitComplete)}),d=Rl(dL,c),f=cL(d);f.present&&(u.current=!0);const p=!f.present&&!u.current&&t||n&&!f.present&&u.current,m=()=>({"data-state":f.skip&&s?void 0:r?"open":"closed",hidden:!f.present});return{ref:f.setNode,getPresenceProps:m,present:f.present,unmounted:p}};var is=(e,t=[])=>({parts:(...n)=>{if(pL(t))return is(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>is(e,[...t,...n]),omit:(...n)=>is(e,t.filter(r=>!n.includes(r))),rename:n=>is(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${io(e)}"][data-part="${io(r)}"]`,`& [data-scope="${io(e)}"][data-part="${io(r)}"]`].join(", "),attrs:{"data-scope":io(e),"data-part":io(r)}}}),{})}),io=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),pL=e=>e.length===0;const mL=["top","right","bottom","left"],di=Math.min,Hr=Math.max,Ml=Math.round,Fl=Math.floor,vr=e=>({x:e,y:e}),gL={left:"right",right:"left",bottom:"top",top:"bottom"};function bT(e,t,n){return Hr(e,di(t,n))}function jr(e,t){return typeof e=="function"?e(t):e}function fi(e){return e.split("-")[0]}function so(e){return e.split("-")[1]}function kh(e){return e==="x"?"y":"x"}function Nh(e){return e==="y"?"height":"width"}function Ar(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ch(e){return kh(Ar(e))}function EL(e,t,n){n===void 0&&(n=!1);const r=so(e),s=Ch(e),a=Nh(s);let u=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(u=Bl(u)),[u,Bl(u)]}function yL(e){const t=Bl(e);return[Oh(e),t,Oh(t)]}function Oh(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const xT=["left","right"],_T=["right","left"],TL=["top","bottom"],bL=["bottom","top"];function xL(e,t,n){switch(e){case"top":case"bottom":return n?t?_T:xT:t?xT:_T;case"left":case"right":return t?TL:bL;default:return[]}}function _L(e,t,n,r){const s=so(e);let a=xL(fi(e),n==="start",r);return s&&(a=a.map(u=>u+"-"+s),t&&(a=a.concat(a.map(Oh)))),a}function Bl(e){const t=fi(e);return gL[t]+e.slice(t.length)}function wL(e){var t,n,r,s;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(s=e.left)!=null?s:0}}function wT(e){return typeof e!="number"?wL(e):{top:e,right:e,bottom:e,left:e}}function Ul(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function ST(e,t,n){let{reference:r,floating:s}=e;const a=Ar(t),u=Ch(t),c=Nh(u),d=fi(t),f=a==="y",p=r.x+r.width/2-s.width/2,m=r.y+r.height/2-s.height/2,b=r[c]/2-s[c]/2;let y;switch(d){case"top":y={x:p,y:r.y-s.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:m};break;case"left":y={x:r.x-s.width,y:m};break;default:y={x:r.x,y:r.y}}const x=so(t);return x&&(y[u]+=b*(x==="end"?1:-1)*(n&&f?-1:1)),y}function SL(e,t){return Ue(this,null,function*(){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:u,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:b=!1,padding:y=0}=jr(t,e),x=wT(y),v=c[b?m==="floating"?"reference":"floating":m],w=Ul(yield a.getClippingRect({element:(n=yield a.isElement==null?void 0:a.isElement(v))==null||n?v:v.contextElement||(yield a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:d})),N=m==="floating"?{x:r,y:s,width:u.floating.width,height:u.floating.height}:u.reference,C=yield a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating),j=(yield a.isElement==null?void 0:a.isElement(C))&&(yield a.getScale==null?void 0:a.getScale(C))||{x:1,y:1},X=Ul(a.convertOffsetParentRelativeRectToViewportRelativeRect?yield a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:N,offsetParent:C,strategy:d}):N);return{top:(w.top-X.top+x.top)/j.y,bottom:(X.bottom-w.bottom+x.bottom)/j.y,left:(w.left-X.left+x.left)/j.x,right:(X.right-w.right+x.right)/j.x}})}const vL=50,AL=(e,t,n)=>Ue(null,null,function*(){const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:u}=n,c=u.detectOverflow?u:le(H({},u),{detectOverflow:SL}),d=yield u.isRTL==null?void 0:u.isRTL(t);let f=yield u.getElementRects({reference:e,floating:t,strategy:s}),{x:p,y:m}=ST(f,r,d),b=r,y=0;const x={};for(let A=0;A<a.length;A++){const v=a[A];if(!v)continue;const{name:w,fn:N}=v,{x:C,y:j,data:X,reset:L}=yield N({x:p,y:m,initialPlacement:r,placement:b,strategy:s,middlewareData:x,rects:f,platform:c,elements:{reference:e,floating:t}});p=C!=null?C:p,m=j!=null?j:m,x[w]=H(H({},x[w]),X),L&&y<vL&&(y++,typeof L=="object"&&(L.placement&&(b=L.placement),L.rects&&(f=L.rects===!0?yield u.getElementRects({reference:e,floating:t,strategy:s}):L.rects),{x:p,y:m}=ST(f,b,d)),A=-1)}return{x:p,y:m,placement:b,strategy:s,middlewareData:x}}),kL=e=>({name:"arrow",options:e,fn(n){return Ue(this,null,function*(){const{x:r,y:s,placement:a,rects:u,platform:c,elements:d,middlewareData:f}=n,{element:p,padding:m=0}=jr(e,n)||{};if(p==null)return{};const b=wT(m),y={x:r,y:s},x=Ch(a),A=Nh(x),v=yield c.getDimensions(p),w=x==="y",N=w?"top":"left",C=w?"bottom":"right",j=w?"clientHeight":"clientWidth",X=u.reference[A]+u.reference[x]-y[x]-u.floating[A],L=y[x]-u.reference[x],G=yield c.getOffsetParent==null?void 0:c.getOffsetParent(p);let ne=G?G[j]:0;(!ne||!(yield c.isElement==null?void 0:c.isElement(G)))&&(ne=d.floating[j]||u.floating[A]);const de=X/2-L/2,z=ne/2-v[A]/2-1,ae=di(b[N],z),oe=di(b[C],z),pe=ne-v[A]-oe,ce=ne/2-v[A]/2+de,se=bT(ae,ce,pe),Ae=!f.arrow&&so(a)!=null&&ce!==se&&u.reference[A]/2-(ce<ae?ae:oe)-v[A]/2<0,re=Ae?ce<ae?ce-ae:ce-pe:0;return{[x]:y[x]+re,data:H({[x]:se,centerOffset:ce-se-re},Ae&&{alignmentOffset:re}),reset:Ae}})}}),NL=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(n){return Ue(this,null,function*(){var r,s;const{placement:a,middlewareData:u,rects:c,initialPlacement:d,platform:f,elements:p}=n,se=jr(e,n),{mainAxis:m=!0,crossAxis:b=!0,fallbackPlacements:y,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:v=!0}=se,w=yn(se,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((r=u.arrow)!=null&&r.alignmentOffset)return{};const N=fi(a),C=Ar(d),j=fi(d)===d,X=yield f.isRTL==null?void 0:f.isRTL(p.floating),L=y||(j||!v?[Bl(d)]:yL(d)),G=A!=="none";!y&&G&&L.push(..._L(d,v,A,X));const ne=[d,...L],de=yield f.detectOverflow(n,w),z=[];let ae=((s=u.flip)==null?void 0:s.overflows)||[];if(m&&z.push(de[N]),b){const Ae=EL(a,c,X);z.push(de[Ae[0]],de[Ae[1]])}if(ae=[...ae,{placement:a,overflows:z}],!z.every(Ae=>Ae<=0)){var oe,pe;const Ae=(((oe=u.flip)==null?void 0:oe.index)||0)+1,re=ne[Ae];if(re&&(!(b==="alignment"?C!==Ar(re):!1)||ae.every(k=>Ar(k.placement)===C?k.overflows[0]>0:!0)))return{data:{index:Ae,overflows:ae},reset:{placement:re}};let Y=(pe=ae.filter(ie=>ie.overflows[0]<=0).sort((ie,k)=>ie.overflows[1]-k.overflows[1])[0])==null?void 0:pe.placement;if(!Y)switch(x){case"bestFit":{var ce;const ie=(ce=ae.filter(k=>{if(G){const D=Ar(k.placement);return D===C||D==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(D=>D>0).reduce((D,Z)=>D+Z,0)]).sort((k,D)=>k[1]-D[1])[0])==null?void 0:ce[0];ie&&(Y=ie);break}case"initialPlacement":Y=d;break}if(a!==Y)return{reset:{placement:Y}}}return{}})}}};function vT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function AT(e){return mL.some(t=>e[t]>=0)}const CL=function(e){return e===void 0&&(e={}),{name:"hide",options:e,fn(n){return Ue(this,null,function*(){const{rects:r,platform:s}=n,c=jr(e,n),{strategy:a="referenceHidden"}=c,u=yn(c,["strategy"]);switch(a){case"referenceHidden":{const d=yield s.detectOverflow(n,le(H({},u),{elementContext:"reference"})),f=vT(d,r.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:AT(f)}}}case"escaped":{const d=yield s.detectOverflow(n,le(H({},u),{altBoundary:!0})),f=vT(d,r.floating);return{data:{escapedOffsets:f,escaped:AT(f)}}}default:return{}}})}}},kT=new Set(["left","top"]);function OL(e,t){return Ue(this,null,function*(){const{placement:n,platform:r,elements:s}=e,a=yield r.isRTL==null?void 0:r.isRTL(s.floating),u=fi(n),c=so(n),d=Ar(n)==="y",f=kT.has(u)?-1:1,p=a&&d?-1:1,m=jr(t,e);let{mainAxis:b,crossAxis:y,alignmentAxis:x}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof x=="number"&&(y=c==="end"?x*-1:x),d?{x:y*p,y:b*f}:{x:b*f,y:y*p}})}const IL=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(n){return Ue(this,null,function*(){var r,s;const{x:a,y:u,placement:c,middlewareData:d}=n,f=yield OL(n,e);return c===((r=d.offset)==null?void 0:r.placement)&&(s=d.arrow)!=null&&s.alignmentOffset?{}:{x:a+f.x,y:u+f.y,data:le(H({},f),{placement:c})}})}}},PL=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(n){return Ue(this,null,function*(){const{x:r,y:s,placement:a,platform:u}=n,C=jr(e,n),{mainAxis:c=!0,crossAxis:d=!1,limiter:f={fn:j=>{let{x:X,y:L}=j;return{x:X,y:L}}}}=C,p=yn(C,["mainAxis","crossAxis","limiter"]),m={x:r,y:s},b=yield u.detectOverflow(n,p),y=Ar(a),x=kh(y);let A=m[x],v=m[y];const w=(j,X)=>bT(X+b[j==="y"?"top":"left"],X,X-b[j==="y"?"bottom":"right"]);c&&(A=w(x,A)),d&&(v=w(y,v));const N=f.fn(le(H({},n),{[x]:A,[y]:v}));return le(H({},N),{data:{x:N.x-r,y:N.y-s,enabled:{[x]:c,[y]:d}}})})}}},RL=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:a,placement:u,rects:c,middlewareData:d}=t,{offset:f=0,mainAxis:p=!0,crossAxis:m=!0}=jr(e,t),b={x:s,y:a},y=Ar(u),x=kh(y);let A=b[x],v=b[y];const w=jr(f,t),N=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:(n=w.mainAxis)!=null?n:0,crossAxis:(r=w.crossAxis)!=null?r:0};if(p){const X=x==="y"?"height":"width",L=c.reference[x]-c.floating[X]+N.mainAxis,G=c.reference[x]+c.reference[X]-N.mainAxis;A<L?A=L:A>G&&(A=G)}if(m){var C,j;const X=x==="y"?"width":"height",L=kT.has(fi(u)),G=c.reference[y]-c.floating[X]+(L&&((C=d.offset)==null?void 0:C[y])||0)+(L?0:N.crossAxis),ne=c.reference[y]+c.reference[X]+(L?0:((j=d.offset)==null?void 0:j[y])||0)-(L?N.crossAxis:0);v<G?v=G:v>ne&&(v=ne)}return{[x]:A,[y]:v}}}},LL=function(e){return e===void 0&&(e={}),{name:"size",options:e,fn(n){return Ue(this,null,function*(){const{placement:r,rects:s,platform:a,elements:u}=n,z=jr(e,n),{apply:c=()=>{}}=z,d=yn(z,["apply"]),f=yield a.detectOverflow(n,d),p=fi(r),m=so(r),b=Ar(r)==="y",{width:y,height:x}=s.floating;let A,v;p==="top"||p==="bottom"?(A=p,v=m===((yield a.isRTL==null?void 0:a.isRTL(u.floating))?"start":"end")?"left":"right"):(v=p,A=m==="end"?"top":"bottom");const w=x-f.top-f.bottom,N=y-f.left-f.right,C=di(x-f[A],w),j=di(y-f[v],N),X=n.middlewareData.shift,L=!X;let G=C,ne=j;X!=null&&X.enabled.x&&(ne=N),X!=null&&X.enabled.y&&(G=w),L&&!m&&(b?ne=y-2*Hr(f.left,f.right):G=x-2*Hr(f.top,f.bottom)),yield c(le(H({},n),{availableWidth:ne,availableHeight:G}));const de=yield a.getDimensions(u.floating);return y!==de.width||x!==de.height?{reset:{rects:!0}}:{}})}}};function Hl(){return typeof window!="undefined"}function oo(e){return NT(e)?(e.nodeName||"").toLowerCase():"#document"}function Fn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function kr(e){var t;return(t=(NT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function NT(e){return Hl()?e instanceof Node||e instanceof Fn(e).Node:!1}function ur(e){return Hl()?e instanceof Element||e instanceof Fn(e).Element:!1}function Nr(e){return Hl()?e instanceof HTMLElement||e instanceof Fn(e).HTMLElement:!1}function CT(e){return!Hl()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof Fn(e).ShadowRoot}function Ia(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=lr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function DL(e){return/^(table|td|th)$/.test(oo(e))}function jl(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}const ML=/transform|translate|scale|rotate|perspective|filter/,FL=/paint|layout|strict|content/,ss=e=>!!e&&e!=="none";let Ih;function Ph(e){const t=ur(e)?lr(e):e;return ss(t.transform)||ss(t.translate)||ss(t.scale)||ss(t.rotate)||ss(t.perspective)||!Rh()&&(ss(t.backdropFilter)||ss(t.filter))||ML.test(t.willChange||"")||FL.test(t.contain||"")}function BL(e){let t=hi(e);for(;Nr(t)&&!ao(t);){if(Ph(t))return t;if(jl(t))return null;t=hi(t)}return null}function Rh(){return Ih==null&&(Ih=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ih}function ao(e){return/^(html|body|#document)$/.test(oo(e))}function lr(e){return Fn(e).getComputedStyle(e)}function $l(e){return ur(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hi(e){if(oo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||CT(e)&&e.host||kr(e);return CT(t)?t.host:t}function OT(e){const t=hi(e);return ao(t)?(e.ownerDocument||e).body:Nr(t)&&Ia(t)?t:OT(t)}function Pa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=OT(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),u=Fn(s);if(a){const c=Lh(u);return t.concat(u,u.visualViewport||[],Ia(s)?s:[],c&&n?Pa(c):[])}else return t.concat(s,Pa(s,[],n))}function Lh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function IT(e){const t=lr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Nr(e),a=s?e.offsetWidth:n,u=s?e.offsetHeight:r,c=Ml(n)!==a||Ml(r)!==u;return c&&(n=a,r=u),{width:n,height:r,$:c}}function Dh(e){return ur(e)?e:e.contextElement}function uo(e){const t=Dh(e);if(!Nr(t))return vr(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=IT(t);let u=(a?Ml(n.width):n.width)/r,c=(a?Ml(n.height):n.height)/s;return(!u||!Number.isFinite(u))&&(u=1),(!c||!Number.isFinite(c))&&(c=1),{x:u,y:c}}const UL=vr(0);function PT(e){const t=Fn(e);return!Rh()||!t.visualViewport?UL:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function HL(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Fn(e)?!1:t}function os(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=Dh(e);let u=vr(1);t&&(r?ur(r)&&(u=uo(r)):u=uo(e));const c=HL(a,n,r)?PT(a):vr(0);let d=(s.left+c.x)/u.x,f=(s.top+c.y)/u.y,p=s.width/u.x,m=s.height/u.y;if(a){const b=Fn(a),y=r&&ur(r)?Fn(r):r;let x=b,A=Lh(x);for(;A&&r&&y!==x;){const v=uo(A),w=A.getBoundingClientRect(),N=lr(A),C=w.left+(A.clientLeft+parseFloat(N.paddingLeft))*v.x,j=w.top+(A.clientTop+parseFloat(N.paddingTop))*v.y;d*=v.x,f*=v.y,p*=v.x,m*=v.y,d+=C,f+=j,x=Fn(A),A=Lh(x)}}return Ul({width:p,height:m,x:d,y:f})}function zl(e,t){const n=$l(e).scrollLeft;return t?t.left+n:os(kr(e)).left+n}function RT(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-zl(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function jL(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",u=kr(r),c=t?jl(t.floating):!1;if(r===u||c&&a)return n;let d={scrollLeft:0,scrollTop:0},f=vr(1);const p=vr(0),m=Nr(r);if((m||!m&&!a)&&((oo(r)!=="body"||Ia(u))&&(d=$l(r)),Nr(r))){const y=os(r);f=uo(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const b=u&&!m&&!a?RT(u,d):vr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+p.x+b.x,y:n.y*f.y-d.scrollTop*f.y+p.y+b.y}}function $L(e){return Array.from(e.getClientRects())}function zL(e){const t=kr(e),n=$l(e),r=e.ownerDocument.body,s=Hr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Hr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+zl(e);const c=-n.scrollTop;return lr(r).direction==="rtl"&&(u+=Hr(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:u,y:c}}const LT=25;function VL(e,t){const n=Fn(e),r=kr(e),s=n.visualViewport;let a=r.clientWidth,u=r.clientHeight,c=0,d=0;if(s){a=s.width,u=s.height;const p=Rh();(!p||p&&t==="fixed")&&(c=s.offsetLeft,d=s.offsetTop)}const f=zl(r);if(f<=0){const p=r.ownerDocument,m=p.body,b=getComputedStyle(m),y=p.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,x=Math.abs(r.clientWidth-m.clientWidth-y);x<=LT&&(a-=x)}else f<=LT&&(a+=f);return{width:a,height:u,x:c,y:d}}const qL=new Set(["absolute","fixed"]);function YL(e,t){const n=os(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=Nr(e)?uo(e):vr(1),u=e.clientWidth*a.x,c=e.clientHeight*a.y,d=s*a.x,f=r*a.y;return{width:u,height:c,x:d,y:f}}function DT(e,t,n){let r;if(t==="viewport")r=VL(e,n);else if(t==="document")r=zL(kr(e));else if(ur(t))r=YL(t,n);else{const s=PT(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Ul(r)}function MT(e,t){const n=hi(e);return n===t||!ur(n)||ao(n)?!1:lr(n).position==="fixed"||MT(n,t)}function WL(e,t){const n=t.get(e);if(n)return n;let r=Pa(e,[],!1).filter(c=>ur(c)&&oo(c)!=="body"),s=null;const a=lr(e).position==="fixed";let u=a?hi(e):e;for(;ur(u)&&!ao(u);){const c=lr(u),d=Ph(u);!d&&c.position==="fixed"&&(s=null),(a?!d&&!s:!d&&c.position==="static"&&!!s&&qL.has(s.position)||Ia(u)&&!d&&MT(e,u))?r=r.filter(p=>p!==u):s=c,u=hi(u)}return t.set(e,r),r}function GL(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const u=[...n==="clippingAncestors"?jl(t)?[]:WL(t,this._c):[].concat(n),r],c=u[0],d=u.reduce((f,p)=>{const m=DT(t,p,s);return f.top=Hr(m.top,f.top),f.right=di(m.right,f.right),f.bottom=di(m.bottom,f.bottom),f.left=Hr(m.left,f.left),f},DT(t,c,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function XL(e){const{width:t,height:n}=IT(e);return{width:t,height:n}}function QL(e,t,n){const r=Nr(t),s=kr(t),a=n==="fixed",u=os(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const d=vr(0);function f(){d.x=zl(s)}if(r||!r&&!a)if((oo(t)!=="body"||Ia(s))&&(c=$l(t)),r){const y=os(t,!0,a,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else s&&f();a&&!r&&s&&f();const p=s&&!r&&!a?RT(s,c):vr(0),m=u.left+c.scrollLeft-d.x-p.x,b=u.top+c.scrollTop-d.y-p.y;return{x:m,y:b,width:u.width,height:u.height}}function Mh(e){return lr(e).position==="static"}function FT(e,t){if(!Nr(e)||lr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return kr(e)===n&&(n=n.ownerDocument.body),n}function BT(e,t){const n=Fn(e);if(jl(e))return n;if(!Nr(e)){let s=hi(e);for(;s&&!ao(s);){if(ur(s)&&!Mh(s))return s;s=hi(s)}return n}let r=FT(e,t);for(;r&&DL(r)&&Mh(r);)r=FT(r,t);return r&&ao(r)&&Mh(r)&&!Ph(r)?n:r||BL(e)||n}const KL=function(e){return Ue(this,null,function*(){const t=this.getOffsetParent||BT,n=this.getDimensions,r=yield n(e.floating);return{reference:QL(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})};function JL(e){return lr(e).direction==="rtl"}const ZL={convertOffsetParentRelativeRectToViewportRelativeRect:jL,getDocumentElement:kr,getClippingRect:GL,getOffsetParent:BT,getElementRects:KL,getClientRects:$L,getDimensions:XL,getScale:uo,isElement:ur,isRTL:JL};function UT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function e5(e,t){let n=null,r;const s=kr(e);function a(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function u(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),a();const f=e.getBoundingClientRect(),{left:p,top:m,width:b,height:y}=f;if(c||t(),!b||!y)return;const x=Fl(m),A=Fl(s.clientWidth-(p+b)),v=Fl(s.clientHeight-(m+y)),w=Fl(p),C={rootMargin:-x+"px "+-A+"px "+-v+"px "+-w+"px",threshold:Hr(0,di(1,d))||1};let j=!0;function X(L){const G=L[0].intersectionRatio;if(G!==d){if(!j)return u();G?u(!1,G):r=setTimeout(()=>{u(!1,1e-7)},1e3)}G===1&&!UT(f,e.getBoundingClientRect())&&u(),j=!1}try{n=new IntersectionObserver(X,le(H({},C),{root:s.ownerDocument}))}catch(L){n=new IntersectionObserver(X,C)}n.observe(e)}return u(!0),a}function t5(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=Dh(e),p=s||a?[...f?Pa(f):[],...Pa(t)]:[];p.forEach(w=>{s&&w.addEventListener("scroll",n,{passive:!0}),a&&w.addEventListener("resize",n)});const m=f&&c?e5(f,n):null;let b=-1,y=null;u&&(y=new ResizeObserver(w=>{let[N]=w;N&&N.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var C;(C=y)==null||C.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let x,A=d?os(e):null;d&&v();function v(){const w=os(e);A&&!UT(A,w)&&n(),A=w,x=requestAnimationFrame(v)}return n(),()=>{var w;p.forEach(N=>{s&&N.removeEventListener("scroll",n),a&&N.removeEventListener("resize",n)}),m==null||m(),(w=y)==null||w.disconnect(),y=null,d&&cancelAnimationFrame(x)}}const n5=IL,r5=PL,i5=NL,s5=LL,o5=CL,a5=kL,u5=RL,l5=(e,t,n)=>{const r=new Map,s=H({platform:ZL},n),a=le(H({},s.platform),{_c:r});return AL(e,t,le(H({},s),{platform:a}))};function HT(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const s={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return le(H({},s),{toJSON:()=>s})}function c5(e){if(!e)return HT();const{x:t,y:n,width:r,height:s}=e;return HT(t,n,r,s)}function d5(e,t){return{contextElement:$t(e)?e:void 0,getBoundingClientRect:()=>{const n=e,r=t==null?void 0:t(n);return r||!n?c5(r):n.getBoundingClientRect()}}}var Ra=e=>({variable:e,reference:`var(${e})`}),$r={arrowSize:Ra("--arrow-size"),arrowSizeHalf:Ra("--arrow-size-half"),arrowBg:Ra("--arrow-background"),transformOrigin:Ra("--transform-origin"),arrowOffset:Ra("--arrow-offset")},f5=e=>e==="top"||e==="bottom"?"y":"x";function h5(e,t){return{name:"transformOrigin",fn(n){var de,z,ae,oe,pe;const{elements:r,middlewareData:s,placement:a,rects:u,y:c}=n,d=a.split("-")[0],f=f5(d),p=((de=s.arrow)==null?void 0:de.x)||0,m=((z=s.arrow)==null?void 0:z.y)||0,b=(t==null?void 0:t.clientWidth)||0,y=(t==null?void 0:t.clientHeight)||0,x=p+b/2,A=m+y/2,v=Math.abs(((ae=s.shift)==null?void 0:ae.y)||0),w=u.reference.height/2,N=y/2,C=(pe=(oe=e.offset)==null?void 0:oe.mainAxis)!=null?pe:e.gutter,j=typeof C=="number"?C+N:C!=null?C:N,X=v>j,L={top:`${x}px calc(100% + ${j}px)`,bottom:`${x}px ${-j}px`,left:`calc(100% + ${j}px) ${A}px`,right:`${-j}px ${A}px`}[d],G=`${x}px ${u.reference.y+w-c}px`,ne=!!e.overlap&&f==="y"&&X;return r.floating.style.setProperty($r.transformOrigin.variable,ne?G:L),{data:{transformOrigin:ne?G:L}}}}}var p5={name:"rects",fn({rects:e}){return{data:e}}},m5=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:s}=n.arrow,a=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:s!=null?`${s}px`:"",[a]:`calc(100% + ${$r.arrowOffset.reference})`}),{}}}};function g5(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}var E5={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function jT(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function Fh(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function y5(e,t,n){const r=e||t.createElement("div");return a5({element:r,padding:n.arrowPadding})}function T5(e,t){var n;if(!U6((n=t.offset)!=null?n:t.gutter))return n5(({placement:r})=>{var p,m,b,y;const s=((e==null?void 0:e.clientHeight)||0)/2,a=(m=(p=t.offset)==null?void 0:p.mainAxis)!=null?m:t.gutter,u=typeof a=="number"?a+s:a!=null?a:s,{hasAlign:c}=g5(r),d=c?void 0:t.shift,f=(y=(b=t.offset)==null?void 0:b.crossAxis)!=null?y:d;return dh({crossAxis:f,mainAxis:u,alignmentAxis:t.shift})})}function b5(e){if(!e.flip)return;const t=Fh(e.boundary);return i5(le(H({},t?{boundary:t}:void 0),{padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}))}function x5(e){if(!e.slide&&!e.overlap)return;const t=Fh(e.boundary);return r5(le(H({},t?{boundary:t}:void 0),{mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:u5()}))}function _5(e){return s5({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:r,availableWidth:s}){const a=t.floating,u=Math.round(n.reference.width),c=Math.round(n.reference.height);s=Math.floor(s),r=Math.floor(r),a.style.setProperty("--reference-width",`${u}px`),a.style.setProperty("--reference-height",`${c}px`),a.style.setProperty("--available-width",`${s}px`),a.style.setProperty("--available-height",`${r}px`)}})}function w5(e){var t;if(e.hideWhenDetached)return o5({strategy:"referenceHidden",boundary:(t=Fh(e.boundary))!=null?t:"clippingAncestors"})}function S5(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function v5(e,t,n={}){const r=d5(e,n.getAnchorRect);if(!t||!r)return;const s=Object.assign({},E5,n),a=t.querySelector("[data-part=arrow]"),u=[T5(a,s),b5(s),x5(s),y5(a,t.ownerDocument,s),m5(a),h5({gutter:s.gutter,offset:s.offset,overlap:s.overlap},a),_5(s),w5(s),p5],{placement:c,strategy:d,onComplete:f,onPositioned:p}=s,m=()=>Ue(null,null,function*(){var j;if(!r||!t)return;const A=yield l5(r,t,{placement:c,middleware:u,strategy:d});f==null||f(A),p==null||p({placed:!0});const v=Ks(t),w=jT(v,A.x),N=jT(v,A.y);t.style.setProperty("--x",`${w}px`),t.style.setProperty("--y",`${N}px`),s.hideWhenDetached&&(((j=A.middlewareData.hide)==null?void 0:j.referenceHidden)?(t.style.setProperty("visibility","hidden"),t.style.setProperty("pointer-events","none")):(t.style.removeProperty("visibility"),t.style.removeProperty("pointer-events")));const C=t.firstElementChild;if(C){const X=Zs(C);t.style.setProperty("--z-index",X.zIndex)}}),b=()=>Ue(null,null,function*(){n.updatePosition?(yield n.updatePosition({updatePosition:m,floatingElement:t}),p==null||p({placed:!0})):yield m()}),y=S5(s.listeners),x=s.listeners?t5(r,t,b,y):G6;return b(),()=>{x==null||x(),p==null||p({placed:!1})}}function $T(e,t,n={}){const c=n,{defer:r}=c,s=yn(c,["defer"]),a=r?Mt:d=>d(),u=[];return u.push(a(()=>{const d=typeof e=="function"?e():e,f=typeof t=="function"?t():t;u.push(v5(d,f,s))})),()=>{u.forEach(d=>d==null?void 0:d())}}var A5={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function k5(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:s="absolute"}=e;return{arrow:{position:"absolute",width:$r.arrowSize.reference,height:$r.arrowSize.reference,[$r.arrowSizeHalf.variable]:`calc(${$r.arrowSize.reference} / 2)`,[$r.arrowOffset.variable]:`calc(${$r.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?A5[t.split("-")[0]]:void 0,background:$r.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:s,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}var lo=new WeakMap,Vl=new WeakMap,ql={},Bh=0,zT=e=>e&&(e.host||zT(e.parentNode)),N5=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=zT(n);return r&&e.contains(r)?r:(console.error("[zag-js > ariaHidden] target",n,"in not contained inside",e,". Doing nothing"),null)}).filter(n=>!!n),C5=new Set(["script","output","status","next-route-announcer"]),O5=e=>C5.has(e.localName)||e.role==="status"||e.hasAttribute("aria-live")?!0:e.matches("[data-live-announcer]"),I5=(e,t)=>{const{parentNode:n,markerName:r,controlAttribute:s,followControlledElements:a=!0}=t,u=N5(n,Array.isArray(e)?e:[e]);ql[r]||(ql[r]=new WeakMap);const c=ql[r],d=[],f=new Set,p=new Set(u),m=y=>{!y||f.has(y)||(f.add(y),m(y.parentNode))};u.forEach(y=>{m(y),a&&$t(y)&&tT(y,x=>{m(x)})});const b=y=>{!y||p.has(y)||Array.prototype.forEach.call(y.children,x=>{if(f.has(x))b(x);else try{if(O5(x))return;const v=x.getAttribute(s)==="true",w=(lo.get(x)||0)+1,N=(c.get(x)||0)+1;lo.set(x,w),c.set(x,N),d.push(x),w===1&&v&&Vl.set(x,!0),N===1&&x.setAttribute(r,""),v||x.setAttribute(s,"true")}catch(A){console.error("[zag-js > ariaHidden] cannot operate on ",x,A)}})};return b(n),f.clear(),Bh++,()=>{d.forEach(y=>{const x=lo.get(y)-1,A=c.get(y)-1;lo.set(y,x),c.set(y,A),x||(Vl.has(y)||y.removeAttribute(s),Vl.delete(y)),A||y.removeAttribute(r)}),Bh--,Bh||(lo=new WeakMap,lo=new WeakMap,Vl=new WeakMap,ql={})}},P5=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,R5=(e,t=P5(e),n="data-aria-hidden",r=!0)=>{if(t)return I5(e,{parentNode:t,markerName:n,controlAttribute:"aria-hidden",followControlledElements:r})},L5=e=>{const t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function VT(e,t={}){const{defer:n=!0}=t,r=n?L5:a=>a(),s=[];return s.push(r(()=>{const u=(typeof e=="function"?e():e).filter(Boolean);u.length!==0&&s.push(R5(u))})),()=>{s.forEach(a=>a==null?void 0:a())}}function D5(e){const t={each(n){var r;for(let s=0;s<((r=e.frames)==null?void 0:r.length);s+=1){const a=e.frames[s];a&&n(a)}},addEventListener(n,r,s){return t.each(a=>{try{a.document.addEventListener(n,r,s)}catch(u){}}),()=>{try{t.removeEventListener(n,r,s)}catch(a){}}},removeEventListener(n,r,s){t.each(a=>{try{a.document.removeEventListener(n,r,s)}catch(u){}})}};return t}function M5(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,s)=>{try{t==null||t.addEventListener(n,r,s)}catch(a){}return()=>{try{t==null||t.removeEventListener(n,r,s)}catch(a){}}},removeEventListener:(n,r,s)=>{try{t==null||t.removeEventListener(n,r,s)}catch(a){}}}}var qT="pointerdown.outside",YT="focus.outside";function F5(e){for(const t of e)if($t(t)&&Sr(t))return!0;return!1}var WT=e=>"clientY"in e;function B5(e,t){if(!WT(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function U5(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function GT(e,t){if(!t||!WT(e))return!1;const n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,s=t.scrollWidth>t.clientWidth,a=s&&e.clientY>t.offsetTop+t.clientHeight,u={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(s?16:0)},c={x:e.clientX,y:e.clientY};return U5(u,c)?r||a:!1}function H5(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:s,onInteractOutside:a,defer:u,followControlledElements:c=!0}=t;if(!e)return;const d=wr(e),f=Ks(e),p=D5(f),m=M5(f);function b(C,j){if(!$t(j)||!j.isConnected||Qs(e,j)||B5(e,C)||c&&eT(e,j))return!1;const X=d.querySelector(`[aria-controls="${e.id}"]`);if(X){const G=bh(X);if(GT(C,G))return!1}const L=bh(e);return GT(C,L)?!1:!(n!=null&&n(j))}const y=new Set,x=ts(e==null?void 0:e.getRootNode());function A(C){function j(X){var de,z;const L=u&&!nT()?Mt:ae=>ae(),G=X!=null?X:C,ne=(z=(de=G==null?void 0:G.composedPath)==null?void 0:de.call(G))!=null?z:[G==null?void 0:G.target];L(()=>{const ae=x?ne[0]:ar(C);if(!(!e||!b(C,ae))){if(s||a){const oe=ch(s,a);e.addEventListener(qT,oe,{once:!0})}XT(e,qT,{bubbles:!1,cancelable:!0,detail:{originalEvent:G,contextmenu:C4(G),focusable:F5(ne),target:ae}})}})}C.pointerType==="touch"?(y.forEach(X=>X()),y.add(zt(d,"click",j,{once:!0})),y.add(m.addEventListener("click",j,{once:!0})),y.add(p.addEventListener("click",j,{once:!0}))):j()}const v=new Set,w=setTimeout(()=>{v.add(zt(d,"pointerdown",A,!0)),v.add(m.addEventListener("pointerdown",A,!0)),v.add(p.addEventListener("pointerdown",A,!0))},0);function N(C){(u?Mt:X=>X())(()=>{var G,ne;const X=(ne=(G=C==null?void 0:C.composedPath)==null?void 0:G.call(C))!=null?ne:[C==null?void 0:C.target],L=x?X[0]:ar(C);if(!(!e||!b(C,L))){if(r||a){const de=ch(r,a);e.addEventListener(YT,de,{once:!0})}XT(e,YT,{bubbles:!1,cancelable:!0,detail:{originalEvent:C,contextmenu:!1,focusable:Sr(L),target:L}})}})}return nT()||(v.add(zt(d,"focusin",N,!0)),v.add(m.addEventListener("focusin",N,!0)),v.add(p.addEventListener("focusin",N,!0))),()=>{clearTimeout(w),y.forEach(C=>C()),v.forEach(C=>C())}}function j5(e,t){const{defer:n}=t,r=n?Mt:a=>a(),s=[];return s.push(r(()=>{const a=typeof e=="function"?e():e;s.push(H5(a,t))})),()=>{s.forEach(a=>a==null?void 0:a())}}function XT(e,t,n){const r=e.ownerDocument.defaultView||window,s=new r.CustomEvent(t,n);return e.dispatchEvent(s)}function $5(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t==null||t(r))};return zt(wr(e),"keydown",n,{capture:!0})}var QT="layer:request-dismiss",Yn={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){var r;const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf((r=this.topMostPointerBlockingLayer())==null?void 0:r.node):-1;return t<n},isTopMost(e){const t=this.layers[this.count()-1];return(t==null?void 0:t.node)===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){const n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(r=>r.type===t)},getParentLayerOfType(e,t){const n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(r=>r.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return this.getNestedLayers(e).some(n=>Qs(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>Qs(t,e))},add(e){this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(r=>Yn.dismiss(r.node,e)),this.layers.splice(t,1),this.syncLayers())},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{e.node.style.setProperty("--layer-index",`${t}`),e.node.removeAttribute("data-nested"),e.node.removeAttribute("data-has-nested"),this.getParentLayerOfType(e.node,e.type)&&e.node.setAttribute("data-nested",e.type);const r=this.countNestedLayersOfType(e.node,e.type);r>0&&e.node.setAttribute("data-has-nested",e.type),e.node.style.setProperty("--nested-layer-count",`${r}`)})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const n=this.indexOf(e);if(n===-1)return;const r=this.layers[n];V5(e,QT,s=>{var a;(a=r.requestDismiss)==null||a.call(r,s),s.defaultPrevented||r==null||r.dismiss()}),z5(e,QT,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function z5(e,t,n){const r=e.ownerDocument.defaultView||window,s=new r.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(s)}function V5(e,t,n){e.addEventListener(t,n,{once:!0})}var KT;function JT(){Yn.layers.forEach(({node:e})=>{e.style.pointerEvents=Yn.isBelowPointerBlockingLayer(e)?"none":"auto"})}function q5(e){e.style.pointerEvents=""}function Y5(e,t){const n=wr(e),r=[];return Yn.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(KT=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t==null||t.forEach(s=>{const[a,u]=J4(()=>{const c=s();return $t(c)?c:null},{timeout:1e3});a.then(c=>r.push(Il(c,{pointerEvents:"auto"}))),r.push(u)}),()=>{Yn.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=KT,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(s=>s()))}}function W5(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){fh("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:r,onRequestDismiss:s,pointerBlocking:a,exclude:u,debug:c,type:d="dialog"}=t,f={dismiss:r,node:e,type:d,pointerBlocking:a,requestDismiss:s};Yn.add(f),JT();function p(A){var w,N;const v=ar(A.detail.originalEvent);Yn.isBelowPointerBlockingLayer(e)||Yn.isInBranch(v)||((w=t.onPointerDownOutside)==null||w.call(t,A),(N=t.onInteractOutside)==null||N.call(t,A),!A.defaultPrevented&&(c&&console.log("onPointerDownOutside:",A.detail.originalEvent),r==null||r()))}function m(A){var w,N;const v=ar(A.detail.originalEvent);Yn.isInBranch(v)||((w=t.onFocusOutside)==null||w.call(t,A),(N=t.onInteractOutside)==null||N.call(t,A),!A.defaultPrevented&&(c&&console.log("onFocusOutside:",A.detail.originalEvent),r==null||r()))}function b(A){var v;Yn.isTopMost(e)&&((v=t.onEscapeKeyDown)==null||v.call(t,A),!A.defaultPrevented&&r&&(A.preventDefault(),r()))}function y(A){var C;if(!e)return!1;const v=typeof u=="function"?u():u,w=Array.isArray(v)?v:[v],N=(C=t.persistentElements)==null?void 0:C.map(j=>j()).filter($t);return N&&w.push(...N),w.some(j=>Qs(j,A))||Yn.isInNestedLayer(e,A)}const x=[a?Y5(e,t.persistentElements):void 0,$5(e,b),j5(e,{exclude:y,onFocusOutside:m,onPointerDownOutside:p,defer:t.defer})];return()=>{Yn.remove(e),JT(),q5(e),x.forEach(A=>A==null?void 0:A())}}function ZT(e,t){const{defer:n}=t,r=n?Mt:a=>a(),s=[];return s.push(r(()=>{const a=Gs(e)?e():e;s.push(W5(a,t))})),()=>{s.forEach(a=>a==null?void 0:a())}}var G5=Object.defineProperty,X5=(e,t,n)=>t in e?G5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_t=(e,t,n)=>X5(e,typeof t!="symbol"?t+"":t,n),eb={activateTrap(e,t){if(e.length>0){const r=e[e.length-1];r!==t&&r.pause()}const n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap(e,t){const n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},Q5=[],K5=class{constructor(e,t){_t(this,"trapStack"),_t(this,"config"),_t(this,"doc"),_t(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),_t(this,"portalContainers",new Set),_t(this,"listenerCleanups",[]),_t(this,"handleFocus",r=>{const s=ar(r),a=this.findContainerIndex(s,r)>=0;if(a||kl(s))a&&(this.state.mostRecentlyFocusedNode=s);else{r.stopImmediatePropagation();let u,c=!0;if(this.state.mostRecentlyFocusedNode)if(Na(this.state.mostRecentlyFocusedNode)>0){const d=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:f}=this.state.containerGroups[d];if(f.length>0){const p=f.findIndex(m=>m===this.state.mostRecentlyFocusedNode);p>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?p+1<f.length&&(u=f[p+1],c=!1):p-1>=0&&(u=f[p-1],c=!1))}}else this.state.containerGroups.some(d=>d.tabbableNodes.some(f=>Na(f)>0))||(c=!1);else c=!1;c&&(u=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),u?this.tryFocus(u):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),_t(this,"handlePointerDown",r=>{const s=ar(r);if(!(this.findContainerIndex(s,r)>=0)){if(Da(this.config.clickOutsideDeactivates,r)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}Da(this.config.allowOutsideClick,r)||r.preventDefault()}}),_t(this,"handleClick",r=>{const s=ar(r);this.findContainerIndex(s,r)>=0||Da(this.config.clickOutsideDeactivates,r)||Da(this.config.allowOutsideClick,r)||(r.preventDefault(),r.stopImmediatePropagation())}),_t(this,"handleTabKey",r=>{if(this.config.isKeyForward(r)||this.config.isKeyBackward(r)){this.state.recentNavEvent=r;const s=this.config.isKeyBackward(r),a=this.findNextNavNode({event:r,isBackward:s});if(!a)return;La(r)&&r.preventDefault(),this.tryFocus(a)}}),_t(this,"handleEscapeKey",r=>{J5(r)&&Da(this.config.escapeDeactivates,r)!==!1&&(r.preventDefault(),this.deactivate())}),_t(this,"_mutationObserver"),_t(this,"setupMutationObserver",()=>{const r=this.doc.defaultView||window;this._mutationObserver=new r.MutationObserver(s=>{s.some(c=>Array.from(c.removedNodes).some(f=>f===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode()),s.some(c=>c.type==="attributes"&&(c.attributeName==="aria-controls"||c.attributeName==="aria-expanded")?!0:c.type==="childList"&&c.addedNodes.length>0?Array.from(c.addedNodes).some(d=>{if(d.nodeType!==Node.ELEMENT_NODE)return!1;const f=d;return b4(f)?!0:f.id&&!this.state.containers.some(p=>p.contains(f))?x4(f):!1}):!1)&&this.state.active&&!this.state.paused&&(this.updateTabbableNodes(),this.updatePortalContainers())})}),_t(this,"updateObservedNodes",()=>{var r;(r=this._mutationObserver)==null||r.disconnect(),this.state.active&&!this.state.paused&&(this.state.containers.map(s=>{var a;(a=this._mutationObserver)==null||a.observe(s,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}),this.portalContainers.forEach(s=>{this.observePortalContainer(s)}))}),_t(this,"getInitialFocusNode",()=>{let r=this.getNodeForOption("initialFocus",{hasFallback:!0});if(r===!1)return!1;if(r===void 0||r&&!Sr(r)){const s=Js(this.doc);if(s&&this.findContainerIndex(s)>=0)r=s;else{const a=this.state.tabbableGroups[0];r=a&&a.firstTabbableNode||this.getNodeForOption("fallbackFocus")}}else r===null&&(r=this.getNodeForOption("fallbackFocus"));if(!r)throw new Error("Your focus-trap needs to have at least one focusable element");return r.isConnected||(r=this.getNodeForOption("fallbackFocus")),r}),_t(this,"tryFocus",r=>{if(r!==!1&&r!==Js(this.doc)){if(!r||!r.focus){this.tryFocus(this.getInitialFocusNode());return}r.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=r,Z5(r)&&r.select()}}),_t(this,"deactivate",r=>{if(!this.state.active)return this;const s=H({onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus},r);clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),eb.deactivateTrap(this.trapStack,this),this.portalContainers.clear();const a=this.getOption(s,"onDeactivate"),u=this.getOption(s,"onPostDeactivate"),c=this.getOption(s,"checkCanReturnFocus"),d=this.getOption(s,"returnFocus","returnFocusOnDeactivate");a==null||a();const f=()=>{tb(()=>{if(d){const p=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(p)}u==null||u()})};if(d&&c){const p=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return c(p).then(f,f),this}return f(),this}),_t(this,"pause",r=>{if(this.state.paused||!this.state.active)return this;const s=this.getOption(r,"onPause"),a=this.getOption(r,"onPostPause");return this.state.paused=!0,s==null||s(),this.removeListeners(),this.updateObservedNodes(),a==null||a(),this}),_t(this,"unpause",r=>{if(!this.state.paused||!this.state.active)return this;const s=this.getOption(r,"onUnpause"),a=this.getOption(r,"onPostUnpause");return this.state.paused=!1,s==null||s(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),a==null||a(),this}),_t(this,"updateContainerElements",r=>(this.state.containers=Array.isArray(r)?r.filter(Boolean):[r].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),_t(this,"getReturnFocusNode",r=>{const s=this.getNodeForOption("setReturnFocus",{params:[r]});return s||(s===!1?!1:r)}),_t(this,"getOption",(r,s,a)=>r&&r[s]!==void 0?r[s]:this.config[a||s]),_t(this,"getNodeForOption",(r,{hasFallback:s=!1,params:a=[]}={})=>{let u=this.config[r];if(typeof u=="function"&&(u=u(...a)),u===!0&&(u=void 0),!u){if(u===void 0||u===!1)return u;throw new Error(`\`${r}\` was specified but was not a node, or did not return a node`)}let c=u;if(typeof u=="string"){try{c=this.doc.querySelector(u)}catch(d){throw new Error(`\`${r}\` appears to be an invalid selector; error="${d.message}"`)}if(!c&&!s)throw new Error(`\`${r}\` as selector refers to no known node`)}return c}),_t(this,"findNextNavNode",r=>{const{event:s,isBackward:a=!1}=r,u=r.target||ar(s);this.updateTabbableNodes();let c=null;if(this.state.tabbableGroups.length>0){const d=this.findContainerIndex(u,s),f=d>=0?this.state.containerGroups[d]:void 0;if(d<0)a?c=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:c=this.state.tabbableGroups[0].firstTabbableNode;else if(a){let p=this.state.tabbableGroups.findIndex(({firstTabbableNode:m})=>u===m);if(p<0&&((f==null?void 0:f.container)===u||Sr(u)&&!ns(u)&&!(f!=null&&f.nextTabbableNode(u,!1)))&&(p=d),p>=0){const m=p===0?this.state.tabbableGroups.length-1:p-1,b=this.state.tabbableGroups[m];c=Na(u)>=0?b.lastTabbableNode:b.lastDomTabbableNode}else La(s)||(c=f==null?void 0:f.nextTabbableNode(u,!1))}else{let p=this.state.tabbableGroups.findIndex(({lastTabbableNode:m})=>u===m);if(p<0&&((f==null?void 0:f.container)===u||Sr(u)&&!ns(u)&&!(f!=null&&f.nextTabbableNode(u)))&&(p=d),p>=0){const m=p===this.state.tabbableGroups.length-1?0:p+1,b=this.state.tabbableGroups[m];c=Na(u)>=0?b.firstTabbableNode:b.firstDomTabbableNode}else La(s)||(c=f==null?void 0:f.nextTabbableNode(u))}}else c=this.getNodeForOption("fallbackFocus");return c}),this.trapStack=t.trapStack||Q5;const n=H({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,followControlledElements:!0,isKeyForward(r){return La(r)&&!r.shiftKey},isKeyBackward(r){return La(r)&&r.shiftKey}},t);this.doc=n.document||wr(Array.isArray(e)?e[0]:e),this.config=n,this.updateContainerElements(e),this.setupMutationObserver()}addPortalContainer(e){const t=e.parentElement;t&&!this.portalContainers.has(t)&&(this.portalContainers.add(t),this.state.active&&!this.state.paused&&this.observePortalContainer(t))}observePortalContainer(e){var t;(t=this._mutationObserver)==null||t.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}updatePortalContainers(){this.config.followControlledElements&&this.state.containers.forEach(e=>{E4(e).forEach(n=>{this.addPortalContainer(n)})})}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){const n=typeof(t==null?void 0:t.composedPath)=="function"?t.composedPath():void 0;return this.state.containerGroups.findIndex(({container:r,tabbableNodes:s})=>r.contains(e)||(n==null?void 0:n.includes(r))||s.find(a=>a===e)||this.isControlledElement(r,e))}isControlledElement(e,t){return this.config.followControlledElements?eT(e,t):!1}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{const t=eo(e,{getShadowRoot:this.config.getShadowRoot}),n=lT(e,{getShadowRoot:this.config.getShadowRoot}),r=t[0],s=t[t.length-1],a=r,u=s;let c=!1;for(let f=0;f<t.length;f++)if(Na(t[f])>0){c=!0;break}function d(f,p=!0){const m=t.indexOf(f);if(m>=0)return t[m+(p?1:-1)];const b=n.indexOf(f);if(!(b<0)){if(p){for(let y=b+1;y<n.length;y++)if(ns(n[y]))return n[y]}else for(let y=b-1;y>=0;y--)if(ns(n[y]))return n[y]}}return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:s,firstDomTabbableNode:a,lastDomTabbableNode:u,nextTabbableNode:d}}),this.state.tabbableGroups=this.state.containerGroups.filter(e=>e.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(e=>e.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return eb.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?tb(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(zt(this.doc,"focusin",this.handleFocus,!0),zt(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),zt(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),zt(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),zt(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),zt(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(e=>e()),this.listenerCleanups=[],this}activate(e){if(this.state.active)return this;const t=this.getOption(e,"onActivate"),n=this.getOption(e,"onPostActivate"),r=this.getOption(e,"checkCanFocusTrap");r||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=Js(this.doc),t==null||t();const s=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),n==null||n()};return r?(r(this.state.containers.concat()).then(s,s),this):(s(),this)}},La=e=>e.key==="Tab",Da=(e,...t)=>typeof e=="function"?e(...t):e,J5=e=>!e.isComposing&&e.key==="Escape",tb=e=>setTimeout(e,0),Z5=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function nb(e,t={}){let n;const r=Mt(()=>{const s=typeof e=="function"?e():e;if(s){n=new K5(s,le(H({escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:s},t),{document:wr(s)}));try{n.activate()}catch(a){}}});return function(){n==null||n.deactivate(),r()}}var Uh="data-scroll-lock";function eD(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function rb(e){const t=Zs(e),n=t==null?void 0:t.scrollbarGutter;return n==="stable"||(n==null?void 0:n.startsWith("stable "))===!0}function ib(e){var y;const t=e!=null?e:document,n=(y=t.defaultView)!=null?y:window,{documentElement:r,body:s}=t;if(s.hasAttribute(Uh))return;const u=rb(r)||rb(s),c=n.innerWidth-r.clientWidth;s.setAttribute(Uh,"");const d=()=>Q4(r,"--scrollbar-width",`${c}px`),f=eD(r),p=()=>{const x={overflow:"hidden"};return!u&&c>0&&(x[f]=`${c}px`),Il(s,x)},m=()=>{var X,L;const{scrollX:x,scrollY:A,visualViewport:v}=n,w=(X=v==null?void 0:v.offsetLeft)!=null?X:0,N=(L=v==null?void 0:v.offsetTop)!=null?L:0,C={position:"fixed",overflow:"hidden",top:`${-(A-Math.floor(N))}px`,left:`${-(x-Math.floor(w))}px`,right:"0"};!u&&c>0&&(C[f]=`${c}px`);const j=Il(s,C);return()=>{j==null||j(),n.scrollTo({left:x,top:A,behavior:"instant"})}},b=[d(),Nl()?m():p()];return()=>{b.forEach(x=>x==null?void 0:x()),s.removeAttribute(Uh)}}var tD=is("popover").parts("arrow","arrowTip","anchor","trigger","indicator","positioner","content","title","description","closeTrigger"),Cr=tD.build(),sb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.anchor)!=null?n:`popover:${e.id}:anchor`},ob=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`popover:${e.id}:trigger`},Hh=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`popover:${e.id}:content`},ab=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`popover:${e.id}:popper`},nD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.arrow)!=null?n:`popover:${e.id}:arrow`},jh=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`popover:${e.id}:title`},$h=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`popover:${e.id}:desc`},rD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`popover:${e.id}:close`},ub=e=>e.getById(sb(e)),co=e=>e.getById(ob(e)),fo=e=>e.getById(Hh(e)),lb=e=>e.getById(ab(e)),iD=e=>e.getById(jh(e)),sD=e=>e.getById($h(e));function oD(e,t){const{state:n,context:r,send:s,computed:a,prop:u,scope:c}=e,d=n.matches("open"),f=r.get("currentPlacement"),p=a("currentPortalled"),m=r.get("renderedElements"),b=k5(le(H({},u("positioning")),{placement:f}));return{portalled:p,open:d,setOpen(y){n.matches("open")!==y&&s({type:y?"OPEN":"CLOSE"})},reposition(y={}){s({type:"POSITIONING.SET",options:y})},getArrowProps(){return t.element(le(H({id:nD(c)},Cr.arrow.attrs),{dir:u("dir"),style:b.arrow}))},getArrowTipProps(){return t.element(le(H({},Cr.arrowTip.attrs),{dir:u("dir"),style:b.arrowTip}))},getAnchorProps(){return t.element(le(H({},Cr.anchor.attrs),{dir:u("dir"),id:sb(c)}))},getTriggerProps(){return t.button(le(H({},Cr.trigger.attrs),{dir:u("dir"),type:"button","data-placement":f,id:ob(c),"aria-haspopup":"dialog","aria-expanded":d,"data-state":d?"open":"closed","aria-controls":Hh(c),onPointerDown(y){rT(y)&&k4()&&y.currentTarget.focus()},onClick(y){y.defaultPrevented||s({type:"TOGGLE"})},onBlur(y){s({type:"TRIGGER_BLUR",target:y.relatedTarget})}}))},getIndicatorProps(){return t.element(le(H({},Cr.indicator.attrs),{dir:u("dir"),"data-state":d?"open":"closed"}))},getPositionerProps(){return t.element(le(H({id:ab(c)},Cr.positioner.attrs),{dir:u("dir"),style:b.floating}))},getContentProps(){return t.element(le(H({},Cr.content.attrs),{dir:u("dir"),id:Hh(c),tabIndex:-1,role:"dialog","aria-modal":Ky(u("modal")),hidden:!d,"data-state":d?"open":"closed","data-expanded":Xs(d),"aria-labelledby":m.title?jh(c):void 0,"aria-describedby":m.description?$h(c):void 0,"data-placement":f}))},getTitleProps(){return t.element(le(H({},Cr.title.attrs),{id:jh(c),dir:u("dir")}))},getDescriptionProps(){return t.element(le(H({},Cr.description.attrs),{id:$h(c),dir:u("dir")}))},getCloseTriggerProps(){return t.button(le(H({},Cr.closeTrigger.attrs),{dir:u("dir"),id:rD(c),type:"button","aria-label":"close",onClick(y){y.defaultPrevented||(y.stopPropagation(),s({type:"CLOSE"}))}}))}}}var aD={props({props:e}){return le(H({closeOnInteractOutside:!0,closeOnEscape:!0,autoFocus:!0,modal:!1,portalled:!0},e),{positioning:H({placement:"bottom"},e.positioning)})},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{currentPlacement:e(()=>({defaultValue:void 0})),renderedElements:e(()=>({defaultValue:{title:!0,description:!0}}))}},computed:{currentPortalled:({prop:e})=>!!e("modal")||!!e("portalled")},watch({track:e,prop:t,action:n}){e([()=>t("open")],()=>{n(["toggleVisibility"])})},entry:["checkRenderedElements"],states:{closed:{on:{"CONTROLLED.OPEN":{target:"open",actions:["setInitialFocus"]},TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus"]}]}},open:{effects:["trapFocus","preventScroll","hideContentBelow","trackPositioning","trackDismissableElement","proxyTabFocus"],on:{"CONTROLLED.CLOSE":{target:"closed",actions:["setFinalFocus"]},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose","setFinalFocus"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"POSITIONING.SET":{actions:["reposition"]}}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackPositioning({context:e,prop:t,scope:n}){var a;e.set("currentPlacement",t("positioning").placement);const r=(a=ub(n))!=null?a:co(n);return $T(r,()=>lb(n),le(H({},t("positioning")),{defer:!0,onComplete(u){e.set("currentPlacement",u.placement)}}))},trackDismissableElement({send:e,prop:t,scope:n}){const r=()=>fo(n);let s=!0;return ZT(r,{type:"popover",pointerBlocking:t("modal"),exclude:co(n),defer:!0,onEscapeKeyDown(a){var u;(u=t("onEscapeKeyDown"))==null||u(a),!t("closeOnEscape")&&a.preventDefault()},onInteractOutside(a){var u;(u=t("onInteractOutside"))==null||u(a),!a.defaultPrevented&&(s=!(a.detail.focusable||a.detail.contextmenu),t("closeOnInteractOutside")||a.preventDefault())},onPointerDownOutside:t("onPointerDownOutside"),onFocusOutside:t("onFocusOutside"),persistentElements:t("persistentElements"),onRequestDismiss:t("onRequestDismiss"),onDismiss(){e({type:"CLOSE",src:"interact-outside",restoreFocus:s})}})},proxyTabFocus({prop:e,scope:t}){return e("modal")||!e("portalled")?void 0:G4(()=>fo(t),{triggerElement:co(t),defer:!0,getShadowRoot:!0,onFocus(r){r.focus({preventScroll:!0})}})},hideContentBelow({prop:e,scope:t}){return e("modal")?VT(()=>[fo(t),co(t)],{defer:!0}):void 0},preventScroll({prop:e,scope:t}){if(e("modal"))return ib(t.getDoc())},trapFocus({prop:e,scope:t}){return e("modal")?nb(()=>fo(t),{initialFocus:()=>cT({root:fo(t),getInitialEl:e("initialFocusEl"),enabled:e("autoFocus")}),getShadowRoot:!0}):void 0}},actions:{reposition({event:e,prop:t,scope:n,context:r}){var u;const s=(u=ub(n))!=null?u:co(n);$T(s,()=>lb(n),le(H(H({},t("positioning")),e.options),{defer:!0,listeners:!1,onComplete(c){r.set("currentPlacement",c.placement)}}))},checkRenderedElements({context:e,scope:t}){Mt(()=>{Object.assign(e.get("renderedElements"),{title:!!iD(t),description:!!sD(t)})})},setInitialFocus({prop:e,scope:t}){e("modal")||Mt(()=>{const n=cT({root:fo(t),getInitialEl:e("initialFocusEl"),enabled:e("autoFocus")});n==null||n.focus({preventScroll:!0})})},setFinalFocus({event:e,scope:t}){var r,s;const n=(s=e.restoreFocus)!=null?s:(r=e.previousEvent)==null?void 0:r.restoreFocus;n!=null&&!n||Mt(()=>{const a=co(t);a==null||a.focus({preventScroll:!0})})},invokeOnOpen({prop:e,flush:t}){t(()=>{var n;(n=e("onOpenChange"))==null||n({open:!0})})},invokeOnClose({prop:e,flush:t}){t(()=>{var n;(n=e("onOpenChange"))==null||n({open:!1})})},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}};ro()(["autoFocus","closeOnEscape","closeOnInteractOutside","dir","getRootNode","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","portalled","positioning"]);const[gU,Yl]=rs({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}}),[EU,zh]=rs({name:"LocaleContext",hookName:"useLocaleContext",providerName:"<LocaleProvider />",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}}),uD=e=>{const t=B.useId(),{getRootNode:n}=Yl(),{dir:r}=zh(),s=H({id:t,dir:r,getRootNode:n},e),a=Rl(aD,s);return oD(a,wh)},lD=e=>{const[t,u]=TT(e),c=u,{children:n}=c,r=yn(c,["children"]),s=uD(r),a=Ah(Ft({present:s.open},t));return _.jsx(lL,{value:s,children:_.jsx(gT,{value:a,children:n})})},cb=B.forwardRef((e,t)=>{const n=vh(),r=Ca(),s=Ft(le(H({},n.getTriggerProps()),{"aria-controls":r.unmounted?void 0:n.getTriggerProps()["aria-controls"]}),e);return _.jsx(ln.button,le(H({},s),{ref:t}))});cb.displayName="PopoverTrigger";function cD(e){return ot({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M11.854 3.646a.5.5 0 0 1 0 .708L8.207 8l3.647 3.646a.5.5 0 0 1-.708.708l-4-4a.5.5 0 0 1 0-.708l4-4a.5.5 0 0 1 .708 0M4.5 1a.5.5 0 0 0-.5.5v13a.5.5 0 0 0 1 0v-13a.5.5 0 0 0-.5-.5"},child:[]}]})(e)}function dD(e){return ot({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.146 3.646a.5.5 0 0 0 0 .708L7.793 8l-3.647 3.646a.5.5 0 0 0 .708.708l4-4a.5.5 0 0 0 0-.708l-4-4a.5.5 0 0 0-.708 0M11.5 1a.5.5 0 0 1 .5.5v13a.5.5 0 0 1-1 0v-13a.5.5 0 0 1 .5-.5"},child:[]}]})(e)}function db(e){return ot({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0"},child:[]}]})(e)}function fb(e){return ot({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708"},child:[]}]})(e)}function fD(e){return ot({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8 2a.5.5 0 0 1 .5.5v5h5a.5.5 0 0 1 0 1h-5v5a.5.5 0 0 1-1 0v-5h-5a.5.5 0 0 1 0-1h5v-5A.5.5 0 0 1 8 2"},child:[]}]})(e)}function hD(e){return ot({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576zm6.787-8.201L1.591 6.602l4.339 2.76z"},child:[]}]})(e)}function Vh(e){return ot({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M7.657 6.247c.11-.33.576-.33.686 0l.645 1.937a2.89 2.89 0 0 0 1.829 1.828l1.936.645c.33.11.33.576 0 .686l-1.937.645a2.89 2.89 0 0 0-1.828 1.829l-.645 1.936a.361.361 0 0 1-.686 0l-.645-1.937a2.89 2.89 0 0 0-1.828-1.828l-1.937-.645a.361.361 0 0 1 0-.686l1.937-.645a2.89 2.89 0 0 0 1.828-1.828zM3.794 1.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387A1.73 1.73 0 0 0 4.593 5.69l-.387 1.162a.217.217 0 0 1-.412 0L3.407 5.69A1.73 1.73 0 0 0 2.31 4.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387A1.73 1.73 0 0 0 3.407 2.31zM10.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.16 1.16 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.16 1.16 0 0 0-.732-.732L9.1 2.137a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732z"},child:[]}]})(e)}function hb(e){return ot({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"},child:[]}]})(e)}const pD=({className:e,componentType:t,children:n})=>{const[r,s]=B.useState(!1),{globalClassName:a}=at(),u=f=>{s(f.open)},c=B.useCallback(()=>{s(!1)},[]),d=B.useMemo(()=>({closeMenu:c}),[c]);return _.jsxs(lD,{open:r,onOpenChange:u,positioning:{placement:"bottom-end"},children:[_.jsx(cb,{"aria-label":`Overflow menu for ${t}`,className:M(`${O}-overflow-menu-button-trigger`,`${O}-icon-button`,a,e,`cim-${t}-component`),children:_.jsx(hb,{})}),_.jsx(yT,{children:_.jsx(ET,{className:M(`${O}-overflow-menu-list`,a,`cim-${t}-component`),children:_.jsx(zy.Provider,{value:d,children:n})})})]})};function pb(e){return ot({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M15 4.00008H13V11.0001H20V9.00008H16.4142L20.7071 4.70718L19.2929 3.29297L15 7.58586V4.00008ZM4.00008 15H7.58586L3.29297 19.2929L4.70718 20.7071L9.00008 16.4142V20H11.0001V13H4.00008V15Z"},child:[]}]})(e)}function mb(e){return ot({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17.5858 5H14V3H21V10H19V6.41421L14.7071 10.7071L13.2929 9.29289L17.5858 5ZM3 14H5V17.5858L9.29289 13.2929L10.7071 14.7071L6.41421 19H10V21H3V14Z"},child:[]}]})(e)}const[mD,as]=rs({name:"CarouselContext",hookName:"useCarouselContext",providerName:"<CarouselProvider />"}),qh=B.forwardRef((e,t)=>{const n=as(),r=Ft(n.getControlProps(),e);return _.jsx(ln.div,le(H(H({},r),e),{ref:t}))});qh.displayName="CarouselControl";const Yh=B.forwardRef((e,t)=>{const[n,r]=Oa()(e,["readOnly","index"]),s=as(),a=Ft(s.getIndicatorProps(n),r);return _.jsx(ln.button,le(H({},a),{ref:t}))});Yh.displayName="CarouselIndicator";const Wh=B.forwardRef((e,t)=>{const n=as(),r=Ft(n.getIndicatorGroupProps(),e);return _.jsx(ln.div,le(H({},r),{ref:t}))});Wh.displayName="CarouselIndicatorGroup";const Gh=B.forwardRef((e,t)=>{const[n,r]=Oa()(e,["index","snapAlign"]),s=as(),a=Ft(s.getItemProps(n),r);return _.jsx(ln.div,le(H({},a),{ref:t}))});Gh.displayName="CarouselItem";const Xh=B.forwardRef((e,t)=>{const n=as(),r=Ft(n.getItemGroupProps(),e);return _.jsx(ln.div,le(H({},r),{ref:t}))});Xh.displayName="CarouselItemGroup";const Qh=B.forwardRef((e,t)=>{const n=as(),r=Ft(n.getNextTriggerProps(),e);return _.jsx(ln.button,le(H({},r),{ref:t}))});Qh.displayName="CarouselNextTrigger";const Kh=B.forwardRef((e,t)=>{const n=as(),r=Ft(n.getPrevTriggerProps(),e);return _.jsx(ln.button,le(H({},r),{ref:t}))});Kh.displayName="CarouselPrevTrigger";function gD(e){const t=Zs(e),n=e.getBoundingClientRect();let r=t.getPropertyValue("scroll-padding-left").replace("auto","0px"),s=t.getPropertyValue("scroll-padding-top").replace("auto","0px"),a=t.getPropertyValue("scroll-padding-right").replace("auto","0px"),u=t.getPropertyValue("scroll-padding-bottom").replace("auto","0px");function c(b,y){let x=parseFloat(b);return/%/.test(b)&&(x/=100,x*=y),Number.isNaN(x)?0:x}let d=c(r,n.width),f=c(s,n.height),p=c(a,n.width),m=c(u,n.height);return{x:{before:d,after:p},y:{before:f,after:m}}}function ED(e,t,n="both"){return n==="x"&&e.right>=t.left&&e.left<=t.right||n==="y"&&e.bottom>=t.top&&e.top<=t.bottom||n==="both"&&e.right>=t.left&&e.left<=t.right&&e.bottom>=t.top&&e.top<=t.bottom}function gb(e){let t=[];for(const n of e.children)t=t.concat(n,gb(n));return t}function Eb(e,t=!1){const n=e.getBoundingClientRect(),r={x:{start:[],center:[],end:[]},y:{start:[],center:[],end:[]}},s=t?gb(e):e.children;for(const a of["x","y"]){const u=a==="x"?"y":"x",c=a==="x"?"left":"top",d=a==="x"?"width":"height",f=a==="x"?"scrollLeft":"scrollTop";for(const p of s){const m=p.getBoundingClientRect();if(!ED(n,m,u))continue;const b=Zs(p);let[y,x]=b.getPropertyValue("scroll-snap-align").split(" ");typeof x=="undefined"&&(x=y);const A=a==="x"?x:y,v=m[c]-n[c]+e[f];switch(A){case"none":break;case"start":r[a].start.push({node:p,position:v});break;case"center":r[a].center.push({node:p,position:v+m[d]/2});break;case"end":r[a].end.push({node:p,position:v+m[d]});break}}}return r}function yb(e){const t=e.getBoundingClientRect(),n=gD(e),r=Eb(e),s={x:e.scrollWidth-e.offsetWidth,y:e.scrollHeight-e.offsetHeight};return{x:Tb([...r.x.start.map(a=>a.position-n.x.before),...r.x.center.map(a=>a.position-t.width/2),...r.x.end.map(a=>a.position-t.width+n.x.after)].map(bb(0,s.x))),y:Tb([...r.y.start.map(a=>a.position-n.y.before),...r.y.center.map(a=>a.position-t.height/2),...r.y.end.map(a=>a.position-t.height+n.y.after)].map(bb(0,s.y)))}}function yD(e,t,n){const r=Eb(e),s=[...r[t].start,...r[t].center,...r[t].end];for(const a of s)if(n(a.node))return a.position}var Tb=e=>[...new Set(e)],bb=(e,t)=>n=>Math.max(e,Math.min(t,n)),TD=is("carousel").parts("root","itemGroup","item","control","nextTrigger","prevTrigger","indicatorGroup","indicator","autoplayTrigger"),zr=TD.build(),bD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.root)!=null?n:`carousel:${e.id}`},xD=(e,t)=>{var n,r,s;return(s=(r=(n=e.ids)==null?void 0:n.item)==null?void 0:r.call(n,t))!=null?s:`carousel:${e.id}:item:${t}`},Wl=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.itemGroup)!=null?n:`carousel:${e.id}:item-group`},_D=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.nextTrigger)!=null?n:`carousel:${e.id}:next-trigger`},wD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.prevTrigger)!=null?n:`carousel:${e.id}:prev-trigger`},SD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.indicatorGroup)!=null?n:`carousel:${e.id}:indicator-group`},xb=(e,t)=>{var n,r,s;return(s=(r=(n=e.ids)==null?void 0:n.indicator)==null?void 0:r.call(n,t))!=null?s:`carousel:${e.id}:indicator:${t}`},vn=e=>e.getById(Wl(e)),_b=e=>X4(vn(e),"[data-part=item]"),vD=(e,t)=>e.getById(xb(e,t)),wb=e=>{const t=vn(e);if(!t)return;const n=eo(t);t.setAttribute("tabindex",n.length>0?"-1":"0")};function AD(e,t){const{state:n,context:r,computed:s,send:a,scope:u,prop:c}=e,d=n.matches("autoplay"),f=n.matches("dragging"),p=s("canScrollNext"),m=s("canScrollPrev"),b=s("isHorizontal"),y=Array.from(r.get("pageSnapPoints")),x=r.get("page"),A=c("slidesPerPage"),v=c("padding"),w=c("translations");return{isPlaying:d,isDragging:f,page:x,pageSnapPoints:y,canScrollNext:p,canScrollPrev:m,getProgress(){return x/y.length},scrollToIndex(N,C){a({type:"INDEX.SET",index:N,instant:C})},scrollTo(N,C){a({type:"PAGE.SET",index:N,instant:C})},scrollNext(N){a({type:"PAGE.NEXT",instant:N})},scrollPrev(N){a({type:"PAGE.PREV",instant:N})},play(){a({type:"AUTOPLAY.START"})},pause(){a({type:"AUTOPLAY.PAUSE"})},isInView(N){return Array.from(r.get("slidesInView")).includes(N)},refresh(){a({type:"SNAP.REFRESH"})},getRootProps(){return t.element(le(H({},zr.root.attrs),{id:bD(u),role:"region","aria-roledescription":"carousel","data-orientation":c("orientation"),dir:c("dir"),style:{"--slides-per-page":A,"--slide-spacing":c("spacing"),"--slide-item-size":"calc(100% / var(--slides-per-page) - var(--slide-spacing) * (var(--slides-per-page) - 1) / var(--slides-per-page))"}}))},getItemGroupProps(){return t.element(le(H({},zr.itemGroup.attrs),{id:Wl(u),"data-orientation":c("orientation"),"data-dragging":Xs(f),dir:c("dir"),"aria-live":d?"off":"polite",onFocus(N){Qs(N.currentTarget,ar(N))&&a({type:"VIEWPORT.FOCUS"})},onBlur(N){Qs(N.currentTarget,N.relatedTarget)||a({type:"VIEWPORT.BLUR"})},onMouseDown(N){if(N.defaultPrevented||!c("allowMouseDrag")||!rT(N))return;const C=ar(N);Sr(C)&&C!==N.currentTarget||(N.preventDefault(),a({type:"DRAGGING.START"}))},onWheel:X6(N=>{const C=c("orientation")==="horizontal"?"deltaX":"deltaY";N[C]<0&&!s("canScrollPrev")||N[C]>0&&!s("canScrollNext")||a({type:"USER.SCROLL"})},150),onTouchStart(){a({type:"USER.SCROLL"})},style:{display:"grid",gap:"var(--slide-spacing)",scrollSnapType:[b?"x":"y",c("snapType")].join(" "),gridAutoFlow:b?"column":"row",scrollbarWidth:"none",overscrollBehaviorX:"contain",[b?"gridAutoColumns":"gridAutoRows"]:"var(--slide-item-size)",[b?"scrollPaddingInline":"scrollPaddingBlock"]:v,[b?"paddingInline":"paddingBlock"]:v,[b?"overflowX":"overflowY"]:"auto"}}))},getItemProps(N){const C=r.get("slidesInView").includes(N.index);return t.element(le(H({},zr.item.attrs),{id:xD(u,N.index),dir:c("dir"),role:"group","data-index":N.index,"data-inview":Xs(C),"aria-roledescription":"slide","data-orientation":c("orientation"),"aria-label":w.item(N.index,c("slideCount")),"aria-hidden":Ky(!C),style:{scrollSnapAlign:(()=>{var ne;const j=(ne=N.snapAlign)!=null?ne:"start",X=c("slidesPerMove"),L=X==="auto"?Math.floor(c("slidesPerPage")):X;return(N.index+L)%L===0?j:void 0})()}}))},getControlProps(){return t.element(le(H({},zr.control.attrs),{"data-orientation":c("orientation")}))},getPrevTriggerProps(){return t.button(le(H({},zr.prevTrigger.attrs),{id:wD(u),type:"button",disabled:!m,dir:c("dir"),"aria-label":w.prevTrigger,"data-orientation":c("orientation"),"aria-controls":Wl(u),onClick(N){N.defaultPrevented||a({type:"PAGE.PREV",src:"trigger"})}}))},getNextTriggerProps(){return t.button(le(H({},zr.nextTrigger.attrs),{dir:c("dir"),id:_D(u),type:"button","aria-label":w.nextTrigger,"data-orientation":c("orientation"),"aria-controls":Wl(u),disabled:!p,onClick(N){N.defaultPrevented||a({type:"PAGE.NEXT",src:"trigger"})}}))},getIndicatorGroupProps(){return t.element(le(H({},zr.indicatorGroup.attrs),{dir:c("dir"),id:SD(u),"data-orientation":c("orientation"),onKeyDown(N){if(N.defaultPrevented)return;const C="indicator",j={ArrowDown(G){b||(a({type:"PAGE.NEXT",src:C}),G.preventDefault())},ArrowUp(G){b||(a({type:"PAGE.PREV",src:C}),G.preventDefault())},ArrowRight(G){b&&(a({type:"PAGE.NEXT",src:C}),G.preventDefault())},ArrowLeft(G){b&&(a({type:"PAGE.PREV",src:C}),G.preventDefault())},Home(G){a({type:"PAGE.SET",index:0,src:C}),G.preventDefault()},End(G){a({type:"PAGE.SET",index:y.length-1,src:C}),G.preventDefault()}},X=P4(N,{dir:c("dir"),orientation:c("orientation")}),L=j[X];L==null||L(N)}}))},getIndicatorProps(N){return t.button(le(H({},zr.indicator.attrs),{dir:c("dir"),id:xb(u,N.index),type:"button","data-orientation":c("orientation"),"data-index":N.index,"data-readonly":Xs(N.readOnly),"data-current":Xs(N.index===x),"aria-label":w.indicator(N.index),onClick(C){C.defaultPrevented||N.readOnly||a({type:"PAGE.SET",index:N.index,src:"indicator"})}}))},getAutoplayTriggerProps(){return t.button(le(H({},zr.autoplayTrigger.attrs),{type:"button","data-orientation":c("orientation"),"data-pressed":Xs(d),"aria-label":d?w.autoplayStop:w.autoplayStart,onClick(N){N.defaultPrevented||a({type:d?"AUTOPLAY.PAUSE":"AUTOPLAY.START"})}}))}}}var kD={props({props:e}){return t4(e,["slideCount"],"carousel"),le(H({dir:"ltr",defaultPage:0,orientation:"horizontal",snapType:"mandatory",loop:!!e.autoplay,slidesPerPage:1,slidesPerMove:"auto",spacing:"0px",autoplay:!1,allowMouseDrag:!1,inViewThreshold:.6},e),{translations:H({nextTrigger:"Next slide",prevTrigger:"Previous slide",indicator:t=>`Go to slide ${t+1}`,item:(t,n)=>`${t+1} of ${n}`,autoplayStart:"Start slide rotation",autoplayStop:"Stop slide rotation"},e.translations)})},refs(){return{timeoutRef:void 0}},initialState({prop:e}){return e("autoplay")?"autoplay":"idle"},context({prop:e,bindable:t,getContext:n}){return{page:t(()=>({defaultValue:e("defaultPage"),value:e("page"),onChange(r){var u;const a=n().get("pageSnapPoints");(u=e("onPageChange"))==null||u({page:r,pageSnapPoint:a[r]})}})),pageSnapPoints:t(()=>({defaultValue:ND(e("slideCount"),e("slidesPerMove"),e("slidesPerPage"))})),slidesInView:t(()=>({defaultValue:[]}))}},computed:{isRtl:({prop:e})=>e("dir")==="rtl",isHorizontal:({prop:e})=>e("orientation")==="horizontal",canScrollNext:({prop:e,context:t})=>e("loop")||t.get("page")<t.get("pageSnapPoints").length-1,canScrollPrev:({prop:e,context:t})=>e("loop")||t.get("page")>0,autoplayInterval:({prop:e})=>{const t=e("autoplay");return B6(t)?t.delay:4e3}},watch({track:e,action:t,context:n,prop:r,send:s}){e([()=>r("slidesPerPage"),()=>r("slidesPerMove")],()=>{t(["setSnapPoints"])}),e([()=>n.get("page")],()=>{t(["scrollToPage","focusIndicatorEl"])}),e([()=>r("orientation")],()=>{t(["setSnapPoints","scrollToPage"])}),e([()=>r("slideCount")],()=>{s({type:"SNAP.REFRESH",src:"slide.count"})}),e([()=>!!r("autoplay")],()=>{s({type:r("autoplay")?"AUTOPLAY.START":"AUTOPLAY.PAUSE",src:"autoplay.prop.change"})})},on:{"PAGE.NEXT":{target:"idle",actions:["clearScrollEndTimer","setNextPage"]},"PAGE.PREV":{target:"idle",actions:["clearScrollEndTimer","setPrevPage"]},"PAGE.SET":{target:"idle",actions:["clearScrollEndTimer","setPage"]},"INDEX.SET":{target:"idle",actions:["clearScrollEndTimer","setMatchingPage"]},"SNAP.REFRESH":{actions:["setSnapPoints","clampPage"]},"PAGE.SCROLL":{actions:["scrollToPage"]}},effects:["trackSlideMutation","trackSlideIntersections","trackSlideResize"],entry:["setSnapPoints","setPage"],exit:["clearScrollEndTimer"],states:{idle:{on:{"DRAGGING.START":{target:"dragging",actions:["invokeDragStart"]},"AUTOPLAY.START":{target:"autoplay",actions:["invokeAutoplayStart"]},"USER.SCROLL":{target:"userScroll"},"VIEWPORT.FOCUS":{target:"focus"}}},focus:{effects:["trackKeyboardScroll"],on:{"VIEWPORT.BLUR":{target:"idle"},"PAGE.NEXT":{actions:["clearScrollEndTimer","setNextPage"]},"PAGE.PREV":{actions:["clearScrollEndTimer","setPrevPage"]},"PAGE.SET":{actions:["clearScrollEndTimer","setPage"]},"INDEX.SET":{actions:["clearScrollEndTimer","setMatchingPage"]},"USER.SCROLL":{target:"userScroll"}}},dragging:{effects:["trackPointerMove"],entry:["disableScrollSnap"],on:{DRAGGING:{actions:["scrollSlides","invokeDragging"]},"DRAGGING.END":{target:"idle",actions:["endDragging","invokeDraggingEnd"]}}},userScroll:{effects:["trackScroll"],on:{"SCROLL.END":[{guard:"isFocused",target:"focus",actions:["setClosestPage"]},{target:"idle",actions:["setClosestPage"]}]}},autoplay:{effects:["trackDocumentVisibility","trackScroll","autoUpdateSlide"],exit:["invokeAutoplayEnd"],on:{"AUTOPLAY.TICK":{actions:["setNextPage","invokeAutoplay"]},"DRAGGING.START":{target:"dragging",actions:["invokeDragStart"]},"AUTOPLAY.PAUSE":{target:"idle"}}}},implementations:{guards:{isFocused:({scope:e})=>e.isActiveElement(vn(e))},effects:{autoUpdateSlide({computed:e,send:t}){const n=setInterval(()=>{t({type:e("canScrollNext")?"AUTOPLAY.TICK":"AUTOPLAY.PAUSE",src:"autoplay.interval"})},e("autoplayInterval"));return()=>clearInterval(n)},trackSlideMutation({scope:e,send:t}){const n=vn(e);if(!n)return;const r=e.getWin(),s=new r.MutationObserver(()=>{t({type:"SNAP.REFRESH",src:"slide.mutation"}),wb(e)});return wb(e),s.observe(n,{childList:!0,subtree:!0}),()=>s.disconnect()},trackSlideResize({scope:e,send:t}){if(!vn(e))return;const r=e.getWin(),s=()=>{t({type:"SNAP.REFRESH",src:"slide.resize"})};Mt(()=>{s(),Mt(()=>{t({type:"PAGE.SCROLL",instant:!0})})});const a=new r.ResizeObserver(s);return _b(e).forEach(u=>a.observe(u)),()=>a.disconnect()},trackSlideIntersections({scope:e,prop:t,context:n}){const r=vn(e),s=e.getWin(),a=new s.IntersectionObserver(u=>{const c=u.reduce((d,f)=>{var b;const p=f.target,m=Number((b=p.dataset.index)!=null?b:"-1");return m==null||Number.isNaN(m)||m===-1?d:f.isIntersecting?R6(d,m):L6(d,m)},n.get("slidesInView"));n.set("slidesInView",D6(c))},{root:r,threshold:t("inViewThreshold")});return _b(e).forEach(u=>a.observe(u)),()=>a.disconnect()},trackScroll({send:e,refs:t,scope:n}){const r=vn(n);return r?zt(r,"scroll",()=>{clearTimeout(t.get("timeoutRef")),t.set("timeoutRef",void 0),t.set("timeoutRef",setTimeout(()=>{e({type:"SCROLL.END"})},150))},{passive:!0}):void 0},trackDocumentVisibility({scope:e,send:t}){const n=e.getDoc();return zt(n,"visibilitychange",()=>{n.visibilityState!=="visible"&&t({type:"AUTOPLAY.PAUSE",src:"doc.hidden"})})},trackPointerMove({scope:e,send:t}){const n=e.getDoc();return Y4(n,{onPointerMove({event:r}){t({type:"DRAGGING",left:-r.movementX,top:-r.movementY})},onPointerUp(){t({type:"DRAGGING.END"})}})},trackKeyboardScroll({scope:e,send:t,context:n}){const r=e.getWin();return zt(r,"keydown",a=>{switch(a.key){case"ArrowRight":a.preventDefault(),t({type:"PAGE.NEXT"});break;case"ArrowLeft":a.preventDefault(),t({type:"PAGE.PREV"});break;case"Home":a.preventDefault(),t({type:"PAGE.SET",index:0});break;case"End":a.preventDefault(),t({type:"PAGE.SET",index:n.get("pageSnapPoints").length-1})}},{capture:!0})}},actions:{clearScrollEndTimer({refs:e}){e.get("timeoutRef")!=null&&(clearTimeout(e.get("timeoutRef")),e.set("timeoutRef",void 0))},scrollToPage({context:e,event:t,scope:n,computed:r,flush:s}){var f;const a=t.instant?"instant":"smooth",u=Xy((f=t.index)!=null?f:e.get("page"),0,e.get("pageSnapPoints").length-1),c=vn(n);if(!c)return;const d=r("isHorizontal")?"left":"top";s(()=>{c.scrollTo({[d]:e.get("pageSnapPoints")[u],behavior:a})})},setClosestPage({context:e,scope:t,computed:n}){const r=vn(t);if(!r)return;const s=n("isHorizontal")?r.scrollLeft:r.scrollTop,a=e.get("pageSnapPoints").findIndex(u=>Math.abs(u-s)<1);a!==-1&&e.set("page",a)},setNextPage({context:e,prop:t,state:n}){const r=n.matches("autoplay")||t("loop"),s=Yy(e.get("pageSnapPoints"),e.get("page"),{loop:r});e.set("page",s)},setPrevPage({context:e,prop:t,state:n}){const r=n.matches("autoplay")||t("loop"),s=M6(e.get("pageSnapPoints"),e.get("page"),{loop:r});e.set("page",s)},setMatchingPage({context:e,event:t,computed:n,scope:r}){const s=vn(r);if(!s)return;const a=yD(s,n("isHorizontal")?"x":"y",c=>c.dataset.index===t.index.toString());if(a==null)return;const u=e.get("pageSnapPoints").findIndex(c=>Math.abs(c-a)<1);e.set("page",u)},setPage({context:e,event:t}){var r;const n=(r=t.index)!=null?r:e.get("page");e.set("page",n)},clampPage({context:e}){const t=Xy(e.get("page"),0,e.get("pageSnapPoints").length-1);e.set("page",t)},setSnapPoints({context:e,computed:t,scope:n}){const r=vn(n);if(!r)return;const s=yb(r);e.set("pageSnapPoints",t("isHorizontal")?s.x:s.y)},disableScrollSnap({scope:e}){const t=vn(e);if(!t)return;const n=getComputedStyle(t);t.dataset.scrollSnapType=n.getPropertyValue("scroll-snap-type"),t.style.setProperty("scroll-snap-type","none")},scrollSlides({scope:e,event:t}){const n=vn(e);n==null||n.scrollBy({left:t.left,top:t.top,behavior:"instant"})},endDragging({scope:e,context:t,computed:n}){const r=vn(e);if(!r)return;const s=r.scrollLeft,a=r.scrollTop,u=yb(r),c=u.x.reduce((f,p)=>Math.abs(p-s)<Math.abs(f-s)?p:f,u.x[0]),d=u.y.reduce((f,p)=>Math.abs(p-a)<Math.abs(f-a)?p:f,u.y[0]);Mt(()=>{r.scrollTo({left:c,top:d,behavior:"smooth"});const f=n("isHorizontal")?c:d;t.set("page",t.get("pageSnapPoints").indexOf(f));const p=r.dataset.scrollSnapType;p&&(r.style.setProperty("scroll-snap-type",p),delete r.dataset.scrollSnapType)})},focusIndicatorEl({context:e,event:t,scope:n}){if(t.src!=="indicator")return;const r=vD(n,e.get("page"));r&&Mt(()=>r.focus({preventScroll:!0}))},invokeDragStart({context:e,prop:t}){var n;(n=t("onDragStatusChange"))==null||n({type:"dragging.start",isDragging:!0,page:e.get("page")})},invokeDragging({context:e,prop:t}){var n;(n=t("onDragStatusChange"))==null||n({type:"dragging",isDragging:!0,page:e.get("page")})},invokeDraggingEnd({context:e,prop:t}){var n;(n=t("onDragStatusChange"))==null||n({type:"dragging.end",isDragging:!1,page:e.get("page")})},invokeAutoplay({context:e,prop:t}){var n;(n=t("onAutoplayStatusChange"))==null||n({type:"autoplay",isPlaying:!0,page:e.get("page")})},invokeAutoplayStart({context:e,prop:t}){var n;(n=t("onAutoplayStatusChange"))==null||n({type:"autoplay.start",isPlaying:!0,page:e.get("page")})},invokeAutoplayEnd({context:e,prop:t}){var n;(n=t("onAutoplayStatusChange"))==null||n({type:"autoplay.stop",isPlaying:!1,page:e.get("page")})}}}};function ND(e,t,n){if(e==null||n<=0)return[];const r=[],s=t==="auto"?Math.floor(n):t;if(s<=0)return[];for(let a=0;a<e&&!(a+n>e);a+=s)r.push(a);return r}ro()(["dir","getRootNode","id","ids","loop","page","defaultPage","onPageChange","orientation","slideCount","slidesPerPage","slidesPerMove","spacing","padding","autoplay","allowMouseDrag","inViewThreshold","translations","snapType","onDragStatusChange","onAutoplayStatusChange"]),ro()(["index","readOnly"]),ro()(["index","snapAlign"]);const CD=e=>{const t=B.useId(),{getRootNode:n}=Yl(),{dir:r}=zh(),s=H({id:t,dir:r,getRootNode:n},e),a=Rl(kD,s);return AD(a,wh)},Jh=B.forwardRef((e,t)=>{const[n,r]=Oa()(e,["allowMouseDrag","autoplay","defaultPage","id","ids","inViewThreshold","loop","onAutoplayStatusChange","onDragStatusChange","onPageChange","orientation","padding","page","slideCount","slidesPerMove","slidesPerPage","snapType","spacing","translations"]),s=CD(n),a=Ft(s.getRootProps(),r);return _.jsx(mD,{value:s,children:_.jsx(ln.div,le(H({},a),{ref:t}))})});Jh.displayName="CarouselRoot";const OD=180,ID=e=>{const t=e.trim(),n=parseFloat(t);return Number.isNaN(n)?0:t.endsWith("rem")?n*16:n},PD=({globalClassName:e,className:t,itemMinWidth:n=OD,spacing:r="0.5rem",loop:s=!1,allowMouseDrag:a=!0,showIndicators:u=!0,showNavigation:c=!0,onPageChange:d,ariaLabel:f="Product carousel",children:p})=>{const m=Array.from(p).map((ne,de)=>({node:ne,key:B.isValidElement(ne)&&ne.key!=null?ne.key:`carousel-item-${de}`})),b=m.length,y=B.useRef(null),[x,A]=B.useState(0),{width:v}=kk();B.useLayoutEffect(()=>{y.current&&A(y.current.getBoundingClientRect().width)},[v,b]);const w=ID(r),N=n+w,C=x>0?(x+w)/N:1,j=Math.max(1,Math.floor(C));if(b===0)return null;const X=b>j,L=Math.ceil(b/j),G=X?Math.max(1,C):j;return _.jsxs(Jh,{ref:y,className:M(e,t,`${O}-carousel`),slidesPerPage:G,slidesPerMove:j,spacing:r,loop:s,allowMouseDrag:a,slideCount:b,onPageChange:d,"aria-label":f,children:[_.jsx(Xh,{className:M(e,`${O}-carousel__item-group`,{"carousel-row-container":!X}),children:m.map(({node:ne,key:de},z)=>_.jsx(Gh,{index:z,className:M(e,`${O}-carousel__item`),children:ne},de))}),c&&X&&_.jsxs(qh,{className:M(e,`${O}-carousel__control`),children:[_.jsx(Kh,{className:M(e,`${O}-carousel__prev-trigger`),"aria-label":"Previous slide",children:_.jsx(db,{size:"16px"})}),_.jsx(Qh,{className:M(e,`${O}-carousel__next-trigger`),"aria-label":"Next slide",children:_.jsx(fb,{size:"16px"})})]}),u&&X&&_.jsx(Wh,{className:M(e,`${O}-carousel__indicator-group`),children:Array.from({length:L},(ne,de)=>_.jsx(Yh,{index:de,className:M(e,`${O}-carousel__indicator`),"aria-label":`Go to slide group ${de+1}`},de))})]})},RD=({className:e,label:t="Close",onClick:n,disabled:r=!1})=>_.jsx("button",{"aria-label":t,title:t,className:M(e,`${O}-close-button`),disabled:r,onClick:n,children:_.jsx("svg",{role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 20",width:"16",height:"16",fill:"currentColor",children:_.jsx("path",{d:"M18.3 5.7a1 1 0 0 0-1.4-1.4L12 9.6 7.1 4.7a1 1 0 1 0-1.4 1.4l4.9 4.9-4.9 4.9a1 1 0 1 0 1.4 1.4l4.9-4.9 4.9 4.9a1 1 0 0 0 1.4-1.4l-4.9-4.9 4.9-4.9z"})})}),[LD,DD]=rs({name:"RenderStrategyContext",hookName:"useRenderStrategyContext",providerName:"<RenderStrategyPropsProvider />"}),MD=e=>Oa()(e,["lazyMount","unmountOnExit"]),[FD,Ma]=rs({name:"DialogContext",hookName:"useDialogContext",providerName:"<DialogProvider />"}),Sb=B.forwardRef((e,t)=>{const n=Ma(),r=DD(),s=Ah(le(H({},r),{present:n.open})),a=Ft(n.getBackdropProps(),s.getPresenceProps(),e);return s.unmounted?null:_.jsx(ln.div,le(H({},a),{ref:Ll(s.ref,t)}))});Sb.displayName="DialogBackdrop";const Zh=B.forwardRef((e,t)=>{const n=Ma(),r=Ca(),s=Ft(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:_.jsx(ln.div,le(H({},s),{ref:Ll(r.ref,t)}))});Zh.displayName="DialogContent";const ep=B.forwardRef((e,t)=>{const n=Ma(),r=Ft(n.getDescriptionProps(),e);return _.jsx(ln.div,le(H({},r),{ref:t}))});ep.displayName="DialogDescription";const tp=B.forwardRef((e,t)=>{const n=Ma(),r=Ft(n.getPositionerProps(),e);return Ca().unmounted?null:_.jsx(ln.div,le(H({},r),{ref:t}))});tp.displayName="DialogPositioner";var BD=is("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),us=BD.build(),vb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`dialog:${e.id}:positioner`},Ab=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.backdrop)!=null?n:`dialog:${e.id}:backdrop`},np=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`dialog:${e.id}:content`},kb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`dialog:${e.id}:trigger`},rp=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`dialog:${e.id}:title`},ip=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`dialog:${e.id}:description`},Nb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`dialog:${e.id}:close`},Gl=e=>e.getById(np(e)),UD=e=>e.getById(vb(e)),HD=e=>e.getById(Ab(e)),jD=e=>e.getById(kb(e)),$D=e=>e.getById(rp(e)),zD=e=>e.getById(ip(e)),VD=e=>e.getById(Nb(e));function qD(e,t){const{state:n,send:r,context:s,prop:a,scope:u}=e,c=a("aria-label"),d=n.matches("open");return{open:d,setOpen(f){n.matches("open")!==f&&r({type:f?"OPEN":"CLOSE"})},getTriggerProps(){return t.button(le(H({},us.trigger.attrs),{dir:a("dir"),id:kb(u),"aria-haspopup":"dialog",type:"button","aria-expanded":d,"data-state":d?"open":"closed","aria-controls":np(u),onClick(f){f.defaultPrevented||r({type:"TOGGLE"})}}))},getBackdropProps(){return t.element(le(H({},us.backdrop.attrs),{dir:a("dir"),hidden:!d,id:Ab(u),"data-state":d?"open":"closed"}))},getPositionerProps(){return t.element(le(H({},us.positioner.attrs),{dir:a("dir"),id:vb(u),style:{pointerEvents:d?void 0:"none"}}))},getContentProps(){const f=s.get("rendered");return t.element(le(H({},us.content.attrs),{dir:a("dir"),role:a("role"),hidden:!d,id:np(u),tabIndex:-1,"data-state":d?"open":"closed","aria-modal":!0,"aria-label":c||void 0,"aria-labelledby":c||!f.title?void 0:rp(u),"aria-describedby":f.description?ip(u):void 0}))},getTitleProps(){return t.element(le(H({},us.title.attrs),{dir:a("dir"),id:rp(u)}))},getDescriptionProps(){return t.element(le(H({},us.description.attrs),{dir:a("dir"),id:ip(u)}))},getCloseTriggerProps(){return t.button(le(H({},us.closeTrigger.attrs),{dir:a("dir"),id:Nb(u),type:"button",onClick(f){f.defaultPrevented||(f.stopPropagation(),r({type:"CLOSE"}))}}))}}}var YD={props({props:e,scope:t}){const n=e.role==="alertdialog",r=n?()=>VD(t):void 0,s=typeof e.modal=="boolean"?e.modal:!0;return H({role:"dialog",modal:s,trapFocus:s,preventScroll:s,closeOnInteractOutside:!n,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:r},e)},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{rendered:e(()=>({defaultValue:{title:!0,description:!0}}))}},watch({track:e,action:t,prop:n}){e([()=>n("open")],()=>{t(["toggleVisibility"])})},states:{open:{entry:["checkRenderedElements","syncZIndex"],effects:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackDismissableElement({scope:e,send:t,prop:n}){return ZT(()=>Gl(e),{type:"dialog",defer:!0,pointerBlocking:n("modal"),exclude:[jD(e)],onInteractOutside(s){var a;(a=n("onInteractOutside"))==null||a(s),n("closeOnInteractOutside")||s.preventDefault()},persistentElements:n("persistentElements"),onFocusOutside:n("onFocusOutside"),onPointerDownOutside:n("onPointerDownOutside"),onRequestDismiss:n("onRequestDismiss"),onEscapeKeyDown(s){var a;(a=n("onEscapeKeyDown"))==null||a(s),n("closeOnEscape")||s.preventDefault()},onDismiss(){t({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:e,prop:t}){if(t("preventScroll"))return ib(e.getDoc())},trapFocus({scope:e,prop:t}){return t("trapFocus")?nb(()=>Gl(e),{preventScroll:!0,returnFocusOnDeactivate:!!t("restoreFocus"),initialFocus:t("initialFocusEl"),setReturnFocus:r=>{var s,a;return(a=(s=t("finalFocusEl"))==null?void 0:s())!=null?a:r},getShadowRoot:!0}):void 0},hideContentBelow({scope:e,prop:t}){return t("modal")?VT(()=>[Gl(e)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:e,scope:t}){Mt(()=>{e.set("rendered",{title:!!$D(t),description:!!zD(t)})})},syncZIndex({scope:e}){Mt(()=>{const t=Gl(e);if(!t)return;const n=Zs(t);[UD(e),HD(e)].forEach(s=>{s==null||s.style.setProperty("--z-index",n.zIndex),s==null||s.style.setProperty("--layer-index",n.getPropertyValue("--layer-index"))})})},invokeOnClose({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!1})},invokeOnOpen({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!0})},toggleVisibility({prop:e,send:t,event:n}){t({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:n})}}}};ro()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);const WD=e=>{const t=B.useId(),{getRootNode:n}=Yl(),{dir:r}=zh(),s=H({id:t,getRootNode:n,dir:r},e),a=Rl(YD,s);return qD(a,wh)},Cb=e=>{const[t,c]=TT(e),d=c,{children:n}=d,r=yn(d,["children"]),[s]=MD(t),a=WD(r),u=Ah(Ft({present:a.open},t));return _.jsx(FD,{value:a,children:_.jsx(LD,{value:s,children:_.jsx(gT,{value:u,children:n})})})},Ob=B.forwardRef((e,t)=>{const n=Ma(),r=Ft(n.getTitleProps(),e);return _.jsx(ln.h2,le(H({},r),{ref:t}))});Ob.displayName="DialogTitle";const GD=({children:e})=>{const[t,n]=B.useState(!1),r=B.useMemo(()=>({toggleMenu:()=>n(a=>!a),closeMenu:()=>n(!1)}),[]),s=B.useMemo(()=>({isOpen:t}),[t]);return _.jsx(lh.Provider,{value:r,children:_.jsx($y.Provider,{value:s,children:e})})},Ib=()=>B.useContext($y),Pb=()=>{const e=B.useContext(lh);if(!e)throw new Error("useOverflowMenuDispatch must be used within an OverflowMenuProvider");return e},XD=`${O}-overflow-menu-button-trigger`,QD=({componentType:e,children:t})=>{const{isOpen:n}=Ib(),{closeMenu:r}=Pb(),{globalClassName:s}=at(),a=B.useRef(null);return B.useEffect(()=>{if(!n)return;const u=d=>{d.key==="Escape"&&r()},c=d=>{const f=d.target;f instanceof Element&&f.closest(`.${XD}`)||a.current&&!a.current.contains(f)&&r()};return document.addEventListener("keydown",u),document.addEventListener("mousedown",c),()=>{document.removeEventListener("keydown",u),document.removeEventListener("mousedown",c)}},[n,r]),n?_.jsx("div",{ref:a,role:"menu","aria-label":`Overflow menu for ${e}`,className:M(`${O}-overflow-panel`,s,`cim-${e}-component`),children:t}):null},KD=({componentType:e,className:t})=>{const{toggleMenu:n}=Pb(),{isOpen:r}=Ib(),{globalClassName:s}=at();return _.jsx("button",{"aria-label":`Overflow menu for ${e}`,title:"More options","aria-expanded":r,"aria-haspopup":"menu",className:M(`${O}-overflow-menu-button-trigger`,`${O}-icon-button`,s,t,`cim-${e}-component`),onClick:n,children:_.jsx(hb,{})})};class JD{constructor(){Ye(this,"initialState",Vg);Ye(this,"promptsStateProxy");Ye(this,"promptsParamsProxy");Ye(this,"_fullGet",(t,n)=>Reflect.get(t,n));Ye(this,"_fullSet",(t,n,r)=>{if(!(n in t))throw new Error(`Property ${n} does not exist on PromptsExtensionState`);return t8(n,r),Reflect.set(t,n,r)});Ye(this,"_paramsFullGet",(t,n)=>Reflect.get(t,n));Ye(this,"_paramsFullSet",(t,n,r)=>Reflect.set(t,n,r));Ye(this,"updatePromptsParamsProxy",t=>new Proxy(H({},t),{get:this._paramsFullGet,set:this._paramsFullSet}));this.promptsStateProxy=new Proxy({isOpen:this.initialState.isOpen,isInline:this.initialState.isInline,elementId:this.initialState.elementId,entryType:this.initialState.entryType},{get:this._fullGet,set:this._fullSet}),this.promptsParamsProxy=this.updatePromptsParamsProxy({})}get isOpen(){return this.promptsStateProxy.isOpen}get isInline(){return this.promptsStateProxy.isInline}get state(){return{isOpen:this.isOpen,isInline:this.isInline}}get params(){return this.promptsParamsProxy}}const pi=new JD,ZD=e=>{window.addEventListener(Od,e)},e8=e=>{window.removeEventListener(Od,e)},t8=(e,t)=>{const n=new CustomEvent(Od,{detail:{property:e,value:t}});window.dispatchEvent(n)},Rb=e=>{const t=pi.isOpen,n=typeof e=="boolean"?e:!t;pi.promptsStateProxy.isOpen=n},n8=e=>{const t=pi.isInline,n=typeof e=="boolean"?e:!t;pi.promptsStateProxy.isInline=n},r8=({elementId:e,entryType:t,params:n,isInline:r})=>{pi.promptsStateProxy.elementId=e,t&&(pi.promptsStateProxy.entryType=t),typeof r=="boolean"&&n8(r),n&&pi.updatePromptsParamsProxy(n),pi.isOpen||Rb(!0)},i8=()=>{const e=B.useContext(Gg);if(!e)throw new Error("usePdp must be used within a PdpProvider");return e},s8=()=>{const e=B.useContext(Yg);if(!e)throw new Error("usePromptsExtensionDispatch must be used within a PromptsExtensionProvider");return e||{}},Xl=()=>{const e=B.useContext(qg);if(!e)throw new Error("usePromptsExtensionState must be used within a PromptsExtensionProvider");return e||{}},o8=({componentType:e,isIcon:t})=>{const{globalClassName:n}=at(),{previousComponentType:r}=ri(),s=Ws(),a=()=>{Ou(r||"dialog"),s()};return t?_.jsx(ir,{className:M(n,`${O}-toggle-dialog-button`,`cim-${e}-component`),ariaLabel:"Collapse",title:"Collapse",onClick:a,icon:_.jsx(pb,{})}):_.jsxs("button",{className:M(n,`${O}-overflow-menu-button`,`${O}-toggle-dialog-button`,`cim-${e}-component`),onClick:a,children:[_.jsx(pb,{}),"Show ",r||"dialog"]})},a8=({componentType:e,isIcon:t})=>{const{globalClassName:n}=at(),{isModalFullscreen:r}=ri(),s=Ws(),a=()=>{Pd(!r),s()},u=r?rN:iN,c="Toggle Fullscreen";return t?_.jsx(ir,{ariaLabel:c,title:c,className:M(n,`${O}-modal-fullscreen-button`,`cim-${e}-component`),icon:_.jsx(u,{}),onClick:a}):_.jsxs("button",{className:M(n,`${O}-overflow-menu-button`,`${O}-modal-fullscreen-button`,`cim-${e}-component`),onClick:a,children:[_.jsx(u,{}),c]})},u8=({componentType:e,isIcon:t})=>{const{globalClassName:n}=at(),{dialogPosition:r}=ri(),s=Ws(),a=r==="bottom-left",u=()=>{Rd(a?"bottom-right":"bottom-left"),s()},c=a?dD:cD,d=a?"Move right":"Move left";return t?_.jsx(ir,{className:M(n,`${O}-left-right-toggle-button`,`cim-${e}-component`),ariaLabel:d,title:d,onClick:u,icon:_.jsx(c,{})}):_.jsxs("button",{className:M(n,`${O}-overflow-menu-button`,`${O}-left-right-toggle-button`,`cim-${e}-component`),onClick:u,children:[_.jsx(c,{}),d]})},Lb=({componentType:e,onClearChat:t,onClose:n,onDownloadTranscript:r})=>{const{headerConfig:s,globalClassName:a,mode:u,enableDownloadTranscript:c}=at(),{mode:d}=ri(),f=u==="messaging"&&c&&!!r,p=d==="standalone",m=e==="modal",b=m?o8:Fb,y=m?a8:u8,x=B.useMemo(()=>s?Qk(s):{},[s]);return _.jsx(GD,{children:_.jsxs("div",{className:M(a,`${O}-${e}-header-wrapper`),style:{display:"flex",flexDirection:"column",position:"relative"},children:[_.jsxs("div",{className:M(a,`${O}-${e}-header`,{standalone:p,embedded:!p}),style:x,children:[(s==null?void 0:s.logoUrl)&&_.jsx("img",{alt:"",role:"img",className:M(a,`${O}-${e}-logo`,{standalone:p,embedded:!p}),src:s.logoUrl}),_.jsx(Ob,{className:M(a,`${O}-${e}-title`,{standalone:p,embedded:!p}),children:s==null?void 0:s.headerText}),_.jsxs("div",{className:M(a,`${O}-${e}-controls`),children:[_.jsx(b,{componentType:e,isIcon:!0}),_.jsx(KD,{componentType:e}),_.jsx(RD,{className:M(a,`cim-${e}-component`),onClick:n})]})]}),_.jsxs(QD,{componentType:e,children:[_.jsx(y,{componentType:e}),_.jsx(h8,{componentType:e}),_.jsx(Vy,{componentType:e,onClearChat:t}),f&&_.jsx(qy,{componentType:e,onDownloadTranscript:r})]})]})})},Ql="USD",Vr=(e,t)=>{if(typeof e!="number"||Number.isNaN(e))return null;try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(e)}catch(n){return`${e}`}},l8=({retailPrice:e,discountPrice:t,currencyCode:n=Ql})=>{const r=n||Ql,s=typeof t=="number"&&typeof e=="number"&&t<e,a=s?t:e||t||null,u=s?e:null;return{price:Vr(a,r),comparePrice:Vr(u,r),hasDiscount:s}},Db=e=>typeof e=="number"&&Number.isFinite(e),c8=({priceBreakdown:e,currencyCode:t=Ql})=>{if(!e)return null;const n=t||Ql,r=[e.sales,e.original],s=r.map(p=>p==null?void 0:p.min).filter(Db),a=r.map(p=>p==null?void 0:p.max).filter(Db);if(s.length===0||a.length===0)return null;const u=Math.min(...s),c=Math.max(...a);if(u===c)return null;const d=Vr(u,n),f=Vr(c,n);return d===null||f===null?null:{range:`${d} – ${f}`,low:d,high:f}},sp=({retailPrice:e,discountPrice:t,currencyCode:n,fontSize:r,globalClassName:s,className:a})=>{const{price:u,comparePrice:c,hasDiscount:d}=l8({retailPrice:e,discountPrice:t,currencyCode:n});if(!u)return null;const f=typeof r=="string"?{fontSize:r}:{};return _.jsxs("div",{className:M(s,a,`${O}-price`),style:f,children:[_.jsx("span",{className:M(s,`${O}-price__amount`),children:u}),d&&c&&_.jsx("span",{className:M(s,`${O}-price__compare`),children:c})]})},d8={sparkle:Vh,plus:fD,"paper-plane":hD},Mb=({icon:e,className:t})=>{const n=d8[e];return n?_.jsx(n,{className:t,"aria-hidden":"true"}):null},f8=({className:e,globalClassName:t,suggestions:n,disabled:r,isWidgetStandalone:s,onSuggestionClick:a})=>{var y;const{suggestionButtonConfig:u}=at(),c=u==null?void 0:u.icon,d=(y=u==null?void 0:u.iconPosition)!=null?y:"left",f=s?"standalone":"embedded",p=x=>()=>{a(x)},m={"has-icon":!!c,"icon-right":!!c&&d==="right"},b=x=>_.jsxs(_.Fragment,{children:[c&&_.jsx(Mb,{icon:c,className:`${O}-suggestion-button-icon`}),_.jsx("span",{children:x})]});return _.jsx("div",{className:M(t,`${O}-suggestion-container ${f}`,e),children:n.map(x=>s?_.jsx(el,{disabled:r,className:M(t,`${O}-suggestion-button standalone`,m),onClick:p(x),children:b(x)},x):_.jsx("button",{disabled:r,className:M(t,`${O}-suggestion-button embedded`,m),onClick:p(x),children:b(x)},x))})},h8=({componentType:e,isIcon:t})=>{const{globalClassName:n,enableMinimize:r}=at();if(!r)return null;const s=()=>{Br(!1),Cu(!0)};return t?_.jsx(ir,{className:M(n,`${O}-toggle-minimize-button`,`cim-${e}-component`),ariaLabel:"Toggle Minimize",title:"Minimize",onClick:s,icon:_.jsx(a1,{})}):_.jsxs("button",{className:M(n,`${O}-overflow-menu-button`,`${O}-toggle-minimize-button`,`cim-${e}-component`),onClick:s,children:[_.jsx(a1,{}),"Minimize"]})},Fb=({componentType:e,isIcon:t})=>{const{globalClassName:n}=at(),r=Ws(),s=()=>{Ou("modal"),r()};return t?_.jsx(ir,{className:M(n,`${O}-toggle-modal-button`,`cim-${e}-component`),ariaLabel:"Expand",title:"Expand",onClick:s,icon:_.jsx(mb,{})}):_.jsxs("button",{className:M(n,`${O}-overflow-menu-button`,`${O}-toggle-modal-button`,`cim-${e}-component`),onClick:s,children:[_.jsx(mb,{}),"Show modal"]})},p8=["Hey there! 👋 What can I find for you today?","Shopping for a gift? Tell me your budget and preferences","Need help? Connect to an agent"],m8=3e3,g8=400,E8=({globalClassName:e,isWidgetStandalone:t,messages:n=p8})=>{const[r,s]=B.useState(0),[a,u]=B.useState(!0);return B.useEffect(()=>{let c;const d=setInterval(()=>{u(!1),c=setTimeout(()=>{s(f=>(f+1)%n.length),u(!0)},g8)},m8);return()=>{clearInterval(d),clearTimeout(c)}},[n.length]),_.jsxs("div",{className:M(e,`${O}-connecting-indicator`,t?"standalone":"embedded"),role:"status","aria-label":"Connecting to assistant",children:[_.jsxs("div",{className:`${O}-connecting-pulse-wrapper`,children:[_.jsx("div",{className:`${O}-connecting-pulse`}),_.jsx("div",{className:`${O}-connecting-ring`})]}),_.jsx("span",{className:M(`${O}-connecting-text`,a&&`${O}-connecting-text--visible`),children:n[r]})]})},y8=({shouldShow:e,loadingText:t})=>e?_.jsx("span",{className:`${O}-processing-text`,children:t}):null,T8=({shouldShow:e})=>e?_.jsxs(_.Fragment,{children:[_.jsx("div",{className:`${O}-processing-shimmer-bar`}),_.jsx("div",{className:`${O}-processing-shimmer-bar`}),_.jsx("div",{className:`${O}-processing-shimmer-bar`})]}):null,op=({globalClassName:e,isWidgetStandalone:t,loadingText:n})=>_.jsxs("div",{className:M(e,`${O}-processing-indicator`,t?"standalone":"embedded"),role:"status","aria-label":n||"Loading response",children:[_.jsx(y8,{shouldShow:!!n,loadingText:n}),_.jsx(T8,{shouldShow:!n})]});function Bb(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function b8(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function x8(e,t,n){const s=dl((n||{}).ignore||[]),a=_8(t);let u=-1;for(;++u<a.length;)_E(e,"text",c);function c(f,p){let m=-1,b;for(;++m<p.length;){const y=p[m],x=b?b.children:void 0;if(s(y,x?x.indexOf(y):void 0,b))return;b=y}if(b)return d(f,p)}function d(f,p){const m=p[p.length-1],b=a[u][0],y=a[u][1];let x=0;const v=m.children.indexOf(f);let w=!1,N=[];b.lastIndex=0;let C=b.exec(f.value);for(;C;){const j=C.index,X={index:C.index,input:C.input,stack:[...p,f]};let L=y(...C,X);if(typeof L=="string"&&(L=L.length>0?{type:"text",value:L}:void 0),L===!1?b.lastIndex=j+1:(x!==j&&N.push({type:"text",value:f.value.slice(x,j)}),Array.isArray(L)?N.push(...L):L&&N.push(L),x=j+C[0].length,w=!0),!b.global)break;C=b.exec(f.value)}return w?(x<f.value.length&&N.push({type:"text",value:f.value.slice(x)}),m.children.splice(v,1,...N)):N=[f],v+N.length}}function _8(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([w8(s[0]),S8(s[1])])}return t}function w8(e){return typeof e=="string"?new RegExp(b8(e),"g"):e}function S8(e){return typeof e=="function"?e:function(){return e}}const ap="phrasing",up=["autolink","link","image","label"];function v8(){return{transforms:[P8],enter:{literalAutolink:k8,literalAutolinkEmail:lp,literalAutolinkHttp:lp,literalAutolinkWww:lp},exit:{literalAutolink:I8,literalAutolinkEmail:O8,literalAutolinkHttp:N8,literalAutolinkWww:C8}}}function A8(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ap,notInConstruct:up},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ap,notInConstruct:up},{character:":",before:"[ps]",after:"\\/",inConstruct:ap,notInConstruct:up}]}}function k8(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function lp(e){this.config.enter.autolinkProtocol.call(this,e)}function N8(e){this.config.exit.autolinkProtocol.call(this,e)}function C8(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function O8(e){this.config.exit.autolinkEmail.call(this,e)}function I8(e){this.exit(e)}function P8(e){x8(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,R8],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),L8]],{ignore:["link","linkReference"]})}function R8(e,t,n,r,s){let a="";if(!Ub(s)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!D8(n)))return!1;const u=M8(n+r);if(!u[0])return!1;const c={type:"link",title:null,url:a+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[c,{type:"text",value:u[1]}]:c}function L8(e,t,n,r){return!Ub(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function D8(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function M8(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=Bb(e,"(");let a=Bb(e,")");for(;r!==-1&&s>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function Ub(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Gi(n)||il(n))&&(!t||n!==47)}Hb.peek=q8;function F8(){this.buffer()}function B8(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function U8(){this.buffer()}function H8(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function j8(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=sr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $8(e){this.exit(e)}function z8(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=sr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function V8(e){this.exit(e)}function q8(){return"["}function Hb(e,t,n,r){const s=n.createTracker(r);let a=s.move("[^");const u=n.enter("footnoteReference"),c=n.enter("reference");return a+=s.move(n.safe(n.associationId(e),{after:"]",before:a})),c(),u(),a+=s.move("]"),a}function Y8(){return{enter:{gfmFootnoteCallString:F8,gfmFootnoteCall:B8,gfmFootnoteDefinitionLabelString:U8,gfmFootnoteDefinition:H8},exit:{gfmFootnoteCallString:j8,gfmFootnoteCall:$8,gfmFootnoteDefinitionLabelString:z8,gfmFootnoteDefinition:V8}}}function W8(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Hb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,a,u){const c=a.createTracker(u);let d=c.move("[^");const f=a.enter("footnoteDefinition"),p=a.enter("label");return d+=c.move(a.safe(a.associationId(r),{before:d,after:"]"})),p(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
37
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Ki={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},BE={}.hasOwnProperty,EI=Object.prototype;function yI(e,t){const n=t||{};return Qf({file:n.file||void 0,location:!1,schema:n.space==="svg"?ii:ia,verbose:n.verbose||!1},e)}function Qf(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},ml(e,r,n),n}case"#document":case"#document-fragment":{const r=t,s="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:UE(e,t.childNodes),data:{quirksMode:s}},e.file&&e.location){const a=String(e.file),u=gI(a),c=u.toPoint(0),d=u.toPoint(a.length);n.position={start:c,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},ml(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},ml(e,r,n),n}default:return n=TI(e,t),n}}function UE(e,t){let n=-1;const r=[];for(;++n<t.length;){const s=Qf(e,t[n]);r.push(s)}return r}function TI(e,t){const n=e.schema;e.schema=t.namespaceURI===Ki.svg?ii:ia;let r=-1;const s={};for(;++r<t.attrs.length;){const c=t.attrs[r],d=(c.prefix?c.prefix+":":"")+c.name;BE.call(EI,d)||(s[d]=c.value)}const u=(e.schema.space==="svg"?mI:pI)(t.tagName,s,UE(e,t.childNodes));if(ml(e,t,u),u.tagName==="template"){const c=t,d=c.sourceCodeLocation,f=d&&d.startTag&&$s(d.startTag),p=d&&d.endTag&&$s(d.endTag),m=Qf(e,c.content);f&&p&&e.file&&(m.position={start:f.end,end:p.start}),u.content=m}return e.schema=n,u}function ml(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=bI(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function bI(e,t,n){const r=$s(n);if(t.type==="element"){const s=t.children[t.children.length-1];if(r&&!n.endTag&&s&&s.position&&s.position.end&&(r.end=Object.assign({},s.position.end)),e.verbose){const a={};let u;if(n.attrs)for(u in n.attrs)BE.call(n.attrs,u)&&(a[tl(e.schema,u).property]=$s(n.attrs[u]));n.startTag;const c=$s(n.startTag),d=n.endTag?$s(n.endTag):void 0,f={opening:c};d&&(f.closing=d),f.properties=a,t.data={position:f}}}return r}function $s(e){const t=HE({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=HE({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function HE(e){return e.line&&e.column?e:void 0}const jE={}.hasOwnProperty;function $E(e,t){const n=t||{};function r(s,...a){let u=r.invalid;const c=r.handlers;if(s&&jE.call(s,e)){const d=String(s[e]);u=jE.call(c,d)?c[d]:r.unknown}if(u)return u.call(this,s,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const xI={},_I={}.hasOwnProperty,zE=$E("type",{handlers:{root:SI,element:CI,text:kI,comment:NI,doctype:AI}});function wI(e,t){const r=(t||xI).space;return zE(e,r==="svg"?ii:ia)}function SI(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Kf(e.children,n,t),zs(e,n),n}function vI(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Kf(e.children,n,t),zs(e,n),n}function AI(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return zs(e,t),t}function kI(e){const t={nodeName:"#text",value:e.value,parentNode:null};return zs(e,t),t}function NI(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return zs(e,t),t}function CI(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=ii);const s=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&_I.call(e.properties,a)){const d=OI(r,a,e.properties[a]);d&&s.push(d)}}const u=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:s,namespaceURI:Ki[u],childNodes:[],parentNode:null};return c.childNodes=Kf(e.children,c,r),zs(e,c),e.tagName==="template"&&e.content&&(c.content=vI(e.content,r)),c}function OI(e,t,n){const r=tl(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?f1(n):v1(n));const s={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=s.name.indexOf(":");a<0?s.prefix="":(s.name=s.name.slice(a+1),s.prefix=r.attribute.slice(0,a)),s.namespace=Ki[r.space]}return s}function Kf(e,t,n){let r=-1;const s=[];if(e)for(;++r<e.length;){const a=zE(e[r],n);a.parentNode=t,s.push(a)}return s}function zs(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const II=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],PI=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),xt="�";var I;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(I||(I={}));const Sn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function VE(e){return e>=55296&&e<=57343}function RI(e){return e>=56320&&e<=57343}function LI(e,t){return(e-55296)*1024+9216+t}function qE(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function YE(e){return e>=64976&&e<=65007||PI.has(e)}var te;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(te||(te={}));const DI=65536;class MI{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=DI,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:s,offset:a}=this,u=s+n,c=a+n;return{code:t,startLine:r,endLine:r,startCol:u,endCol:u,startOffset:c,endOffset:c}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(RI(n))return this.pos++,this._addGap(),LI(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,I.EOF;return this._err(te.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;const r=this.html.charCodeAt(n);return r===I.CARRIAGE_RETURN?I.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;let t=this.html.charCodeAt(this.pos);return t===I.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,I.LINE_FEED):t===I.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,VE(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===I.LINE_FEED||t===I.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){qE(t)?this._err(te.controlCharacterInInputStream):YE(t)&&this._err(te.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Qe;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(Qe||(Qe={}));function WE(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const FI=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),BI=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function UI(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=BI.get(e))!==null&&t!==void 0?t:e}var Ht;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Ht||(Ht={}));const HI=32;var ai;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(ai||(ai={}));function Jf(e){return e>=Ht.ZERO&&e<=Ht.NINE}function jI(e){return e>=Ht.UPPER_A&&e<=Ht.UPPER_F||e>=Ht.LOWER_A&&e<=Ht.LOWER_F}function $I(e){return e>=Ht.UPPER_A&&e<=Ht.UPPER_Z||e>=Ht.LOWER_A&&e<=Ht.LOWER_Z||Jf(e)}function zI(e){return e===Ht.EQUALS||$I(e)}var jt;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(jt||(jt={}));var Ur;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ur||(Ur={}));class VI{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=jt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ur.Strict}startEntity(t){this.decodeMode=t,this.state=jt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case jt.EntityStart:return t.charCodeAt(n)===Ht.NUM?(this.state=jt.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=jt.NamedEntity,this.stateNamedEntity(t,n));case jt.NumericStart:return this.stateNumericStart(t,n);case jt.NumericDecimal:return this.stateNumericDecimal(t,n);case jt.NumericHex:return this.stateNumericHex(t,n);case jt.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|HI)===Ht.LOWER_X?(this.state=jt.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=jt.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,s){if(n!==r){const a=r-n;this.result=this.result*Math.pow(s,a)+Number.parseInt(t.substr(n,a),s),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(Jf(s)||jI(s))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(Jf(s))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Ht.SEMI)this.consumed+=1;else if(this.decodeMode===Ur.Strict)return 0;return this.emitCodePoint(UI(this.result),this.consumed),this.errors&&(t!==Ht.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let s=r[this.treeIndex],a=(s&ai.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const u=t.charCodeAt(n);if(this.treeIndex=qI(r,s,this.treeIndex+Math.max(1,a),u),this.treeIndex<0)return this.result===0||this.decodeMode===Ur.Attribute&&(a===0||zI(u))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&ai.VALUE_LENGTH)>>14,a!==0){if(u===Ht.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==Ur.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,s=(r[n]&ai.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[t]&~ai.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case jt.NamedEntity:return this.result!==0&&(this.decodeMode!==Ur.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case jt.NumericDecimal:return this.emitNumericEntity(0,2);case jt.NumericHex:return this.emitNumericEntity(0,3);case jt.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case jt.EntityStart:return 0}}}function qI(e,t,n,r){const s=(t&ai.BRANCH_LENGTH)>>7,a=t&ai.JUMP_TABLE;if(s===0)return a!==0&&r===a?n:-1;if(a){const d=r-a;return d<0||d>=s?-1:e[n+d]-1}let u=n,c=u+s-1;for(;u<=c;){const d=u+c>>>1,f=e[d];if(f<r)u=d+1;else if(f>r)c=d-1;else return e[d+s]}return-1}var ye;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(ye||(ye={}));var Ji;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Ji||(Ji={}));var qn;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(qn||(qn={}));var K;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(K||(K={}));var g;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(g||(g={}));const YI=new Map([[K.A,g.A],[K.ADDRESS,g.ADDRESS],[K.ANNOTATION_XML,g.ANNOTATION_XML],[K.APPLET,g.APPLET],[K.AREA,g.AREA],[K.ARTICLE,g.ARTICLE],[K.ASIDE,g.ASIDE],[K.B,g.B],[K.BASE,g.BASE],[K.BASEFONT,g.BASEFONT],[K.BGSOUND,g.BGSOUND],[K.BIG,g.BIG],[K.BLOCKQUOTE,g.BLOCKQUOTE],[K.BODY,g.BODY],[K.BR,g.BR],[K.BUTTON,g.BUTTON],[K.CAPTION,g.CAPTION],[K.CENTER,g.CENTER],[K.CODE,g.CODE],[K.COL,g.COL],[K.COLGROUP,g.COLGROUP],[K.DD,g.DD],[K.DESC,g.DESC],[K.DETAILS,g.DETAILS],[K.DIALOG,g.DIALOG],[K.DIR,g.DIR],[K.DIV,g.DIV],[K.DL,g.DL],[K.DT,g.DT],[K.EM,g.EM],[K.EMBED,g.EMBED],[K.FIELDSET,g.FIELDSET],[K.FIGCAPTION,g.FIGCAPTION],[K.FIGURE,g.FIGURE],[K.FONT,g.FONT],[K.FOOTER,g.FOOTER],[K.FOREIGN_OBJECT,g.FOREIGN_OBJECT],[K.FORM,g.FORM],[K.FRAME,g.FRAME],[K.FRAMESET,g.FRAMESET],[K.H1,g.H1],[K.H2,g.H2],[K.H3,g.H3],[K.H4,g.H4],[K.H5,g.H5],[K.H6,g.H6],[K.HEAD,g.HEAD],[K.HEADER,g.HEADER],[K.HGROUP,g.HGROUP],[K.HR,g.HR],[K.HTML,g.HTML],[K.I,g.I],[K.IMG,g.IMG],[K.IMAGE,g.IMAGE],[K.INPUT,g.INPUT],[K.IFRAME,g.IFRAME],[K.KEYGEN,g.KEYGEN],[K.LABEL,g.LABEL],[K.LI,g.LI],[K.LINK,g.LINK],[K.LISTING,g.LISTING],[K.MAIN,g.MAIN],[K.MALIGNMARK,g.MALIGNMARK],[K.MARQUEE,g.MARQUEE],[K.MATH,g.MATH],[K.MENU,g.MENU],[K.META,g.META],[K.MGLYPH,g.MGLYPH],[K.MI,g.MI],[K.MO,g.MO],[K.MN,g.MN],[K.MS,g.MS],[K.MTEXT,g.MTEXT],[K.NAV,g.NAV],[K.NOBR,g.NOBR],[K.NOFRAMES,g.NOFRAMES],[K.NOEMBED,g.NOEMBED],[K.NOSCRIPT,g.NOSCRIPT],[K.OBJECT,g.OBJECT],[K.OL,g.OL],[K.OPTGROUP,g.OPTGROUP],[K.OPTION,g.OPTION],[K.P,g.P],[K.PARAM,g.PARAM],[K.PLAINTEXT,g.PLAINTEXT],[K.PRE,g.PRE],[K.RB,g.RB],[K.RP,g.RP],[K.RT,g.RT],[K.RTC,g.RTC],[K.RUBY,g.RUBY],[K.S,g.S],[K.SCRIPT,g.SCRIPT],[K.SEARCH,g.SEARCH],[K.SECTION,g.SECTION],[K.SELECT,g.SELECT],[K.SOURCE,g.SOURCE],[K.SMALL,g.SMALL],[K.SPAN,g.SPAN],[K.STRIKE,g.STRIKE],[K.STRONG,g.STRONG],[K.STYLE,g.STYLE],[K.SUB,g.SUB],[K.SUMMARY,g.SUMMARY],[K.SUP,g.SUP],[K.TABLE,g.TABLE],[K.TBODY,g.TBODY],[K.TEMPLATE,g.TEMPLATE],[K.TEXTAREA,g.TEXTAREA],[K.TFOOT,g.TFOOT],[K.TD,g.TD],[K.TH,g.TH],[K.THEAD,g.THEAD],[K.TITLE,g.TITLE],[K.TR,g.TR],[K.TRACK,g.TRACK],[K.TT,g.TT],[K.U,g.U],[K.UL,g.UL],[K.SVG,g.SVG],[K.VAR,g.VAR],[K.WBR,g.WBR],[K.XMP,g.XMP]]);function Vs(e){var t;return(t=YI.get(e))!==null&&t!==void 0?t:g.UNKNOWN}const be=g,WI={[ye.HTML]:new Set([be.ADDRESS,be.APPLET,be.AREA,be.ARTICLE,be.ASIDE,be.BASE,be.BASEFONT,be.BGSOUND,be.BLOCKQUOTE,be.BODY,be.BR,be.BUTTON,be.CAPTION,be.CENTER,be.COL,be.COLGROUP,be.DD,be.DETAILS,be.DIR,be.DIV,be.DL,be.DT,be.EMBED,be.FIELDSET,be.FIGCAPTION,be.FIGURE,be.FOOTER,be.FORM,be.FRAME,be.FRAMESET,be.H1,be.H2,be.H3,be.H4,be.H5,be.H6,be.HEAD,be.HEADER,be.HGROUP,be.HR,be.HTML,be.IFRAME,be.IMG,be.INPUT,be.LI,be.LINK,be.LISTING,be.MAIN,be.MARQUEE,be.MENU,be.META,be.NAV,be.NOEMBED,be.NOFRAMES,be.NOSCRIPT,be.OBJECT,be.OL,be.P,be.PARAM,be.PLAINTEXT,be.PRE,be.SCRIPT,be.SECTION,be.SELECT,be.SOURCE,be.STYLE,be.SUMMARY,be.TABLE,be.TBODY,be.TD,be.TEMPLATE,be.TEXTAREA,be.TFOOT,be.TH,be.THEAD,be.TITLE,be.TR,be.TRACK,be.UL,be.WBR,be.XMP]),[ye.MATHML]:new Set([be.MI,be.MO,be.MN,be.MS,be.MTEXT,be.ANNOTATION_XML]),[ye.SVG]:new Set([be.TITLE,be.FOREIGN_OBJECT,be.DESC]),[ye.XLINK]:new Set,[ye.XML]:new Set,[ye.XMLNS]:new Set},Zf=new Set([be.H1,be.H2,be.H3,be.H4,be.H5,be.H6]);K.STYLE,K.SCRIPT,K.XMP,K.IFRAME,K.NOEMBED,K.NOFRAMES,K.PLAINTEXT;var R;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(R||(R={}));const Ct={DATA:R.DATA,RCDATA:R.RCDATA,RAWTEXT:R.RAWTEXT,SCRIPT_DATA:R.SCRIPT_DATA,PLAINTEXT:R.PLAINTEXT,CDATA_SECTION:R.CDATA_SECTION};function GI(e){return e>=I.DIGIT_0&&e<=I.DIGIT_9}function ma(e){return e>=I.LATIN_CAPITAL_A&&e<=I.LATIN_CAPITAL_Z}function XI(e){return e>=I.LATIN_SMALL_A&&e<=I.LATIN_SMALL_Z}function ui(e){return XI(e)||ma(e)}function GE(e){return ui(e)||GI(e)}function gl(e){return e+32}function XE(e){return e===I.SPACE||e===I.LINE_FEED||e===I.TABULATION||e===I.FORM_FEED}function QE(e){return XE(e)||e===I.SOLIDUS||e===I.GREATER_THAN_SIGN}function QI(e){return e===I.NULL?te.nullCharacterReference:e>1114111?te.characterReferenceOutsideUnicodeRange:VE(e)?te.surrogateCharacterReference:YE(e)?te.noncharacterCharacterReference:qE(e)||e===I.CARRIAGE_RETURN?te.controlCharacterReference:null}class KI{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=R.DATA,this.returnState=R.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new MI(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new VI(FI,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(te.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(te.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=QI(r);s&&this._err(s,1)}}:void 0)}_err(t,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Qe.START_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Qe.END_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:Qe.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:Qe.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(WE(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(te.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Vs(t.tagName),t.type===Qe.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(te.endTagWithAttributes),t.selfClosing&&this._err(te.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case Qe.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Qe.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Qe.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:Qe.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=XE(t)?Qe.WHITESPACE_CHARACTER:t===I.NULL?Qe.NULL_CHARACTER:Qe.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Qe.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=R.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Ur.Attribute:Ur.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===R.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===R.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===R.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case R.DATA:{this._stateData(t);break}case R.RCDATA:{this._stateRcdata(t);break}case R.RAWTEXT:{this._stateRawtext(t);break}case R.SCRIPT_DATA:{this._stateScriptData(t);break}case R.PLAINTEXT:{this._statePlaintext(t);break}case R.TAG_OPEN:{this._stateTagOpen(t);break}case R.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case R.TAG_NAME:{this._stateTagName(t);break}case R.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case R.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case R.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case R.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case R.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case R.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case R.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case R.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case R.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case R.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case R.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case R.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case R.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case R.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case R.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case R.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case R.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case R.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case R.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case R.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case R.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case R.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case R.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case R.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case R.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case R.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case R.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case R.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case R.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case R.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case R.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case R.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case R.BOGUS_COMMENT:{this._stateBogusComment(t);break}case R.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case R.COMMENT_START:{this._stateCommentStart(t);break}case R.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case R.COMMENT:{this._stateComment(t);break}case R.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case R.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case R.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case R.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case R.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case R.COMMENT_END:{this._stateCommentEnd(t);break}case R.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case R.DOCTYPE:{this._stateDoctype(t);break}case R.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case R.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case R.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case R.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case R.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case R.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case R.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case R.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case R.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case R.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case R.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case R.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case R.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case R.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case R.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case R.CDATA_SECTION:{this._stateCdataSection(t);break}case R.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case R.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case R.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case R.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case I.LESS_THAN_SIGN:{this.state=R.TAG_OPEN;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(te.unexpectedNullCharacter),this._emitCodePoint(t);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case I.AMPERSAND:{this._startCharacterReference();break}case I.LESS_THAN_SIGN:{this.state=R.RCDATA_LESS_THAN_SIGN;break}case I.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(xt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case I.LESS_THAN_SIGN:{this.state=R.RAWTEXT_LESS_THAN_SIGN;break}case I.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(xt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case I.LESS_THAN_SIGN:{this.state=R.SCRIPT_DATA_LESS_THAN_SIGN;break}case I.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(xt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case I.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(xt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(ui(t))this._createStartTagToken(),this.state=R.TAG_NAME,this._stateTagName(t);else switch(t){case I.EXCLAMATION_MARK:{this.state=R.MARKUP_DECLARATION_OPEN;break}case I.SOLIDUS:{this.state=R.END_TAG_OPEN;break}case I.QUESTION_MARK:{this._err(te.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=R.BOGUS_COMMENT,this._stateBogusComment(t);break}case I.EOF:{this._err(te.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(te.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=R.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(ui(t))this._createEndTagToken(),this.state=R.TAG_NAME,this._stateTagName(t);else switch(t){case I.GREATER_THAN_SIGN:{this._err(te.missingEndTagName),this.state=R.DATA;break}case I.EOF:{this._err(te.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(te.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=R.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=R.BEFORE_ATTRIBUTE_NAME;break}case I.SOLIDUS:{this.state=R.SELF_CLOSING_START_TAG;break}case I.GREATER_THAN_SIGN:{this.state=R.DATA,this.emitCurrentTagToken();break}case I.NULL:{this._err(te.unexpectedNullCharacter),n.tagName+=xt;break}case I.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(ma(t)?gl(t):t)}}_stateRcdataLessThanSign(t){t===I.SOLIDUS?this.state=R.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=R.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){ui(t)?(this.state=R.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=R.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=R.BEFORE_ATTRIBUTE_NAME,!1;case I.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=R.SELF_CLOSING_START_TAG,!1;case I.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=R.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=R.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===I.SOLIDUS?this.state=R.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=R.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){ui(t)?(this.state=R.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=R.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=R.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case I.SOLIDUS:{this.state=R.SCRIPT_DATA_END_TAG_OPEN;break}case I.EXCLAMATION_MARK:{this.state=R.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=R.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){ui(t)?(this.state=R.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=R.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=R.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===I.HYPHEN_MINUS?(this.state=R.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=R.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===I.HYPHEN_MINUS?(this.state=R.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=R.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case I.HYPHEN_MINUS:{this.state=R.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=R.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(xt);break}case I.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case I.HYPHEN_MINUS:{this.state=R.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=R.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.NULL:{this._err(te.unexpectedNullCharacter),this.state=R.SCRIPT_DATA_ESCAPED,this._emitChars(xt);break}case I.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=R.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case I.HYPHEN_MINUS:{this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=R.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.GREATER_THAN_SIGN:{this.state=R.SCRIPT_DATA,this._emitChars(">");break}case I.NULL:{this._err(te.unexpectedNullCharacter),this.state=R.SCRIPT_DATA_ESCAPED,this._emitChars(xt);break}case I.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=R.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===I.SOLIDUS?this.state=R.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ui(t)?(this._emitChars("<"),this.state=R.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=R.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){ui(t)?(this.state=R.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=R.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=R.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Sn.SCRIPT,!1)&&QE(this.preprocessor.peek(Sn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Sn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=R.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case I.HYPHEN_MINUS:{this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(xt);break}case I.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case I.HYPHEN_MINUS:{this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.NULL:{this._err(te.unexpectedNullCharacter),this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(xt);break}case I.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case I.HYPHEN_MINUS:{this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.GREATER_THAN_SIGN:{this.state=R.SCRIPT_DATA,this._emitChars(">");break}case I.NULL:{this._err(te.unexpectedNullCharacter),this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(xt);break}case I.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===I.SOLIDUS?(this.state=R.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Sn.SCRIPT,!1)&&QE(this.preprocessor.peek(Sn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Sn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=R.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=R.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.SOLIDUS:case I.GREATER_THAN_SIGN:case I.EOF:{this.state=R.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case I.EQUALS_SIGN:{this._err(te.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=R.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=R.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:case I.SOLIDUS:case I.GREATER_THAN_SIGN:case I.EOF:{this._leaveAttrName(),this.state=R.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case I.EQUALS_SIGN:{this._leaveAttrName(),this.state=R.BEFORE_ATTRIBUTE_VALUE;break}case I.QUOTATION_MARK:case I.APOSTROPHE:case I.LESS_THAN_SIGN:{this._err(te.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case I.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.name+=xt;break}default:this.currentAttr.name+=String.fromCodePoint(ma(t)?gl(t):t)}}_stateAfterAttributeName(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.SOLIDUS:{this.state=R.SELF_CLOSING_START_TAG;break}case I.EQUALS_SIGN:{this.state=R.BEFORE_ATTRIBUTE_VALUE;break}case I.GREATER_THAN_SIGN:{this.state=R.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=R.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{this.state=R.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this.state=R.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(te.missingAttributeValue),this.state=R.DATA,this.emitCurrentTagToken();break}default:this.state=R.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case I.QUOTATION_MARK:{this.state=R.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=xt;break}case I.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case I.APOSTROPHE:{this.state=R.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=xt;break}case I.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this._leaveAttrValue(),this.state=R.BEFORE_ATTRIBUTE_NAME;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=R.DATA,this.emitCurrentTagToken();break}case I.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=xt;break}case I.QUOTATION_MARK:case I.APOSTROPHE:case I.LESS_THAN_SIGN:case I.EQUALS_SIGN:case I.GRAVE_ACCENT:{this._err(te.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case I.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this._leaveAttrValue(),this.state=R.BEFORE_ATTRIBUTE_NAME;break}case I.SOLIDUS:{this._leaveAttrValue(),this.state=R.SELF_CLOSING_START_TAG;break}case I.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=R.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._err(te.missingWhitespaceBetweenAttributes),this.state=R.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case I.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=R.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._err(te.unexpectedSolidusInTag),this.state=R.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case I.GREATER_THAN_SIGN:{this.state=R.DATA,this.emitCurrentComment(n);break}case I.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case I.NULL:{this._err(te.unexpectedNullCharacter),n.data+=xt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Sn.DASH_DASH,!0)?(this._createCommentToken(Sn.DASH_DASH.length+1),this.state=R.COMMENT_START):this._consumeSequenceIfMatch(Sn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Sn.DOCTYPE.length+1),this.state=R.DOCTYPE):this._consumeSequenceIfMatch(Sn.CDATA_START,!0)?this.inForeignNode?this.state=R.CDATA_SECTION:(this._err(te.cdataInHtmlContent),this._createCommentToken(Sn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=R.BOGUS_COMMENT):this._ensureHibernation()||(this._err(te.incorrectlyOpenedComment),this._createCommentToken(2),this.state=R.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case I.HYPHEN_MINUS:{this.state=R.COMMENT_START_DASH;break}case I.GREATER_THAN_SIGN:{this._err(te.abruptClosingOfEmptyComment),this.state=R.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=R.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case I.HYPHEN_MINUS:{this.state=R.COMMENT_END;break}case I.GREATER_THAN_SIGN:{this._err(te.abruptClosingOfEmptyComment),this.state=R.DATA,this.emitCurrentComment(n);break}case I.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=R.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case I.HYPHEN_MINUS:{this.state=R.COMMENT_END_DASH;break}case I.LESS_THAN_SIGN:{n.data+="<",this.state=R.COMMENT_LESS_THAN_SIGN;break}case I.NULL:{this._err(te.unexpectedNullCharacter),n.data+=xt;break}case I.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case I.EXCLAMATION_MARK:{n.data+="!",this.state=R.COMMENT_LESS_THAN_SIGN_BANG;break}case I.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=R.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===I.HYPHEN_MINUS?this.state=R.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=R.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===I.HYPHEN_MINUS?this.state=R.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=R.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==I.GREATER_THAN_SIGN&&t!==I.EOF&&this._err(te.nestedComment),this.state=R.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case I.HYPHEN_MINUS:{this.state=R.COMMENT_END;break}case I.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=R.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case I.GREATER_THAN_SIGN:{this.state=R.DATA,this.emitCurrentComment(n);break}case I.EXCLAMATION_MARK:{this.state=R.COMMENT_END_BANG;break}case I.HYPHEN_MINUS:{n.data+="-";break}case I.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=R.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case I.HYPHEN_MINUS:{n.data+="--!",this.state=R.COMMENT_END_DASH;break}case I.GREATER_THAN_SIGN:{this._err(te.incorrectlyClosedComment),this.state=R.DATA,this.emitCurrentComment(n);break}case I.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=R.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=R.BEFORE_DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this.state=R.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case I.EOF:{this._err(te.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingWhitespaceBeforeDoctypeName),this.state=R.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(ma(t))this._createDoctypeToken(String.fromCharCode(gl(t))),this.state=R.DOCTYPE_NAME;else switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.NULL:{this._err(te.unexpectedNullCharacter),this._createDoctypeToken(xt),this.state=R.DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this._err(te.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=R.DATA;break}case I.EOF:{this._err(te.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=R.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=R.AFTER_DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this.state=R.DATA,this.emitCurrentDoctype(n);break}case I.NULL:{this._err(te.unexpectedNullCharacter),n.name+=xt;break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(ma(t)?gl(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.state=R.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Sn.PUBLIC,!1)?this.state=R.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Sn.SYSTEM,!1)?this.state=R.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(te.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=R.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=R.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.QUOTATION_MARK:{this._err(te.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=R.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(te.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=R.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(te.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=R.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=R.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{n.publicId="",this.state=R.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{n.publicId="",this.state=R.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(te.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=R.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=R.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case I.QUOTATION_MARK:{this.state=R.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.NULL:{this._err(te.unexpectedNullCharacter),n.publicId+=xt;break}case I.GREATER_THAN_SIGN:{this._err(te.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=R.DATA;break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case I.APOSTROPHE:{this.state=R.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.NULL:{this._err(te.unexpectedNullCharacter),n.publicId+=xt;break}case I.GREATER_THAN_SIGN:{this._err(te.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=R.DATA;break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=R.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case I.GREATER_THAN_SIGN:{this.state=R.DATA,this.emitCurrentDoctype(n);break}case I.QUOTATION_MARK:{this._err(te.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=R.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(te.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=R.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=R.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=R.DATA;break}case I.QUOTATION_MARK:{n.systemId="",this.state=R.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{n.systemId="",this.state=R.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=R.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=R.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.QUOTATION_MARK:{this._err(te.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=R.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(te.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=R.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(te.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=R.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=R.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{n.systemId="",this.state=R.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{n.systemId="",this.state=R.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(te.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=R.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=R.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case I.QUOTATION_MARK:{this.state=R.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.NULL:{this._err(te.unexpectedNullCharacter),n.systemId+=xt;break}case I.GREATER_THAN_SIGN:{this._err(te.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=R.DATA;break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case I.APOSTROPHE:{this.state=R.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.NULL:{this._err(te.unexpectedNullCharacter),n.systemId+=xt;break}case I.GREATER_THAN_SIGN:{this._err(te.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=R.DATA;break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=R.DATA;break}case I.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=R.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=R.DATA;break}case I.NULL:{this._err(te.unexpectedNullCharacter);break}case I.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case I.RIGHT_SQUARE_BRACKET:{this.state=R.CDATA_SECTION_BRACKET;break}case I.EOF:{this._err(te.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===I.RIGHT_SQUARE_BRACKET?this.state=R.CDATA_SECTION_END:(this._emitChars("]"),this.state=R.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case I.GREATER_THAN_SIGN:{this.state=R.DATA;break}case I.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=R.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(I.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&GE(this.preprocessor.peek(1))?R.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){GE(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===I.SEMICOLON&&this._err(te.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const KE=new Set([g.DD,g.DT,g.LI,g.OPTGROUP,g.OPTION,g.P,g.RB,g.RP,g.RT,g.RTC]),JE=new Set([...KE,g.CAPTION,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]),El=new Set([g.APPLET,g.CAPTION,g.HTML,g.MARQUEE,g.OBJECT,g.TABLE,g.TD,g.TEMPLATE,g.TH]),JI=new Set([...El,g.OL,g.UL]),ZI=new Set([...El,g.BUTTON]),ZE=new Set([g.ANNOTATION_XML,g.MI,g.MN,g.MO,g.MS,g.MTEXT]),ey=new Set([g.DESC,g.FOREIGN_OBJECT,g.TITLE]),eP=new Set([g.TR,g.TEMPLATE,g.HTML]),tP=new Set([g.TBODY,g.TFOOT,g.THEAD,g.TEMPLATE,g.HTML]),nP=new Set([g.TABLE,g.TEMPLATE,g.HTML]),rP=new Set([g.TD,g.TH]);class iP{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=g.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===g.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===ye.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const s=this._indexOf(t)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==ye.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Zf,ye.HTML)}popUntilTableCellPopped(){this.popUntilPopped(rP,ye.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(nP,ye.HTML)}clearBackToTableBodyContext(){this.clearBackTo(tP,ye.HTML)}clearBackToTableRowContext(){this.clearBackTo(eP,ye.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===g.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===g.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case ye.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case ye.SVG:{if(ey.has(s))return!1;break}case ye.MATHML:{if(ZE.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,El)}hasInListItemScope(t){return this.hasInDynamicScope(t,JI)}hasInButtonScope(t){return this.hasInDynamicScope(t,ZI)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case ye.HTML:{if(Zf.has(n))return!0;if(El.has(n))return!1;break}case ye.SVG:{if(ey.has(n))return!1;break}case ye.MATHML:{if(ZE.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ye.HTML)switch(this.tagIDs[n]){case t:return!0;case g.TABLE:case g.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===ye.HTML)switch(this.tagIDs[t]){case g.TBODY:case g.THEAD:case g.TFOOT:return!0;case g.TABLE:case g.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ye.HTML)switch(this.tagIDs[n]){case t:return!0;case g.OPTION:case g.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&KE.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&JE.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&JE.has(this.currentTagId);)this.pop()}}const eh=3;var _r;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(_r||(_r={}));const ty={type:_r.Marker};class sP{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],s=n.length,a=this.treeAdapter.getTagName(t),u=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const d=this.entries[c];if(d.type===_r.Marker)break;const{element:f}=d;if(this.treeAdapter.getTagName(f)===a&&this.treeAdapter.getNamespaceURI(f)===u){const p=this.treeAdapter.getAttrList(f);p.length===s&&r.push({idx:c,attrs:p})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<eh)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<eh)return;const s=new Map(n.map(u=>[u.name,u.value]));let a=0;for(let u=0;u<r.length;u++){const c=r[u];c.attrs.every(d=>s.get(d.name)===d.value)&&(a+=1,a>=eh&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(ty)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:_r.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:_r.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(ty);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===_r.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===_r.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===_r.Element&&n.element===t)}}const li={createDocument(){return{nodeName:"#document",mode:qn.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const s=e.childNodes.find(a=>a.nodeName==="#documentType");if(s)s.name=t,s.publicId=n,s.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};li.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(li.isTextNode(n)){n.value+=t;return}}li.appendChild(e,li.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&li.isTextNode(r)?r.value+=t:li.insertBefore(e,li.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation=H(H({},e.sourceCodeLocation),t)}},ny="html",oP="about:legacy-compat",aP="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",ry=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],uP=[...ry,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],lP=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),iy=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],cP=[...iy,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function sy(e,t){return t.some(n=>e.startsWith(n))}function dP(e){return e.name===ny&&e.publicId===null&&(e.systemId===null||e.systemId===oP)}function fP(e){if(e.name!==ny)return qn.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===aP)return qn.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),lP.has(n))return qn.QUIRKS;let r=t===null?uP:ry;if(sy(n,r))return qn.QUIRKS;if(r=t===null?iy:cP,sy(n,r))return qn.LIMITED_QUIRKS}return qn.NO_QUIRKS}const oy={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},hP="definitionurl",pP="definitionURL",mP=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),gP=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ye.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ye.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ye.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ye.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ye.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ye.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ye.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ye.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ye.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ye.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ye.XMLNS}]]),EP=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),yP=new Set([g.B,g.BIG,g.BLOCKQUOTE,g.BODY,g.BR,g.CENTER,g.CODE,g.DD,g.DIV,g.DL,g.DT,g.EM,g.EMBED,g.H1,g.H2,g.H3,g.H4,g.H5,g.H6,g.HEAD,g.HR,g.I,g.IMG,g.LI,g.LISTING,g.MENU,g.META,g.NOBR,g.OL,g.P,g.PRE,g.RUBY,g.S,g.SMALL,g.SPAN,g.STRONG,g.STRIKE,g.SUB,g.SUP,g.TABLE,g.TT,g.U,g.UL,g.VAR]);function TP(e){const t=e.tagID;return t===g.FONT&&e.attrs.some(({name:r})=>r===Ji.COLOR||r===Ji.SIZE||r===Ji.FACE)||yP.has(t)}function ay(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===hP){e.attrs[t].name=pP;break}}function uy(e){for(let t=0;t<e.attrs.length;t++){const n=mP.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function th(e){for(let t=0;t<e.attrs.length;t++){const n=gP.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function bP(e){const t=EP.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Vs(e.tagName))}function xP(e,t){return t===ye.MATHML&&(e===g.MI||e===g.MO||e===g.MN||e===g.MS||e===g.MTEXT)}function _P(e,t,n){if(t===ye.MATHML&&e===g.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Ji.ENCODING){const s=n[r].value.toLowerCase();return s===oy.TEXT_HTML||s===oy.APPLICATION_XML}}return t===ye.SVG&&(e===g.FOREIGN_OBJECT||e===g.DESC||e===g.TITLE)}function wP(e,t,n,r){return(!r||r===ye.HTML)&&_P(e,t,n)||(!r||r===ye.MATHML)&&xP(e,t)}const SP="hidden",vP=8,AP=3;var U;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(U||(U={}));const kP={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},ly=new Set([g.TABLE,g.TBODY,g.TFOOT,g.THEAD,g.TR]),cy={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:li,onParseError:null};class dy{constructor(t,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=U.INITIAL,this.originalInsertionMode=U.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options=H(H({},cy),t),this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n!=null?n:this.treeAdapter.createDocument(),this.tokenizer=new KI(this.options,this),this.activeFormattingElements=new sP(this.treeAdapter),this.fragmentContextID=r?Vs(this.treeAdapter.getTagName(r)):g.UNKNOWN,this._setContextModes(r!=null?r:this.document,this.fragmentContextID),this.openElements=new iP(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r=H(H({},cy),n);t!=null||(t=r.treeAdapter.createElement(K.TEMPLATE,ye.HTML,[]));const s=r.treeAdapter.createElement("documentmock",ye.HTML,[]),a=new this(r,s,t);return a.fragmentContextID===g.TEMPLATE&&a.tmplInsertionModeStack.unshift(U.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var s;if(!this.onParseError)return;const a=(s=t.location)!==null&&s!==void 0?s:kP,u={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(u)}onItemPush(t,n,r){var s,a;(a=(s=this.treeAdapter).onItemPush)===null||a===void 0||a.call(s,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,t,this.openElements.current),n){let a,u;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,u=this.fragmentContextID):{current:a,currentTagId:u}=this.openElements,this._setContextModes(a,u)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===ye.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,ye.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=U.TEXT}switchToPlaintextParsing(){this.insertionMode=U.TEXT,this.originalInsertionMode=U.IN_BODY,this.tokenizer.state=Ct.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===K.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ye.HTML))switch(this.fragmentContextID){case g.TITLE:case g.TEXTAREA:{this.tokenizer.state=Ct.RCDATA;break}case g.STYLE:case g.XMP:case g.IFRAME:case g.NOEMBED:case g.NOFRAMES:case g.NOSCRIPT:{this.tokenizer.state=Ct.RAWTEXT;break}case g.SCRIPT:{this.tokenizer.state=Ct.SCRIPT_DATA;break}case g.PLAINTEXT:{this.tokenizer.state=Ct.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),t.location){const u=this.treeAdapter.getChildNodes(this.document).find(c=>this.treeAdapter.isDocumentTypeNode(c));u&&this.treeAdapter.setNodeSourceCodeLocation(u,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&le(H({},n),{startTag:n});this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r!=null?r:this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,ye.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,ye.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(K.HTML,ye.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,g.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const s=this.treeAdapter.getChildNodes(n),a=r?s.lastIndexOf(r):s.length,u=s[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(u)){const{endLine:d,endCol:f,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(u,{endLine:d,endCol:f,endOffset:p})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(u,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(t),a=n.type===Qe.END_TAG&&s===n.tagName?{endTag:H({},r),endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===g.SVG&&this.treeAdapter.getTagName(n)===K.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ye.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===g.MGLYPH||t.tagID===g.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ye.HTML)}_processToken(t){switch(t.type){case Qe.CHARACTER:{this.onCharacter(t);break}case Qe.NULL_CHARACTER:{this.onNullCharacter(t);break}case Qe.COMMENT:{this.onComment(t);break}case Qe.DOCTYPE:{this.onDoctype(t);break}case Qe.START_TAG:{this._processStartTag(t);break}case Qe.END_TAG:{this.onEndTag(t);break}case Qe.EOF:{this.onEof(t);break}case Qe.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return wP(t,s,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===_r.Marker||this.openElements.contains(s.element)),r=n===-1?t-1:n-1;for(let s=r;s>=0;s--){const a=this.activeFormattingElements.entries[s];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=U.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(g.P),this.openElements.popUntilTagNamePopped(g.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case g.TR:{this.insertionMode=U.IN_ROW;return}case g.TBODY:case g.THEAD:case g.TFOOT:{this.insertionMode=U.IN_TABLE_BODY;return}case g.CAPTION:{this.insertionMode=U.IN_CAPTION;return}case g.COLGROUP:{this.insertionMode=U.IN_COLUMN_GROUP;return}case g.TABLE:{this.insertionMode=U.IN_TABLE;return}case g.BODY:{this.insertionMode=U.IN_BODY;return}case g.FRAMESET:{this.insertionMode=U.IN_FRAMESET;return}case g.SELECT:{this._resetInsertionModeForSelect(t);return}case g.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case g.HTML:{this.insertionMode=this.headElement?U.AFTER_HEAD:U.BEFORE_HEAD;return}case g.TD:case g.TH:{if(t>0){this.insertionMode=U.IN_CELL;return}break}case g.HEAD:{if(t>0){this.insertionMode=U.IN_HEAD;return}break}}this.insertionMode=U.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===g.TEMPLATE)break;if(r===g.TABLE){this.insertionMode=U.IN_SELECT_IN_TABLE;return}}this.insertionMode=U.IN_SELECT}_isElementCausesFosterParenting(t){return ly.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case g.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===ye.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case g.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return WI[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){r6(this,t);return}switch(this.insertionMode){case U.INITIAL:{ga(this,t);break}case U.BEFORE_HTML:{Ea(this,t);break}case U.BEFORE_HEAD:{ya(this,t);break}case U.IN_HEAD:{Ta(this,t);break}case U.IN_HEAD_NO_SCRIPT:{ba(this,t);break}case U.AFTER_HEAD:{xa(this,t);break}case U.IN_BODY:case U.IN_CAPTION:case U.IN_CELL:case U.IN_TEMPLATE:{hy(this,t);break}case U.TEXT:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:{sh(this,t);break}case U.IN_TABLE_TEXT:{xy(this,t);break}case U.IN_COLUMN_GROUP:{bl(this,t);break}case U.AFTER_BODY:{wl(this,t);break}case U.AFTER_AFTER_BODY:{Sl(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){n6(this,t);return}switch(this.insertionMode){case U.INITIAL:{ga(this,t);break}case U.BEFORE_HTML:{Ea(this,t);break}case U.BEFORE_HEAD:{ya(this,t);break}case U.IN_HEAD:{Ta(this,t);break}case U.IN_HEAD_NO_SCRIPT:{ba(this,t);break}case U.AFTER_HEAD:{xa(this,t);break}case U.TEXT:{this._insertCharacters(t);break}case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:{sh(this,t);break}case U.IN_COLUMN_GROUP:{bl(this,t);break}case U.AFTER_BODY:{wl(this,t);break}case U.AFTER_AFTER_BODY:{Sl(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){rh(this,t);return}switch(this.insertionMode){case U.INITIAL:case U.BEFORE_HTML:case U.BEFORE_HEAD:case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:case U.IN_BODY:case U.IN_TABLE:case U.IN_CAPTION:case U.IN_COLUMN_GROUP:case U.IN_TABLE_BODY:case U.IN_ROW:case U.IN_CELL:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:case U.IN_TEMPLATE:case U.IN_FRAMESET:case U.AFTER_FRAMESET:{rh(this,t);break}case U.IN_TABLE_TEXT:{Sa(this,t);break}case U.AFTER_BODY:{LP(this,t);break}case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:{DP(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case U.INITIAL:{MP(this,t);break}case U.BEFORE_HEAD:case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:{this._err(t,te.misplacedDoctype);break}case U.IN_TABLE_TEXT:{Sa(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,te.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?i6(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case U.INITIAL:{ga(this,t);break}case U.BEFORE_HTML:{FP(this,t);break}case U.BEFORE_HEAD:{UP(this,t);break}case U.IN_HEAD:{or(this,t);break}case U.IN_HEAD_NO_SCRIPT:{$P(this,t);break}case U.AFTER_HEAD:{VP(this,t);break}case U.IN_BODY:{un(this,t);break}case U.IN_TABLE:{qs(this,t);break}case U.IN_TABLE_TEXT:{Sa(this,t);break}case U.IN_CAPTION:{HR(this,t);break}case U.IN_COLUMN_GROUP:{oh(this,t);break}case U.IN_TABLE_BODY:{xl(this,t);break}case U.IN_ROW:{_l(this,t);break}case U.IN_CELL:{zR(this,t);break}case U.IN_SELECT:{Sy(this,t);break}case U.IN_SELECT_IN_TABLE:{qR(this,t);break}case U.IN_TEMPLATE:{WR(this,t);break}case U.AFTER_BODY:{XR(this,t);break}case U.IN_FRAMESET:{QR(this,t);break}case U.AFTER_FRAMESET:{JR(this,t);break}case U.AFTER_AFTER_BODY:{e6(this,t);break}case U.AFTER_AFTER_FRAMESET:{t6(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?s6(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case U.INITIAL:{ga(this,t);break}case U.BEFORE_HTML:{BP(this,t);break}case U.BEFORE_HEAD:{HP(this,t);break}case U.IN_HEAD:{jP(this,t);break}case U.IN_HEAD_NO_SCRIPT:{zP(this,t);break}case U.AFTER_HEAD:{qP(this,t);break}case U.IN_BODY:{Tl(this,t);break}case U.TEXT:{OR(this,t);break}case U.IN_TABLE:{_a(this,t);break}case U.IN_TABLE_TEXT:{Sa(this,t);break}case U.IN_CAPTION:{jR(this,t);break}case U.IN_COLUMN_GROUP:{$R(this,t);break}case U.IN_TABLE_BODY:{ah(this,t);break}case U.IN_ROW:{wy(this,t);break}case U.IN_CELL:{VR(this,t);break}case U.IN_SELECT:{vy(this,t);break}case U.IN_SELECT_IN_TABLE:{YR(this,t);break}case U.IN_TEMPLATE:{GR(this,t);break}case U.AFTER_BODY:{ky(this,t);break}case U.IN_FRAMESET:{KR(this,t);break}case U.AFTER_FRAMESET:{ZR(this,t);break}case U.AFTER_AFTER_BODY:{Sl(this,t);break}}}onEof(t){switch(this.insertionMode){case U.INITIAL:{ga(this,t);break}case U.BEFORE_HTML:{Ea(this,t);break}case U.BEFORE_HEAD:{ya(this,t);break}case U.IN_HEAD:{Ta(this,t);break}case U.IN_HEAD_NO_SCRIPT:{ba(this,t);break}case U.AFTER_HEAD:{xa(this,t);break}case U.IN_BODY:case U.IN_TABLE:case U.IN_CAPTION:case U.IN_COLUMN_GROUP:case U.IN_TABLE_BODY:case U.IN_ROW:case U.IN_CELL:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:{Ty(this,t);break}case U.TEXT:{IR(this,t);break}case U.IN_TABLE_TEXT:{Sa(this,t);break}case U.IN_TEMPLATE:{Ay(this,t);break}case U.AFTER_BODY:case U.IN_FRAMESET:case U.AFTER_FRAMESET:case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:{ih(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===I.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:case U.TEXT:case U.IN_COLUMN_GROUP:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:case U.IN_FRAMESET:case U.AFTER_FRAMESET:{this._insertCharacters(t);break}case U.IN_BODY:case U.IN_CAPTION:case U.IN_CELL:case U.IN_TEMPLATE:case U.AFTER_BODY:case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:{fy(this,t);break}case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:{sh(this,t);break}case U.IN_TABLE_TEXT:{by(this,t);break}}}}function NP(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):yy(e,t),n}function CP(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const s=e.openElements.items[r];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[r])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function OP(e,t,n){let r=t,s=e.openElements.getCommonAncestor(t);for(let a=0,u=s;u!==n;a++,u=s){s=e.openElements.getCommonAncestor(u);const c=e.activeFormattingElements.getElementEntry(u),d=c&&a>=AP;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(u)):(u=IP(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(u,r),r=u)}return r}function IP(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function PP(e,t,n){const r=e.treeAdapter.getTagName(t),s=Vs(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);s===g.TEMPLATE&&a===ye.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function RP(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,a=e.treeAdapter.createElement(s.tagName,r,s.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,s.tagID)}function nh(e,t){for(let n=0;n<vP;n++){const r=NP(e,t);if(!r)break;const s=CP(e,r);if(!s)break;e.activeFormattingElements.bookmark=r;const a=OP(e,s,r.element),u=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),u&&PP(e,u,a),RP(e,s,r)}}function rh(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function LP(e,t){e._appendCommentNode(t,e.openElements.items[0])}function DP(e,t){e._appendCommentNode(t,e.document)}function ih(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],u=e.treeAdapter.getNodeSourceCodeLocation(a);u&&!u.endTag&&e._setEndLocation(a,t)}}}}function MP(e,t){e._setDocumentType(t);const n=t.forceQuirks?qn.QUIRKS:fP(t);dP(t)||e._err(t,te.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=U.BEFORE_HTML}function ga(e,t){e._err(t,te.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,qn.QUIRKS),e.insertionMode=U.BEFORE_HTML,e._processToken(t)}function FP(e,t){t.tagID===g.HTML?(e._insertElement(t,ye.HTML),e.insertionMode=U.BEFORE_HEAD):Ea(e,t)}function BP(e,t){const n=t.tagID;(n===g.HTML||n===g.HEAD||n===g.BODY||n===g.BR)&&Ea(e,t)}function Ea(e,t){e._insertFakeRootElement(),e.insertionMode=U.BEFORE_HEAD,e._processToken(t)}function UP(e,t){switch(t.tagID){case g.HTML:{un(e,t);break}case g.HEAD:{e._insertElement(t,ye.HTML),e.headElement=e.openElements.current,e.insertionMode=U.IN_HEAD;break}default:ya(e,t)}}function HP(e,t){const n=t.tagID;n===g.HEAD||n===g.BODY||n===g.HTML||n===g.BR?ya(e,t):e._err(t,te.endTagWithoutMatchingOpenElement)}function ya(e,t){e._insertFakeElement(K.HEAD,g.HEAD),e.headElement=e.openElements.current,e.insertionMode=U.IN_HEAD,e._processToken(t)}function or(e,t){switch(t.tagID){case g.HTML:{un(e,t);break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:{e._appendElement(t,ye.HTML),t.ackSelfClosing=!0;break}case g.TITLE:{e._switchToTextParsing(t,Ct.RCDATA);break}case g.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Ct.RAWTEXT):(e._insertElement(t,ye.HTML),e.insertionMode=U.IN_HEAD_NO_SCRIPT);break}case g.NOFRAMES:case g.STYLE:{e._switchToTextParsing(t,Ct.RAWTEXT);break}case g.SCRIPT:{e._switchToTextParsing(t,Ct.SCRIPT_DATA);break}case g.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=U.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(U.IN_TEMPLATE);break}case g.HEAD:{e._err(t,te.misplacedStartTagForHeadElement);break}default:Ta(e,t)}}function jP(e,t){switch(t.tagID){case g.HEAD:{e.openElements.pop(),e.insertionMode=U.AFTER_HEAD;break}case g.BODY:case g.BR:case g.HTML:{Ta(e,t);break}case g.TEMPLATE:{Zi(e,t);break}default:e._err(t,te.endTagWithoutMatchingOpenElement)}}function Zi(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==g.TEMPLATE&&e._err(t,te.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,te.endTagWithoutMatchingOpenElement)}function Ta(e,t){e.openElements.pop(),e.insertionMode=U.AFTER_HEAD,e._processToken(t)}function $P(e,t){switch(t.tagID){case g.HTML:{un(e,t);break}case g.BASEFONT:case g.BGSOUND:case g.HEAD:case g.LINK:case g.META:case g.NOFRAMES:case g.STYLE:{or(e,t);break}case g.NOSCRIPT:{e._err(t,te.nestedNoscriptInHead);break}default:ba(e,t)}}function zP(e,t){switch(t.tagID){case g.NOSCRIPT:{e.openElements.pop(),e.insertionMode=U.IN_HEAD;break}case g.BR:{ba(e,t);break}default:e._err(t,te.endTagWithoutMatchingOpenElement)}}function ba(e,t){const n=t.type===Qe.EOF?te.openElementsLeftAfterEof:te.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=U.IN_HEAD,e._processToken(t)}function VP(e,t){switch(t.tagID){case g.HTML:{un(e,t);break}case g.BODY:{e._insertElement(t,ye.HTML),e.framesetOk=!1,e.insertionMode=U.IN_BODY;break}case g.FRAMESET:{e._insertElement(t,ye.HTML),e.insertionMode=U.IN_FRAMESET;break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:case g.NOFRAMES:case g.SCRIPT:case g.STYLE:case g.TEMPLATE:case g.TITLE:{e._err(t,te.abandonedHeadElementChild),e.openElements.push(e.headElement,g.HEAD),or(e,t),e.openElements.remove(e.headElement);break}case g.HEAD:{e._err(t,te.misplacedStartTagForHeadElement);break}default:xa(e,t)}}function qP(e,t){switch(t.tagID){case g.BODY:case g.HTML:case g.BR:{xa(e,t);break}case g.TEMPLATE:{Zi(e,t);break}default:e._err(t,te.endTagWithoutMatchingOpenElement)}}function xa(e,t){e._insertFakeElement(K.BODY,g.BODY),e.insertionMode=U.IN_BODY,yl(e,t)}function yl(e,t){switch(t.type){case Qe.CHARACTER:{hy(e,t);break}case Qe.WHITESPACE_CHARACTER:{fy(e,t);break}case Qe.COMMENT:{rh(e,t);break}case Qe.START_TAG:{un(e,t);break}case Qe.END_TAG:{Tl(e,t);break}case Qe.EOF:{Ty(e,t);break}}}function fy(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function hy(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function YP(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function WP(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function GP(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ye.HTML),e.insertionMode=U.IN_FRAMESET)}function XP(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ye.HTML)}function QP(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Zf.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ye.HTML)}function KP(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ye.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function JP(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ye.HTML),n||(e.formElement=e.openElements.current))}function ZP(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const s=e.openElements.tagIDs[r];if(n===g.LI&&s===g.LI||(n===g.DD||n===g.DT)&&(s===g.DD||s===g.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==g.ADDRESS&&s!==g.DIV&&s!==g.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ye.HTML)}function eR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ye.HTML),e.tokenizer.state=Ct.PLAINTEXT}function tR(e,t){e.openElements.hasInScope(g.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ye.HTML),e.framesetOk=!1}function nR(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(K.A);n&&(nh(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ye.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function rR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ye.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function iR(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(g.NOBR)&&(nh(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ye.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function sR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ye.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function oR(e,t){e.treeAdapter.getDocumentMode(e.document)!==qn.QUIRKS&&e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,ye.HTML),e.framesetOk=!1,e.insertionMode=U.IN_TABLE}function py(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ye.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function my(e){const t=WE(e,Ji.TYPE);return t!=null&&t.toLowerCase()===SP}function aR(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ye.HTML),my(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function uR(e,t){e._appendElement(t,ye.HTML),t.ackSelfClosing=!0}function lR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._appendElement(t,ye.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function cR(e,t){t.tagName=K.IMG,t.tagID=g.IMG,py(e,t)}function dR(e,t){e._insertElement(t,ye.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Ct.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=U.TEXT}function fR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Ct.RAWTEXT)}function hR(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Ct.RAWTEXT)}function gy(e,t){e._switchToTextParsing(t,Ct.RAWTEXT)}function pR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ye.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===U.IN_TABLE||e.insertionMode===U.IN_CAPTION||e.insertionMode===U.IN_TABLE_BODY||e.insertionMode===U.IN_ROW||e.insertionMode===U.IN_CELL?U.IN_SELECT_IN_TABLE:U.IN_SELECT}function mR(e,t){e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ye.HTML)}function gR(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ye.HTML)}function ER(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(g.RTC),e._insertElement(t,ye.HTML)}function yR(e,t){e._reconstructActiveFormattingElements(),ay(t),th(t),t.selfClosing?e._appendElement(t,ye.MATHML):e._insertElement(t,ye.MATHML),t.ackSelfClosing=!0}function TR(e,t){e._reconstructActiveFormattingElements(),uy(t),th(t),t.selfClosing?e._appendElement(t,ye.SVG):e._insertElement(t,ye.SVG),t.ackSelfClosing=!0}function Ey(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ye.HTML)}function un(e,t){switch(t.tagID){case g.I:case g.S:case g.B:case g.U:case g.EM:case g.TT:case g.BIG:case g.CODE:case g.FONT:case g.SMALL:case g.STRIKE:case g.STRONG:{rR(e,t);break}case g.A:{nR(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{QP(e,t);break}case g.P:case g.DL:case g.OL:case g.UL:case g.DIV:case g.DIR:case g.NAV:case g.MAIN:case g.MENU:case g.ASIDE:case g.CENTER:case g.FIGURE:case g.FOOTER:case g.HEADER:case g.HGROUP:case g.DIALOG:case g.DETAILS:case g.ADDRESS:case g.ARTICLE:case g.SEARCH:case g.SECTION:case g.SUMMARY:case g.FIELDSET:case g.BLOCKQUOTE:case g.FIGCAPTION:{XP(e,t);break}case g.LI:case g.DD:case g.DT:{ZP(e,t);break}case g.BR:case g.IMG:case g.WBR:case g.AREA:case g.EMBED:case g.KEYGEN:{py(e,t);break}case g.HR:{lR(e,t);break}case g.RB:case g.RTC:{gR(e,t);break}case g.RT:case g.RP:{ER(e,t);break}case g.PRE:case g.LISTING:{KP(e,t);break}case g.XMP:{fR(e,t);break}case g.SVG:{TR(e,t);break}case g.HTML:{YP(e,t);break}case g.BASE:case g.LINK:case g.META:case g.STYLE:case g.TITLE:case g.SCRIPT:case g.BGSOUND:case g.BASEFONT:case g.TEMPLATE:{or(e,t);break}case g.BODY:{WP(e,t);break}case g.FORM:{JP(e,t);break}case g.NOBR:{iR(e,t);break}case g.MATH:{yR(e,t);break}case g.TABLE:{oR(e,t);break}case g.INPUT:{aR(e,t);break}case g.PARAM:case g.TRACK:case g.SOURCE:{uR(e,t);break}case g.IMAGE:{cR(e,t);break}case g.BUTTON:{tR(e,t);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{sR(e,t);break}case g.IFRAME:{hR(e,t);break}case g.SELECT:{pR(e,t);break}case g.OPTION:case g.OPTGROUP:{mR(e,t);break}case g.NOEMBED:case g.NOFRAMES:{gy(e,t);break}case g.FRAMESET:{GP(e,t);break}case g.TEXTAREA:{dR(e,t);break}case g.NOSCRIPT:{e.options.scriptingEnabled?gy(e,t):Ey(e,t);break}case g.PLAINTEXT:{eR(e,t);break}case g.COL:case g.TH:case g.TD:case g.TR:case g.HEAD:case g.FRAME:case g.TBODY:case g.TFOOT:case g.THEAD:case g.CAPTION:case g.COLGROUP:break;default:Ey(e,t)}}function bR(e,t){if(e.openElements.hasInScope(g.BODY)&&(e.insertionMode=U.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function xR(e,t){e.openElements.hasInScope(g.BODY)&&(e.insertionMode=U.AFTER_BODY,ky(e,t))}function _R(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function wR(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(g.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(g.FORM):n&&e.openElements.remove(n))}function SR(e){e.openElements.hasInButtonScope(g.P)||e._insertFakeElement(K.P,g.P),e._closePElement()}function vR(e){e.openElements.hasInListItemScope(g.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(g.LI),e.openElements.popUntilTagNamePopped(g.LI))}function AR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function kR(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function NR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function CR(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(K.BR,g.BR),e.openElements.pop(),e.framesetOk=!1}function yy(e,t){const n=t.tagName,r=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){const a=e.openElements.items[s],u=e.openElements.tagIDs[s];if(r===u&&(r!==g.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(a,u))break}}function Tl(e,t){switch(t.tagID){case g.A:case g.B:case g.I:case g.S:case g.U:case g.EM:case g.TT:case g.BIG:case g.CODE:case g.FONT:case g.NOBR:case g.SMALL:case g.STRIKE:case g.STRONG:{nh(e,t);break}case g.P:{SR(e);break}case g.DL:case g.UL:case g.OL:case g.DIR:case g.DIV:case g.NAV:case g.PRE:case g.MAIN:case g.MENU:case g.ASIDE:case g.BUTTON:case g.CENTER:case g.FIGURE:case g.FOOTER:case g.HEADER:case g.HGROUP:case g.DIALOG:case g.ADDRESS:case g.ARTICLE:case g.DETAILS:case g.SEARCH:case g.SECTION:case g.SUMMARY:case g.LISTING:case g.FIELDSET:case g.BLOCKQUOTE:case g.FIGCAPTION:{_R(e,t);break}case g.LI:{vR(e);break}case g.DD:case g.DT:{AR(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{kR(e);break}case g.BR:{CR(e);break}case g.BODY:{bR(e,t);break}case g.HTML:{xR(e,t);break}case g.FORM:{wR(e);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{NR(e,t);break}case g.TEMPLATE:{Zi(e,t);break}default:yy(e,t)}}function Ty(e,t){e.tmplInsertionModeStack.length>0?Ay(e,t):ih(e,t)}function OR(e,t){var n;t.tagID===g.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function IR(e,t){e._err(t,te.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function sh(e,t){if(e.openElements.currentTagId!==void 0&&ly.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=U.IN_TABLE_TEXT,t.type){case Qe.CHARACTER:{xy(e,t);break}case Qe.WHITESPACE_CHARACTER:{by(e,t);break}}else wa(e,t)}function PR(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ye.HTML),e.insertionMode=U.IN_CAPTION}function RR(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ye.HTML),e.insertionMode=U.IN_COLUMN_GROUP}function LR(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(K.COLGROUP,g.COLGROUP),e.insertionMode=U.IN_COLUMN_GROUP,oh(e,t)}function DR(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ye.HTML),e.insertionMode=U.IN_TABLE_BODY}function MR(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(K.TBODY,g.TBODY),e.insertionMode=U.IN_TABLE_BODY,xl(e,t)}function FR(e,t){e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function BR(e,t){my(t)?e._appendElement(t,ye.HTML):wa(e,t),t.ackSelfClosing=!0}function UR(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,ye.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function qs(e,t){switch(t.tagID){case g.TD:case g.TH:case g.TR:{MR(e,t);break}case g.STYLE:case g.SCRIPT:case g.TEMPLATE:{or(e,t);break}case g.COL:{LR(e,t);break}case g.FORM:{UR(e,t);break}case g.TABLE:{FR(e,t);break}case g.TBODY:case g.TFOOT:case g.THEAD:{DR(e,t);break}case g.INPUT:{BR(e,t);break}case g.CAPTION:{PR(e,t);break}case g.COLGROUP:{RR(e,t);break}default:wa(e,t)}}function _a(e,t){switch(t.tagID){case g.TABLE:{e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode());break}case g.TEMPLATE:{Zi(e,t);break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TBODY:case g.TD:case g.TFOOT:case g.TH:case g.THEAD:case g.TR:break;default:wa(e,t)}}function wa(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,yl(e,t),e.fosterParentingEnabled=n}function by(e,t){e.pendingCharacterTokens.push(t)}function xy(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Sa(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)wa(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const _y=new Set([g.CAPTION,g.COL,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]);function HR(e,t){const n=t.tagID;_y.has(n)?e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_TABLE,qs(e,t)):un(e,t)}function jR(e,t){const n=t.tagID;switch(n){case g.CAPTION:case g.TABLE:{e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_TABLE,n===g.TABLE&&_a(e,t));break}case g.BODY:case g.COL:case g.COLGROUP:case g.HTML:case g.TBODY:case g.TD:case g.TFOOT:case g.TH:case g.THEAD:case g.TR:break;default:Tl(e,t)}}function oh(e,t){switch(t.tagID){case g.HTML:{un(e,t);break}case g.COL:{e._appendElement(t,ye.HTML),t.ackSelfClosing=!0;break}case g.TEMPLATE:{or(e,t);break}default:bl(e,t)}}function $R(e,t){switch(t.tagID){case g.COLGROUP:{e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=U.IN_TABLE);break}case g.TEMPLATE:{Zi(e,t);break}case g.COL:break;default:bl(e,t)}}function bl(e,t){e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=U.IN_TABLE,e._processToken(t))}function xl(e,t){switch(t.tagID){case g.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,ye.HTML),e.insertionMode=U.IN_ROW;break}case g.TH:case g.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(K.TR,g.TR),e.insertionMode=U.IN_ROW,_l(e,t);break}case g.CAPTION:case g.COL:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE,qs(e,t));break}default:qs(e,t)}}function ah(e,t){const n=t.tagID;switch(t.tagID){case g.TBODY:case g.TFOOT:case g.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE);break}case g.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE,_a(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TD:case g.TH:case g.TR:break;default:_a(e,t)}}function _l(e,t){switch(t.tagID){case g.TH:case g.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,ye.HTML),e.insertionMode=U.IN_CELL,e.activeFormattingElements.insertMarker();break}case g.CAPTION:case g.COL:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,xl(e,t));break}default:qs(e,t)}}function wy(e,t){switch(t.tagID){case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY);break}case g.TABLE:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,ah(e,t));break}case g.TBODY:case g.TFOOT:case g.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(g.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,ah(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TD:case g.TH:break;default:_a(e,t)}}function zR(e,t){const n=t.tagID;_y.has(n)?(e.openElements.hasInTableScope(g.TD)||e.openElements.hasInTableScope(g.TH))&&(e._closeTableCell(),_l(e,t)):un(e,t)}function VR(e,t){const n=t.tagID;switch(n){case g.TD:case g.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_ROW);break}case g.TABLE:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),wy(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:break;default:Tl(e,t)}}function Sy(e,t){switch(t.tagID){case g.HTML:{un(e,t);break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._insertElement(t,ye.HTML);break}case g.OPTGROUP:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._insertElement(t,ye.HTML);break}case g.HR:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._appendElement(t,ye.HTML),t.ackSelfClosing=!0;break}case g.INPUT:case g.KEYGEN:case g.TEXTAREA:case g.SELECT:{e.openElements.hasInSelectScope(g.SELECT)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),t.tagID!==g.SELECT&&e._processStartTag(t));break}case g.SCRIPT:case g.TEMPLATE:{or(e,t);break}}}function vy(e,t){switch(t.tagID){case g.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===g.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===g.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop();break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop();break}case g.SELECT:{e.openElements.hasInSelectScope(g.SELECT)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode());break}case g.TEMPLATE:{Zi(e,t);break}}}function qR(e,t){const n=t.tagID;n===g.CAPTION||n===g.TABLE||n===g.TBODY||n===g.TFOOT||n===g.THEAD||n===g.TR||n===g.TD||n===g.TH?(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Sy(e,t)}function YR(e,t){const n=t.tagID;n===g.CAPTION||n===g.TABLE||n===g.TBODY||n===g.TFOOT||n===g.THEAD||n===g.TR||n===g.TD||n===g.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),e.onEndTag(t)):vy(e,t)}function WR(e,t){switch(t.tagID){case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:case g.NOFRAMES:case g.SCRIPT:case g.STYLE:case g.TEMPLATE:case g.TITLE:{or(e,t);break}case g.CAPTION:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.tmplInsertionModeStack[0]=U.IN_TABLE,e.insertionMode=U.IN_TABLE,qs(e,t);break}case g.COL:{e.tmplInsertionModeStack[0]=U.IN_COLUMN_GROUP,e.insertionMode=U.IN_COLUMN_GROUP,oh(e,t);break}case g.TR:{e.tmplInsertionModeStack[0]=U.IN_TABLE_BODY,e.insertionMode=U.IN_TABLE_BODY,xl(e,t);break}case g.TD:case g.TH:{e.tmplInsertionModeStack[0]=U.IN_ROW,e.insertionMode=U.IN_ROW,_l(e,t);break}default:e.tmplInsertionModeStack[0]=U.IN_BODY,e.insertionMode=U.IN_BODY,un(e,t)}}function GR(e,t){t.tagID===g.TEMPLATE&&Zi(e,t)}function Ay(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):ih(e,t)}function XR(e,t){t.tagID===g.HTML?un(e,t):wl(e,t)}function ky(e,t){var n;if(t.tagID===g.HTML){if(e.fragmentContext||(e.insertionMode=U.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===g.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else wl(e,t)}function wl(e,t){e.insertionMode=U.IN_BODY,yl(e,t)}function QR(e,t){switch(t.tagID){case g.HTML:{un(e,t);break}case g.FRAMESET:{e._insertElement(t,ye.HTML);break}case g.FRAME:{e._appendElement(t,ye.HTML),t.ackSelfClosing=!0;break}case g.NOFRAMES:{or(e,t);break}}}function KR(e,t){t.tagID===g.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==g.FRAMESET&&(e.insertionMode=U.AFTER_FRAMESET))}function JR(e,t){switch(t.tagID){case g.HTML:{un(e,t);break}case g.NOFRAMES:{or(e,t);break}}}function ZR(e,t){t.tagID===g.HTML&&(e.insertionMode=U.AFTER_AFTER_FRAMESET)}function e6(e,t){t.tagID===g.HTML?un(e,t):Sl(e,t)}function Sl(e,t){e.insertionMode=U.IN_BODY,yl(e,t)}function t6(e,t){switch(t.tagID){case g.HTML:{un(e,t);break}case g.NOFRAMES:{or(e,t);break}}}function n6(e,t){t.chars=xt,e._insertCharacters(t)}function r6(e,t){e._insertCharacters(t),e.framesetOk=!1}function Ny(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ye.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function i6(e,t){if(TP(t))Ny(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ye.MATHML?ay(t):r===ye.SVG&&(bP(t),uy(t)),th(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function s6(e,t){if(t.tagID===g.P||t.tagID===g.BR){Ny(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===ye.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}K.AREA,K.BASE,K.BASEFONT,K.BGSOUND,K.BR,K.COL,K.EMBED,K.FRAME,K.HR,K.IMG,K.INPUT,K.KEYGEN,K.LINK,K.META,K.PARAM,K.SOURCE,K.TRACK,K.WBR;const o6=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,a6=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Cy={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Oy(e,t){const n=E6(e),r=$E("type",{handlers:{root:u6,element:l6,text:c6,comment:Py,doctype:d6,raw:h6},unknown:p6}),s={parser:n?new dy(Cy):dy.getFragmentParser(void 0,Cy),handle(c){r(c,s)},stitches:!1,options:t||{}};r(e,s),Ys(s,br());const a=n?s.parser.document:s.parser.getFragment(),u=yI(a,{file:s.options.file});return s.stitches&&hl(u,"comment",function(c,d,f){const p=c;if(p.value.stitch&&f&&d!==void 0){const m=f.children;return m[d]=p.value.stitch,d}}),u.type==="root"&&u.children.length===1&&u.children[0].type===e.type?u.children[0]:u}function Iy(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function u6(e,t){Iy(e.children,t)}function l6(e,t){m6(e,t),Iy(e.children,t),g6(e,t)}function c6(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Qe.CHARACTER,chars:e.value,location:va(e)};Ys(t,br(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function d6(e,t){const n={type:Qe.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:va(e)};Ys(t,br(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function f6(e,t){t.stitches=!0;const n=y6(e);if("children"in e&&"children"in n){const r=Oy({type:"root",children:e.children},t.options);n.children=r.children}Py({type:"comment",value:{stitch:n}},t)}function Py(e,t){const n=e.value,r={type:Qe.COMMENT,data:n,location:va(e)};Ys(t,br(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function h6(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,Ry(t,br(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(o6,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function p6(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))f6(n,t);else{let r="";throw a6.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Ys(e,t){Ry(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Ct.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function Ry(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function m6(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Ct.PLAINTEXT)return;Ys(t,br(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:Ki.html;s===Ki.html&&n==="svg"&&(s=Ki.svg);const a=wI(le(H({},e),{children:[]}),{space:s===Ki.svg?"svg":"html"}),u={type:Qe.START_TAG,tagName:n,tagID:Vs(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:va(e)};t.parser.currentToken=u,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function g6(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&II.includes(n)||t.parser.tokenizer.state===Ct.PLAINTEXT)return;Ys(t,nl(e));const r={type:Qe.END_TAG,tagName:n,tagID:Vs(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:va(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Ct.RCDATA||t.parser.tokenizer.state===Ct.RAWTEXT||t.parser.tokenizer.state===Ct.SCRIPT_DATA)&&(t.parser.tokenizer.state=Ct.DATA)}function E6(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function va(e){const t=br(e)||{line:void 0,column:void 0,offset:void 0},n=nl(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function y6(e){return"children"in e?Qi(le(H({},e),{children:[]})):Qi(e)}function Ly(e){return function(t,n){return Oy(t,le(H({},e),{file:n}))}}const es=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Dy={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...es,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...es],h2:[["className","sr-only"]],img:[...es,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...es,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...es],table:[...es],ul:[...es,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},ci={}.hasOwnProperty;function T6(e,t){let n={type:"root",children:[]};const r={schema:t?H(H({},Dy),t):Dy,stack:[]},s=My(r,e);return s&&(Array.isArray(s)?s.length===1?n=s[0]:n.children=s:n=s),n}function My(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return b6(e,n);case"doctype":return x6(e,n);case"element":return _6(e,n);case"root":return w6(e,n);case"text":return S6(e,n)}}}function b6(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),a={type:"comment",value:r<0?n:n.slice(0,r)};return Aa(a,t),a}}function x6(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Aa(n,t),n}}function _6(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=Fy(e,t.children),s=v6(e,t.properties);e.stack.pop();let a=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&ci.call(e.schema.ancestors,n))){const c=e.schema.ancestors[n];let d=-1;for(a=!1;++d<c.length;)e.stack.includes(c[d])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const u={type:"element",tagName:n,properties:s,children:r};return Aa(u,t),u}function w6(e,t){const r={type:"root",children:Fy(e,t.children)};return Aa(r,t),r}function S6(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Aa(r,t),r}function Fy(e,t){const n=[];if(Array.isArray(t)){const r=t;let s=-1;for(;++s<r.length;){const a=My(e,r[s]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function v6(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,s=e.schema.required,a=r&&ci.call(r,n)?r[n]:void 0,u=r&&ci.call(r,"*")?r["*"]:void 0,c=t&&typeof t=="object"?t:{},d={};let f;for(f in c)if(ci.call(c,f)){const p=c[f];let m=By(e,Hy(a,f),f,p);m==null&&(m=By(e,Hy(u,f),f,p)),m!=null&&(d[f]=m)}if(s&&ci.call(s,n)){const p=s[n];for(f in p)ci.call(p,f)&&!ci.call(d,f)&&(d[f]=p[f])}return d}function By(e,t,n,r){return t?Array.isArray(r)?A6(e,t,n,r):Uy(e,t,n,r):void 0}function A6(e,t,n,r){let s=-1;const a=[];for(;++s<r.length;){const u=Uy(e,t,n,r[s]);(typeof u=="number"||typeof u=="string")&&a.push(u)}return a}function Uy(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&k6(e,n,r)){if(typeof t=="object"&&t.length>1){let s=!1,a=0;for(;++a<t.length;){const u=t[a];if(u&&typeof u=="object"&&"flags"in u){if(u.test(String(r))){s=!0;break}}else if(u===r){s=!0;break}}if(!s)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function k6(e,t,n){const r=e.schema.protocols&&ci.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const s=String(n),a=s.indexOf(":"),u=s.indexOf("?"),c=s.indexOf("#"),d=s.indexOf("/");if(a<0||d>-1&&a>d||u>-1&&a>u||c>-1&&a>c)return!0;let f=-1;for(;++f<r.length;){const p=r[f];if(a===p.length&&s.slice(0,p.length)===p)return!0}return!1}function Aa(e,t){const n=I1(t);t.data&&(e.data=Qi(t.data)),n&&(e.position=n)}function Hy(e,t){let n,r=-1;if(e)for(;++r<e.length;){const s=e[r],a=typeof s=="string"?s:s[0];if(a===t)return s;a==="data*"&&(n=s)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function N6(e){return function(t){return T6(t,e)}}const jy=({globalClassName:e,openLinksInNewTab:t,href:n,title:r,children:s})=>{const a=n?t?"_blank":"_self":void 0;return _.jsx("a",le(H(H({className:M(e,`${O}-link`)},n?{href:n,target:a}:{}),r?{title:r}:{}),{rel:"noopener noreferrer",children:s}))},C6=()=>{const{disclaimerText:e,disclaimerMarkdown:t,globalClassName:n}=at();return!e&&!t?null:_.jsx("div",{className:M(n,`${O}-disclaimer`),children:t?_.jsx(RE,{rehypePlugins:[Ly,N6],components:{ul:({children:r})=>_.jsx("ul",{className:M(n,`${O}-ul`),children:r}),ol:({children:r})=>_.jsx("ol",{className:M(n,`${O}-ol`),children:r}),li:({children:r})=>_.jsx("li",{className:M(n,`${O}-li`),children:r}),a:({href:r,title:s,children:a})=>_.jsx(jy,{globalClassName:n,openLinksInNewTab:!0,href:r,title:s,children:a}),img:({src:r,alt:s})=>_.jsx("img",{className:M(n,`${O}-disclaimer-image`),src:r,alt:s}),p:({children:r})=>_.jsx("p",{className:M(n,`${O}-disclaimer-text`),children:r}),span:({children:r})=>_.jsx("span",{className:M(n,`${O}-disclaimer-text-span`),children:r})},children:t}):_.jsx("p",{className:M(n,`${O}-disclaimer-text`),children:e})})},uh=({className:e,isLoading:t,componentType:n,onSubmit:r})=>{const{isConnected:s,sessionExpired:a}=sn(),{globalClassName:u,searchConfig:c,enableEscalationToAgent:d}=at(),f=B.useRef(null),p=t||!s&&!a,m=B.useRef(t);B.useEffect(()=>{var A;const x=m.current&&!t;m.current=t,x&&!p&&((A=f.current)==null||A.focus({preventScroll:!0}))},[t,p]);const b=x=>{var v;x.preventDefault();const A=(((v=f.current)==null?void 0:v.value)||"").trim();A&&(f.current.value="",r(A))},y=()=>{r("Can you connect me to a human?")};return _.jsxs("div",{className:M(u,e,`cim-${n}-component`,`${O}-search-bar-wrapper`),children:[_.jsxs("form",{className:M(u,e,`cim-${n}-component`,`${O}-search-bar`),name:`${O}-search-form`,onSubmit:b,children:[_.jsx("input",{className:M(u,e,`cim-${n}-component`,`${O}-search-input`),type:"text",ref:f,placeholder:(c==null?void 0:c.placeholder)||"Ask us anything",name:`${O}-user-input`,disabled:p}),_.jsx(aN,{className:e,globalClassName:u,searchConfig:c,componentType:n,isLoading:p}),d&&_.jsx(ir,{className:M(u,`${O}-escalate-btn`),ariaLabel:"Connect to a human agent",title:"Connect to a human agent",disabled:p,onClick:y,icon:_.jsx(Xk,{})})]}),_.jsx(C6,{})]})};function O6(e){return ot({attr:{version:"1.1",viewBox:"0 0 17 17"},child:[{tag:"g",attr:{},child:[]},{tag:"path",attr:{d:"M17 16v1h-17v-1h17zM13.354 8.854l-0.707-0.707-3.646 3.646v-11.793h-1v11.794l-3.647-3.648-0.708 0.708 4.854 4.853 4.854-4.853z"},child:[]}]})(e)}function I6(e){return ot({attr:{version:"1.1",viewBox:"0 0 17 17"},child:[{tag:"g",attr:{},child:[]},{tag:"path",attr:{d:"M6 8h-6v-6h1v4.109c1.013-3.193 4.036-5.484 7.5-5.484 3.506 0 6.621 2.36 7.574 5.739l-0.963 0.271c-0.832-2.95-3.551-5.011-6.611-5.011-3.226 0.001-6.016 2.276-6.708 5.376h4.208v1zM11 9v1h4.208c-0.693 3.101-3.479 5.375-6.708 5.375-3.062 0-5.78-2.061-6.611-5.011l-0.963 0.271c0.952 3.379 4.067 5.739 7.574 5.739 3.459 0 6.475-2.28 7.5-5.482v4.108h1v-6h-6z"},child:[]}]})(e)}const $y=B.createContext({isOpen:!1}),lh=B.createContext(null),zy=B.createContext(null),Ws=()=>{var n,r;const e=B.useContext(lh),t=B.useContext(zy);return(r=(n=e==null?void 0:e.closeMenu)!=null?n:t==null?void 0:t.closeMenu)!=null?r:(()=>{})},Vy=({onClearChat:e,componentType:t})=>{const n=Ws(),r=()=>{e(),n()};return _.jsxs("button",{className:M(`${O}-overflow-menu-button`,"clear-chat-button",`cim-${t}-component`),onClick:r,children:[_.jsx(I6,{}),"Clear chat"]})},qy=({onDownloadTranscript:e,componentType:t})=>{const{logger:n}=at(),r=Ws(),[s,a]=B.useState(!1),u=()=>Ue(null,null,function*(){if(!s){a(!0);try{yield e(),r()}catch(c){n==null||n.error("Error downloading transcript:",c)}finally{a(!1)}}});return _.jsxs("button",{className:M(`${O}-overflow-menu-button`,"download-transcript-button",`cim-${t}-component`),onClick:u,disabled:s,children:[_.jsx(O6,{}),"Download transcript"]})};function P6(e){return e==null?[]:Array.isArray(e)?e:[e]}var R6=(e,...t)=>e.concat(t),L6=(e,...t)=>e.filter(n=>!t.includes(n)),D6=e=>Array.from(new Set(e));function Yy(e,t,n={}){const{step:r=1,loop:s=!0}=n,a=t+r,u=e.length,c=u-1;return t===-1?r>0?0:c:a<0?s?c:0:a>=u?s?0:t>u?u:t:a}function M6(e,t,n={}){const{step:r=1,loop:s=!0}=n;return Yy(e,t,{step:-r,loop:s})}var F6=e=>Array.isArray(e),Wy=e=>e!=null&&typeof e=="object",B6=e=>Wy(e)&&!F6(e),vl=e=>typeof e=="string",Gs=e=>typeof e=="function",U6=e=>e==null,H6=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),j6=e=>Object.prototype.toString.call(e),Gy=Function.prototype.toString,$6=Gy.call(Object),z6=e=>{if(!Wy(e)||j6(e)!="[object Object]"||Y6(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=H6(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Gy.call(n)==$6},V6=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,q6=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,Y6=e=>V6(e)||q6(e),W6=e=>e(),G6=()=>{},ch=(...e)=>(...t)=>{e.forEach(function(n){n==null||n(...t)})};function X6(e,t=0){let n=0,r=null;return((...s)=>{const a=Date.now(),u=a-n;u>=t?(r&&(clearTimeout(r),r=null),e(...s),n=a):r||(r=setTimeout(()=>{e(...s),n=Date.now(),r=null},t-u))})}var{min:Q6,max:K6}=Math,J6=e=>Number.isNaN(e),Z6=e=>J6(e)?0:e,Xy=(e,t,n)=>Q6(K6(Z6(e),t),n);function dh(e){if(!z6(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const s=e[r];s!==void 0&&(n[r]=dh(s))}return n}function fh(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function e4(e,t){if(e==null)throw new Error(t())}function t4(e,t,n){let r=[];for(const s of t)e[s]==null&&r.push(s);if(r.length>0)throw new Error(`[zag-js${` > ${n}`}] missing required props: ${r.join(", ")}`)}var n4=Object.defineProperty,r4=(e,t,n)=>t in e?n4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hh=(e,t,n)=>r4(e,typeof t!="symbol"?t+"":t,n),Qy=()=>{},Al=e=>typeof e=="object"&&e!==null,Xs=e=>e?"":void 0,Ky=e=>e?"true":void 0,i4=1,s4=9,o4=11,$t=e=>Al(e)&&e.nodeType===i4&&typeof e.nodeName=="string",kl=e=>Al(e)&&e.nodeType===s4,a4=e=>Al(e)&&e===e.window,Jy=e=>$t(e)?e.localName||"":"#document";function u4(e){return["html","body","#document"].includes(Jy(e))}var l4=e=>Al(e)&&e.nodeType!==void 0,ts=e=>l4(e)&&e.nodeType===o4&&"host"in e,c4=e=>$t(e)&&e.localName==="input",d4=e=>$t(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function ka(e){if(!e)return!1;const t=e.getRootNode();return Js(t)===e}var f4=/(textarea|select)/;function h4(e){if(e==null||!$t(e))return!1;try{return c4(e)&&e.selectionStart!=null||f4.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch(t){return!1}}function Qs(e,t){var r;if(!e||!t||!$t(e)||!$t(t))return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e===t||e.contains(t))return!0;if(n&&ts(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function wr(e){var t;return kl(e)?e:a4(e)?e.document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function p4(e){return wr(e).documentElement}function Ks(e){var t,n,r;return ts(e)?Ks(e.host):kl(e)?(t=e.defaultView)!=null?t:window:$t(e)&&(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window}function Js(e){let t=e.activeElement;for(;t!=null&&t.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n||n===t)break;t=n}return t}function m4(e){if(Jy(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ts(e)&&e.host||p4(e);return ts(t)?t.host:t}function ph(e){var n;let t;try{if(t=e.getRootNode({composed:!0}),kl(t)||ts(t))return t}catch(r){}return(n=e.ownerDocument)!=null?n:document}var mh=new WeakMap;function Zs(e){return mh.has(e)||mh.set(e,Ks(e).getComputedStyle(e)),mh.get(e)}var gh=new Set(["menu","listbox","dialog","grid","tree","region"]),g4=e=>gh.has(e),Zy=e=>{var t;return((t=e.getAttribute("aria-controls"))==null?void 0:t.split(" "))||[]};function eT(e,t){const n=new Set,r=ph(e),s=a=>{const u=a.querySelectorAll("[aria-controls]");for(const c of u){if(c.getAttribute("aria-expanded")!=="true")continue;const d=Zy(c);for(const f of d){if(!f||n.has(f))continue;n.add(f);const p=r.getElementById(f);if(p){const m=p.getAttribute("role"),b=p.getAttribute("aria-modal")==="true";if(m&&g4(m)&&!b&&(p===t||p.contains(t)||s(p)))return!0}}}return!1};return s(e)}function tT(e,t){const n=ph(e),r=new Set,s=a=>{const u=a.querySelectorAll("[aria-controls]");for(const c of u){if(c.getAttribute("aria-expanded")!=="true")continue;const d=Zy(c);for(const f of d){if(!f||r.has(f))continue;r.add(f);const p=n.getElementById(f);if(p){const m=p.getAttribute("role"),b=p.getAttribute("aria-modal")==="true";m&&gh.has(m)&&!b&&(t(p),s(p))}}}};s(e)}function E4(e){const t=new Set;return tT(e,n=>{e.contains(n)||t.add(n)}),Array.from(t)}function y4(e){const t=e.getAttribute("role");return!!(t&&gh.has(t))}function T4(e){return e.hasAttribute("aria-controls")&&e.getAttribute("aria-expanded")==="true"}function b4(e){var t;return T4(e)?!0:!!((t=e.querySelector)!=null&&t.call(e,'[aria-controls][aria-expanded="true"]'))}function x4(e){if(!e.id)return!1;const t=ph(e),n=CSS.escape(e.id),r=`[aria-controls~="${n}"][aria-expanded="true"], [aria-controls="${n}"][aria-expanded="true"]`;return!!(t.querySelector(r)&&y4(e))}var Eh=()=>typeof document!="undefined";function _4(){var t;const e=navigator.userAgentData;return(t=e==null?void 0:e.platform)!=null?t:navigator.platform}var yh=e=>Eh()&&e.test(_4()),w4=e=>Eh()&&e.test(navigator.vendor),nT=()=>Eh()&&!!navigator.maxTouchPoints,S4=()=>yh(/^iPhone/i),v4=()=>yh(/^iPad/i)||Th()&&navigator.maxTouchPoints>1,Nl=()=>S4()||v4(),A4=()=>Th()||Nl(),Th=()=>yh(/^Mac/i),k4=()=>A4()&&w4(/apple/i);function N4(e){var t,n,r,s;return(s=(t=e.composedPath)==null?void 0:t.call(e))!=null?s:(r=(n=e.nativeEvent)==null?void 0:n.composedPath)==null?void 0:r.call(n)}function ar(e){var n;const t=N4(e);return(n=t==null?void 0:t[0])!=null?n:e.target}var rT=e=>e.button===0,C4=e=>e.button===2||Th()&&e.ctrlKey&&e.button===0,O4=e=>"touches"in e&&e.touches.length>0,I4={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},iT={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function P4(e,t={}){var u;const{dir:n="ltr",orientation:r="horizontal"}=t;let s=e.key;return s=(u=I4[s])!=null?u:s,n==="rtl"&&r==="horizontal"&&s in iT&&(s=iT[s]),s}function sT(e,t="client"){const n=O4(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var zt=(e,t,n,r)=>{const s=typeof e=="function"?e():e;return s==null||s.addEventListener(t,n,r),()=>{s==null||s.removeEventListener(t,n,r)}},oT=e=>$t(e)&&e.tagName==="IFRAME",R4=/^(audio|video|details)$/;function aT(e){const t=e.getAttribute("tabindex");return t?parseInt(t,10):NaN}var L4=e=>!Number.isNaN(aT(e)),D4=e=>aT(e)<0;function M4(e,t){if(!t)return null;if(t===!0)return e.shadowRoot||null;const n=t(e);return(n===!0?e.shadowRoot:n)||null}function uT(e,t,n){const r=[...e],s=[...e],a=new Set,u=new Map;e.forEach((d,f)=>u.set(d,f));let c=0;for(;c<s.length;){const d=s[c++];if(!d||a.has(d))continue;a.add(d);const f=M4(d,t);if(f){const p=Array.from(f.querySelectorAll(Cl)).filter(n),m=u.get(d);if(m!==void 0){const b=m+1;r.splice(b,0,...p),p.forEach((y,x)=>{u.set(y,b+x)});for(let y=b+p.length;y<r.length;y++)u.set(r[y],y)}else{const b=r.length;r.push(...p),p.forEach((y,x)=>{u.set(y,b+x)})}s.push(...p)}}return r}var Cl="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type",lT=(e,t={})=>{if(!e)return[];const{includeContainer:n=!1,getShadowRoot:r}=t,s=Array.from(e.querySelectorAll(Cl));(n==!0||n=="if-empty"&&s.length===0)&&$t(e)&&Sr(e)&&s.unshift(e);const u=[];for(const c of s)if(Sr(c)){if(oT(c)&&c.contentDocument){const d=c.contentDocument.body;u.push(...lT(d,{getShadowRoot:r}));continue}u.push(c)}return r?uT(u,r,Sr):u};function Sr(e){return!$t(e)||e.closest("[inert]")?!1:e.matches(Cl)&&d4(e)}function eo(e,t={}){if(!e)return[];const{includeContainer:n,getShadowRoot:r}=t,s=Array.from(e.querySelectorAll(Cl));n&&ns(e)&&s.unshift(e);const a=[];for(const u of s)if(ns(u)){if(oT(u)&&u.contentDocument){const c=u.contentDocument.body;a.push(...eo(c,{getShadowRoot:r}));continue}a.push(u)}if(r){const u=uT(a,r,ns);return!u.length&&n?s:u}return!a.length&&n?s:a}function ns(e){return $t(e)&&e.tabIndex>0?!0:Sr(e)&&!D4(e)}function F4(e,t={}){const n=eo(e,t),r=n[0]||null,s=n[n.length-1]||null;return[r,s]}function B4(e,t={}){const{current:n,getShadowRoot:r}=t,s=eo(e,{getShadowRoot:r}),a=(e==null?void 0:e.ownerDocument)||document,u=n!=null?n:Js(a);if(!u)return null;const c=s.indexOf(u);return s[c+1]||null}function Na(e){return e.tabIndex<0&&(R4.test(e.localName)||h4(e))&&!L4(e)?0:e.tabIndex}function cT(e){const{root:t,getInitialEl:n,filter:r,enabled:s=!0}=e;if(!s)return;let a=null;if(a||(a=typeof n=="function"?n():n),a||(a=t==null?void 0:t.querySelector("[data-autofocus],[autofocus]")),!a){const u=eo(t);a=r?u.filter(r)[0]:u[0]}return a||t||void 0}var U4=class y2{constructor(){hh(this,"id",null),hh(this,"fn_cleanup"),hh(this,"cleanup",()=>{this.cancel()})}static create(){return new y2}request(t){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=t==null?void 0:t()})}cancel(){var t;this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),(t=this.fn_cleanup)==null||t.call(this),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function Mt(e){const t=U4.create();return t.request(e),t.cleanup}function dT(e){const t=new Set;function n(r){const s=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(s))}return n(()=>n(e)),function(){t.forEach(s=>s())}}function bh(e){const t=m4(e);return u4(t)?wr(t).body:$t(t)&&$4(t)?t:bh(t)}var H4=/auto|scroll|overlay|hidden|clip/,j4=new Set(["inline","contents"]);function $4(e){const t=Ks(e),{overflow:n,overflowX:r,overflowY:s,display:a}=t.getComputedStyle(e);return H4.test(n+s+r)&&!j4.has(a)}var to="default",xh="",Ol=new WeakMap;function z4(e={}){const{target:t,doc:n}=e,r=n!=null?n:document,s=r.documentElement;return Nl()?(to==="default"&&(xh=s.style.webkitUserSelect,s.style.webkitUserSelect="none"),to="disabled"):t&&(Ol.set(t,t.style.userSelect),t.style.userSelect="none"),()=>V4({target:t,doc:r})}function V4(e={}){const{target:t,doc:n}=e,s=(n!=null?n:document).documentElement;if(Nl()){if(to!=="disabled")return;to="restoring",setTimeout(()=>{dT(()=>{to==="restoring"&&(s.style.webkitUserSelect==="none"&&(s.style.webkitUserSelect=xh||""),xh="",to="default")})},300)}else if(t&&Ol.has(t)){const a=Ol.get(t);t.style.userSelect==="none"&&(t.style.userSelect=a!=null?a:""),t.getAttribute("style")===""&&t.removeAttribute("style"),Ol.delete(t)}}function q4(e={}){const u=e,{defer:t,target:n}=u,r=yn(u,["defer","target"]),s=t?Mt:c=>c(),a=[];return a.push(s(()=>{const c=typeof n=="function"?n():n;a.push(z4(le(H({},r),{target:c})))})),()=>{a.forEach(c=>c==null?void 0:c())}}function Y4(e,t){const{onPointerMove:n,onPointerUp:r}=t,s=c=>{const d=sT(c),f=Math.sqrt(fd(d.x,2)+fd(d.y,2)),p=c.pointerType==="touch"?10:5;if(!(f<p)){if(c.pointerType==="mouse"&&c.button===0){a(c);return}n({point:d,event:c})}},a=c=>{const d=sT(c);r({point:d,event:c})},u=[zt(e,"pointermove",s,!1),zt(e,"pointerup",a,!1),zt(e,"pointercancel",a,!1),zt(e,"contextmenu",a,!1),q4({doc:e})];return()=>{u.forEach(c=>c())}}function W4(e,t={}){const{triggerElement:n,onFocus:r,onFocusEnter:s,getShadowRoot:a}=t,u=(e==null?void 0:e.ownerDocument)||document,c=u.body;function d(f){if(f.key!=="Tab")return;let p=null;const[m,b]=F4(e,{includeContainer:!0,getShadowRoot:a}),y=B4(c,{current:n,getShadowRoot:a}),x=!m&&!b;f.shiftKey&&ka(y)?(s==null||s(),p=b):f.shiftKey&&(ka(m)||x)?p=n:!f.shiftKey&&ka(n)?(s==null||s(),p=m):!f.shiftKey&&(ka(b)||x)&&(p=y),p&&(f.preventDefault(),typeof r=="function"?r(p):p.focus())}return zt(u,"keydown",d,!0)}function G4(e,t){const c=t,{defer:n,triggerElement:r}=c,s=yn(c,["defer","triggerElement"]),a=n?Mt:d=>d(),u=[];return u.push(a(()=>{const d=typeof e=="function"?e():e,f=typeof r=="function"?r():r;u.push(W4(d,H({triggerElement:f},s)))})),()=>{u.forEach(d=>d==null?void 0:d())}}function X4(e,t){var n;return Array.from((n=e==null?void 0:e.querySelectorAll(t))!=null?n:[])}function Il(e,t){if(!e)return Qy;const n=Object.keys(t).reduce((r,s)=>(r[s]=e.style.getPropertyValue(s),r),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")}}function Q4(e,t,n){if(!e)return Qy;const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r),e.style.length===0&&e.removeAttribute("style")}}function K4(e,t,n){const{signal:r}=t;return[new Promise((u,c)=>{const d=setTimeout(()=>{c(new Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener("abort",()=>{clearTimeout(d),c(new Error("Promise aborted"))}),e.then(f=>{r.aborted||(clearTimeout(d),u(f))}).catch(f=>{r.aborted||(clearTimeout(d),c(f))})}),()=>t.abort()]}function J4(e,t){const{timeout:n,rootNode:r}=t,s=Ks(r),a=wr(r),u=new s.AbortController;return K4(new Promise(c=>{const d=e();if(d){c(d);return}const f=new s.MutationObserver(()=>{const p=e();p&&p.isConnected&&(f.disconnect(),c(p))});f.observe(a.body,{childList:!0,subtree:!0})}),u,n)}var Z4=(...e)=>e.map(t=>{var n;return(n=t==null?void 0:t.trim)==null?void 0:n.call(t)}).filter(Boolean).join(" "),eL=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,fT=e=>{const t={};let n;for(;n=eL.exec(e);)t[n[1]]=n[2];return t},tL=(e,t)=>{if(vl(e)){if(vl(t))return`${e};${t}`;e=fT(e)}else vl(t)&&(t=fT(t));return Object.assign({},e!=null?e:{},t!=null?t:{})};function Ft(...e){let t={};for(let n of e){if(!n)continue;for(let s in t){if(s.startsWith("on")&&typeof t[s]=="function"&&typeof n[s]=="function"){t[s]=ch(n[s],t[s]);continue}if(s==="className"||s==="class"){t[s]=Z4(t[s],n[s]);continue}if(s==="style"){t[s]=tL(t[s],n[s]);continue}t[s]=n[s]!==void 0?n[s]:t[s]}for(let s in n)t[s]===void 0&&(t[s]=n[s]);const r=Object.getOwnPropertySymbols(n);for(let s of r)t[s]=n[s]}return t}function pU(e){return e}var no=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(no||{}),_h="__init__";function nL(e){const t=()=>{var u,c;return(c=(u=e.getRootNode)==null?void 0:u.call(e))!=null?c:document},n=()=>wr(t()),r=()=>{var u;return(u=n().defaultView)!=null?u:window},s=()=>Js(t()),a=u=>t().getElementById(u);return le(H({},e),{getRootNode:t,getDoc:n,getWin:r,getActiveElement:s,isActiveElement:ka,getById:a})}function rL(e){return new Proxy({},{get(t,n){return n==="style"?r=>e({style:r}).style:e}})}var ro=()=>e=>Array.from(new Set(e)),hT=typeof globalThis.document!="undefined"?B.useLayoutEffect:B.useEffect;function Pl(e){var m,b;const t=(m=e().value)!=null?m:e().defaultValue,n=(b=e().isEqual)!=null?b:Object.is,[r]=B.useState(t),[s,a]=B.useState(r),u=e().value!==void 0,c=B.useRef(s);c.current=u?e().value:s;const d=B.useRef(c.current);hT(()=>{d.current=c.current},[s,e().value]);const f=y=>{var v,w;const x=d.current,A=Gs(y)?y(x):y;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:A,prev:x}),u||a(A),n(A,x)||(w=(v=e()).onChange)==null||w.call(v,A,x)};function p(){return u?e().value:s}return{initial:r,ref:c,get:p,set(y){(e().sync?Fs.flushSync:W6)(()=>f(y))},invoke(y,x){var A,v;(v=(A=e()).onChange)==null||v.call(A,y,x)},hash(y){var x,A,v;return(v=(A=(x=e()).hash)==null?void 0:A.call(x,y))!=null?v:String(y)}}}Pl.cleanup=e=>{B.useEffect(()=>e,[])},Pl.ref=e=>{const t=B.useRef(e);return{get:()=>t.current,set:n=>{t.current=n}}};function iL(e){const t=B.useRef(e);return{get(n){return t.current[n]},set(n,r){t.current[n]=r}}}var sL=(e,t)=>{const n=B.useRef(!1),r=B.useRef(!1);B.useEffect(()=>{if(n.current&&r.current)return t();r.current=!0},[...(e!=null?e:[]).map(s=>typeof s=="function"?s():s)]),B.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function Rl(e,t={}){var ae,oe,pe,ce,se,Ae;const n=B.useMemo(()=>{const{id:re,ids:Y,getRootNode:ie}=t;return nL({id:re,ids:Y,getRootNode:ie})},[t]),r=(...re)=>{e.debug&&console.log(...re)},s=(oe=(ae=e.props)==null?void 0:ae.call(e,{props:dh(t),scope:n}))!=null?oe:t,a=oL(s),u=(pe=e.context)==null?void 0:pe.call(e,{prop:a,bindable:Pl,scope:n,flush:mT,getContext(){return d},getComputed(){return X},getRefs(){return A},getEvent(){return y()}}),c=pT(u),d={get(re){var Y;return(Y=c.current)==null?void 0:Y[re].ref.current},set(re,Y){var ie;(ie=c.current)==null||ie[re].set(Y)},initial(re){var Y;return(Y=c.current)==null?void 0:Y[re].initial},hash(re){var ie,k;const Y=(ie=c.current)==null?void 0:ie[re].get();return(k=c.current)==null?void 0:k[re].hash(Y)}},f=B.useRef(new Map),p=B.useRef(null),m=B.useRef(null),b=B.useRef({type:""}),y=()=>le(H({},b.current),{current(){return b.current},previous(){return m.current}}),x=()=>le(H({},L),{matches(...re){return re.includes(L.ref.current)},hasTag(re){var Y,ie;return!!((ie=(Y=e.states[L.ref.current])==null?void 0:Y.tags)!=null&&ie.includes(re))}}),A=iL((se=(ce=e.refs)==null?void 0:ce.call(e,{prop:a,context:d}))!=null?se:{}),v=()=>({state:x(),context:d,event:y(),prop:a,send:z,action:w,guard:N,track:sL,refs:A,computed:X,flush:mT,scope:n,choose:j}),w=re=>{const Y=Gs(re)?re(v()):re;if(!Y)return;const ie=Y.map(k=>{var Z,P;const D=(P=(Z=e.implementations)==null?void 0:Z.actions)==null?void 0:P[k];return D||fh(`[zag-js] No implementation found for action "${JSON.stringify(k)}"`),D});for(const k of ie)k==null||k(v())},N=re=>{var Y,ie;return Gs(re)?re(v()):(ie=(Y=e.implementations)==null?void 0:Y.guards)==null?void 0:ie[re](v())},C=re=>{const Y=Gs(re)?re(v()):re;if(!Y)return;const ie=Y.map(D=>{var P,ke;const Z=(ke=(P=e.implementations)==null?void 0:P.effects)==null?void 0:ke[D];return Z||fh(`[zag-js] No implementation found for effect "${JSON.stringify(D)}"`),Z}),k=[];for(const D of ie){const Z=D==null?void 0:D(v());Z&&k.push(Z)}return()=>k.forEach(D=>D==null?void 0:D())},j=re=>P6(re).find(Y=>{let ie=!Y.guard;return vl(Y.guard)?ie=!!N(Y.guard):Gs(Y.guard)&&(ie=Y.guard(v())),ie}),X=re=>{e4(e.computed,()=>"[zag-js] No computed object found on machine");const Y=e.computed[re];return Y({context:d,event:y(),prop:a,refs:A,scope:n,computed:X})},L=Pl(()=>({defaultValue:e.initialState({prop:a}),onChange(re,Y){var k,D,Z,P;if(Y){const ke=f.current.get(Y);ke==null||ke(),f.current.delete(Y)}Y&&w((k=e.states[Y])==null?void 0:k.exit),w((D=p.current)==null?void 0:D.actions);const ie=C((Z=e.states[re])==null?void 0:Z.effects);if(ie&&f.current.set(re,ie),Y===_h){w(e.entry);const ke=C(e.effects);ke&&f.current.set(_h,ke)}w((P=e.states[re])==null?void 0:P.entry)}})),G=B.useRef(void 0),ne=B.useRef(no.NotStarted);hT(()=>{queueMicrotask(()=>{var D;const ie=ne.current===no.Started;ne.current=no.Started,r(ie?"rehydrating...":"initializing...");const k=(D=G.current)!=null?D:L.initial;L.invoke(k,ie?L.get():_h)});const re=f.current,Y=L.ref.current;return()=>{r("unmounting..."),G.current=Y,ne.current=no.Stopped,re.forEach(ie=>ie==null?void 0:ie()),f.current=new Map,p.current=null,queueMicrotask(()=>{w(e.exit)})}},[]);const de=()=>"ref"in L?L.ref.current:L.get(),z=re=>{queueMicrotask(()=>{var P,ke,Ce,ge,Le;if(ne.current!==no.Started)return;m.current=b.current,b.current=re;let Y=de();const ie=(Ce=(P=e.states[Y].on)==null?void 0:P[re.type])!=null?Ce:(ke=e.on)==null?void 0:ke[re.type],k=j(ie);if(!k)return;p.current=k;const D=(ge=k.target)!=null?ge:Y;r("transition",re.type,k.target||Y,`(${k.actions})`);const Z=D!==Y;Z?Fs.flushSync(()=>L.set(D)):k.reenter&&!Z?L.invoke(Y,Y):w((Le=k.actions)!=null?Le:[])})};return(Ae=e.watch)==null||Ae.call(e,v()),{state:x(),send:z,context:d,prop:a,scope:n,refs:A,computed:X,event:y(),getStatus:()=>ne.current}}function pT(e){const t=B.useRef(e);return t.current=e,t}function oL(e){const t=pT(e);return function(r){return t.current[r]}}function mT(e){queueMicrotask(()=>{Fs.flushSync(()=>e())})}var wh=rL(e=>e);function Ll(...e){return t=>{const n=[];for(const r of e)if(typeof r=="function"){const s=r(t);typeof s=="function"&&n.push(s)}else r&&(r.current=t);if(n.length)return()=>{for(const r of n)r()}}}function aL(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Sh=e=>{const t=B.memo(B.forwardRef((n,r)=>{const f=n,{asChild:s,children:a}=f,u=yn(f,["asChild","children"]);if(!s)return B.createElement(e,le(H({},u),{ref:r}),a);if(!B.isValidElement(a))return null;const c=B.Children.only(a),d=aL(c);return B.cloneElement(c,le(H({},Ft(u,c.props)),{ref:r?Ll(r,d):d}))}));return t.displayName=e.displayName||e.name,t},ln=(()=>{const e=new Map;return new Proxy(Sh,{apply(t,n,r){return Sh(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,Sh(r)),e.get(r)}})})();function uL(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function rs(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:s="Provider",errorMessage:a,defaultValue:u}=e,c=B.createContext(u);c.displayName=t;function d(){var p;const f=B.useContext(c);if(!f&&n){const m=new Error(a!=null?a:uL(r,s));throw m.name="ContextError",(p=Error.captureStackTrace)==null||p.call(Error,m,d),m}return f}return[c.Provider,d,c]}const[lL,vh]=rs({name:"PopoverContext",hookName:"usePopoverContext",providerName:"<PopoverProvider />"}),[gT,Ca]=rs({name:"PresenceContext",hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),ET=B.forwardRef((e,t)=>{const n=vh(),r=Ca(),s=Ft(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:_.jsx(ln.div,le(H({},s),{ref:Ll(r.ref,t)}))});ET.displayName="PopoverContent";const yT=B.forwardRef((e,t)=>{const n=vh(),r=Ca(),s=Ft(n.getPositionerProps(),e);return r.unmounted?null:_.jsx(ln.div,le(H({},s),{ref:t}))});yT.displayName="PopoverPositioner";const Oa=()=>(e,t)=>t.reduce((n,r)=>{const[s,a]=n,u=r;return a[u]!==void 0&&(s[u]=a[u]),delete a[u],[s,a]},[{},H({},e)]),TT=e=>Oa()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]);function cL(e,t){const{state:n,send:r,context:s}=e,a=n.matches("mounted","unmountSuspended");return{skip:!s.get("initial"),present:a,setNode(u){u&&r({type:"NODE.SET",node:u})},unmount(){r({type:"UNMOUNT"})}}}var dL={props({props:e}){return le(H({},e),{present:!!e.present})},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["clearInitial","cleanupNode"],watch({track:e,prop:t,send:n}){e([()=>t("present")],()=>{n({type:"PRESENCE.CHANGED"})})},on:{"NODE.SET":{actions:["setupNode"]},"PRESENCE.CHANGED":{actions:["setInitial","syncPresence"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},clearInitial:({context:e})=>{e.set("initial",!1)},invokeOnExitComplete:({prop:e})=>{var t;(t=e("onExitComplete"))==null||t()},setupNode:({refs:e,event:t})=>{e.get("node")!==t.node&&(e.set("node",t.node),e.set("styles",Zs(t.node)))},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{const s=r("present");if(s)return n({type:"MOUNT",src:"presence.changed"});const a=t.get("node");if(!s&&(a==null?void 0:a.ownerDocument.visibilityState)==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});Mt(()=>{var c,d;const u=Dl(t.get("styles"));e.set("unmountAnimationName",u),u==="none"||u===e.get("prevAnimationName")||((c=t.get("styles"))==null?void 0:c.display)==="none"||((d=t.get("styles"))==null?void 0:d.animationDuration)==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{Mt(()=>{e.set("prevAnimationName",Dl(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:r})=>{const s=t.get("node");if(!s)return;const a=d=>{var p,m,b;((b=(m=(p=d.composedPath)==null?void 0:p.call(d))==null?void 0:m[0])!=null?b:d.target)===s&&e.set("prevAnimationName",Dl(t.get("styles")))},u=d=>{const f=Dl(t.get("styles"));ar(d)===s&&f===e.get("unmountAnimationName")&&!r("present")&&n({type:"UNMOUNT",src:"animationend"})};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",u),s.addEventListener("animationend",u);const c=Il(s,{animationFillMode:"forwards"});return()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",u),s.removeEventListener("animationend",u),dT(()=>c())}}}}};function Dl(e){return(e==null?void 0:e.animationName)||"none"}ro()(["onExitComplete","present","immediate"]);function fL(e,t={}){const{sync:n=!1}=t,r=hL(e);return B.useCallback((...s)=>{var a;return n?queueMicrotask(()=>{var u;return(u=r.current)==null?void 0:u.call(r,...s)}):(a=r.current)==null?void 0:a.call(r,...s)},[n,r])}function hL(e){const t=B.useRef(e);return t.current=e,t}const Ah=(e={})=>{const b=e,{lazyMount:t,unmountOnExit:n,present:r,skipAnimationOnMount:s=!1}=b,a=yn(b,["lazyMount","unmountOnExit","present","skipAnimationOnMount"]),u=B.useRef(!1),c=le(H({},a),{present:r,onExitComplete:fL(e.onExitComplete)}),d=Rl(dL,c),f=cL(d);f.present&&(u.current=!0);const p=!f.present&&!u.current&&t||n&&!f.present&&u.current,m=()=>({"data-state":f.skip&&s?void 0:r?"open":"closed",hidden:!f.present});return{ref:f.setNode,getPresenceProps:m,present:f.present,unmounted:p}};var is=(e,t=[])=>({parts:(...n)=>{if(pL(t))return is(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>is(e,[...t,...n]),omit:(...n)=>is(e,t.filter(r=>!n.includes(r))),rename:n=>is(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${io(e)}"][data-part="${io(r)}"]`,`& [data-scope="${io(e)}"][data-part="${io(r)}"]`].join(", "),attrs:{"data-scope":io(e),"data-part":io(r)}}}),{})}),io=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),pL=e=>e.length===0;const mL=["top","right","bottom","left"],di=Math.min,Hr=Math.max,Ml=Math.round,Fl=Math.floor,vr=e=>({x:e,y:e}),gL={left:"right",right:"left",bottom:"top",top:"bottom"};function bT(e,t,n){return Hr(e,di(t,n))}function jr(e,t){return typeof e=="function"?e(t):e}function fi(e){return e.split("-")[0]}function so(e){return e.split("-")[1]}function kh(e){return e==="x"?"y":"x"}function Nh(e){return e==="y"?"height":"width"}function Ar(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ch(e){return kh(Ar(e))}function EL(e,t,n){n===void 0&&(n=!1);const r=so(e),s=Ch(e),a=Nh(s);let u=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(u=Bl(u)),[u,Bl(u)]}function yL(e){const t=Bl(e);return[Oh(e),t,Oh(t)]}function Oh(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const xT=["left","right"],_T=["right","left"],TL=["top","bottom"],bL=["bottom","top"];function xL(e,t,n){switch(e){case"top":case"bottom":return n?t?_T:xT:t?xT:_T;case"left":case"right":return t?TL:bL;default:return[]}}function _L(e,t,n,r){const s=so(e);let a=xL(fi(e),n==="start",r);return s&&(a=a.map(u=>u+"-"+s),t&&(a=a.concat(a.map(Oh)))),a}function Bl(e){const t=fi(e);return gL[t]+e.slice(t.length)}function wL(e){var t,n,r,s;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(s=e.left)!=null?s:0}}function wT(e){return typeof e!="number"?wL(e):{top:e,right:e,bottom:e,left:e}}function Ul(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function ST(e,t,n){let{reference:r,floating:s}=e;const a=Ar(t),u=Ch(t),c=Nh(u),d=fi(t),f=a==="y",p=r.x+r.width/2-s.width/2,m=r.y+r.height/2-s.height/2,b=r[c]/2-s[c]/2;let y;switch(d){case"top":y={x:p,y:r.y-s.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:m};break;case"left":y={x:r.x-s.width,y:m};break;default:y={x:r.x,y:r.y}}const x=so(t);return x&&(y[u]+=b*(x==="end"?1:-1)*(n&&f?-1:1)),y}function SL(e,t){return Ue(this,null,function*(){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:u,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:b=!1,padding:y=0}=jr(t,e),x=wT(y),v=c[b?m==="floating"?"reference":"floating":m],w=Ul(yield a.getClippingRect({element:(n=yield a.isElement==null?void 0:a.isElement(v))==null||n?v:v.contextElement||(yield a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:d})),N=m==="floating"?{x:r,y:s,width:u.floating.width,height:u.floating.height}:u.reference,C=yield a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating),j=(yield a.isElement==null?void 0:a.isElement(C))&&(yield a.getScale==null?void 0:a.getScale(C))||{x:1,y:1},X=Ul(a.convertOffsetParentRelativeRectToViewportRelativeRect?yield a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:N,offsetParent:C,strategy:d}):N);return{top:(w.top-X.top+x.top)/j.y,bottom:(X.bottom-w.bottom+x.bottom)/j.y,left:(w.left-X.left+x.left)/j.x,right:(X.right-w.right+x.right)/j.x}})}const vL=50,AL=(e,t,n)=>Ue(null,null,function*(){const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:u}=n,c=u.detectOverflow?u:le(H({},u),{detectOverflow:SL}),d=yield u.isRTL==null?void 0:u.isRTL(t);let f=yield u.getElementRects({reference:e,floating:t,strategy:s}),{x:p,y:m}=ST(f,r,d),b=r,y=0;const x={};for(let A=0;A<a.length;A++){const v=a[A];if(!v)continue;const{name:w,fn:N}=v,{x:C,y:j,data:X,reset:L}=yield N({x:p,y:m,initialPlacement:r,placement:b,strategy:s,middlewareData:x,rects:f,platform:c,elements:{reference:e,floating:t}});p=C!=null?C:p,m=j!=null?j:m,x[w]=H(H({},x[w]),X),L&&y<vL&&(y++,typeof L=="object"&&(L.placement&&(b=L.placement),L.rects&&(f=L.rects===!0?yield u.getElementRects({reference:e,floating:t,strategy:s}):L.rects),{x:p,y:m}=ST(f,b,d)),A=-1)}return{x:p,y:m,placement:b,strategy:s,middlewareData:x}}),kL=e=>({name:"arrow",options:e,fn(n){return Ue(this,null,function*(){const{x:r,y:s,placement:a,rects:u,platform:c,elements:d,middlewareData:f}=n,{element:p,padding:m=0}=jr(e,n)||{};if(p==null)return{};const b=wT(m),y={x:r,y:s},x=Ch(a),A=Nh(x),v=yield c.getDimensions(p),w=x==="y",N=w?"top":"left",C=w?"bottom":"right",j=w?"clientHeight":"clientWidth",X=u.reference[A]+u.reference[x]-y[x]-u.floating[A],L=y[x]-u.reference[x],G=yield c.getOffsetParent==null?void 0:c.getOffsetParent(p);let ne=G?G[j]:0;(!ne||!(yield c.isElement==null?void 0:c.isElement(G)))&&(ne=d.floating[j]||u.floating[A]);const de=X/2-L/2,z=ne/2-v[A]/2-1,ae=di(b[N],z),oe=di(b[C],z),pe=ne-v[A]-oe,ce=ne/2-v[A]/2+de,se=bT(ae,ce,pe),Ae=!f.arrow&&so(a)!=null&&ce!==se&&u.reference[A]/2-(ce<ae?ae:oe)-v[A]/2<0,re=Ae?ce<ae?ce-ae:ce-pe:0;return{[x]:y[x]+re,data:H({[x]:se,centerOffset:ce-se-re},Ae&&{alignmentOffset:re}),reset:Ae}})}}),NL=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(n){return Ue(this,null,function*(){var r,s;const{placement:a,middlewareData:u,rects:c,initialPlacement:d,platform:f,elements:p}=n,se=jr(e,n),{mainAxis:m=!0,crossAxis:b=!0,fallbackPlacements:y,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:v=!0}=se,w=yn(se,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((r=u.arrow)!=null&&r.alignmentOffset)return{};const N=fi(a),C=Ar(d),j=fi(d)===d,X=yield f.isRTL==null?void 0:f.isRTL(p.floating),L=y||(j||!v?[Bl(d)]:yL(d)),G=A!=="none";!y&&G&&L.push(..._L(d,v,A,X));const ne=[d,...L],de=yield f.detectOverflow(n,w),z=[];let ae=((s=u.flip)==null?void 0:s.overflows)||[];if(m&&z.push(de[N]),b){const Ae=EL(a,c,X);z.push(de[Ae[0]],de[Ae[1]])}if(ae=[...ae,{placement:a,overflows:z}],!z.every(Ae=>Ae<=0)){var oe,pe;const Ae=(((oe=u.flip)==null?void 0:oe.index)||0)+1,re=ne[Ae];if(re&&(!(b==="alignment"?C!==Ar(re):!1)||ae.every(k=>Ar(k.placement)===C?k.overflows[0]>0:!0)))return{data:{index:Ae,overflows:ae},reset:{placement:re}};let Y=(pe=ae.filter(ie=>ie.overflows[0]<=0).sort((ie,k)=>ie.overflows[1]-k.overflows[1])[0])==null?void 0:pe.placement;if(!Y)switch(x){case"bestFit":{var ce;const ie=(ce=ae.filter(k=>{if(G){const D=Ar(k.placement);return D===C||D==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(D=>D>0).reduce((D,Z)=>D+Z,0)]).sort((k,D)=>k[1]-D[1])[0])==null?void 0:ce[0];ie&&(Y=ie);break}case"initialPlacement":Y=d;break}if(a!==Y)return{reset:{placement:Y}}}return{}})}}};function vT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function AT(e){return mL.some(t=>e[t]>=0)}const CL=function(e){return e===void 0&&(e={}),{name:"hide",options:e,fn(n){return Ue(this,null,function*(){const{rects:r,platform:s}=n,c=jr(e,n),{strategy:a="referenceHidden"}=c,u=yn(c,["strategy"]);switch(a){case"referenceHidden":{const d=yield s.detectOverflow(n,le(H({},u),{elementContext:"reference"})),f=vT(d,r.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:AT(f)}}}case"escaped":{const d=yield s.detectOverflow(n,le(H({},u),{altBoundary:!0})),f=vT(d,r.floating);return{data:{escapedOffsets:f,escaped:AT(f)}}}default:return{}}})}}},kT=new Set(["left","top"]);function OL(e,t){return Ue(this,null,function*(){const{placement:n,platform:r,elements:s}=e,a=yield r.isRTL==null?void 0:r.isRTL(s.floating),u=fi(n),c=so(n),d=Ar(n)==="y",f=kT.has(u)?-1:1,p=a&&d?-1:1,m=jr(t,e);let{mainAxis:b,crossAxis:y,alignmentAxis:x}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof x=="number"&&(y=c==="end"?x*-1:x),d?{x:y*p,y:b*f}:{x:b*f,y:y*p}})}const IL=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(n){return Ue(this,null,function*(){var r,s;const{x:a,y:u,placement:c,middlewareData:d}=n,f=yield OL(n,e);return c===((r=d.offset)==null?void 0:r.placement)&&(s=d.arrow)!=null&&s.alignmentOffset?{}:{x:a+f.x,y:u+f.y,data:le(H({},f),{placement:c})}})}}},PL=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(n){return Ue(this,null,function*(){const{x:r,y:s,placement:a,platform:u}=n,C=jr(e,n),{mainAxis:c=!0,crossAxis:d=!1,limiter:f={fn:j=>{let{x:X,y:L}=j;return{x:X,y:L}}}}=C,p=yn(C,["mainAxis","crossAxis","limiter"]),m={x:r,y:s},b=yield u.detectOverflow(n,p),y=Ar(a),x=kh(y);let A=m[x],v=m[y];const w=(j,X)=>bT(X+b[j==="y"?"top":"left"],X,X-b[j==="y"?"bottom":"right"]);c&&(A=w(x,A)),d&&(v=w(y,v));const N=f.fn(le(H({},n),{[x]:A,[y]:v}));return le(H({},N),{data:{x:N.x-r,y:N.y-s,enabled:{[x]:c,[y]:d}}})})}}},RL=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:a,placement:u,rects:c,middlewareData:d}=t,{offset:f=0,mainAxis:p=!0,crossAxis:m=!0}=jr(e,t),b={x:s,y:a},y=Ar(u),x=kh(y);let A=b[x],v=b[y];const w=jr(f,t),N=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:(n=w.mainAxis)!=null?n:0,crossAxis:(r=w.crossAxis)!=null?r:0};if(p){const X=x==="y"?"height":"width",L=c.reference[x]-c.floating[X]+N.mainAxis,G=c.reference[x]+c.reference[X]-N.mainAxis;A<L?A=L:A>G&&(A=G)}if(m){var C,j;const X=x==="y"?"width":"height",L=kT.has(fi(u)),G=c.reference[y]-c.floating[X]+(L&&((C=d.offset)==null?void 0:C[y])||0)+(L?0:N.crossAxis),ne=c.reference[y]+c.reference[X]+(L?0:((j=d.offset)==null?void 0:j[y])||0)-(L?N.crossAxis:0);v<G?v=G:v>ne&&(v=ne)}return{[x]:A,[y]:v}}}},LL=function(e){return e===void 0&&(e={}),{name:"size",options:e,fn(n){return Ue(this,null,function*(){const{placement:r,rects:s,platform:a,elements:u}=n,z=jr(e,n),{apply:c=()=>{}}=z,d=yn(z,["apply"]),f=yield a.detectOverflow(n,d),p=fi(r),m=so(r),b=Ar(r)==="y",{width:y,height:x}=s.floating;let A,v;p==="top"||p==="bottom"?(A=p,v=m===((yield a.isRTL==null?void 0:a.isRTL(u.floating))?"start":"end")?"left":"right"):(v=p,A=m==="end"?"top":"bottom");const w=x-f.top-f.bottom,N=y-f.left-f.right,C=di(x-f[A],w),j=di(y-f[v],N),X=n.middlewareData.shift,L=!X;let G=C,ne=j;X!=null&&X.enabled.x&&(ne=N),X!=null&&X.enabled.y&&(G=w),L&&!m&&(b?ne=y-2*Hr(f.left,f.right):G=x-2*Hr(f.top,f.bottom)),yield c(le(H({},n),{availableWidth:ne,availableHeight:G}));const de=yield a.getDimensions(u.floating);return y!==de.width||x!==de.height?{reset:{rects:!0}}:{}})}}};function Hl(){return typeof window!="undefined"}function oo(e){return NT(e)?(e.nodeName||"").toLowerCase():"#document"}function Fn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function kr(e){var t;return(t=(NT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function NT(e){return Hl()?e instanceof Node||e instanceof Fn(e).Node:!1}function ur(e){return Hl()?e instanceof Element||e instanceof Fn(e).Element:!1}function Nr(e){return Hl()?e instanceof HTMLElement||e instanceof Fn(e).HTMLElement:!1}function CT(e){return!Hl()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof Fn(e).ShadowRoot}function Ia(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=lr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function DL(e){return/^(table|td|th)$/.test(oo(e))}function jl(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}const ML=/transform|translate|scale|rotate|perspective|filter/,FL=/paint|layout|strict|content/,ss=e=>!!e&&e!=="none";let Ih;function Ph(e){const t=ur(e)?lr(e):e;return ss(t.transform)||ss(t.translate)||ss(t.scale)||ss(t.rotate)||ss(t.perspective)||!Rh()&&(ss(t.backdropFilter)||ss(t.filter))||ML.test(t.willChange||"")||FL.test(t.contain||"")}function BL(e){let t=hi(e);for(;Nr(t)&&!ao(t);){if(Ph(t))return t;if(jl(t))return null;t=hi(t)}return null}function Rh(){return Ih==null&&(Ih=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ih}function ao(e){return/^(html|body|#document)$/.test(oo(e))}function lr(e){return Fn(e).getComputedStyle(e)}function $l(e){return ur(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hi(e){if(oo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||CT(e)&&e.host||kr(e);return CT(t)?t.host:t}function OT(e){const t=hi(e);return ao(t)?(e.ownerDocument||e).body:Nr(t)&&Ia(t)?t:OT(t)}function Pa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=OT(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),u=Fn(s);if(a){const c=Lh(u);return t.concat(u,u.visualViewport||[],Ia(s)?s:[],c&&n?Pa(c):[])}else return t.concat(s,Pa(s,[],n))}function Lh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function IT(e){const t=lr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Nr(e),a=s?e.offsetWidth:n,u=s?e.offsetHeight:r,c=Ml(n)!==a||Ml(r)!==u;return c&&(n=a,r=u),{width:n,height:r,$:c}}function Dh(e){return ur(e)?e:e.contextElement}function uo(e){const t=Dh(e);if(!Nr(t))return vr(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=IT(t);let u=(a?Ml(n.width):n.width)/r,c=(a?Ml(n.height):n.height)/s;return(!u||!Number.isFinite(u))&&(u=1),(!c||!Number.isFinite(c))&&(c=1),{x:u,y:c}}const UL=vr(0);function PT(e){const t=Fn(e);return!Rh()||!t.visualViewport?UL:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function HL(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Fn(e)?!1:t}function os(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=Dh(e);let u=vr(1);t&&(r?ur(r)&&(u=uo(r)):u=uo(e));const c=HL(a,n,r)?PT(a):vr(0);let d=(s.left+c.x)/u.x,f=(s.top+c.y)/u.y,p=s.width/u.x,m=s.height/u.y;if(a){const b=Fn(a),y=r&&ur(r)?Fn(r):r;let x=b,A=Lh(x);for(;A&&r&&y!==x;){const v=uo(A),w=A.getBoundingClientRect(),N=lr(A),C=w.left+(A.clientLeft+parseFloat(N.paddingLeft))*v.x,j=w.top+(A.clientTop+parseFloat(N.paddingTop))*v.y;d*=v.x,f*=v.y,p*=v.x,m*=v.y,d+=C,f+=j,x=Fn(A),A=Lh(x)}}return Ul({width:p,height:m,x:d,y:f})}function zl(e,t){const n=$l(e).scrollLeft;return t?t.left+n:os(kr(e)).left+n}function RT(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-zl(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function jL(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",u=kr(r),c=t?jl(t.floating):!1;if(r===u||c&&a)return n;let d={scrollLeft:0,scrollTop:0},f=vr(1);const p=vr(0),m=Nr(r);if((m||!m&&!a)&&((oo(r)!=="body"||Ia(u))&&(d=$l(r)),Nr(r))){const y=os(r);f=uo(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const b=u&&!m&&!a?RT(u,d):vr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+p.x+b.x,y:n.y*f.y-d.scrollTop*f.y+p.y+b.y}}function $L(e){return Array.from(e.getClientRects())}function zL(e){const t=kr(e),n=$l(e),r=e.ownerDocument.body,s=Hr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Hr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+zl(e);const c=-n.scrollTop;return lr(r).direction==="rtl"&&(u+=Hr(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:u,y:c}}const LT=25;function VL(e,t){const n=Fn(e),r=kr(e),s=n.visualViewport;let a=r.clientWidth,u=r.clientHeight,c=0,d=0;if(s){a=s.width,u=s.height;const p=Rh();(!p||p&&t==="fixed")&&(c=s.offsetLeft,d=s.offsetTop)}const f=zl(r);if(f<=0){const p=r.ownerDocument,m=p.body,b=getComputedStyle(m),y=p.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,x=Math.abs(r.clientWidth-m.clientWidth-y);x<=LT&&(a-=x)}else f<=LT&&(a+=f);return{width:a,height:u,x:c,y:d}}const qL=new Set(["absolute","fixed"]);function YL(e,t){const n=os(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=Nr(e)?uo(e):vr(1),u=e.clientWidth*a.x,c=e.clientHeight*a.y,d=s*a.x,f=r*a.y;return{width:u,height:c,x:d,y:f}}function DT(e,t,n){let r;if(t==="viewport")r=VL(e,n);else if(t==="document")r=zL(kr(e));else if(ur(t))r=YL(t,n);else{const s=PT(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Ul(r)}function MT(e,t){const n=hi(e);return n===t||!ur(n)||ao(n)?!1:lr(n).position==="fixed"||MT(n,t)}function WL(e,t){const n=t.get(e);if(n)return n;let r=Pa(e,[],!1).filter(c=>ur(c)&&oo(c)!=="body"),s=null;const a=lr(e).position==="fixed";let u=a?hi(e):e;for(;ur(u)&&!ao(u);){const c=lr(u),d=Ph(u);!d&&c.position==="fixed"&&(s=null),(a?!d&&!s:!d&&c.position==="static"&&!!s&&qL.has(s.position)||Ia(u)&&!d&&MT(e,u))?r=r.filter(p=>p!==u):s=c,u=hi(u)}return t.set(e,r),r}function GL(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const u=[...n==="clippingAncestors"?jl(t)?[]:WL(t,this._c):[].concat(n),r],c=u[0],d=u.reduce((f,p)=>{const m=DT(t,p,s);return f.top=Hr(m.top,f.top),f.right=di(m.right,f.right),f.bottom=di(m.bottom,f.bottom),f.left=Hr(m.left,f.left),f},DT(t,c,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function XL(e){const{width:t,height:n}=IT(e);return{width:t,height:n}}function QL(e,t,n){const r=Nr(t),s=kr(t),a=n==="fixed",u=os(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const d=vr(0);function f(){d.x=zl(s)}if(r||!r&&!a)if((oo(t)!=="body"||Ia(s))&&(c=$l(t)),r){const y=os(t,!0,a,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else s&&f();a&&!r&&s&&f();const p=s&&!r&&!a?RT(s,c):vr(0),m=u.left+c.scrollLeft-d.x-p.x,b=u.top+c.scrollTop-d.y-p.y;return{x:m,y:b,width:u.width,height:u.height}}function Mh(e){return lr(e).position==="static"}function FT(e,t){if(!Nr(e)||lr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return kr(e)===n&&(n=n.ownerDocument.body),n}function BT(e,t){const n=Fn(e);if(jl(e))return n;if(!Nr(e)){let s=hi(e);for(;s&&!ao(s);){if(ur(s)&&!Mh(s))return s;s=hi(s)}return n}let r=FT(e,t);for(;r&&DL(r)&&Mh(r);)r=FT(r,t);return r&&ao(r)&&Mh(r)&&!Ph(r)?n:r||BL(e)||n}const KL=function(e){return Ue(this,null,function*(){const t=this.getOffsetParent||BT,n=this.getDimensions,r=yield n(e.floating);return{reference:QL(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})};function JL(e){return lr(e).direction==="rtl"}const ZL={convertOffsetParentRelativeRectToViewportRelativeRect:jL,getDocumentElement:kr,getClippingRect:GL,getOffsetParent:BT,getElementRects:KL,getClientRects:$L,getDimensions:XL,getScale:uo,isElement:ur,isRTL:JL};function UT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function e5(e,t){let n=null,r;const s=kr(e);function a(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function u(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),a();const f=e.getBoundingClientRect(),{left:p,top:m,width:b,height:y}=f;if(c||t(),!b||!y)return;const x=Fl(m),A=Fl(s.clientWidth-(p+b)),v=Fl(s.clientHeight-(m+y)),w=Fl(p),C={rootMargin:-x+"px "+-A+"px "+-v+"px "+-w+"px",threshold:Hr(0,di(1,d))||1};let j=!0;function X(L){const G=L[0].intersectionRatio;if(G!==d){if(!j)return u();G?u(!1,G):r=setTimeout(()=>{u(!1,1e-7)},1e3)}G===1&&!UT(f,e.getBoundingClientRect())&&u(),j=!1}try{n=new IntersectionObserver(X,le(H({},C),{root:s.ownerDocument}))}catch(L){n=new IntersectionObserver(X,C)}n.observe(e)}return u(!0),a}function t5(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=Dh(e),p=s||a?[...f?Pa(f):[],...Pa(t)]:[];p.forEach(w=>{s&&w.addEventListener("scroll",n,{passive:!0}),a&&w.addEventListener("resize",n)});const m=f&&c?e5(f,n):null;let b=-1,y=null;u&&(y=new ResizeObserver(w=>{let[N]=w;N&&N.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var C;(C=y)==null||C.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let x,A=d?os(e):null;d&&v();function v(){const w=os(e);A&&!UT(A,w)&&n(),A=w,x=requestAnimationFrame(v)}return n(),()=>{var w;p.forEach(N=>{s&&N.removeEventListener("scroll",n),a&&N.removeEventListener("resize",n)}),m==null||m(),(w=y)==null||w.disconnect(),y=null,d&&cancelAnimationFrame(x)}}const n5=IL,r5=PL,i5=NL,s5=LL,o5=CL,a5=kL,u5=RL,l5=(e,t,n)=>{const r=new Map,s=H({platform:ZL},n),a=le(H({},s.platform),{_c:r});return AL(e,t,le(H({},s),{platform:a}))};function HT(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const s={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return le(H({},s),{toJSON:()=>s})}function c5(e){if(!e)return HT();const{x:t,y:n,width:r,height:s}=e;return HT(t,n,r,s)}function d5(e,t){return{contextElement:$t(e)?e:void 0,getBoundingClientRect:()=>{const n=e,r=t==null?void 0:t(n);return r||!n?c5(r):n.getBoundingClientRect()}}}var Ra=e=>({variable:e,reference:`var(${e})`}),$r={arrowSize:Ra("--arrow-size"),arrowSizeHalf:Ra("--arrow-size-half"),arrowBg:Ra("--arrow-background"),transformOrigin:Ra("--transform-origin"),arrowOffset:Ra("--arrow-offset")},f5=e=>e==="top"||e==="bottom"?"y":"x";function h5(e,t){return{name:"transformOrigin",fn(n){var de,z,ae,oe,pe;const{elements:r,middlewareData:s,placement:a,rects:u,y:c}=n,d=a.split("-")[0],f=f5(d),p=((de=s.arrow)==null?void 0:de.x)||0,m=((z=s.arrow)==null?void 0:z.y)||0,b=(t==null?void 0:t.clientWidth)||0,y=(t==null?void 0:t.clientHeight)||0,x=p+b/2,A=m+y/2,v=Math.abs(((ae=s.shift)==null?void 0:ae.y)||0),w=u.reference.height/2,N=y/2,C=(pe=(oe=e.offset)==null?void 0:oe.mainAxis)!=null?pe:e.gutter,j=typeof C=="number"?C+N:C!=null?C:N,X=v>j,L={top:`${x}px calc(100% + ${j}px)`,bottom:`${x}px ${-j}px`,left:`calc(100% + ${j}px) ${A}px`,right:`${-j}px ${A}px`}[d],G=`${x}px ${u.reference.y+w-c}px`,ne=!!e.overlap&&f==="y"&&X;return r.floating.style.setProperty($r.transformOrigin.variable,ne?G:L),{data:{transformOrigin:ne?G:L}}}}}var p5={name:"rects",fn({rects:e}){return{data:e}}},m5=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:s}=n.arrow,a=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:s!=null?`${s}px`:"",[a]:`calc(100% + ${$r.arrowOffset.reference})`}),{}}}};function g5(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}var E5={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function jT(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function Fh(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function y5(e,t,n){const r=e||t.createElement("div");return a5({element:r,padding:n.arrowPadding})}function T5(e,t){var n;if(!U6((n=t.offset)!=null?n:t.gutter))return n5(({placement:r})=>{var p,m,b,y;const s=((e==null?void 0:e.clientHeight)||0)/2,a=(m=(p=t.offset)==null?void 0:p.mainAxis)!=null?m:t.gutter,u=typeof a=="number"?a+s:a!=null?a:s,{hasAlign:c}=g5(r),d=c?void 0:t.shift,f=(y=(b=t.offset)==null?void 0:b.crossAxis)!=null?y:d;return dh({crossAxis:f,mainAxis:u,alignmentAxis:t.shift})})}function b5(e){if(!e.flip)return;const t=Fh(e.boundary);return i5(le(H({},t?{boundary:t}:void 0),{padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}))}function x5(e){if(!e.slide&&!e.overlap)return;const t=Fh(e.boundary);return r5(le(H({},t?{boundary:t}:void 0),{mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:u5()}))}function _5(e){return s5({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:r,availableWidth:s}){const a=t.floating,u=Math.round(n.reference.width),c=Math.round(n.reference.height);s=Math.floor(s),r=Math.floor(r),a.style.setProperty("--reference-width",`${u}px`),a.style.setProperty("--reference-height",`${c}px`),a.style.setProperty("--available-width",`${s}px`),a.style.setProperty("--available-height",`${r}px`)}})}function w5(e){var t;if(e.hideWhenDetached)return o5({strategy:"referenceHidden",boundary:(t=Fh(e.boundary))!=null?t:"clippingAncestors"})}function S5(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function v5(e,t,n={}){const r=d5(e,n.getAnchorRect);if(!t||!r)return;const s=Object.assign({},E5,n),a=t.querySelector("[data-part=arrow]"),u=[T5(a,s),b5(s),x5(s),y5(a,t.ownerDocument,s),m5(a),h5({gutter:s.gutter,offset:s.offset,overlap:s.overlap},a),_5(s),w5(s),p5],{placement:c,strategy:d,onComplete:f,onPositioned:p}=s,m=()=>Ue(null,null,function*(){var j;if(!r||!t)return;const A=yield l5(r,t,{placement:c,middleware:u,strategy:d});f==null||f(A),p==null||p({placed:!0});const v=Ks(t),w=jT(v,A.x),N=jT(v,A.y);t.style.setProperty("--x",`${w}px`),t.style.setProperty("--y",`${N}px`),s.hideWhenDetached&&(((j=A.middlewareData.hide)==null?void 0:j.referenceHidden)?(t.style.setProperty("visibility","hidden"),t.style.setProperty("pointer-events","none")):(t.style.removeProperty("visibility"),t.style.removeProperty("pointer-events")));const C=t.firstElementChild;if(C){const X=Zs(C);t.style.setProperty("--z-index",X.zIndex)}}),b=()=>Ue(null,null,function*(){n.updatePosition?(yield n.updatePosition({updatePosition:m,floatingElement:t}),p==null||p({placed:!0})):yield m()}),y=S5(s.listeners),x=s.listeners?t5(r,t,b,y):G6;return b(),()=>{x==null||x(),p==null||p({placed:!1})}}function $T(e,t,n={}){const c=n,{defer:r}=c,s=yn(c,["defer"]),a=r?Mt:d=>d(),u=[];return u.push(a(()=>{const d=typeof e=="function"?e():e,f=typeof t=="function"?t():t;u.push(v5(d,f,s))})),()=>{u.forEach(d=>d==null?void 0:d())}}var A5={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function k5(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:s="absolute"}=e;return{arrow:{position:"absolute",width:$r.arrowSize.reference,height:$r.arrowSize.reference,[$r.arrowSizeHalf.variable]:`calc(${$r.arrowSize.reference} / 2)`,[$r.arrowOffset.variable]:`calc(${$r.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?A5[t.split("-")[0]]:void 0,background:$r.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:s,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}var lo=new WeakMap,Vl=new WeakMap,ql={},Bh=0,zT=e=>e&&(e.host||zT(e.parentNode)),N5=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=zT(n);return r&&e.contains(r)?r:(console.error("[zag-js > ariaHidden] target",n,"in not contained inside",e,". Doing nothing"),null)}).filter(n=>!!n),C5=new Set(["script","output","status","next-route-announcer"]),O5=e=>C5.has(e.localName)||e.role==="status"||e.hasAttribute("aria-live")?!0:e.matches("[data-live-announcer]"),I5=(e,t)=>{const{parentNode:n,markerName:r,controlAttribute:s,followControlledElements:a=!0}=t,u=N5(n,Array.isArray(e)?e:[e]);ql[r]||(ql[r]=new WeakMap);const c=ql[r],d=[],f=new Set,p=new Set(u),m=y=>{!y||f.has(y)||(f.add(y),m(y.parentNode))};u.forEach(y=>{m(y),a&&$t(y)&&tT(y,x=>{m(x)})});const b=y=>{!y||p.has(y)||Array.prototype.forEach.call(y.children,x=>{if(f.has(x))b(x);else try{if(O5(x))return;const v=x.getAttribute(s)==="true",w=(lo.get(x)||0)+1,N=(c.get(x)||0)+1;lo.set(x,w),c.set(x,N),d.push(x),w===1&&v&&Vl.set(x,!0),N===1&&x.setAttribute(r,""),v||x.setAttribute(s,"true")}catch(A){console.error("[zag-js > ariaHidden] cannot operate on ",x,A)}})};return b(n),f.clear(),Bh++,()=>{d.forEach(y=>{const x=lo.get(y)-1,A=c.get(y)-1;lo.set(y,x),c.set(y,A),x||(Vl.has(y)||y.removeAttribute(s),Vl.delete(y)),A||y.removeAttribute(r)}),Bh--,Bh||(lo=new WeakMap,lo=new WeakMap,Vl=new WeakMap,ql={})}},P5=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,R5=(e,t=P5(e),n="data-aria-hidden",r=!0)=>{if(t)return I5(e,{parentNode:t,markerName:n,controlAttribute:"aria-hidden",followControlledElements:r})},L5=e=>{const t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function VT(e,t={}){const{defer:n=!0}=t,r=n?L5:a=>a(),s=[];return s.push(r(()=>{const u=(typeof e=="function"?e():e).filter(Boolean);u.length!==0&&s.push(R5(u))})),()=>{s.forEach(a=>a==null?void 0:a())}}function D5(e){const t={each(n){var r;for(let s=0;s<((r=e.frames)==null?void 0:r.length);s+=1){const a=e.frames[s];a&&n(a)}},addEventListener(n,r,s){return t.each(a=>{try{a.document.addEventListener(n,r,s)}catch(u){}}),()=>{try{t.removeEventListener(n,r,s)}catch(a){}}},removeEventListener(n,r,s){t.each(a=>{try{a.document.removeEventListener(n,r,s)}catch(u){}})}};return t}function M5(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,s)=>{try{t==null||t.addEventListener(n,r,s)}catch(a){}return()=>{try{t==null||t.removeEventListener(n,r,s)}catch(a){}}},removeEventListener:(n,r,s)=>{try{t==null||t.removeEventListener(n,r,s)}catch(a){}}}}var qT="pointerdown.outside",YT="focus.outside";function F5(e){for(const t of e)if($t(t)&&Sr(t))return!0;return!1}var WT=e=>"clientY"in e;function B5(e,t){if(!WT(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function U5(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function GT(e,t){if(!t||!WT(e))return!1;const n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,s=t.scrollWidth>t.clientWidth,a=s&&e.clientY>t.offsetTop+t.clientHeight,u={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(s?16:0)},c={x:e.clientX,y:e.clientY};return U5(u,c)?r||a:!1}function H5(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:s,onInteractOutside:a,defer:u,followControlledElements:c=!0}=t;if(!e)return;const d=wr(e),f=Ks(e),p=D5(f),m=M5(f);function b(C,j){if(!$t(j)||!j.isConnected||Qs(e,j)||B5(e,C)||c&&eT(e,j))return!1;const X=d.querySelector(`[aria-controls="${e.id}"]`);if(X){const G=bh(X);if(GT(C,G))return!1}const L=bh(e);return GT(C,L)?!1:!(n!=null&&n(j))}const y=new Set,x=ts(e==null?void 0:e.getRootNode());function A(C){function j(X){var de,z;const L=u&&!nT()?Mt:ae=>ae(),G=X!=null?X:C,ne=(z=(de=G==null?void 0:G.composedPath)==null?void 0:de.call(G))!=null?z:[G==null?void 0:G.target];L(()=>{const ae=x?ne[0]:ar(C);if(!(!e||!b(C,ae))){if(s||a){const oe=ch(s,a);e.addEventListener(qT,oe,{once:!0})}XT(e,qT,{bubbles:!1,cancelable:!0,detail:{originalEvent:G,contextmenu:C4(G),focusable:F5(ne),target:ae}})}})}C.pointerType==="touch"?(y.forEach(X=>X()),y.add(zt(d,"click",j,{once:!0})),y.add(m.addEventListener("click",j,{once:!0})),y.add(p.addEventListener("click",j,{once:!0}))):j()}const v=new Set,w=setTimeout(()=>{v.add(zt(d,"pointerdown",A,!0)),v.add(m.addEventListener("pointerdown",A,!0)),v.add(p.addEventListener("pointerdown",A,!0))},0);function N(C){(u?Mt:X=>X())(()=>{var G,ne;const X=(ne=(G=C==null?void 0:C.composedPath)==null?void 0:G.call(C))!=null?ne:[C==null?void 0:C.target],L=x?X[0]:ar(C);if(!(!e||!b(C,L))){if(r||a){const de=ch(r,a);e.addEventListener(YT,de,{once:!0})}XT(e,YT,{bubbles:!1,cancelable:!0,detail:{originalEvent:C,contextmenu:!1,focusable:Sr(L),target:L}})}})}return nT()||(v.add(zt(d,"focusin",N,!0)),v.add(m.addEventListener("focusin",N,!0)),v.add(p.addEventListener("focusin",N,!0))),()=>{clearTimeout(w),y.forEach(C=>C()),v.forEach(C=>C())}}function j5(e,t){const{defer:n}=t,r=n?Mt:a=>a(),s=[];return s.push(r(()=>{const a=typeof e=="function"?e():e;s.push(H5(a,t))})),()=>{s.forEach(a=>a==null?void 0:a())}}function XT(e,t,n){const r=e.ownerDocument.defaultView||window,s=new r.CustomEvent(t,n);return e.dispatchEvent(s)}function $5(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t==null||t(r))};return zt(wr(e),"keydown",n,{capture:!0})}var QT="layer:request-dismiss",Yn={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){var r;const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf((r=this.topMostPointerBlockingLayer())==null?void 0:r.node):-1;return t<n},isTopMost(e){const t=this.layers[this.count()-1];return(t==null?void 0:t.node)===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){const n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(r=>r.type===t)},getParentLayerOfType(e,t){const n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(r=>r.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return this.getNestedLayers(e).some(n=>Qs(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>Qs(t,e))},add(e){this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(r=>Yn.dismiss(r.node,e)),this.layers.splice(t,1),this.syncLayers())},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{e.node.style.setProperty("--layer-index",`${t}`),e.node.removeAttribute("data-nested"),e.node.removeAttribute("data-has-nested"),this.getParentLayerOfType(e.node,e.type)&&e.node.setAttribute("data-nested",e.type);const r=this.countNestedLayersOfType(e.node,e.type);r>0&&e.node.setAttribute("data-has-nested",e.type),e.node.style.setProperty("--nested-layer-count",`${r}`)})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const n=this.indexOf(e);if(n===-1)return;const r=this.layers[n];V5(e,QT,s=>{var a;(a=r.requestDismiss)==null||a.call(r,s),s.defaultPrevented||r==null||r.dismiss()}),z5(e,QT,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function z5(e,t,n){const r=e.ownerDocument.defaultView||window,s=new r.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(s)}function V5(e,t,n){e.addEventListener(t,n,{once:!0})}var KT;function JT(){Yn.layers.forEach(({node:e})=>{e.style.pointerEvents=Yn.isBelowPointerBlockingLayer(e)?"none":"auto"})}function q5(e){e.style.pointerEvents=""}function Y5(e,t){const n=wr(e),r=[];return Yn.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(KT=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t==null||t.forEach(s=>{const[a,u]=J4(()=>{const c=s();return $t(c)?c:null},{timeout:1e3});a.then(c=>r.push(Il(c,{pointerEvents:"auto"}))),r.push(u)}),()=>{Yn.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=KT,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(s=>s()))}}function W5(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){fh("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:r,onRequestDismiss:s,pointerBlocking:a,exclude:u,debug:c,type:d="dialog"}=t,f={dismiss:r,node:e,type:d,pointerBlocking:a,requestDismiss:s};Yn.add(f),JT();function p(A){var w,N;const v=ar(A.detail.originalEvent);Yn.isBelowPointerBlockingLayer(e)||Yn.isInBranch(v)||((w=t.onPointerDownOutside)==null||w.call(t,A),(N=t.onInteractOutside)==null||N.call(t,A),!A.defaultPrevented&&(c&&console.log("onPointerDownOutside:",A.detail.originalEvent),r==null||r()))}function m(A){var w,N;const v=ar(A.detail.originalEvent);Yn.isInBranch(v)||((w=t.onFocusOutside)==null||w.call(t,A),(N=t.onInteractOutside)==null||N.call(t,A),!A.defaultPrevented&&(c&&console.log("onFocusOutside:",A.detail.originalEvent),r==null||r()))}function b(A){var v;Yn.isTopMost(e)&&((v=t.onEscapeKeyDown)==null||v.call(t,A),!A.defaultPrevented&&r&&(A.preventDefault(),r()))}function y(A){var C;if(!e)return!1;const v=typeof u=="function"?u():u,w=Array.isArray(v)?v:[v],N=(C=t.persistentElements)==null?void 0:C.map(j=>j()).filter($t);return N&&w.push(...N),w.some(j=>Qs(j,A))||Yn.isInNestedLayer(e,A)}const x=[a?Y5(e,t.persistentElements):void 0,$5(e,b),j5(e,{exclude:y,onFocusOutside:m,onPointerDownOutside:p,defer:t.defer})];return()=>{Yn.remove(e),JT(),q5(e),x.forEach(A=>A==null?void 0:A())}}function ZT(e,t){const{defer:n}=t,r=n?Mt:a=>a(),s=[];return s.push(r(()=>{const a=Gs(e)?e():e;s.push(W5(a,t))})),()=>{s.forEach(a=>a==null?void 0:a())}}var G5=Object.defineProperty,X5=(e,t,n)=>t in e?G5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_t=(e,t,n)=>X5(e,typeof t!="symbol"?t+"":t,n),eb={activateTrap(e,t){if(e.length>0){const r=e[e.length-1];r!==t&&r.pause()}const n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap(e,t){const n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},Q5=[],K5=class{constructor(e,t){_t(this,"trapStack"),_t(this,"config"),_t(this,"doc"),_t(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),_t(this,"portalContainers",new Set),_t(this,"listenerCleanups",[]),_t(this,"handleFocus",r=>{const s=ar(r),a=this.findContainerIndex(s,r)>=0;if(a||kl(s))a&&(this.state.mostRecentlyFocusedNode=s);else{r.stopImmediatePropagation();let u,c=!0;if(this.state.mostRecentlyFocusedNode)if(Na(this.state.mostRecentlyFocusedNode)>0){const d=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:f}=this.state.containerGroups[d];if(f.length>0){const p=f.findIndex(m=>m===this.state.mostRecentlyFocusedNode);p>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?p+1<f.length&&(u=f[p+1],c=!1):p-1>=0&&(u=f[p-1],c=!1))}}else this.state.containerGroups.some(d=>d.tabbableNodes.some(f=>Na(f)>0))||(c=!1);else c=!1;c&&(u=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),u?this.tryFocus(u):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),_t(this,"handlePointerDown",r=>{const s=ar(r);if(!(this.findContainerIndex(s,r)>=0)){if(Da(this.config.clickOutsideDeactivates,r)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}Da(this.config.allowOutsideClick,r)||r.preventDefault()}}),_t(this,"handleClick",r=>{const s=ar(r);this.findContainerIndex(s,r)>=0||Da(this.config.clickOutsideDeactivates,r)||Da(this.config.allowOutsideClick,r)||(r.preventDefault(),r.stopImmediatePropagation())}),_t(this,"handleTabKey",r=>{if(this.config.isKeyForward(r)||this.config.isKeyBackward(r)){this.state.recentNavEvent=r;const s=this.config.isKeyBackward(r),a=this.findNextNavNode({event:r,isBackward:s});if(!a)return;La(r)&&r.preventDefault(),this.tryFocus(a)}}),_t(this,"handleEscapeKey",r=>{J5(r)&&Da(this.config.escapeDeactivates,r)!==!1&&(r.preventDefault(),this.deactivate())}),_t(this,"_mutationObserver"),_t(this,"setupMutationObserver",()=>{const r=this.doc.defaultView||window;this._mutationObserver=new r.MutationObserver(s=>{s.some(c=>Array.from(c.removedNodes).some(f=>f===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode()),s.some(c=>c.type==="attributes"&&(c.attributeName==="aria-controls"||c.attributeName==="aria-expanded")?!0:c.type==="childList"&&c.addedNodes.length>0?Array.from(c.addedNodes).some(d=>{if(d.nodeType!==Node.ELEMENT_NODE)return!1;const f=d;return b4(f)?!0:f.id&&!this.state.containers.some(p=>p.contains(f))?x4(f):!1}):!1)&&this.state.active&&!this.state.paused&&(this.updateTabbableNodes(),this.updatePortalContainers())})}),_t(this,"updateObservedNodes",()=>{var r;(r=this._mutationObserver)==null||r.disconnect(),this.state.active&&!this.state.paused&&(this.state.containers.map(s=>{var a;(a=this._mutationObserver)==null||a.observe(s,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}),this.portalContainers.forEach(s=>{this.observePortalContainer(s)}))}),_t(this,"getInitialFocusNode",()=>{let r=this.getNodeForOption("initialFocus",{hasFallback:!0});if(r===!1)return!1;if(r===void 0||r&&!Sr(r)){const s=Js(this.doc);if(s&&this.findContainerIndex(s)>=0)r=s;else{const a=this.state.tabbableGroups[0];r=a&&a.firstTabbableNode||this.getNodeForOption("fallbackFocus")}}else r===null&&(r=this.getNodeForOption("fallbackFocus"));if(!r)throw new Error("Your focus-trap needs to have at least one focusable element");return r.isConnected||(r=this.getNodeForOption("fallbackFocus")),r}),_t(this,"tryFocus",r=>{if(r!==!1&&r!==Js(this.doc)){if(!r||!r.focus){this.tryFocus(this.getInitialFocusNode());return}r.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=r,Z5(r)&&r.select()}}),_t(this,"deactivate",r=>{if(!this.state.active)return this;const s=H({onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus},r);clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),eb.deactivateTrap(this.trapStack,this),this.portalContainers.clear();const a=this.getOption(s,"onDeactivate"),u=this.getOption(s,"onPostDeactivate"),c=this.getOption(s,"checkCanReturnFocus"),d=this.getOption(s,"returnFocus","returnFocusOnDeactivate");a==null||a();const f=()=>{tb(()=>{if(d){const p=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(p)}u==null||u()})};if(d&&c){const p=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return c(p).then(f,f),this}return f(),this}),_t(this,"pause",r=>{if(this.state.paused||!this.state.active)return this;const s=this.getOption(r,"onPause"),a=this.getOption(r,"onPostPause");return this.state.paused=!0,s==null||s(),this.removeListeners(),this.updateObservedNodes(),a==null||a(),this}),_t(this,"unpause",r=>{if(!this.state.paused||!this.state.active)return this;const s=this.getOption(r,"onUnpause"),a=this.getOption(r,"onPostUnpause");return this.state.paused=!1,s==null||s(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),a==null||a(),this}),_t(this,"updateContainerElements",r=>(this.state.containers=Array.isArray(r)?r.filter(Boolean):[r].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),_t(this,"getReturnFocusNode",r=>{const s=this.getNodeForOption("setReturnFocus",{params:[r]});return s||(s===!1?!1:r)}),_t(this,"getOption",(r,s,a)=>r&&r[s]!==void 0?r[s]:this.config[a||s]),_t(this,"getNodeForOption",(r,{hasFallback:s=!1,params:a=[]}={})=>{let u=this.config[r];if(typeof u=="function"&&(u=u(...a)),u===!0&&(u=void 0),!u){if(u===void 0||u===!1)return u;throw new Error(`\`${r}\` was specified but was not a node, or did not return a node`)}let c=u;if(typeof u=="string"){try{c=this.doc.querySelector(u)}catch(d){throw new Error(`\`${r}\` appears to be an invalid selector; error="${d.message}"`)}if(!c&&!s)throw new Error(`\`${r}\` as selector refers to no known node`)}return c}),_t(this,"findNextNavNode",r=>{const{event:s,isBackward:a=!1}=r,u=r.target||ar(s);this.updateTabbableNodes();let c=null;if(this.state.tabbableGroups.length>0){const d=this.findContainerIndex(u,s),f=d>=0?this.state.containerGroups[d]:void 0;if(d<0)a?c=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:c=this.state.tabbableGroups[0].firstTabbableNode;else if(a){let p=this.state.tabbableGroups.findIndex(({firstTabbableNode:m})=>u===m);if(p<0&&((f==null?void 0:f.container)===u||Sr(u)&&!ns(u)&&!(f!=null&&f.nextTabbableNode(u,!1)))&&(p=d),p>=0){const m=p===0?this.state.tabbableGroups.length-1:p-1,b=this.state.tabbableGroups[m];c=Na(u)>=0?b.lastTabbableNode:b.lastDomTabbableNode}else La(s)||(c=f==null?void 0:f.nextTabbableNode(u,!1))}else{let p=this.state.tabbableGroups.findIndex(({lastTabbableNode:m})=>u===m);if(p<0&&((f==null?void 0:f.container)===u||Sr(u)&&!ns(u)&&!(f!=null&&f.nextTabbableNode(u)))&&(p=d),p>=0){const m=p===this.state.tabbableGroups.length-1?0:p+1,b=this.state.tabbableGroups[m];c=Na(u)>=0?b.firstTabbableNode:b.firstDomTabbableNode}else La(s)||(c=f==null?void 0:f.nextTabbableNode(u))}}else c=this.getNodeForOption("fallbackFocus");return c}),this.trapStack=t.trapStack||Q5;const n=H({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,followControlledElements:!0,isKeyForward(r){return La(r)&&!r.shiftKey},isKeyBackward(r){return La(r)&&r.shiftKey}},t);this.doc=n.document||wr(Array.isArray(e)?e[0]:e),this.config=n,this.updateContainerElements(e),this.setupMutationObserver()}addPortalContainer(e){const t=e.parentElement;t&&!this.portalContainers.has(t)&&(this.portalContainers.add(t),this.state.active&&!this.state.paused&&this.observePortalContainer(t))}observePortalContainer(e){var t;(t=this._mutationObserver)==null||t.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}updatePortalContainers(){this.config.followControlledElements&&this.state.containers.forEach(e=>{E4(e).forEach(n=>{this.addPortalContainer(n)})})}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){const n=typeof(t==null?void 0:t.composedPath)=="function"?t.composedPath():void 0;return this.state.containerGroups.findIndex(({container:r,tabbableNodes:s})=>r.contains(e)||(n==null?void 0:n.includes(r))||s.find(a=>a===e)||this.isControlledElement(r,e))}isControlledElement(e,t){return this.config.followControlledElements?eT(e,t):!1}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{const t=eo(e,{getShadowRoot:this.config.getShadowRoot}),n=lT(e,{getShadowRoot:this.config.getShadowRoot}),r=t[0],s=t[t.length-1],a=r,u=s;let c=!1;for(let f=0;f<t.length;f++)if(Na(t[f])>0){c=!0;break}function d(f,p=!0){const m=t.indexOf(f);if(m>=0)return t[m+(p?1:-1)];const b=n.indexOf(f);if(!(b<0)){if(p){for(let y=b+1;y<n.length;y++)if(ns(n[y]))return n[y]}else for(let y=b-1;y>=0;y--)if(ns(n[y]))return n[y]}}return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:s,firstDomTabbableNode:a,lastDomTabbableNode:u,nextTabbableNode:d}}),this.state.tabbableGroups=this.state.containerGroups.filter(e=>e.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(e=>e.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return eb.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?tb(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(zt(this.doc,"focusin",this.handleFocus,!0),zt(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),zt(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),zt(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),zt(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),zt(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(e=>e()),this.listenerCleanups=[],this}activate(e){if(this.state.active)return this;const t=this.getOption(e,"onActivate"),n=this.getOption(e,"onPostActivate"),r=this.getOption(e,"checkCanFocusTrap");r||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=Js(this.doc),t==null||t();const s=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),n==null||n()};return r?(r(this.state.containers.concat()).then(s,s),this):(s(),this)}},La=e=>e.key==="Tab",Da=(e,...t)=>typeof e=="function"?e(...t):e,J5=e=>!e.isComposing&&e.key==="Escape",tb=e=>setTimeout(e,0),Z5=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function nb(e,t={}){let n;const r=Mt(()=>{const s=typeof e=="function"?e():e;if(s){n=new K5(s,le(H({escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:s},t),{document:wr(s)}));try{n.activate()}catch(a){}}});return function(){n==null||n.deactivate(),r()}}var Uh="data-scroll-lock";function eD(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function rb(e){const t=Zs(e),n=t==null?void 0:t.scrollbarGutter;return n==="stable"||(n==null?void 0:n.startsWith("stable "))===!0}function ib(e){var y;const t=e!=null?e:document,n=(y=t.defaultView)!=null?y:window,{documentElement:r,body:s}=t;if(s.hasAttribute(Uh))return;const u=rb(r)||rb(s),c=n.innerWidth-r.clientWidth;s.setAttribute(Uh,"");const d=()=>Q4(r,"--scrollbar-width",`${c}px`),f=eD(r),p=()=>{const x={overflow:"hidden"};return!u&&c>0&&(x[f]=`${c}px`),Il(s,x)},m=()=>{var X,L;const{scrollX:x,scrollY:A,visualViewport:v}=n,w=(X=v==null?void 0:v.offsetLeft)!=null?X:0,N=(L=v==null?void 0:v.offsetTop)!=null?L:0,C={position:"fixed",overflow:"hidden",top:`${-(A-Math.floor(N))}px`,left:`${-(x-Math.floor(w))}px`,right:"0"};!u&&c>0&&(C[f]=`${c}px`);const j=Il(s,C);return()=>{j==null||j(),n.scrollTo({left:x,top:A,behavior:"instant"})}},b=[d(),Nl()?m():p()];return()=>{b.forEach(x=>x==null?void 0:x()),s.removeAttribute(Uh)}}var tD=is("popover").parts("arrow","arrowTip","anchor","trigger","indicator","positioner","content","title","description","closeTrigger"),Cr=tD.build(),sb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.anchor)!=null?n:`popover:${e.id}:anchor`},ob=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`popover:${e.id}:trigger`},Hh=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`popover:${e.id}:content`},ab=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`popover:${e.id}:popper`},nD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.arrow)!=null?n:`popover:${e.id}:arrow`},jh=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`popover:${e.id}:title`},$h=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`popover:${e.id}:desc`},rD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`popover:${e.id}:close`},ub=e=>e.getById(sb(e)),co=e=>e.getById(ob(e)),fo=e=>e.getById(Hh(e)),lb=e=>e.getById(ab(e)),iD=e=>e.getById(jh(e)),sD=e=>e.getById($h(e));function oD(e,t){const{state:n,context:r,send:s,computed:a,prop:u,scope:c}=e,d=n.matches("open"),f=r.get("currentPlacement"),p=a("currentPortalled"),m=r.get("renderedElements"),b=k5(le(H({},u("positioning")),{placement:f}));return{portalled:p,open:d,setOpen(y){n.matches("open")!==y&&s({type:y?"OPEN":"CLOSE"})},reposition(y={}){s({type:"POSITIONING.SET",options:y})},getArrowProps(){return t.element(le(H({id:nD(c)},Cr.arrow.attrs),{dir:u("dir"),style:b.arrow}))},getArrowTipProps(){return t.element(le(H({},Cr.arrowTip.attrs),{dir:u("dir"),style:b.arrowTip}))},getAnchorProps(){return t.element(le(H({},Cr.anchor.attrs),{dir:u("dir"),id:sb(c)}))},getTriggerProps(){return t.button(le(H({},Cr.trigger.attrs),{dir:u("dir"),type:"button","data-placement":f,id:ob(c),"aria-haspopup":"dialog","aria-expanded":d,"data-state":d?"open":"closed","aria-controls":Hh(c),onPointerDown(y){rT(y)&&k4()&&y.currentTarget.focus()},onClick(y){y.defaultPrevented||s({type:"TOGGLE"})},onBlur(y){s({type:"TRIGGER_BLUR",target:y.relatedTarget})}}))},getIndicatorProps(){return t.element(le(H({},Cr.indicator.attrs),{dir:u("dir"),"data-state":d?"open":"closed"}))},getPositionerProps(){return t.element(le(H({id:ab(c)},Cr.positioner.attrs),{dir:u("dir"),style:b.floating}))},getContentProps(){return t.element(le(H({},Cr.content.attrs),{dir:u("dir"),id:Hh(c),tabIndex:-1,role:"dialog","aria-modal":Ky(u("modal")),hidden:!d,"data-state":d?"open":"closed","data-expanded":Xs(d),"aria-labelledby":m.title?jh(c):void 0,"aria-describedby":m.description?$h(c):void 0,"data-placement":f}))},getTitleProps(){return t.element(le(H({},Cr.title.attrs),{id:jh(c),dir:u("dir")}))},getDescriptionProps(){return t.element(le(H({},Cr.description.attrs),{id:$h(c),dir:u("dir")}))},getCloseTriggerProps(){return t.button(le(H({},Cr.closeTrigger.attrs),{dir:u("dir"),id:rD(c),type:"button","aria-label":"close",onClick(y){y.defaultPrevented||(y.stopPropagation(),s({type:"CLOSE"}))}}))}}}var aD={props({props:e}){return le(H({closeOnInteractOutside:!0,closeOnEscape:!0,autoFocus:!0,modal:!1,portalled:!0},e),{positioning:H({placement:"bottom"},e.positioning)})},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{currentPlacement:e(()=>({defaultValue:void 0})),renderedElements:e(()=>({defaultValue:{title:!0,description:!0}}))}},computed:{currentPortalled:({prop:e})=>!!e("modal")||!!e("portalled")},watch({track:e,prop:t,action:n}){e([()=>t("open")],()=>{n(["toggleVisibility"])})},entry:["checkRenderedElements"],states:{closed:{on:{"CONTROLLED.OPEN":{target:"open",actions:["setInitialFocus"]},TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus"]}]}},open:{effects:["trapFocus","preventScroll","hideContentBelow","trackPositioning","trackDismissableElement","proxyTabFocus"],on:{"CONTROLLED.CLOSE":{target:"closed",actions:["setFinalFocus"]},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose","setFinalFocus"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"POSITIONING.SET":{actions:["reposition"]}}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackPositioning({context:e,prop:t,scope:n}){var a;e.set("currentPlacement",t("positioning").placement);const r=(a=ub(n))!=null?a:co(n);return $T(r,()=>lb(n),le(H({},t("positioning")),{defer:!0,onComplete(u){e.set("currentPlacement",u.placement)}}))},trackDismissableElement({send:e,prop:t,scope:n}){const r=()=>fo(n);let s=!0;return ZT(r,{type:"popover",pointerBlocking:t("modal"),exclude:co(n),defer:!0,onEscapeKeyDown(a){var u;(u=t("onEscapeKeyDown"))==null||u(a),!t("closeOnEscape")&&a.preventDefault()},onInteractOutside(a){var u;(u=t("onInteractOutside"))==null||u(a),!a.defaultPrevented&&(s=!(a.detail.focusable||a.detail.contextmenu),t("closeOnInteractOutside")||a.preventDefault())},onPointerDownOutside:t("onPointerDownOutside"),onFocusOutside:t("onFocusOutside"),persistentElements:t("persistentElements"),onRequestDismiss:t("onRequestDismiss"),onDismiss(){e({type:"CLOSE",src:"interact-outside",restoreFocus:s})}})},proxyTabFocus({prop:e,scope:t}){return e("modal")||!e("portalled")?void 0:G4(()=>fo(t),{triggerElement:co(t),defer:!0,getShadowRoot:!0,onFocus(r){r.focus({preventScroll:!0})}})},hideContentBelow({prop:e,scope:t}){return e("modal")?VT(()=>[fo(t),co(t)],{defer:!0}):void 0},preventScroll({prop:e,scope:t}){if(e("modal"))return ib(t.getDoc())},trapFocus({prop:e,scope:t}){return e("modal")?nb(()=>fo(t),{initialFocus:()=>cT({root:fo(t),getInitialEl:e("initialFocusEl"),enabled:e("autoFocus")}),getShadowRoot:!0}):void 0}},actions:{reposition({event:e,prop:t,scope:n,context:r}){var u;const s=(u=ub(n))!=null?u:co(n);$T(s,()=>lb(n),le(H(H({},t("positioning")),e.options),{defer:!0,listeners:!1,onComplete(c){r.set("currentPlacement",c.placement)}}))},checkRenderedElements({context:e,scope:t}){Mt(()=>{Object.assign(e.get("renderedElements"),{title:!!iD(t),description:!!sD(t)})})},setInitialFocus({prop:e,scope:t}){e("modal")||Mt(()=>{const n=cT({root:fo(t),getInitialEl:e("initialFocusEl"),enabled:e("autoFocus")});n==null||n.focus({preventScroll:!0})})},setFinalFocus({event:e,scope:t}){var r,s;const n=(s=e.restoreFocus)!=null?s:(r=e.previousEvent)==null?void 0:r.restoreFocus;n!=null&&!n||Mt(()=>{const a=co(t);a==null||a.focus({preventScroll:!0})})},invokeOnOpen({prop:e,flush:t}){t(()=>{var n;(n=e("onOpenChange"))==null||n({open:!0})})},invokeOnClose({prop:e,flush:t}){t(()=>{var n;(n=e("onOpenChange"))==null||n({open:!1})})},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}};ro()(["autoFocus","closeOnEscape","closeOnInteractOutside","dir","getRootNode","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","portalled","positioning"]);const[gU,Yl]=rs({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}}),[EU,zh]=rs({name:"LocaleContext",hookName:"useLocaleContext",providerName:"<LocaleProvider />",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}}),uD=e=>{const t=B.useId(),{getRootNode:n}=Yl(),{dir:r}=zh(),s=H({id:t,dir:r,getRootNode:n},e),a=Rl(aD,s);return oD(a,wh)},lD=e=>{const[t,u]=TT(e),c=u,{children:n}=c,r=yn(c,["children"]),s=uD(r),a=Ah(Ft({present:s.open},t));return _.jsx(lL,{value:s,children:_.jsx(gT,{value:a,children:n})})},cb=B.forwardRef((e,t)=>{const n=vh(),r=Ca(),s=Ft(le(H({},n.getTriggerProps()),{"aria-controls":r.unmounted?void 0:n.getTriggerProps()["aria-controls"]}),e);return _.jsx(ln.button,le(H({},s),{ref:t}))});cb.displayName="PopoverTrigger";function cD(e){return ot({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M11.854 3.646a.5.5 0 0 1 0 .708L8.207 8l3.647 3.646a.5.5 0 0 1-.708.708l-4-4a.5.5 0 0 1 0-.708l4-4a.5.5 0 0 1 .708 0M4.5 1a.5.5 0 0 0-.5.5v13a.5.5 0 0 0 1 0v-13a.5.5 0 0 0-.5-.5"},child:[]}]})(e)}function dD(e){return ot({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.146 3.646a.5.5 0 0 0 0 .708L7.793 8l-3.647 3.646a.5.5 0 0 0 .708.708l4-4a.5.5 0 0 0 0-.708l-4-4a.5.5 0 0 0-.708 0M11.5 1a.5.5 0 0 1 .5.5v13a.5.5 0 0 1-1 0v-13a.5.5 0 0 1 .5-.5"},child:[]}]})(e)}function db(e){return ot({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0"},child:[]}]})(e)}function fb(e){return ot({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708"},child:[]}]})(e)}function fD(e){return ot({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8 2a.5.5 0 0 1 .5.5v5h5a.5.5 0 0 1 0 1h-5v5a.5.5 0 0 1-1 0v-5h-5a.5.5 0 0 1 0-1h5v-5A.5.5 0 0 1 8 2"},child:[]}]})(e)}function hD(e){return ot({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576zm6.787-8.201L1.591 6.602l4.339 2.76z"},child:[]}]})(e)}function Vh(e){return ot({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M7.657 6.247c.11-.33.576-.33.686 0l.645 1.937a2.89 2.89 0 0 0 1.829 1.828l1.936.645c.33.11.33.576 0 .686l-1.937.645a2.89 2.89 0 0 0-1.828 1.829l-.645 1.936a.361.361 0 0 1-.686 0l-.645-1.937a2.89 2.89 0 0 0-1.828-1.828l-1.937-.645a.361.361 0 0 1 0-.686l1.937-.645a2.89 2.89 0 0 0 1.828-1.828zM3.794 1.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387A1.73 1.73 0 0 0 4.593 5.69l-.387 1.162a.217.217 0 0 1-.412 0L3.407 5.69A1.73 1.73 0 0 0 2.31 4.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387A1.73 1.73 0 0 0 3.407 2.31zM10.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.16 1.16 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.16 1.16 0 0 0-.732-.732L9.1 2.137a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732z"},child:[]}]})(e)}function hb(e){return ot({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"},child:[]}]})(e)}const pD=({className:e,componentType:t,children:n})=>{const[r,s]=B.useState(!1),{globalClassName:a}=at(),u=f=>{s(f.open)},c=B.useCallback(()=>{s(!1)},[]),d=B.useMemo(()=>({closeMenu:c}),[c]);return _.jsxs(lD,{open:r,onOpenChange:u,positioning:{placement:"bottom-end"},children:[_.jsx(cb,{"aria-label":`Overflow menu for ${t}`,className:M(`${O}-overflow-menu-button-trigger`,`${O}-icon-button`,a,e,`cim-${t}-component`),children:_.jsx(hb,{})}),_.jsx(yT,{children:_.jsx(ET,{className:M(`${O}-overflow-menu-list`,a,`cim-${t}-component`),children:_.jsx(zy.Provider,{value:d,children:n})})})]})};function pb(e){return ot({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M15 4.00008H13V11.0001H20V9.00008H16.4142L20.7071 4.70718L19.2929 3.29297L15 7.58586V4.00008ZM4.00008 15H7.58586L3.29297 19.2929L4.70718 20.7071L9.00008 16.4142V20H11.0001V13H4.00008V15Z"},child:[]}]})(e)}function mb(e){return ot({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17.5858 5H14V3H21V10H19V6.41421L14.7071 10.7071L13.2929 9.29289L17.5858 5ZM3 14H5V17.5858L9.29289 13.2929L10.7071 14.7071L6.41421 19H10V21H3V14Z"},child:[]}]})(e)}const[mD,as]=rs({name:"CarouselContext",hookName:"useCarouselContext",providerName:"<CarouselProvider />"}),qh=B.forwardRef((e,t)=>{const n=as(),r=Ft(n.getControlProps(),e);return _.jsx(ln.div,le(H(H({},r),e),{ref:t}))});qh.displayName="CarouselControl";const Yh=B.forwardRef((e,t)=>{const[n,r]=Oa()(e,["readOnly","index"]),s=as(),a=Ft(s.getIndicatorProps(n),r);return _.jsx(ln.button,le(H({},a),{ref:t}))});Yh.displayName="CarouselIndicator";const Wh=B.forwardRef((e,t)=>{const n=as(),r=Ft(n.getIndicatorGroupProps(),e);return _.jsx(ln.div,le(H({},r),{ref:t}))});Wh.displayName="CarouselIndicatorGroup";const Gh=B.forwardRef((e,t)=>{const[n,r]=Oa()(e,["index","snapAlign"]),s=as(),a=Ft(s.getItemProps(n),r);return _.jsx(ln.div,le(H({},a),{ref:t}))});Gh.displayName="CarouselItem";const Xh=B.forwardRef((e,t)=>{const n=as(),r=Ft(n.getItemGroupProps(),e);return _.jsx(ln.div,le(H({},r),{ref:t}))});Xh.displayName="CarouselItemGroup";const Qh=B.forwardRef((e,t)=>{const n=as(),r=Ft(n.getNextTriggerProps(),e);return _.jsx(ln.button,le(H({},r),{ref:t}))});Qh.displayName="CarouselNextTrigger";const Kh=B.forwardRef((e,t)=>{const n=as(),r=Ft(n.getPrevTriggerProps(),e);return _.jsx(ln.button,le(H({},r),{ref:t}))});Kh.displayName="CarouselPrevTrigger";function gD(e){const t=Zs(e),n=e.getBoundingClientRect();let r=t.getPropertyValue("scroll-padding-left").replace("auto","0px"),s=t.getPropertyValue("scroll-padding-top").replace("auto","0px"),a=t.getPropertyValue("scroll-padding-right").replace("auto","0px"),u=t.getPropertyValue("scroll-padding-bottom").replace("auto","0px");function c(b,y){let x=parseFloat(b);return/%/.test(b)&&(x/=100,x*=y),Number.isNaN(x)?0:x}let d=c(r,n.width),f=c(s,n.height),p=c(a,n.width),m=c(u,n.height);return{x:{before:d,after:p},y:{before:f,after:m}}}function ED(e,t,n="both"){return n==="x"&&e.right>=t.left&&e.left<=t.right||n==="y"&&e.bottom>=t.top&&e.top<=t.bottom||n==="both"&&e.right>=t.left&&e.left<=t.right&&e.bottom>=t.top&&e.top<=t.bottom}function gb(e){let t=[];for(const n of e.children)t=t.concat(n,gb(n));return t}function Eb(e,t=!1){const n=e.getBoundingClientRect(),r={x:{start:[],center:[],end:[]},y:{start:[],center:[],end:[]}},s=t?gb(e):e.children;for(const a of["x","y"]){const u=a==="x"?"y":"x",c=a==="x"?"left":"top",d=a==="x"?"width":"height",f=a==="x"?"scrollLeft":"scrollTop";for(const p of s){const m=p.getBoundingClientRect();if(!ED(n,m,u))continue;const b=Zs(p);let[y,x]=b.getPropertyValue("scroll-snap-align").split(" ");typeof x=="undefined"&&(x=y);const A=a==="x"?x:y,v=m[c]-n[c]+e[f];switch(A){case"none":break;case"start":r[a].start.push({node:p,position:v});break;case"center":r[a].center.push({node:p,position:v+m[d]/2});break;case"end":r[a].end.push({node:p,position:v+m[d]});break}}}return r}function yb(e){const t=e.getBoundingClientRect(),n=gD(e),r=Eb(e),s={x:e.scrollWidth-e.offsetWidth,y:e.scrollHeight-e.offsetHeight};return{x:Tb([...r.x.start.map(a=>a.position-n.x.before),...r.x.center.map(a=>a.position-t.width/2),...r.x.end.map(a=>a.position-t.width+n.x.after)].map(bb(0,s.x))),y:Tb([...r.y.start.map(a=>a.position-n.y.before),...r.y.center.map(a=>a.position-t.height/2),...r.y.end.map(a=>a.position-t.height+n.y.after)].map(bb(0,s.y)))}}function yD(e,t,n){const r=Eb(e),s=[...r[t].start,...r[t].center,...r[t].end];for(const a of s)if(n(a.node))return a.position}var Tb=e=>[...new Set(e)],bb=(e,t)=>n=>Math.max(e,Math.min(t,n)),TD=is("carousel").parts("root","itemGroup","item","control","nextTrigger","prevTrigger","indicatorGroup","indicator","autoplayTrigger"),zr=TD.build(),bD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.root)!=null?n:`carousel:${e.id}`},xD=(e,t)=>{var n,r,s;return(s=(r=(n=e.ids)==null?void 0:n.item)==null?void 0:r.call(n,t))!=null?s:`carousel:${e.id}:item:${t}`},Wl=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.itemGroup)!=null?n:`carousel:${e.id}:item-group`},_D=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.nextTrigger)!=null?n:`carousel:${e.id}:next-trigger`},wD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.prevTrigger)!=null?n:`carousel:${e.id}:prev-trigger`},SD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.indicatorGroup)!=null?n:`carousel:${e.id}:indicator-group`},xb=(e,t)=>{var n,r,s;return(s=(r=(n=e.ids)==null?void 0:n.indicator)==null?void 0:r.call(n,t))!=null?s:`carousel:${e.id}:indicator:${t}`},vn=e=>e.getById(Wl(e)),_b=e=>X4(vn(e),"[data-part=item]"),vD=(e,t)=>e.getById(xb(e,t)),wb=e=>{const t=vn(e);if(!t)return;const n=eo(t);t.setAttribute("tabindex",n.length>0?"-1":"0")};function AD(e,t){const{state:n,context:r,computed:s,send:a,scope:u,prop:c}=e,d=n.matches("autoplay"),f=n.matches("dragging"),p=s("canScrollNext"),m=s("canScrollPrev"),b=s("isHorizontal"),y=Array.from(r.get("pageSnapPoints")),x=r.get("page"),A=c("slidesPerPage"),v=c("padding"),w=c("translations");return{isPlaying:d,isDragging:f,page:x,pageSnapPoints:y,canScrollNext:p,canScrollPrev:m,getProgress(){return x/y.length},scrollToIndex(N,C){a({type:"INDEX.SET",index:N,instant:C})},scrollTo(N,C){a({type:"PAGE.SET",index:N,instant:C})},scrollNext(N){a({type:"PAGE.NEXT",instant:N})},scrollPrev(N){a({type:"PAGE.PREV",instant:N})},play(){a({type:"AUTOPLAY.START"})},pause(){a({type:"AUTOPLAY.PAUSE"})},isInView(N){return Array.from(r.get("slidesInView")).includes(N)},refresh(){a({type:"SNAP.REFRESH"})},getRootProps(){return t.element(le(H({},zr.root.attrs),{id:bD(u),role:"region","aria-roledescription":"carousel","data-orientation":c("orientation"),dir:c("dir"),style:{"--slides-per-page":A,"--slide-spacing":c("spacing"),"--slide-item-size":"calc(100% / var(--slides-per-page) - var(--slide-spacing) * (var(--slides-per-page) - 1) / var(--slides-per-page))"}}))},getItemGroupProps(){return t.element(le(H({},zr.itemGroup.attrs),{id:Wl(u),"data-orientation":c("orientation"),"data-dragging":Xs(f),dir:c("dir"),"aria-live":d?"off":"polite",onFocus(N){Qs(N.currentTarget,ar(N))&&a({type:"VIEWPORT.FOCUS"})},onBlur(N){Qs(N.currentTarget,N.relatedTarget)||a({type:"VIEWPORT.BLUR"})},onMouseDown(N){if(N.defaultPrevented||!c("allowMouseDrag")||!rT(N))return;const C=ar(N);Sr(C)&&C!==N.currentTarget||(N.preventDefault(),a({type:"DRAGGING.START"}))},onWheel:X6(N=>{const C=c("orientation")==="horizontal"?"deltaX":"deltaY";N[C]<0&&!s("canScrollPrev")||N[C]>0&&!s("canScrollNext")||a({type:"USER.SCROLL"})},150),onTouchStart(){a({type:"USER.SCROLL"})},style:{display:"grid",gap:"var(--slide-spacing)",scrollSnapType:[b?"x":"y",c("snapType")].join(" "),gridAutoFlow:b?"column":"row",scrollbarWidth:"none",overscrollBehaviorX:"contain",[b?"gridAutoColumns":"gridAutoRows"]:"var(--slide-item-size)",[b?"scrollPaddingInline":"scrollPaddingBlock"]:v,[b?"paddingInline":"paddingBlock"]:v,[b?"overflowX":"overflowY"]:"auto"}}))},getItemProps(N){const C=r.get("slidesInView").includes(N.index);return t.element(le(H({},zr.item.attrs),{id:xD(u,N.index),dir:c("dir"),role:"group","data-index":N.index,"data-inview":Xs(C),"aria-roledescription":"slide","data-orientation":c("orientation"),"aria-label":w.item(N.index,c("slideCount")),"aria-hidden":Ky(!C),style:{scrollSnapAlign:(()=>{var ne;const j=(ne=N.snapAlign)!=null?ne:"start",X=c("slidesPerMove"),L=X==="auto"?Math.floor(c("slidesPerPage")):X;return(N.index+L)%L===0?j:void 0})()}}))},getControlProps(){return t.element(le(H({},zr.control.attrs),{"data-orientation":c("orientation")}))},getPrevTriggerProps(){return t.button(le(H({},zr.prevTrigger.attrs),{id:wD(u),type:"button",disabled:!m,dir:c("dir"),"aria-label":w.prevTrigger,"data-orientation":c("orientation"),"aria-controls":Wl(u),onClick(N){N.defaultPrevented||a({type:"PAGE.PREV",src:"trigger"})}}))},getNextTriggerProps(){return t.button(le(H({},zr.nextTrigger.attrs),{dir:c("dir"),id:_D(u),type:"button","aria-label":w.nextTrigger,"data-orientation":c("orientation"),"aria-controls":Wl(u),disabled:!p,onClick(N){N.defaultPrevented||a({type:"PAGE.NEXT",src:"trigger"})}}))},getIndicatorGroupProps(){return t.element(le(H({},zr.indicatorGroup.attrs),{dir:c("dir"),id:SD(u),"data-orientation":c("orientation"),onKeyDown(N){if(N.defaultPrevented)return;const C="indicator",j={ArrowDown(G){b||(a({type:"PAGE.NEXT",src:C}),G.preventDefault())},ArrowUp(G){b||(a({type:"PAGE.PREV",src:C}),G.preventDefault())},ArrowRight(G){b&&(a({type:"PAGE.NEXT",src:C}),G.preventDefault())},ArrowLeft(G){b&&(a({type:"PAGE.PREV",src:C}),G.preventDefault())},Home(G){a({type:"PAGE.SET",index:0,src:C}),G.preventDefault()},End(G){a({type:"PAGE.SET",index:y.length-1,src:C}),G.preventDefault()}},X=P4(N,{dir:c("dir"),orientation:c("orientation")}),L=j[X];L==null||L(N)}}))},getIndicatorProps(N){return t.button(le(H({},zr.indicator.attrs),{dir:c("dir"),id:xb(u,N.index),type:"button","data-orientation":c("orientation"),"data-index":N.index,"data-readonly":Xs(N.readOnly),"data-current":Xs(N.index===x),"aria-label":w.indicator(N.index),onClick(C){C.defaultPrevented||N.readOnly||a({type:"PAGE.SET",index:N.index,src:"indicator"})}}))},getAutoplayTriggerProps(){return t.button(le(H({},zr.autoplayTrigger.attrs),{type:"button","data-orientation":c("orientation"),"data-pressed":Xs(d),"aria-label":d?w.autoplayStop:w.autoplayStart,onClick(N){N.defaultPrevented||a({type:d?"AUTOPLAY.PAUSE":"AUTOPLAY.START"})}}))}}}var kD={props({props:e}){return t4(e,["slideCount"],"carousel"),le(H({dir:"ltr",defaultPage:0,orientation:"horizontal",snapType:"mandatory",loop:!!e.autoplay,slidesPerPage:1,slidesPerMove:"auto",spacing:"0px",autoplay:!1,allowMouseDrag:!1,inViewThreshold:.6},e),{translations:H({nextTrigger:"Next slide",prevTrigger:"Previous slide",indicator:t=>`Go to slide ${t+1}`,item:(t,n)=>`${t+1} of ${n}`,autoplayStart:"Start slide rotation",autoplayStop:"Stop slide rotation"},e.translations)})},refs(){return{timeoutRef:void 0}},initialState({prop:e}){return e("autoplay")?"autoplay":"idle"},context({prop:e,bindable:t,getContext:n}){return{page:t(()=>({defaultValue:e("defaultPage"),value:e("page"),onChange(r){var u;const a=n().get("pageSnapPoints");(u=e("onPageChange"))==null||u({page:r,pageSnapPoint:a[r]})}})),pageSnapPoints:t(()=>({defaultValue:ND(e("slideCount"),e("slidesPerMove"),e("slidesPerPage"))})),slidesInView:t(()=>({defaultValue:[]}))}},computed:{isRtl:({prop:e})=>e("dir")==="rtl",isHorizontal:({prop:e})=>e("orientation")==="horizontal",canScrollNext:({prop:e,context:t})=>e("loop")||t.get("page")<t.get("pageSnapPoints").length-1,canScrollPrev:({prop:e,context:t})=>e("loop")||t.get("page")>0,autoplayInterval:({prop:e})=>{const t=e("autoplay");return B6(t)?t.delay:4e3}},watch({track:e,action:t,context:n,prop:r,send:s}){e([()=>r("slidesPerPage"),()=>r("slidesPerMove")],()=>{t(["setSnapPoints"])}),e([()=>n.get("page")],()=>{t(["scrollToPage","focusIndicatorEl"])}),e([()=>r("orientation")],()=>{t(["setSnapPoints","scrollToPage"])}),e([()=>r("slideCount")],()=>{s({type:"SNAP.REFRESH",src:"slide.count"})}),e([()=>!!r("autoplay")],()=>{s({type:r("autoplay")?"AUTOPLAY.START":"AUTOPLAY.PAUSE",src:"autoplay.prop.change"})})},on:{"PAGE.NEXT":{target:"idle",actions:["clearScrollEndTimer","setNextPage"]},"PAGE.PREV":{target:"idle",actions:["clearScrollEndTimer","setPrevPage"]},"PAGE.SET":{target:"idle",actions:["clearScrollEndTimer","setPage"]},"INDEX.SET":{target:"idle",actions:["clearScrollEndTimer","setMatchingPage"]},"SNAP.REFRESH":{actions:["setSnapPoints","clampPage"]},"PAGE.SCROLL":{actions:["scrollToPage"]}},effects:["trackSlideMutation","trackSlideIntersections","trackSlideResize"],entry:["setSnapPoints","setPage"],exit:["clearScrollEndTimer"],states:{idle:{on:{"DRAGGING.START":{target:"dragging",actions:["invokeDragStart"]},"AUTOPLAY.START":{target:"autoplay",actions:["invokeAutoplayStart"]},"USER.SCROLL":{target:"userScroll"},"VIEWPORT.FOCUS":{target:"focus"}}},focus:{effects:["trackKeyboardScroll"],on:{"VIEWPORT.BLUR":{target:"idle"},"PAGE.NEXT":{actions:["clearScrollEndTimer","setNextPage"]},"PAGE.PREV":{actions:["clearScrollEndTimer","setPrevPage"]},"PAGE.SET":{actions:["clearScrollEndTimer","setPage"]},"INDEX.SET":{actions:["clearScrollEndTimer","setMatchingPage"]},"USER.SCROLL":{target:"userScroll"}}},dragging:{effects:["trackPointerMove"],entry:["disableScrollSnap"],on:{DRAGGING:{actions:["scrollSlides","invokeDragging"]},"DRAGGING.END":{target:"idle",actions:["endDragging","invokeDraggingEnd"]}}},userScroll:{effects:["trackScroll"],on:{"SCROLL.END":[{guard:"isFocused",target:"focus",actions:["setClosestPage"]},{target:"idle",actions:["setClosestPage"]}]}},autoplay:{effects:["trackDocumentVisibility","trackScroll","autoUpdateSlide"],exit:["invokeAutoplayEnd"],on:{"AUTOPLAY.TICK":{actions:["setNextPage","invokeAutoplay"]},"DRAGGING.START":{target:"dragging",actions:["invokeDragStart"]},"AUTOPLAY.PAUSE":{target:"idle"}}}},implementations:{guards:{isFocused:({scope:e})=>e.isActiveElement(vn(e))},effects:{autoUpdateSlide({computed:e,send:t}){const n=setInterval(()=>{t({type:e("canScrollNext")?"AUTOPLAY.TICK":"AUTOPLAY.PAUSE",src:"autoplay.interval"})},e("autoplayInterval"));return()=>clearInterval(n)},trackSlideMutation({scope:e,send:t}){const n=vn(e);if(!n)return;const r=e.getWin(),s=new r.MutationObserver(()=>{t({type:"SNAP.REFRESH",src:"slide.mutation"}),wb(e)});return wb(e),s.observe(n,{childList:!0,subtree:!0}),()=>s.disconnect()},trackSlideResize({scope:e,send:t}){if(!vn(e))return;const r=e.getWin(),s=()=>{t({type:"SNAP.REFRESH",src:"slide.resize"})};Mt(()=>{s(),Mt(()=>{t({type:"PAGE.SCROLL",instant:!0})})});const a=new r.ResizeObserver(s);return _b(e).forEach(u=>a.observe(u)),()=>a.disconnect()},trackSlideIntersections({scope:e,prop:t,context:n}){const r=vn(e),s=e.getWin(),a=new s.IntersectionObserver(u=>{const c=u.reduce((d,f)=>{var b;const p=f.target,m=Number((b=p.dataset.index)!=null?b:"-1");return m==null||Number.isNaN(m)||m===-1?d:f.isIntersecting?R6(d,m):L6(d,m)},n.get("slidesInView"));n.set("slidesInView",D6(c))},{root:r,threshold:t("inViewThreshold")});return _b(e).forEach(u=>a.observe(u)),()=>a.disconnect()},trackScroll({send:e,refs:t,scope:n}){const r=vn(n);return r?zt(r,"scroll",()=>{clearTimeout(t.get("timeoutRef")),t.set("timeoutRef",void 0),t.set("timeoutRef",setTimeout(()=>{e({type:"SCROLL.END"})},150))},{passive:!0}):void 0},trackDocumentVisibility({scope:e,send:t}){const n=e.getDoc();return zt(n,"visibilitychange",()=>{n.visibilityState!=="visible"&&t({type:"AUTOPLAY.PAUSE",src:"doc.hidden"})})},trackPointerMove({scope:e,send:t}){const n=e.getDoc();return Y4(n,{onPointerMove({event:r}){t({type:"DRAGGING",left:-r.movementX,top:-r.movementY})},onPointerUp(){t({type:"DRAGGING.END"})}})},trackKeyboardScroll({scope:e,send:t,context:n}){const r=e.getWin();return zt(r,"keydown",a=>{switch(a.key){case"ArrowRight":a.preventDefault(),t({type:"PAGE.NEXT"});break;case"ArrowLeft":a.preventDefault(),t({type:"PAGE.PREV"});break;case"Home":a.preventDefault(),t({type:"PAGE.SET",index:0});break;case"End":a.preventDefault(),t({type:"PAGE.SET",index:n.get("pageSnapPoints").length-1})}},{capture:!0})}},actions:{clearScrollEndTimer({refs:e}){e.get("timeoutRef")!=null&&(clearTimeout(e.get("timeoutRef")),e.set("timeoutRef",void 0))},scrollToPage({context:e,event:t,scope:n,computed:r,flush:s}){var f;const a=t.instant?"instant":"smooth",u=Xy((f=t.index)!=null?f:e.get("page"),0,e.get("pageSnapPoints").length-1),c=vn(n);if(!c)return;const d=r("isHorizontal")?"left":"top";s(()=>{c.scrollTo({[d]:e.get("pageSnapPoints")[u],behavior:a})})},setClosestPage({context:e,scope:t,computed:n}){const r=vn(t);if(!r)return;const s=n("isHorizontal")?r.scrollLeft:r.scrollTop,a=e.get("pageSnapPoints").findIndex(u=>Math.abs(u-s)<1);a!==-1&&e.set("page",a)},setNextPage({context:e,prop:t,state:n}){const r=n.matches("autoplay")||t("loop"),s=Yy(e.get("pageSnapPoints"),e.get("page"),{loop:r});e.set("page",s)},setPrevPage({context:e,prop:t,state:n}){const r=n.matches("autoplay")||t("loop"),s=M6(e.get("pageSnapPoints"),e.get("page"),{loop:r});e.set("page",s)},setMatchingPage({context:e,event:t,computed:n,scope:r}){const s=vn(r);if(!s)return;const a=yD(s,n("isHorizontal")?"x":"y",c=>c.dataset.index===t.index.toString());if(a==null)return;const u=e.get("pageSnapPoints").findIndex(c=>Math.abs(c-a)<1);e.set("page",u)},setPage({context:e,event:t}){var r;const n=(r=t.index)!=null?r:e.get("page");e.set("page",n)},clampPage({context:e}){const t=Xy(e.get("page"),0,e.get("pageSnapPoints").length-1);e.set("page",t)},setSnapPoints({context:e,computed:t,scope:n}){const r=vn(n);if(!r)return;const s=yb(r);e.set("pageSnapPoints",t("isHorizontal")?s.x:s.y)},disableScrollSnap({scope:e}){const t=vn(e);if(!t)return;const n=getComputedStyle(t);t.dataset.scrollSnapType=n.getPropertyValue("scroll-snap-type"),t.style.setProperty("scroll-snap-type","none")},scrollSlides({scope:e,event:t}){const n=vn(e);n==null||n.scrollBy({left:t.left,top:t.top,behavior:"instant"})},endDragging({scope:e,context:t,computed:n}){const r=vn(e);if(!r)return;const s=r.scrollLeft,a=r.scrollTop,u=yb(r),c=u.x.reduce((f,p)=>Math.abs(p-s)<Math.abs(f-s)?p:f,u.x[0]),d=u.y.reduce((f,p)=>Math.abs(p-a)<Math.abs(f-a)?p:f,u.y[0]);Mt(()=>{r.scrollTo({left:c,top:d,behavior:"smooth"});const f=n("isHorizontal")?c:d;t.set("page",t.get("pageSnapPoints").indexOf(f));const p=r.dataset.scrollSnapType;p&&(r.style.setProperty("scroll-snap-type",p),delete r.dataset.scrollSnapType)})},focusIndicatorEl({context:e,event:t,scope:n}){if(t.src!=="indicator")return;const r=vD(n,e.get("page"));r&&Mt(()=>r.focus({preventScroll:!0}))},invokeDragStart({context:e,prop:t}){var n;(n=t("onDragStatusChange"))==null||n({type:"dragging.start",isDragging:!0,page:e.get("page")})},invokeDragging({context:e,prop:t}){var n;(n=t("onDragStatusChange"))==null||n({type:"dragging",isDragging:!0,page:e.get("page")})},invokeDraggingEnd({context:e,prop:t}){var n;(n=t("onDragStatusChange"))==null||n({type:"dragging.end",isDragging:!1,page:e.get("page")})},invokeAutoplay({context:e,prop:t}){var n;(n=t("onAutoplayStatusChange"))==null||n({type:"autoplay",isPlaying:!0,page:e.get("page")})},invokeAutoplayStart({context:e,prop:t}){var n;(n=t("onAutoplayStatusChange"))==null||n({type:"autoplay.start",isPlaying:!0,page:e.get("page")})},invokeAutoplayEnd({context:e,prop:t}){var n;(n=t("onAutoplayStatusChange"))==null||n({type:"autoplay.stop",isPlaying:!1,page:e.get("page")})}}}};function ND(e,t,n){if(e==null||n<=0)return[];const r=[],s=t==="auto"?Math.floor(n):t;if(s<=0)return[];for(let a=0;a<e&&!(a+n>e);a+=s)r.push(a);return r}ro()(["dir","getRootNode","id","ids","loop","page","defaultPage","onPageChange","orientation","slideCount","slidesPerPage","slidesPerMove","spacing","padding","autoplay","allowMouseDrag","inViewThreshold","translations","snapType","onDragStatusChange","onAutoplayStatusChange"]),ro()(["index","readOnly"]),ro()(["index","snapAlign"]);const CD=e=>{const t=B.useId(),{getRootNode:n}=Yl(),{dir:r}=zh(),s=H({id:t,dir:r,getRootNode:n},e),a=Rl(kD,s);return AD(a,wh)},Jh=B.forwardRef((e,t)=>{const[n,r]=Oa()(e,["allowMouseDrag","autoplay","defaultPage","id","ids","inViewThreshold","loop","onAutoplayStatusChange","onDragStatusChange","onPageChange","orientation","padding","page","slideCount","slidesPerMove","slidesPerPage","snapType","spacing","translations"]),s=CD(n),a=Ft(s.getRootProps(),r);return _.jsx(mD,{value:s,children:_.jsx(ln.div,le(H({},a),{ref:t}))})});Jh.displayName="CarouselRoot";const OD=180,ID=e=>{const t=e.trim(),n=parseFloat(t);return Number.isNaN(n)?0:t.endsWith("rem")?n*16:n},PD=({globalClassName:e,className:t,itemMinWidth:n=OD,spacing:r="0.5rem",loop:s=!1,allowMouseDrag:a=!0,showIndicators:u=!0,showNavigation:c=!0,onPageChange:d,ariaLabel:f="Product carousel",children:p})=>{const m=Array.from(p).map((ne,de)=>({node:ne,key:B.isValidElement(ne)&&ne.key!=null?ne.key:`carousel-item-${de}`})),b=m.length,y=B.useRef(null),[x,A]=B.useState(0),{width:v}=kk();B.useLayoutEffect(()=>{y.current&&A(y.current.getBoundingClientRect().width)},[v,b]);const w=ID(r),N=n+w,C=x>0?(x+w)/N:1,j=Math.max(1,Math.floor(C));if(b===0)return null;const X=b>j,L=Math.ceil(b/j),G=X?Math.max(1,C):j;return _.jsxs(Jh,{ref:y,className:M(e,t,`${O}-carousel`),slidesPerPage:G,slidesPerMove:j,spacing:r,loop:s,allowMouseDrag:a,slideCount:b,onPageChange:d,"aria-label":f,children:[_.jsx(Xh,{className:M(e,`${O}-carousel__item-group`,{"carousel-row-container":!X}),children:m.map(({node:ne,key:de},z)=>_.jsx(Gh,{index:z,className:M(e,`${O}-carousel__item`),children:ne},de))}),c&&X&&_.jsxs(qh,{className:M(e,`${O}-carousel__control`),children:[_.jsx(Kh,{className:M(e,`${O}-carousel__prev-trigger`),"aria-label":"Previous slide",children:_.jsx(db,{size:"16px"})}),_.jsx(Qh,{className:M(e,`${O}-carousel__next-trigger`),"aria-label":"Next slide",children:_.jsx(fb,{size:"16px"})})]}),u&&X&&_.jsx(Wh,{className:M(e,`${O}-carousel__indicator-group`),children:Array.from({length:L},(ne,de)=>_.jsx(Yh,{index:de,className:M(e,`${O}-carousel__indicator`),"aria-label":`Go to slide group ${de+1}`},de))})]})},RD=({className:e,label:t="Close",onClick:n,disabled:r=!1})=>_.jsx("button",{"aria-label":t,title:t,className:M(e,`${O}-close-button`),disabled:r,onClick:n,children:_.jsx("svg",{role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 20",width:"16",height:"16",fill:"currentColor",children:_.jsx("path",{d:"M18.3 5.7a1 1 0 0 0-1.4-1.4L12 9.6 7.1 4.7a1 1 0 1 0-1.4 1.4l4.9 4.9-4.9 4.9a1 1 0 1 0 1.4 1.4l4.9-4.9 4.9 4.9a1 1 0 0 0 1.4-1.4l-4.9-4.9 4.9-4.9z"})})}),[LD,DD]=rs({name:"RenderStrategyContext",hookName:"useRenderStrategyContext",providerName:"<RenderStrategyPropsProvider />"}),MD=e=>Oa()(e,["lazyMount","unmountOnExit"]),[FD,Ma]=rs({name:"DialogContext",hookName:"useDialogContext",providerName:"<DialogProvider />"}),Sb=B.forwardRef((e,t)=>{const n=Ma(),r=DD(),s=Ah(le(H({},r),{present:n.open})),a=Ft(n.getBackdropProps(),s.getPresenceProps(),e);return s.unmounted?null:_.jsx(ln.div,le(H({},a),{ref:Ll(s.ref,t)}))});Sb.displayName="DialogBackdrop";const Zh=B.forwardRef((e,t)=>{const n=Ma(),r=Ca(),s=Ft(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:_.jsx(ln.div,le(H({},s),{ref:Ll(r.ref,t)}))});Zh.displayName="DialogContent";const ep=B.forwardRef((e,t)=>{const n=Ma(),r=Ft(n.getDescriptionProps(),e);return _.jsx(ln.div,le(H({},r),{ref:t}))});ep.displayName="DialogDescription";const tp=B.forwardRef((e,t)=>{const n=Ma(),r=Ft(n.getPositionerProps(),e);return Ca().unmounted?null:_.jsx(ln.div,le(H({},r),{ref:t}))});tp.displayName="DialogPositioner";var BD=is("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),us=BD.build(),vb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`dialog:${e.id}:positioner`},Ab=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.backdrop)!=null?n:`dialog:${e.id}:backdrop`},np=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`dialog:${e.id}:content`},kb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`dialog:${e.id}:trigger`},rp=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`dialog:${e.id}:title`},ip=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`dialog:${e.id}:description`},Nb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`dialog:${e.id}:close`},Gl=e=>e.getById(np(e)),UD=e=>e.getById(vb(e)),HD=e=>e.getById(Ab(e)),jD=e=>e.getById(kb(e)),$D=e=>e.getById(rp(e)),zD=e=>e.getById(ip(e)),VD=e=>e.getById(Nb(e));function qD(e,t){const{state:n,send:r,context:s,prop:a,scope:u}=e,c=a("aria-label"),d=n.matches("open");return{open:d,setOpen(f){n.matches("open")!==f&&r({type:f?"OPEN":"CLOSE"})},getTriggerProps(){return t.button(le(H({},us.trigger.attrs),{dir:a("dir"),id:kb(u),"aria-haspopup":"dialog",type:"button","aria-expanded":d,"data-state":d?"open":"closed","aria-controls":np(u),onClick(f){f.defaultPrevented||r({type:"TOGGLE"})}}))},getBackdropProps(){return t.element(le(H({},us.backdrop.attrs),{dir:a("dir"),hidden:!d,id:Ab(u),"data-state":d?"open":"closed"}))},getPositionerProps(){return t.element(le(H({},us.positioner.attrs),{dir:a("dir"),id:vb(u),style:{pointerEvents:d?void 0:"none"}}))},getContentProps(){const f=s.get("rendered");return t.element(le(H({},us.content.attrs),{dir:a("dir"),role:a("role"),hidden:!d,id:np(u),tabIndex:-1,"data-state":d?"open":"closed","aria-modal":!0,"aria-label":c||void 0,"aria-labelledby":c||!f.title?void 0:rp(u),"aria-describedby":f.description?ip(u):void 0}))},getTitleProps(){return t.element(le(H({},us.title.attrs),{dir:a("dir"),id:rp(u)}))},getDescriptionProps(){return t.element(le(H({},us.description.attrs),{dir:a("dir"),id:ip(u)}))},getCloseTriggerProps(){return t.button(le(H({},us.closeTrigger.attrs),{dir:a("dir"),id:Nb(u),type:"button",onClick(f){f.defaultPrevented||(f.stopPropagation(),r({type:"CLOSE"}))}}))}}}var YD={props({props:e,scope:t}){const n=e.role==="alertdialog",r=n?()=>VD(t):void 0,s=typeof e.modal=="boolean"?e.modal:!0;return H({role:"dialog",modal:s,trapFocus:s,preventScroll:s,closeOnInteractOutside:!n,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:r},e)},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{rendered:e(()=>({defaultValue:{title:!0,description:!0}}))}},watch({track:e,action:t,prop:n}){e([()=>n("open")],()=>{t(["toggleVisibility"])})},states:{open:{entry:["checkRenderedElements","syncZIndex"],effects:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackDismissableElement({scope:e,send:t,prop:n}){return ZT(()=>Gl(e),{type:"dialog",defer:!0,pointerBlocking:n("modal"),exclude:[jD(e)],onInteractOutside(s){var a;(a=n("onInteractOutside"))==null||a(s),n("closeOnInteractOutside")||s.preventDefault()},persistentElements:n("persistentElements"),onFocusOutside:n("onFocusOutside"),onPointerDownOutside:n("onPointerDownOutside"),onRequestDismiss:n("onRequestDismiss"),onEscapeKeyDown(s){var a;(a=n("onEscapeKeyDown"))==null||a(s),n("closeOnEscape")||s.preventDefault()},onDismiss(){t({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:e,prop:t}){if(t("preventScroll"))return ib(e.getDoc())},trapFocus({scope:e,prop:t}){return t("trapFocus")?nb(()=>Gl(e),{preventScroll:!0,returnFocusOnDeactivate:!!t("restoreFocus"),initialFocus:t("initialFocusEl"),setReturnFocus:r=>{var s,a;return(a=(s=t("finalFocusEl"))==null?void 0:s())!=null?a:r},getShadowRoot:!0}):void 0},hideContentBelow({scope:e,prop:t}){return t("modal")?VT(()=>[Gl(e)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:e,scope:t}){Mt(()=>{e.set("rendered",{title:!!$D(t),description:!!zD(t)})})},syncZIndex({scope:e}){Mt(()=>{const t=Gl(e);if(!t)return;const n=Zs(t);[UD(e),HD(e)].forEach(s=>{s==null||s.style.setProperty("--z-index",n.zIndex),s==null||s.style.setProperty("--layer-index",n.getPropertyValue("--layer-index"))})})},invokeOnClose({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!1})},invokeOnOpen({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!0})},toggleVisibility({prop:e,send:t,event:n}){t({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:n})}}}};ro()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);const WD=e=>{const t=B.useId(),{getRootNode:n}=Yl(),{dir:r}=zh(),s=H({id:t,getRootNode:n,dir:r},e),a=Rl(YD,s);return qD(a,wh)},Cb=e=>{const[t,c]=TT(e),d=c,{children:n}=d,r=yn(d,["children"]),[s]=MD(t),a=WD(r),u=Ah(Ft({present:a.open},t));return _.jsx(FD,{value:a,children:_.jsx(LD,{value:s,children:_.jsx(gT,{value:u,children:n})})})},Ob=B.forwardRef((e,t)=>{const n=Ma(),r=Ft(n.getTitleProps(),e);return _.jsx(ln.h2,le(H({},r),{ref:t}))});Ob.displayName="DialogTitle";const GD=({children:e})=>{const[t,n]=B.useState(!1),r=B.useMemo(()=>({toggleMenu:()=>n(a=>!a),closeMenu:()=>n(!1)}),[]),s=B.useMemo(()=>({isOpen:t}),[t]);return _.jsx(lh.Provider,{value:r,children:_.jsx($y.Provider,{value:s,children:e})})},Ib=()=>B.useContext($y),Pb=()=>{const e=B.useContext(lh);if(!e)throw new Error("useOverflowMenuDispatch must be used within an OverflowMenuProvider");return e},XD=`${O}-overflow-menu-button-trigger`,QD=({componentType:e,children:t})=>{const{isOpen:n}=Ib(),{closeMenu:r}=Pb(),{globalClassName:s}=at(),a=B.useRef(null);return B.useEffect(()=>{if(!n)return;const u=d=>{d.key==="Escape"&&r()},c=d=>{const f=d.target;f instanceof Element&&f.closest(`.${XD}`)||a.current&&!a.current.contains(f)&&r()};return document.addEventListener("keydown",u),document.addEventListener("mousedown",c),()=>{document.removeEventListener("keydown",u),document.removeEventListener("mousedown",c)}},[n,r]),n?_.jsx("div",{ref:a,role:"menu","aria-label":`Overflow menu for ${e}`,className:M(`${O}-overflow-panel`,s,`cim-${e}-component`),children:t}):null},KD=({componentType:e,className:t})=>{const{toggleMenu:n}=Pb(),{isOpen:r}=Ib(),{globalClassName:s}=at();return _.jsx("button",{"aria-label":`Overflow menu for ${e}`,title:"More options","aria-expanded":r,"aria-haspopup":"menu",className:M(`${O}-overflow-menu-button-trigger`,`${O}-icon-button`,s,t,`cim-${e}-component`),onClick:n,children:_.jsx(hb,{})})};class JD{constructor(){Ye(this,"initialState",Vg);Ye(this,"promptsStateProxy");Ye(this,"promptsParamsProxy");Ye(this,"_fullGet",(t,n)=>Reflect.get(t,n));Ye(this,"_fullSet",(t,n,r)=>{if(!(n in t))throw new Error(`Property ${n} does not exist on PromptsExtensionState`);return t8(n,r),Reflect.set(t,n,r)});Ye(this,"_paramsFullGet",(t,n)=>Reflect.get(t,n));Ye(this,"_paramsFullSet",(t,n,r)=>Reflect.set(t,n,r));Ye(this,"updatePromptsParamsProxy",t=>new Proxy(H({},t),{get:this._paramsFullGet,set:this._paramsFullSet}));this.promptsStateProxy=new Proxy({isOpen:this.initialState.isOpen,isInline:this.initialState.isInline,elementId:this.initialState.elementId,entryType:this.initialState.entryType},{get:this._fullGet,set:this._fullSet}),this.promptsParamsProxy=this.updatePromptsParamsProxy({})}get isOpen(){return this.promptsStateProxy.isOpen}get isInline(){return this.promptsStateProxy.isInline}get state(){return{isOpen:this.isOpen,isInline:this.isInline}}get params(){return this.promptsParamsProxy}}const pi=new JD,ZD=e=>{window.addEventListener(Od,e)},e8=e=>{window.removeEventListener(Od,e)},t8=(e,t)=>{const n=new CustomEvent(Od,{detail:{property:e,value:t}});window.dispatchEvent(n)},Rb=e=>{const t=pi.isOpen,n=typeof e=="boolean"?e:!t;pi.promptsStateProxy.isOpen=n},n8=e=>{const t=pi.isInline,n=typeof e=="boolean"?e:!t;pi.promptsStateProxy.isInline=n},r8=({elementId:e,entryType:t,params:n,isInline:r})=>{pi.promptsStateProxy.elementId=e,t&&(pi.promptsStateProxy.entryType=t),typeof r=="boolean"&&n8(r),n&&pi.updatePromptsParamsProxy(n),pi.isOpen||Rb(!0)},i8=()=>{const e=B.useContext(Gg);if(!e)throw new Error("usePdp must be used within a PdpProvider");return e},s8=()=>{const e=B.useContext(Yg);if(!e)throw new Error("usePromptsExtensionDispatch must be used within a PromptsExtensionProvider");return e||{}},Xl=()=>{const e=B.useContext(qg);if(!e)throw new Error("usePromptsExtensionState must be used within a PromptsExtensionProvider");return e||{}},o8=({componentType:e,isIcon:t})=>{const{globalClassName:n}=at(),{previousComponentType:r}=ri(),s=Ws(),a=()=>{Ou(r||"dialog"),s()};return t?_.jsx(ir,{className:M(n,`${O}-toggle-dialog-button`,`cim-${e}-component`),ariaLabel:"Collapse",title:"Collapse",onClick:a,icon:_.jsx(pb,{})}):_.jsxs("button",{className:M(n,`${O}-overflow-menu-button`,`${O}-toggle-dialog-button`,`cim-${e}-component`),onClick:a,children:[_.jsx(pb,{}),"Show ",r||"dialog"]})},a8=({componentType:e,isIcon:t})=>{const{globalClassName:n}=at(),{isModalFullscreen:r}=ri(),s=Ws(),a=()=>{Pd(!r),s()},u=r?rN:iN,c="Toggle Fullscreen";return t?_.jsx(ir,{ariaLabel:c,title:c,className:M(n,`${O}-modal-fullscreen-button`,`cim-${e}-component`),icon:_.jsx(u,{}),onClick:a}):_.jsxs("button",{className:M(n,`${O}-overflow-menu-button`,`${O}-modal-fullscreen-button`,`cim-${e}-component`),onClick:a,children:[_.jsx(u,{}),c]})},u8=({componentType:e,isIcon:t})=>{const{globalClassName:n}=at(),{dialogPosition:r}=ri(),s=Ws(),a=r==="bottom-left",u=()=>{Rd(a?"bottom-right":"bottom-left"),s()},c=a?dD:cD,d=a?"Move right":"Move left";return t?_.jsx(ir,{className:M(n,`${O}-left-right-toggle-button`,`cim-${e}-component`),ariaLabel:d,title:d,onClick:u,icon:_.jsx(c,{})}):_.jsxs("button",{className:M(n,`${O}-overflow-menu-button`,`${O}-left-right-toggle-button`,`cim-${e}-component`),onClick:u,children:[_.jsx(c,{}),d]})},Lb=({componentType:e,onClearChat:t,onClose:n,onDownloadTranscript:r})=>{const{headerConfig:s,globalClassName:a,mode:u,enableDownloadTranscript:c}=at(),{mode:d}=ri(),f=u==="messaging"&&c&&!!r,p=d==="standalone",m=e==="modal",b=m?o8:Fb,y=m?a8:u8,x=B.useMemo(()=>s?Qk(s):{},[s]);return _.jsx(GD,{children:_.jsxs("div",{className:M(a,`${O}-${e}-header-wrapper`),style:{display:"flex",flexDirection:"column",position:"relative"},children:[_.jsxs("div",{className:M(a,`${O}-${e}-header`,{standalone:p,embedded:!p}),style:x,children:[(s==null?void 0:s.logoUrl)&&_.jsx("img",{alt:"",role:"img",className:M(a,`${O}-${e}-logo`,{standalone:p,embedded:!p}),src:s.logoUrl}),_.jsx(Ob,{className:M(a,`${O}-${e}-title`,{standalone:p,embedded:!p}),children:s==null?void 0:s.headerText}),_.jsxs("div",{className:M(a,`${O}-${e}-controls`),children:[_.jsx(b,{componentType:e,isIcon:!0}),_.jsx(KD,{componentType:e}),_.jsx(RD,{className:M(a,`cim-${e}-component`),onClick:n})]})]}),_.jsxs(QD,{componentType:e,children:[_.jsx(y,{componentType:e}),_.jsx(h8,{componentType:e}),_.jsx(Vy,{componentType:e,onClearChat:t}),f&&_.jsx(qy,{componentType:e,onDownloadTranscript:r})]})]})})},Ql="USD",Vr=(e,t)=>{if(typeof e!="number"||Number.isNaN(e))return null;try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(e)}catch(n){return`${e}`}},l8=({retailPrice:e,discountPrice:t,currencyCode:n=Ql})=>{const r=n||Ql,s=typeof t=="number"&&typeof e=="number"&&t<e,a=s?t:e||t||null,u=s?e:null;return{price:Vr(a,r),comparePrice:Vr(u,r),hasDiscount:s}},Db=e=>typeof e=="number"&&Number.isFinite(e),c8=({priceBreakdown:e,currencyCode:t=Ql})=>{if(!e)return null;const n=t||Ql,r=[e.sales,e.original],s=r.map(p=>p==null?void 0:p.min).filter(Db),a=r.map(p=>p==null?void 0:p.max).filter(Db);if(s.length===0||a.length===0)return null;const u=Math.min(...s),c=Math.max(...a);if(u===c)return null;const d=Vr(u,n),f=Vr(c,n);return d===null||f===null?null:{range:`${d} – ${f}`,low:d,high:f}},sp=({retailPrice:e,discountPrice:t,currencyCode:n,fontSize:r,globalClassName:s,className:a})=>{const{price:u,comparePrice:c,hasDiscount:d}=l8({retailPrice:e,discountPrice:t,currencyCode:n});if(!u)return null;const f=typeof r=="string"?{fontSize:r}:{};return _.jsxs("div",{className:M(s,a,`${O}-price`),style:f,children:[_.jsx("span",{className:M(s,`${O}-price__amount`),children:u}),d&&c&&_.jsx("span",{className:M(s,`${O}-price__compare`),children:c})]})},d8={sparkle:Vh,plus:fD,"paper-plane":hD},Mb=({icon:e,className:t})=>{const n=d8[e];return n?_.jsx(n,{className:t,"aria-hidden":"true"}):null},f8=({className:e,globalClassName:t,suggestions:n,disabled:r,isWidgetStandalone:s,onSuggestionClick:a})=>{var y;const{suggestionButtonConfig:u}=at(),c=u==null?void 0:u.icon,d=(y=u==null?void 0:u.iconPosition)!=null?y:"left",f=s?"standalone":"embedded",p=x=>()=>{a(x)},m={"has-icon":!!c,"icon-right":!!c&&d==="right"},b=x=>_.jsxs(_.Fragment,{children:[c&&_.jsx(Mb,{icon:c,className:`${O}-suggestion-button-icon`}),_.jsx("span",{children:x})]});return _.jsx("div",{className:M(t,`${O}-suggestion-container ${f}`,e),children:n.map(x=>s?_.jsx(el,{disabled:r,className:M(t,`${O}-suggestion-button standalone`,m),onClick:p(x),children:b(x)},x):_.jsx("button",{disabled:r,className:M(t,`${O}-suggestion-button embedded`,m),onClick:p(x),children:b(x)},x))})},h8=({componentType:e,isIcon:t})=>{const{globalClassName:n,enableMinimize:r}=at();if(!r)return null;const s=()=>{Br(!1),Cu(!0)};return t?_.jsx(ir,{className:M(n,`${O}-toggle-minimize-button`,`cim-${e}-component`),ariaLabel:"Toggle Minimize",title:"Minimize",onClick:s,icon:_.jsx(a1,{})}):_.jsxs("button",{className:M(n,`${O}-overflow-menu-button`,`${O}-toggle-minimize-button`,`cim-${e}-component`),onClick:s,children:[_.jsx(a1,{}),"Minimize"]})},Fb=({componentType:e,isIcon:t})=>{const{globalClassName:n}=at(),r=Ws(),s=()=>{Ou("modal"),r()};return t?_.jsx(ir,{className:M(n,`${O}-toggle-modal-button`,`cim-${e}-component`),ariaLabel:"Expand",title:"Expand",onClick:s,icon:_.jsx(mb,{})}):_.jsxs("button",{className:M(n,`${O}-overflow-menu-button`,`${O}-toggle-modal-button`,`cim-${e}-component`),onClick:s,children:[_.jsx(mb,{}),"Show modal"]})},p8=["Hey there! 👋 What can I find for you today?","Shopping for a gift? Tell me your budget and preferences","Need help? Connect to an agent"],m8=3e3,g8=400,E8=({globalClassName:e,isWidgetStandalone:t,messages:n=p8})=>{const[r,s]=B.useState(0),[a,u]=B.useState(!0);return B.useEffect(()=>{let c;const d=setInterval(()=>{u(!1),c=setTimeout(()=>{s(f=>(f+1)%n.length),u(!0)},g8)},m8);return()=>{clearInterval(d),clearTimeout(c)}},[n.length]),_.jsxs("div",{className:M(e,`${O}-connecting-indicator`,t?"standalone":"embedded"),role:"status","aria-label":"Connecting to assistant",children:[_.jsxs("div",{className:`${O}-connecting-pulse-wrapper`,children:[_.jsx("div",{className:`${O}-connecting-pulse`}),_.jsx("div",{className:`${O}-connecting-ring`})]}),_.jsx("span",{className:M(`${O}-connecting-text`,a&&`${O}-connecting-text--visible`),children:n[r]})]})},y8=({shouldShow:e,loadingText:t})=>e?_.jsx("span",{className:`${O}-processing-text`,children:t}):null,T8=({shouldShow:e})=>e?_.jsxs(_.Fragment,{children:[_.jsx("div",{className:`${O}-processing-shimmer-bar`}),_.jsx("div",{className:`${O}-processing-shimmer-bar`}),_.jsx("div",{className:`${O}-processing-shimmer-bar`})]}):null,op=({globalClassName:e,isWidgetStandalone:t,loadingText:n})=>_.jsxs("div",{className:M(e,`${O}-processing-indicator`,t?"standalone":"embedded"),role:"status","aria-label":n||"Loading response",children:[_.jsx(y8,{shouldShow:!!n,loadingText:n}),_.jsx(T8,{shouldShow:!n})]});function Bb(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function b8(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function x8(e,t,n){const s=dl((n||{}).ignore||[]),a=_8(t);let u=-1;for(;++u<a.length;)_E(e,"text",c);function c(f,p){let m=-1,b;for(;++m<p.length;){const y=p[m],x=b?b.children:void 0;if(s(y,x?x.indexOf(y):void 0,b))return;b=y}if(b)return d(f,p)}function d(f,p){const m=p[p.length-1],b=a[u][0],y=a[u][1];let x=0;const v=m.children.indexOf(f);let w=!1,N=[];b.lastIndex=0;let C=b.exec(f.value);for(;C;){const j=C.index,X={index:C.index,input:C.input,stack:[...p,f]};let L=y(...C,X);if(typeof L=="string"&&(L=L.length>0?{type:"text",value:L}:void 0),L===!1?b.lastIndex=j+1:(x!==j&&N.push({type:"text",value:f.value.slice(x,j)}),Array.isArray(L)?N.push(...L):L&&N.push(L),x=j+C[0].length,w=!0),!b.global)break;C=b.exec(f.value)}return w?(x<f.value.length&&N.push({type:"text",value:f.value.slice(x)}),m.children.splice(v,1,...N)):N=[f],v+N.length}}function _8(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([w8(s[0]),S8(s[1])])}return t}function w8(e){return typeof e=="string"?new RegExp(b8(e),"g"):e}function S8(e){return typeof e=="function"?e:function(){return e}}const ap="phrasing",up=["autolink","link","image","label"];function v8(){return{transforms:[P8],enter:{literalAutolink:k8,literalAutolinkEmail:lp,literalAutolinkHttp:lp,literalAutolinkWww:lp},exit:{literalAutolink:I8,literalAutolinkEmail:O8,literalAutolinkHttp:N8,literalAutolinkWww:C8}}}function A8(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ap,notInConstruct:up},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ap,notInConstruct:up},{character:":",before:"[ps]",after:"\\/",inConstruct:ap,notInConstruct:up}]}}function k8(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function lp(e){this.config.enter.autolinkProtocol.call(this,e)}function N8(e){this.config.exit.autolinkProtocol.call(this,e)}function C8(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function O8(e){this.config.exit.autolinkEmail.call(this,e)}function I8(e){this.exit(e)}function P8(e){x8(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,R8],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),L8]],{ignore:["link","linkReference"]})}function R8(e,t,n,r,s){let a="";if(!Ub(s)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!D8(n)))return!1;const u=M8(n+r);if(!u[0])return!1;const c={type:"link",title:null,url:a+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[c,{type:"text",value:u[1]}]:c}function L8(e,t,n,r){return!Ub(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function D8(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function M8(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=Bb(e,"(");let a=Bb(e,")");for(;r!==-1&&s>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function Ub(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Gi(n)||il(n))&&(!t||n!==47)}Hb.peek=q8;function F8(){this.buffer()}function B8(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function U8(){this.buffer()}function H8(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function j8(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=sr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $8(e){this.exit(e)}function z8(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=sr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function V8(e){this.exit(e)}function q8(){return"["}function Hb(e,t,n,r){const s=n.createTracker(r);let a=s.move("[^");const u=n.enter("footnoteReference"),c=n.enter("reference");return a+=s.move(n.safe(n.associationId(e),{after:"]",before:a})),c(),u(),a+=s.move("]"),a}function Y8(){return{enter:{gfmFootnoteCallString:F8,gfmFootnoteCall:B8,gfmFootnoteDefinitionLabelString:U8,gfmFootnoteDefinition:H8},exit:{gfmFootnoteCallString:j8,gfmFootnoteCall:$8,gfmFootnoteDefinitionLabelString:z8,gfmFootnoteDefinition:V8}}}function W8(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Hb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,a,u){const c=a.createTracker(u);let d=c.move("[^");const f=a.enter("footnoteDefinition"),p=a.enter("label");return d+=c.move(a.safe(a.associationId(r),{before:d,after:"]"})),p(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
38
38
  `:" ")+a.indentLines(a.containerFlow(r,c.current()),t?jb:G8))),f(),d}}function G8(e,t,n){return t===0?e:jb(e,t,n)}function jb(e,t,n){return(n?"":" ")+e}const X8=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];$b.peek=eM;function Q8(){return{canContainEols:["delete"],enter:{strikethrough:J8},exit:{strikethrough:Z8}}}function K8(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:X8}],handlers:{delete:$b}}}function J8(e){this.enter({type:"delete",children:[]},e)}function Z8(e){this.exit(e)}function $b(e,t,n,r){const s=n.createTracker(r),a=n.enter("strikethrough");let u=s.move("~~");return u+=n.containerPhrasing(e,le(H({},s.current()),{before:u,after:"~"})),u+=s.move("~~"),a(),u}function eM(){return"~"}function tM(e){return e.length}function nM(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||tM,a=[],u=[],c=[],d=[];let f=0,p=-1;for(;++p<e.length;){const A=[],v=[];let w=-1;for(e[p].length>f&&(f=e[p].length);++w<e[p].length;){const N=rM(e[p][w]);if(n.alignDelimiters!==!1){const C=s(N);v[w]=C,(d[w]===void 0||C>d[w])&&(d[w]=C)}A.push(N)}u[p]=A,c[p]=v}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<f;)a[m]=zb(r[m]);else{const A=zb(r);for(;++m<f;)a[m]=A}m=-1;const b=[],y=[];for(;++m<f;){const A=a[m];let v="",w="";A===99?(v=":",w=":"):A===108?v=":":A===114&&(w=":");let N=n.alignDelimiters===!1?1:Math.max(1,d[m]-v.length-w.length);const C=v+"-".repeat(N)+w;n.alignDelimiters!==!1&&(N=v.length+N+w.length,N>d[m]&&(d[m]=N),y[m]=N),b[m]=C}u.splice(1,0,b),c.splice(1,0,y),p=-1;const x=[];for(;++p<u.length;){const A=u[p],v=c[p];m=-1;const w=[];for(;++m<f;){const N=A[m]||"";let C="",j="";if(n.alignDelimiters!==!1){const X=d[m]-(v[m]||0),L=a[m];L===114?C=" ".repeat(X):L===99?X%2?(C=" ".repeat(X/2+.5),j=" ".repeat(X/2-.5)):(C=" ".repeat(X/2),j=C):j=" ".repeat(X)}n.delimiterStart!==!1&&!m&&w.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||m)&&w.push(" "),n.alignDelimiters!==!1&&w.push(C),w.push(N),n.alignDelimiters!==!1&&w.push(j),n.padding!==!1&&w.push(" "),(n.delimiterEnd!==!1||m!==f-1)&&w.push("|")}x.push(n.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return x.join(`
39
39
  `)}function rM(e){return e==null?"":String(e)}function zb(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function iM(e,t,n,r){const s=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const u=n.indentLines(n.containerFlow(e,a.current()),sM);return s(),u}function sM(e,t,n){return">"+(n?"":" ")+e}function oM(e,t){return Vb(e,t.inConstruct,!0)&&!Vb(e,t.notInConstruct,!1)}function Vb(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function qb(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
40
40
  `&&oM(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
@@ -49,4 +49,4 @@ Error generating stack: `+T.message+`
49
49
  `))+1))}const u="#".repeat(s),c=n.enter("headingAtx"),d=n.enter("phrasing");a.move(u+" ");let f=n.containerPhrasing(e,H({before:"# ",after:`
50
50
  `},a.current()));return/^[\t ]/.test(f)&&(f=Fa(f.charCodeAt(0))+f.slice(1)),f=f?u+" "+f:u,n.options.closeAtx&&(f+=" "+u),d(),c(),f}Wb.peek=EM;function Wb(e){return e.value||""}function EM(){return"<"}Gb.peek=yM;function Gb(e,t,n,r){const s=cp(n),a=s==='"'?"Quote":"Apostrophe",u=n.enter("image");let c=n.enter("label");const d=n.createTracker(r);let f=d.move("![");return f+=d.move(n.safe(e.alt,H({before:f,after:"]"},d.current()))),f+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,H({before:f,after:">"},d.current()))),f+=d.move(">")):(c=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,H({before:f,after:e.title?" ":")"},d.current())))),c(),e.title&&(c=n.enter(`title${a}`),f+=d.move(" "+s),f+=d.move(n.safe(e.title,H({before:f,after:s},d.current()))),f+=d.move(s),c()),f+=d.move(")"),u(),f}function yM(){return"!"}Xb.peek=TM;function Xb(e,t,n,r){const s=e.referenceType,a=n.enter("imageReference");let u=n.enter("label");const c=n.createTracker(r);let d=c.move("![");const f=n.safe(e.alt,H({before:d,after:"]"},c.current()));d+=c.move(f+"]["),u();const p=n.stack;n.stack=[],u=n.enter("reference");const m=n.safe(n.associationId(e),H({before:d,after:"]"},c.current()));return u(),n.stack=p,a(),s==="full"||!f||f!==m?d+=c.move(m+"]"):s==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function TM(){return"!"}Qb.peek=bM;function Qb(e,t,n){let r=e.value||"",s="`",a=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const u=n.unsafe[a],c=n.compilePattern(u);let d;if(u.atBreak)for(;d=c.exec(r);){let f=d.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(d.index+1)}}return s+r+s}function bM(){return"`"}function Kb(e,t){const n=vf(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Jb.peek=xM;function Jb(e,t,n,r){const s=cp(n),a=s==='"'?"Quote":"Apostrophe",u=n.createTracker(r);let c,d;if(Kb(e,n)){const p=n.stack;n.stack=[],c=n.enter("autolink");let m=u.move("<");return m+=u.move(n.containerPhrasing(e,H({before:m,after:">"},u.current()))),m+=u.move(">"),c(),n.stack=p,m}c=n.enter("link"),d=n.enter("label");let f=u.move("[");return f+=u.move(n.containerPhrasing(e,H({before:f,after:"]("},u.current()))),f+=u.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(n.safe(e.url,H({before:f,after:">"},u.current()))),f+=u.move(">")):(d=n.enter("destinationRaw"),f+=u.move(n.safe(e.url,H({before:f,after:e.title?" ":")"},u.current())))),d(),e.title&&(d=n.enter(`title${a}`),f+=u.move(" "+s),f+=u.move(n.safe(e.title,H({before:f,after:s},u.current()))),f+=u.move(s),d()),f+=u.move(")"),c(),f}function xM(e,t,n){return Kb(e,n)?"<":"["}Zb.peek=_M;function Zb(e,t,n,r){const s=e.referenceType,a=n.enter("linkReference");let u=n.enter("label");const c=n.createTracker(r);let d=c.move("[");const f=n.containerPhrasing(e,H({before:d,after:"]"},c.current()));d+=c.move(f+"]["),u();const p=n.stack;n.stack=[],u=n.enter("reference");const m=n.safe(n.associationId(e),H({before:d,after:"]"},c.current()));return u(),n.stack=p,a(),s==="full"||!f||f!==m?d+=c.move(m+"]"):s==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function _M(){return"["}function dp(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function wM(e){const t=dp(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function SM(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ex(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function vM(e,t,n,r){const s=n.enter("list"),a=n.bulletCurrent;let u=e.ordered?SM(n):dp(n);const c=e.ordered?u==="."?")":".":wM(n);let d=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),ex(n)===u&&p){let m=-1;for(;++m<e.children.length;){const b=e.children[m];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(u=c),n.bulletCurrent=u;const f=n.containerFlow(e,r);return n.bulletLastUsed=u,n.bulletCurrent=a,s(),f}function AM(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function kM(e,t,n,r){const s=AM(n);let a=n.bulletCurrent||dp(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let u=a.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const c=n.createTracker(r);c.move(a+" ".repeat(u-a.length)),c.shift(u);const d=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,c.current()),p);return d(),f;function p(m,b,y){return b?(y?"":" ".repeat(u))+m:(y?a:a+" ".repeat(u-a.length))+m}}function NM(e,t,n,r){const s=n.enter("paragraph"),a=n.enter("phrasing"),u=n.containerPhrasing(e,r);return a(),s(),u}const CM=dl(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function OM(e,t,n,r){return(e.children.some(function(u){return CM(u)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function IM(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}tx.peek=PM;function tx(e,t,n,r){const s=IM(n),a=n.enter("strong"),u=n.createTracker(r),c=u.move(s+s);let d=u.move(n.containerPhrasing(e,H({after:s,before:c},u.current())));const f=d.charCodeAt(0),p=Kl(r.before.charCodeAt(r.before.length-1),f,s);p.inside&&(d=Fa(f)+d.slice(1));const m=d.charCodeAt(d.length-1),b=Kl(r.after.charCodeAt(0),m,s);b.inside&&(d=d.slice(0,-1)+Fa(m));const y=u.move(s+s);return a(),n.attentionEncodeSurroundingInfo={after:b.outside,before:p.outside},c+d+y}function PM(e,t,n){return n.options.strong||"*"}function RM(e,t,n,r){return n.safe(e.value,r)}function LM(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function DM(e,t,n){const r=(ex(n)+(n.options.ruleSpaces?" ":"")).repeat(LM(n));return n.options.ruleSpaces?r.slice(0,-1):r}const nx={blockquote:iM,break:qb,code:cM,definition:fM,emphasis:Yb,hardBreak:qb,heading:gM,html:Wb,image:Gb,imageReference:Xb,inlineCode:Qb,link:Jb,linkReference:Zb,list:vM,listItem:kM,paragraph:NM,root:OM,strong:tx,text:RM,thematicBreak:DM};function MM(){return{enter:{table:FM,tableData:rx,tableHeader:rx,tableRow:UM},exit:{codeText:HM,table:BM,tableData:fp,tableHeader:fp,tableRow:fp}}}function FM(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function BM(e){this.exit(e),this.data.inTable=void 0}function UM(e){this.enter({type:"tableRow",children:[]},e)}function fp(e){this.exit(e)}function rx(e){this.enter({type:"tableCell",children:[]},e)}function HM(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,jM));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function jM(e,t){return t==="|"?t:e}function $M(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
51
51
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:u,tableCell:d,tableRow:c}};function u(y,x,A,v){return f(p(y,A,v),y.align)}function c(y,x,A,v){const w=m(y,A,v),N=f([w]);return N.slice(0,N.indexOf(`
52
- `))}function d(y,x,A,v){const w=A.enter("tableCell"),N=A.enter("phrasing"),C=A.containerPhrasing(y,le(H({},v),{before:a,after:a}));return N(),w(),C}function f(y,x){return nM(y,{align:x,alignDelimiters:r,padding:n,stringLength:s})}function p(y,x,A){const v=y.children;let w=-1;const N=[],C=x.enter("table");for(;++w<v.length;)N[w]=m(v[w],x,A);return C(),N}function m(y,x,A){const v=y.children;let w=-1;const N=[],C=x.enter("tableRow");for(;++w<v.length;)N[w]=d(v[w],y,x,A);return C(),N}function b(y,x,A){let v=nx.inlineCode(y,x,A);return A.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function zM(){return{exit:{taskListCheckValueChecked:ix,taskListCheckValueUnchecked:ix,paragraph:qM}}}function VM(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:YM}}}function ix(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function qM(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let a=-1,u;for(;++a<s.length;){const c=s[a];if(c.type==="paragraph"){u=c;break}}u===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function YM(e,t,n,r){const s=e.children[0],a=typeof e.checked=="boolean"&&s&&s.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);a&&c.move(u);let d=nx.listItem(e,t,n,H(H({},r),c.current()));return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),d;function f(p){return p+u}}function WM(){return[v8(),Y8(),Q8(),MM(),zM()]}function GM(e){return{extensions:[A8(),W8(e),K8(),$M(e),VM()]}}const XM={tokenize:t9,partial:!0},sx={tokenize:n9,partial:!0},ox={tokenize:r9,partial:!0},ax={tokenize:i9,partial:!0},QM={tokenize:s9,partial:!0},ux={name:"wwwAutolink",tokenize:ZM,previous:cx},lx={name:"protocolAutolink",tokenize:e9,previous:dx},qr={name:"emailAutolink",tokenize:JM,previous:fx},Or={};function KM(){return{text:Or}}let ls=48;for(;ls<123;)Or[ls]=qr,ls++,ls===58?ls=65:ls===91&&(ls=97);Or[43]=qr,Or[45]=qr,Or[46]=qr,Or[95]=qr,Or[72]=[qr,lx],Or[104]=[qr,lx],Or[87]=[qr,ux],Or[119]=[qr,ux];function JM(e,t,n){const r=this;let s,a;return u;function u(m){return!hp(m)||!fx.call(r,r.previous)||pp(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(m))}function c(m){return hp(m)?(e.consume(m),c):m===64?(e.consume(m),d):n(m)}function d(m){return m===46?e.check(QM,p,f)(m):m===45||m===95||an(m)?(a=!0,e.consume(m),d):p(m)}function f(m){return e.consume(m),s=!0,d}function p(m){return a&&s&&mn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function ZM(e,t,n){const r=this;return s;function s(u){return u!==87&&u!==119||!cx.call(r,r.previous)||pp(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(XM,e.attempt(sx,e.attempt(ox,a),n),n)(u))}function a(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function e9(e,t,n){const r=this;let s="",a=!1;return u;function u(m){return(m===72||m===104)&&dx.call(r,r.previous)&&!pp(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(m),e.consume(m),c):n(m)}function c(m){if(mn(m)&&s.length<5)return s+=String.fromCodePoint(m),e.consume(m),c;if(m===58){const b=s.toLowerCase();if(b==="http"||b==="https")return e.consume(m),d}return n(m)}function d(m){return m===47?(e.consume(m),a?f:(a=!0,d)):n(m)}function f(m){return m===null||rl(m)||ht(m)||Gi(m)||il(m)?n(m):e.attempt(sx,e.attempt(ox,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function t9(e,t,n){let r=0;return s;function s(u){return(u===87||u===119)&&r<3?(r++,e.consume(u),s):u===46&&r===3?(e.consume(u),a):n(u)}function a(u){return u===null?n(u):t(u)}}function n9(e,t,n){let r,s,a;return u;function u(f){return f===46||f===95?e.check(ax,d,c)(f):f===null||ht(f)||Gi(f)||f!==45&&il(f)?d(f):(a=!0,e.consume(f),u)}function c(f){return f===95?r=!0:(s=r,r=void 0),e.consume(f),u}function d(f){return s||r||!a?n(f):t(f)}}function r9(e,t){let n=0,r=0;return s;function s(u){return u===40?(n++,e.consume(u),s):u===41&&r<n?a(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(ax,t,a)(u):u===null||ht(u)||Gi(u)?t(u):(e.consume(u),s)}function a(u){return u===41&&r++,e.consume(u),s}}function i9(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),a):c===93?(e.consume(c),s):c===60||c===null||ht(c)||Gi(c)?t(c):n(c)}function s(c){return c===null||c===40||c===91||ht(c)||Gi(c)?t(c):r(c)}function a(c){return mn(c)?u(c):n(c)}function u(c){return c===59?(e.consume(c),r):mn(c)?(e.consume(c),u):n(c)}}function s9(e,t,n){return r;function r(a){return e.consume(a),s}function s(a){return an(a)?n(a):t(a)}}function cx(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ht(e)}function dx(e){return!mn(e)}function fx(e){return!(e===47||hp(e))}function hp(e){return e===43||e===45||e===46||e===95||an(e)}function pp(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const o9={tokenize:p9,partial:!0};function a9(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:d9,continuation:{tokenize:f9},exit:h9}},text:{91:{name:"gfmFootnoteCall",tokenize:c9},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:u9,resolveTo:l9}}}}function u9(e,t,n){const r=this;let s=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u;for(;s--;){const d=r.events[s][1];if(d.type==="labelImage"){u=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!u||!u._balanced)return n(d);const f=sr(r.sliceSerialize({start:u.end,end:r.now()}));return f.codePointAt(0)!==94||!a.includes(f.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function l9(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",a,t],["enter",u,t],["exit",u,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function c9(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,u;return c;function c(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),d}function d(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(m){if(a>999||m===93&&!u||m===null||m===91||ht(m))return n(m);if(m===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return s.includes(sr(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return ht(m)||(u=!0),a++,e.consume(m),m===92?p:f}function p(m){return m===91||m===92||m===93?(e.consume(m),a++,f):f(m)}}function d9(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,u=0,c;return d;function d(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(x)}function p(x){if(u>999||x===93&&!c||x===null||x===91||ht(x))return n(x);if(x===93){e.exit("chunkString");const A=e.exit("gfmFootnoteDefinitionLabelString");return a=sr(r.sliceSerialize(A)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return ht(x)||(c=!0),u++,e.consume(x),x===92?m:p}function m(x){return x===91||x===92||x===93?(e.consume(x),u++,p):p(x)}function b(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),s.includes(a)||s.push(a),tt(e,y,"gfmFootnoteDefinitionWhitespace")):n(x)}function y(x){return t(x)}}function f9(e,t,n){return e.check(la,t,e.attempt(o9,t,n))}function h9(e){e.exit("gfmFootnoteDefinition")}function p9(e,t,n){const r=this;return tt(e,s,"gfmFootnoteDefinitionIndent",5);function s(a){const u=r.events[r.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(a):n(a)}}function m9(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(u,c){let d=-1;for(;++d<u.length;)if(u[d][0]==="enter"&&u[d][1].type==="strikethroughSequenceTemporary"&&u[d][1]._close){let f=d;for(;f--;)if(u[f][0]==="exit"&&u[f][1].type==="strikethroughSequenceTemporary"&&u[f][1]._open&&u[d][1].end.offset-u[d][1].start.offset===u[f][1].end.offset-u[f][1].start.offset){u[d][1].type="strikethroughSequence",u[f][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},u[f][1].start),end:Object.assign({},u[d][1].end)},m={type:"strikethroughText",start:Object.assign({},u[f][1].end),end:Object.assign({},u[d][1].start)},b=[["enter",p,c],["enter",u[f][1],c],["exit",u[f][1],c],["enter",m,c]],y=c.parser.constructs.insideSpan.null;y&&Mn(b,b.length,0,sl(y,u.slice(f+1,d),c)),Mn(b,b.length,0,[["exit",m,c],["enter",u[d][1],c],["exit",u[d][1],c],["exit",p,c]]),Mn(u,f-1,d-f+3,b),d=f+b.length-2;break}}for(d=-1;++d<u.length;)u[d][1].type==="strikethroughSequenceTemporary"&&(u[d][1].type="data");return u}function a(u,c,d){const f=this.previous,p=this.events;let m=0;return b;function b(x){return f===126&&p[p.length-1][1].type!=="characterEscape"?d(x):(u.enter("strikethroughSequenceTemporary"),y(x))}function y(x){const A=js(f);if(x===126)return m>1?d(x):(u.consume(x),m++,y);if(m<2&&!n)return d(x);const v=u.exit("strikethroughSequenceTemporary"),w=js(x);return v._open=!w||w===2&&!!A,v._close=!A||A===2&&!!w,c(x)}}}class g9{constructor(){this.map=[]}add(t,n,r){E9(this,t,n,r)}consume(t){if(this.map.sort(function(a,u){return a[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const a of s)t.push(a);s=r.pop()}this.map.length=0}}function E9(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function y9(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function T9(){return{flow:{null:{name:"table",tokenize:b9,resolveAll:x9}}}}function b9(e,t,n){const r=this;let s=0,a=0,u;return c;function c(z){let ae=r.events.length-1;for(;ae>-1;){const ce=r.events[ae][1].type;if(ce==="lineEnding"||ce==="linePrefix")ae--;else break}const oe=ae>-1?r.events[ae][1].type:null,pe=oe==="tableHead"||oe==="tableRow"?L:d;return pe===L&&r.parser.lazy[r.now().line]?n(z):pe(z)}function d(z){return e.enter("tableHead"),e.enter("tableRow"),f(z)}function f(z){return z===124||(u=!0,a+=1),p(z)}function p(z){return z===null?n(z):He(z)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),y):n(z):Ze(z)?tt(e,p,"whitespace")(z):(a+=1,u&&(u=!1,s+=1),z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),u=!0,p):(e.enter("data"),m(z)))}function m(z){return z===null||z===124||ht(z)?(e.exit("data"),p(z)):(e.consume(z),z===92?b:m)}function b(z){return z===92||z===124?(e.consume(z),m):m(z)}function y(z){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(z):(e.enter("tableDelimiterRow"),u=!1,Ze(z)?tt(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):x(z))}function x(z){return z===45||z===58?v(z):z===124?(u=!0,e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),A):X(z)}function A(z){return Ze(z)?tt(e,v,"whitespace")(z):v(z)}function v(z){return z===58?(a+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),w):z===45?(a+=1,w(z)):z===null||He(z)?j(z):X(z)}function w(z){return z===45?(e.enter("tableDelimiterFiller"),N(z)):X(z)}function N(z){return z===45?(e.consume(z),N):z===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(z))}function C(z){return Ze(z)?tt(e,j,"whitespace")(z):j(z)}function j(z){return z===124?x(z):z===null||He(z)?!u||s!==a?X(z):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(z)):X(z)}function X(z){return n(z)}function L(z){return e.enter("tableRow"),G(z)}function G(z){return z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),G):z===null||He(z)?(e.exit("tableRow"),t(z)):Ze(z)?tt(e,G,"whitespace")(z):(e.enter("data"),ne(z))}function ne(z){return z===null||z===124||ht(z)?(e.exit("data"),G(z)):(e.consume(z),z===92?de:ne)}function de(z){return z===92||z===124?(e.consume(z),ne):ne(z)}}function x9(e,t){let n=-1,r=!0,s=0,a=[0,0,0,0],u=[0,0,0,0],c=!1,d=0,f,p,m;const b=new g9;for(;++n<e.length;){const y=e[n],x=y[1];y[0]==="enter"?x.type==="tableHead"?(c=!1,d!==0&&(hx(b,t,d,f,p),p=void 0,d=0),f={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},b.add(n,0,[["enter",f,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,m=void 0,a=[0,0,0,0],u=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},b.add(n,0,[["enter",p,t]])),s=x.type==="tableDelimiterRow"?2:p?3:1):s&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,u[2]===0&&(a[1]!==0&&(u[0]=u[1],m=Jl(b,t,a,s,void 0,m),a=[0,0,0,0]),u[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(u[0]=u[1],m=Jl(b,t,a,s,void 0,m)),a=u,u=[a[1],n,0,0])):x.type==="tableHead"?(c=!0,d=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(d=n,a[1]!==0?(u[0]=u[1],m=Jl(b,t,a,s,n,m)):u[1]!==0&&(m=Jl(b,t,u,s,n,m)),s=0):s&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(u[3]=n)}for(d!==0&&hx(b,t,d,f,p),b.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=y9(t.events,n))}return e}function Jl(e,t,n,r,s,a){const u=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(a.end=Object.assign({},ho(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=ho(t.events,n[1]);if(a={type:u,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const f=ho(t.events,n[2]),p=ho(t.events,n[3]),m={type:c,start:Object.assign({},f),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",m,t]]),r!==2){const b=t.events[n[2]],y=t.events[n[3]];if(b[1].end=Object.assign({},y[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,A=n[3]-n[2]-1;e.add(x,A,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return s!==void 0&&(a.end=Object.assign({},ho(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function hx(e,t,n,r,s){const a=[],u=ho(t.events,n);s&&(s.end=Object.assign({},u),a.push(["exit",s,t])),r.end=Object.assign({},u),a.push(["exit",r,t]),e.add(n+1,0,a)}function ho(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const _9={name:"tasklistCheck",tokenize:S9};function w9(){return{text:{91:_9}}}function S9(e,t,n){const r=this;return s;function s(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),a)}function a(d){return ht(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),u):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),u):n(d)}function u(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(d)}function c(d){return He(d)?t(d):Ze(d)?e.check({tokenize:v9},t,n)(d):n(d)}}function v9(e,t,n){return tt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function A9(e){return $1([KM(),a9(),m9(e),T9(),w9()])}const k9={};function N9(e){const t=this,n=e||k9,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(A9(n)),a.push(WM()),u.push(GM(n))}const C9=()=>_.jsx("span",{className:`${O}-blinking-cursor`,children:_.jsx("svg",{height:"16px",width:"16px",xmlns:"http://www.w3.org/2000/svg",children:_.jsx("circle",{r:"0.45rem",cx:"0.5rem",cy:"0.55rem",fill:"black"})})}),po=({globalClassName:e,openLinksInNewTab:t,showIsLoading:n,text:r})=>_.jsx(RE,{remarkPlugins:[N9],rehypePlugins:[Ly],components:{h1:({children:s})=>_.jsx("h1",{className:M(e,`${O}-header h1`),children:s}),h2:({children:s})=>_.jsx("h2",{className:M(e,`${O}-header h2`),children:s}),h3:({children:s})=>_.jsx("h3",{className:M(e,`${O}-header h3`),children:s}),ul:({children:s})=>_.jsx("ul",{className:M(e,`${O}-ul`),children:s}),ol:({children:s})=>_.jsx("ol",{className:M(e,`${O}-ol`),children:s}),li:({children:s})=>_.jsx("li",{className:M(e,`${O}-li`),children:s}),a:({href:s,children:a})=>_.jsx(jy,{globalClassName:e,openLinksInNewTab:t,href:s,children:a}),table:({children:s})=>_.jsx("div",{className:M(e,`${O}-table-container`),children:_.jsx("table",{className:M(e,`${O}-table`),children:s})}),thead:({children:s})=>_.jsx("thead",{className:M(e,`${O}-thead`),children:s}),tbody:({children:s})=>_.jsx("tbody",{className:M(e,`${O}-tbody`),children:s}),tr:({children:s})=>_.jsx("tr",{className:M(e,`${O}-tr`),children:s}),th:({children:s})=>_.jsx("th",{className:M(e,`${O}-th`),children:s}),td:({children:s})=>_.jsx("td",{className:M(e,`${O}-td`),children:s}),span:({className:s,children:a})=>s===`${O}-blinking-cursor`?_.jsx(C9,{}):_.jsx("span",{children:a})},children:r+(n?`<span className='${O}-blinking-cursor'></span>`:"")}),mo=()=>B.useContext(Xg),go=()=>{const{sendMessage:e,loading:t,isConnected:n}=sn(),{mode:r,status:s}=ri();return B.useMemo(()=>({sendMessage:e,isLoading:t,isConnected:n,componentType:s.type,mode:r}),[e,t,n,s.type,r])};function O9(e){return e.includes("-")&&e===e.toLowerCase()}function Eo({tagName:e,props:t,label:n}){const r=B.useRef(null),s=B.useRef(null),a=B.useRef(e),u=B.useRef(null);return B.useEffect(()=>{const c=r.current;if(!c)return;if(a.current!==e&&(a.current=e,s.current=null),!O9(e)){u.current!==e&&(u.current=e,yt(!0,"error",`[CimulateOverrides] ${n||"Override"} rejected: "${e}" is not a valid custom element name (must contain a hyphen and be lowercase, e.g. "product-card").`)),s.current=null,c.replaceChildren();return}const d=s.current;if(d&&d.isConnected)try{d.props=t;return}catch(f){yt(!0,"error",`[CimulateOverrides] ${n||"Override"} threw an error during props update:`,f),s.current=null,c.replaceChildren();return}try{const f=document.createElement(e);f.props=t,c.replaceChildren(f);const p=f.localName;s.current=typeof customElements!="undefined"&&customElements.get(p)?f:null}catch(f){yt(!0,"error",`[CimulateOverrides] ${n||"Override"} threw an error:`,f),s.current=null,c.replaceChildren()}},[e,t,n]),B.useEffect(()=>{const c=r.current;return()=>{s.current=null,c==null||c.replaceChildren()}},[]),_.jsx("div",{ref:r,"data-override":n||"custom"})}class I9 extends B.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){yt(!0,"error",`Override "${this.props.overrideName}" threw during render:`,t,n.componentStack)}render(){return this.state.hasError?null:this.props.children}}function P9(e){return ot({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Image_Off"},child:[{tag:"path",attr:{d:"M19.937,14.218l0,-8.654c0,-0.829 -0.672,-1.5 -1.5,-1.5l-10.628,-0c-0.276,-0 -0.5,-0.225 -0.5,-0.5c0,-0.276 0.224,-0.5 0.5,-0.5l10.628,-0c1.38,-0 2.5,1.118 2.5,2.5l0,10.624c0,0.276 -0.224,0.5 -0.5,0.501c-0.276,-0 -0.5,-0.225 -0.5,-0.5l0,-0.556l-4.583,-4.584c-0.456,-0.456 0.251,-1.163 0.707,-0.707c0.162,0.162 2.37,2.37 3.876,3.876Zm-0.121,6.304c-0.395,0.262 -0.869,0.415 -1.379,0.415l-12.874,-0c-1.381,-0 -2.5,-1.119 -2.5,-2.5l0,-12.873c0,-0.51 0.153,-0.984 0.414,-1.38l-0.263,-0.263c-0.456,-0.456 0.251,-1.163 0.707,-0.707c0.088,0.088 0.176,0.176 0.263,0.263c0.245,0.245 16.095,16.094 16.339,16.338l0.263,0.263c0.455,0.456 -0.252,1.163 -0.707,0.707c-0.088,-0.087 -0.175,-0.175 -0.263,-0.263Zm-11.104,-11.103l-2.001,-2.001c-0.094,0.196 -0.146,0.415 -0.146,0.647c-0,0.829 0.672,1.5 1.5,1.5c0.232,-0 0.451,-0.052 0.647,-0.146Zm-2.733,-2.733l-1.77,-1.77c-0.093,0.196 -0.146,0.416 -0.146,0.648l0,10.717l1.926,-1.926c0.587,-0.586 1.536,-0.586 2.122,-0l0.555,0.554c0.195,0.196 0.511,0.196 0.706,0l2.415,-2.415l-2.343,-2.343c-0.395,0.262 -0.869,0.414 -1.379,0.414c-1.38,-0 -2.5,-1.119 -2.5,-2.5c-0,-0.509 0.152,-0.983 0.414,-1.379Zm-1.916,11.009l0,0.741c0,0.829 0.671,1.5 1.5,1.5l12.874,0c0.232,0 0.451,-0.052 0.647,-0.145c-0.165,-0.165 -3.264,-3.263 -6.59,-6.59l-2.414,2.415c-0.585,0.586 -1.537,0.586 -2.122,0l-0.554,-0.554c-0.195,-0.196 -0.512,-0.196 -0.708,0l-2.633,2.633Z"},child:[]}]}]})(e)}const R9=({imageUrl:e,globalClassName:t,isCartMgmtSupported:n,productPageUrl:r,openLinksInNewTab:s,ariaLabel:a,name:u,showInWidgetDetails:c})=>{const{loading:d}=sn();return _.jsx("div",{className:M(t,`${O}-msg-product-card__image-wrapper`),children:e?n?_.jsx("button",{type:"button",className:M(t,`${O}-msg-product-card__image-button`),onClick:c,disabled:d,"aria-label":a,children:_.jsx("img",{className:M(t,`${O}-msg-product-card__image`),src:e,alt:u||"Product image",loading:"lazy"})}):r?_.jsx("a",{href:r,target:s?"_blank":"_self",rel:"noopener","aria-label":a,children:_.jsx("img",{className:M(t,`${O}-msg-product-card__image`),src:e,alt:u||"Product image",loading:"lazy"})}):_.jsx("img",{className:M(t,`${O}-msg-product-card__image`),src:e,alt:u||"Product image",loading:"lazy"}):_.jsx("div",{className:M(t,`${O}-msg-product-card__image-placeholder`),"aria-label":u?`No image for ${u}`:"No product image",role:"img",children:_.jsx(P9,{"aria-hidden":"true"})})})},L9=({name:e,globalClassName:t,isCartMgmtSupported:n,productPageUrl:r,openLinksInNewTab:s,ariaLabel:a,showInWidgetDetails:u})=>{const{loading:c}=sn();return n?_.jsx("button",{type:"button",disabled:c,onClick:u,className:M(t,`${O}-msg-product-card__title-link`),"aria-label":a,children:e}):r?_.jsx("a",{href:r,target:s?"_blank":"_self",rel:"noopener",className:M(t,`${O}-msg-product-card__title-link`),"aria-label":a,children:e}):_.jsx("p",{className:M(t,`${O}-msg-product-card__title`),children:e})},D9=({product:e,globalClassName:t,openLinksInNewTab:n,isCartMgmtSupported:r=!1,rawProduct:s})=>{const{showProductDescription:a}=at(),{overrides:u,isInitialized:c}=mo(),{sendMessage:d,loading:f}=sn(),p=go(),m=c?u.ProductTile:void 0;if(m){const z={name:"ProductTile",payload:s!=null?s:{},api:p};return _.jsx(Eo,{tagName:m,props:z,label:"ProductTile"})}const{id:b,name:y,imageUrl:x,description:A,productPageUrl:v,price:w,priceBreakdown:N,discountPrice:C,listPrice:j,currencyCode:X}=e,L=C!=null?C:w,G=c8({priceBreakdown:N,currencyCode:X}),ne=()=>{if(f)return;const z=y||"this product",ae=b?` [SKU: ${b}]`:"";d(`Show me details for ${z}${ae}`)},de=r?`View details for ${y}`:`Go to product page for ${y}`;return _.jsxs("div",{className:M(t,`${O}-msg-product-card`),children:[_.jsx(R9,{imageUrl:x||"",globalClassName:t,isCartMgmtSupported:r,productPageUrl:v,openLinksInNewTab:n,ariaLabel:de,name:y,showInWidgetDetails:ne}),_.jsxs("div",{className:M(t,`${O}-msg-product-card__content`),children:[_.jsxs("div",{className:M(t,`${O}-msg-product-card__content-header`),children:[_.jsx(L9,{name:y||b,globalClassName:t,isCartMgmtSupported:r,productPageUrl:v,openLinksInNewTab:n,ariaLabel:de,showInWidgetDetails:ne}),a&&A&&_.jsx("div",{className:M(t,`${O}-msg-product-card__description`),title:A,children:_.jsx(po,{globalClassName:t,text:A})})]}),_.jsx("div",{className:M(t,`${O}-msg-product-card__price-row`),children:G?_.jsx("span",{className:M(t,`${O}-msg-product-card__price`),"aria-label":`Price from ${G.low} to ${G.high}`,children:G.range}):_.jsx(sp,{globalClassName:t,retailPrice:j,discountPrice:L,currencyCode:X})})]})]})},M9=e=>{var t,n;return{id:e.id,name:e.data.name,label:e.caption,description:e.data.description,imageUrl:e.data.imageUrl,productPageUrl:e.data.productPageUrl,price:e.data.price,discountPrice:e.data.discountPrice,listPrice:(t=e.data.listPrice)!=null?t:void 0,priceBreakdown:(n=e.data.priceBreakdown)!=null?n:void 0,currencyCode:e.data.currencyCode}},F9=({title:e,products:t,globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s,isCartMgmtSupported:a=!1})=>{const{showProductCaptions:u}=at(),{overrides:c,isInitialized:d}=mo(),f=go(),p=d?c.ProductCarousel:void 0;if(p){const m={name:"ProductCarousel",payload:{title:e,products:t},api:f};return _.jsx(Eo,{tagName:p,props:m,label:"ProductCarousel"})}return _.jsxs("div",{style:{marginBottom:"1rem"},children:[e&&_.jsx("p",{className:M(n,`${O}-product-carousel-title`),children:e}),_.jsx(PD,{globalClassName:n,spacing:s?"0.5rem":"6px",ariaLabel:e||"Product recommendations",children:t.map(m=>_.jsxs("div",{className:M(n,`${O}-product-carousel-item`),children:[_.jsx(D9,{product:M9(m),rawProduct:m,globalClassName:n,openLinksInNewTab:r,isCartMgmtSupported:a}),u&&_.jsx("p",{className:M(n,`${O}-product-carousel-caption`),title:m.caption,children:m.caption})]},m.id))})]})},mp=44,B9=400,U9=e=>{const t=typeof e=="number"?e:Number(e);return!Number.isFinite(t)||t<=0?mp:Math.min(Math.max(Math.round(t),mp),B9)},H9=e=>{try{return new URL(e,window.location.href).origin}catch(t){return null}},j9="parentOrigin",$9=(e,t)=>{if(!t)return e;try{const n=new URL(e,window.location.href);return n.searchParams.set(j9,t),n.toString()}catch(n){return e}},z9=(e,t,n)=>{if(!e||!t)return null;try{const r=new URL(e,window.location.href);return r.origin!==window.location.origin||!/\/Payments-Express\/?$/.test(r.pathname)?null:(r.pathname=r.pathname.replace(/\/Payments-Express\/?$/,"/Payments-ExpressProduct"),r.searchParams.set("pid",t),r.searchParams.set("quantity",String(n)),r.toString())}catch(r){return null}},px=({expressPaymentUrl:e,globalClassName:t,onOrderComplete:n})=>{const r=B.useRef(null),[s,a]=B.useState(!1),[u,c]=B.useState(mp),d=typeof window!="undefined"?window.location.origin:"",f=$9(e,d),p=H9(e);return B.useEffect(()=>{const m=b=>{var x,A,v;if(p&&b.origin!==p||r.current&&b.source!==r.current.contentWindow)return;const y=b.data;if(!(!y||typeof y.type!="string"))switch(y.type){case"express.payment.available":a(!0),c(U9((x=y.payload)==null?void 0:x.height));break;case"express.payment.unavailable":a(!1);break;case"express.payment.success":n==null||n((v=(A=y.payload)==null?void 0:A.orderId)!=null?v:null);break}};return window.addEventListener("message",m),()=>window.removeEventListener("message",m)},[p,n]),_.jsx("div",{className:M(t,`${O}-cart-express`,{[`${O}-cart-express-ready`]:s}),style:s?{height:u}:void 0,"data-testid":"express-payment","aria-hidden":!s,children:_.jsx("iframe",{ref:r,className:M(t,`${O}-cart-express-frame`),src:f,title:"Express payment",allow:"payment *",scrolling:"no"})})};function V9(e){return typeof e=="string"?e:e&&typeof e.code=="string"?e.code:null}function Zl(e){return(e!=null?e:[]).map(V9).filter(t=>t!==null)}const ec=({code:e,globalClassName:t})=>_.jsxs("span",{className:M(t,`${O}-cart-chip`),children:[_.jsx(c1,{"aria-hidden":"true"}),_.jsx("span",{children:e})]}),An=({label:e,badge:t,value:n,currencyCode:r,globalClassName:s,emphasized:a,isDiscount:u,fallback:c,loading:d})=>{let f;if(typeof n=="number")n===0&&!u?f="Free":f=Vr(u?-n:n,r);else if(c)f=c;else return null;return _.jsxs("div",{className:M(s,`${O}-cart-total-row`,{emphasized:a}),children:[_.jsxs("span",{className:M(s,`${O}-cart-total-label`),children:[e,t&&_.jsx("span",{className:M(s,`${O}-cart-total-badge`),children:t})]}),_.jsx("span",{className:M(s,`${O}-cart-total-value`),children:d?_.jsx("span",{className:M(s,`${O}-cart-total-shimmer`)}):f})]})},q9=({quantity:e,loading:t,disabled:n,globalClassName:r,onChange:s})=>{const[a,u]=B.useState(e.toString());B.useEffect(()=>{u(e.toString())},[e]);const c=p=>{if(n)return;const m=p.target.value;/^\d*$/.test(m)&&u(m)},d=()=>{const p=parseInt(a,10);!n&&!isNaN(p)&&p>0&&p!==e?s(p):u(e.toString())},f=p=>{p.key==="Enter"&&(p.preventDefault(),d())};return _.jsx("div",{className:M(r,`${O}-cart-qty-input-wrapper`),children:t?_.jsx(Jk,{className:M(r,`${O}-cart-qty-spinner`),"aria-hidden":"true"}):_.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:M(r,`${O}-cart-qty-input`),value:a,disabled:n,onChange:c,onBlur:d,onKeyDown:f,"aria-label":"Quantity"})})},Y9=({item:e,currencyCode:t,loading:n,disabled:r,globalClassName:s,onRemove:a,onQuantityChange:u})=>{var f,p;const c=typeof e.originalSubtotal=="number"&&typeof e.itemSubtotal=="number"&&e.originalSubtotal>e.itemSubtotal,d=Zl(e.coupons);return _.jsxs("li",{className:M(s,`${O}-cart-item`),children:[e.imageUrl&&_.jsx("div",{className:M(s,`${O}-cart-item-image`),children:_.jsx("img",{src:e.imageUrl,alt:e.name||"Product image",loading:"lazy"})}),_.jsxs("div",{className:M(s,`${O}-cart-item-details`),children:[_.jsx("p",{className:M(s,`${O}-cart-item-name`),children:e.name}),_.jsxs("div",{className:M(s,`${O}-cart-item-attrs`),children:[((f=e.variants)!=null?f:[]).map(m=>_.jsxs("p",{className:M(s,`${O}-cart-item-attr`),children:[m.lbl,": ",m.value]},`${m.type}-${m.value}`)),((p=e.promotions)!=null?p:[]).map(m=>_.jsxs("p",{className:M(s,`${O}-cart-item-attr`),children:["Promotion: ",m]},m))]}),d.length>0&&_.jsx("div",{className:M(s,`${O}-cart-chips`),children:d.map(m=>_.jsx(ec,{code:m,globalClassName:s},m))}),_.jsx("span",{className:M(s,`${O}-cart-item-price`),children:n?_.jsx("span",{className:M(s,`${O}-cart-total-shimmer`)}):_.jsxs(_.Fragment,{children:[c&&_.jsx("span",{className:M(s,`${O}-cart-item-original-price`),children:Vr(e.originalSubtotal,t)}),_.jsx("span",{className:M(s,`${O}-cart-item-final-price`),children:Vr(e.itemSubtotal,t)})]})}),_.jsxs("div",{className:M(s,`${O}-cart-item-footer`),children:[_.jsx("span",{className:M(s,`${O}-cart-qty-heading`),children:"Quantity"}),_.jsx(q9,{quantity:e.quantity,loading:n,disabled:r,globalClassName:s,onChange:m=>u(e,m)}),_.jsx("button",{type:"button",className:M(s,`${O}-cart-item-remove`),disabled:r,onClick:()=>a(e),children:"Remove"})]})]})]})},W9=({cart:e,messageId:t,globalClassName:n,openLinksInNewTab:r})=>{const{sendMessage:s,loading:a,cartUpdating:u}=sn(),[c,d]=B.useState(!0),[f,p]=B.useState(""),[m,b]=B.useState(null),y=a||u,{items:x=[],currencyCode:A="USD",subtotal:v,total:w,taxes:N,shippingCost:C,shippingDiscount:j,shippingPromotions:X=[],promotionsDiscount:L,promotions:G=[],couponsDiscount:ne,bodyMessage:de,footerMessage:z,checkoutButtonUrl:ae,expressPaymentUrl:oe}=e,pe=Zl(e.couponsApplied),ce=Y=>{y||s(`Remove ${Y.name} from my cart`)},se=Y=>{s(Y?`I completed express payment. Show my order confirmation for order ${Y}.`:"I completed express payment. Show my order confirmation.")},Ae=(Y,ie)=>{y||m||ie<1||(b(Y.itemId),s(`Update ${Y.name} quantity to ${ie}`,{silent:!0,reconcileMessageId:t}).then(k=>{k.outcome==="success"?setTimeout(()=>b(null),300):b(null)}))},re=()=>{const Y=f.trim();!Y||y||(s(`Apply coupon code ${Y}`),p(""))};return _.jsxs("div",{className:M(n,`${O}-cart`),children:[_.jsxs("div",{className:M(n,`${O}-cart-box`),children:[de&&_.jsxs("button",{type:"button",className:M(n,`${O}-cart-summary`),"aria-expanded":c,onClick:()=>d(Y=>!Y),children:[_.jsx("span",{className:M(n,`${O}-cart-summary-text`),children:_.jsx(po,{text:de,globalClassName:n,openLinksInNewTab:r,showIsLoading:!1})}),_.jsx("span",{className:M(n,`${O}-cart-summary-toggle`),"aria-hidden":"true",children:c?_.jsx(u1,{}):_.jsx(l1,{})})]}),c&&_.jsxs("div",{className:M(n,`${O}-cart-expanded`),children:[_.jsxs("div",{className:M(n,`${O}-cart-items-section`),children:[_.jsx("ul",{className:M(n,`${O}-cart-items`),children:x.map(Y=>_.jsx(Y9,{item:Y,currencyCode:A,loading:m===Y.itemId,disabled:y||m===Y.itemId,globalClassName:n,onRemove:ce,onQuantityChange:Ae},Y.itemId))}),pe.length>0&&_.jsx("div",{className:M(n,`${O}-cart-chips`,`${O}-cart-applied-coupons`),children:pe.map(Y=>_.jsx(ec,{code:Y,globalClassName:n},Y))})]}),_.jsxs("div",{className:M(n,`${O}-cart-totals`),children:[_.jsx(An,{label:"Subtotal",value:v,currencyCode:A,globalClassName:n,loading:!!m}),_.jsx(An,{label:"Coupon",value:ne,currencyCode:A,globalClassName:n,isDiscount:!0,loading:!!m}),_.jsx(An,{label:"Promotions",badge:G[0],value:L,currencyCode:A,globalClassName:n,isDiscount:!0,loading:!!m}),_.jsx(An,{label:"Shipping",value:C,currencyCode:A,globalClassName:n,fallback:"TBD",loading:!!m}),_.jsx(An,{label:"Shipping Discount",badge:X[0],value:j,currencyCode:A,globalClassName:n,isDiscount:!0,loading:!!m}),_.jsx(An,{label:"Tax",value:N,currencyCode:A,globalClassName:n,fallback:"TBD",loading:!!m}),_.jsx(An,{label:"Total",value:w,currencyCode:A,globalClassName:n,emphasized:!0,loading:!!m})]})]})]}),_.jsxs("div",{className:M(n,`${O}-cart-coupon`),children:[_.jsxs("div",{className:M(n,`${O}-cart-coupon-field`),children:[_.jsx("span",{className:M(n,`${O}-cart-coupon-icon`),"aria-hidden":"true",children:_.jsx(c1,{})}),_.jsx("input",{type:"text",className:M(n,`${O}-cart-coupon-input`),placeholder:"Enter coupon code","aria-label":"Enter coupon code",value:f,disabled:y,onChange:Y=>p(Y.target.value),onKeyDown:Y=>{Y.key==="Enter"&&(Y.preventDefault(),re())}})]}),_.jsx("button",{type:"button",className:M(n,`${O}-cart-coupon-submit`),"aria-label":"Apply coupon",disabled:y||!f.trim(),onClick:re,children:_.jsx(tN,{"aria-hidden":"true"})})]}),oe&&_.jsx(px,{expressPaymentUrl:oe,globalClassName:n,onOrderComplete:se}),ae&&_.jsxs("a",{className:M(n,`${O}-cart-checkout-button`),href:ae,target:r?"_blank":"_self",rel:"noopener noreferrer",children:[_.jsx(Zk,{"aria-hidden":"true"}),_.jsx("span",{children:"Checkout"})]}),_.jsx("p",{className:M(n,`${O}-cart-footer`),children:z||"Shipping and taxes calculated at checkout."})]})},G9=({item:e,currencyCode:t,globalClassName:n})=>{var a,u;const r=typeof e.originalSubtotal=="number"&&typeof e.itemSubtotal=="number"&&e.originalSubtotal>e.itemSubtotal,s=Zl(e.coupons);return _.jsxs("li",{className:M(n,`${O}-cart-item`),children:[e.imageUrl&&_.jsx("div",{className:M(n,`${O}-cart-item-image`),children:_.jsx("img",{src:e.imageUrl,alt:e.name||"Product image",loading:"lazy"})}),_.jsxs("div",{className:M(n,`${O}-cart-item-details`),children:[_.jsx("p",{className:M(n,`${O}-cart-item-name`),children:e.name}),_.jsxs("div",{className:M(n,`${O}-cart-item-attrs`),children:[((a=e.variants)!=null?a:[]).map(c=>_.jsxs("p",{className:M(n,`${O}-cart-item-attr`),children:[c.lbl,": ",c.value]},`${c.type}-${c.value}`)),((u=e.promotions)!=null?u:[]).map(c=>_.jsxs("p",{className:M(n,`${O}-cart-item-attr`),children:["Promotion: ",c]},c))]}),s.length>0&&_.jsx("div",{className:M(n,`${O}-cart-chips`),children:s.map(c=>_.jsx(ec,{code:c,globalClassName:n},c))}),_.jsxs("span",{className:M(n,`${O}-cart-item-price`),children:[r&&_.jsx("span",{className:M(n,`${O}-cart-item-original-price`),children:Vr(e.originalSubtotal,t)}),_.jsx("span",{className:M(n,`${O}-cart-item-final-price`),children:Vr(e.itemSubtotal,t)})]}),_.jsx("div",{className:M(n,`${O}-cart-item-footer`),children:_.jsxs("span",{className:M(n,`${O}-cart-item-qty`),children:["Qty: ",e.quantity]})})]})]})},X9=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})},Q9=({order:e,globalClassName:t})=>{const[n,r]=B.useState(!0),{id:s,orderedOn:a,items:u=[],currencyCode:c="USD",subtotal:d,total:f,taxes:p,shippingCost:m,shippingDiscount:b,shippingPromotions:y=[],promotionsDiscount:x,promotions:A=[],couponsDiscount:v,bodyMessage:w,footerMessage:N}=e,C=Zl(e.couponsApplied);return _.jsxs("div",{className:M(t,`${O}-cart`),children:[_.jsxs("div",{className:M(t,`${O}-cart-banner`),children:[_.jsx("span",{className:M(t,`${O}-cart-banner-icon`),"aria-hidden":"true",children:_.jsx(nN,{})}),_.jsx("p",{className:M(t,`${O}-cart-banner-text`),children:"Your order is confirmed!"})]}),_.jsxs("div",{className:M(t,`${O}-order-confirmation-meta`),children:[_.jsxs("span",{children:["Order No: ",s]}),_.jsxs("span",{children:["Ordered On: ",X9(a)]})]}),_.jsxs("div",{className:M(t,`${O}-cart-box`),children:[w&&_.jsxs("button",{type:"button",className:M(t,`${O}-cart-summary`),"aria-expanded":n,onClick:()=>r(j=>!j),children:[_.jsx("span",{className:M(t,`${O}-cart-summary-text`),children:_.jsx(po,{text:w,globalClassName:t,showIsLoading:!1})}),_.jsx("span",{className:M(t,`${O}-cart-summary-toggle`),"aria-hidden":"true",children:n?_.jsx(u1,{}):_.jsx(l1,{})})]}),n&&_.jsxs("div",{className:M(t,`${O}-cart-expanded`),children:[_.jsx("ul",{className:M(t,`${O}-cart-items`),children:u.map(j=>_.jsx(G9,{item:j,currencyCode:c,globalClassName:t},j.itemId))}),C.length>0&&_.jsx("div",{className:M(t,`${O}-cart-chips`,`${O}-cart-applied-coupons`),children:C.map(j=>_.jsx(ec,{code:j,globalClassName:t},j))}),_.jsxs("div",{className:M(t,`${O}-cart-totals`),children:[_.jsx(An,{label:"Subtotal",value:d,currencyCode:c,globalClassName:t}),_.jsx(An,{label:"Coupon",value:v,currencyCode:c,globalClassName:t,isDiscount:!0}),_.jsx(An,{label:"Promotions",badge:A[0],value:x,currencyCode:c,globalClassName:t,isDiscount:!0}),_.jsx(An,{label:"Shipping",value:m,currencyCode:c,globalClassName:t,fallback:"TBD"}),_.jsx(An,{label:"Shipping Discount",badge:y[0],value:b,currencyCode:c,globalClassName:t,isDiscount:!0}),_.jsx(An,{label:"Tax",value:p,currencyCode:c,globalClassName:t,fallback:"TBD"}),_.jsx(An,{label:"Total",value:f,currencyCode:c,globalClassName:t,emphasized:!0})]})]})]}),_.jsx("p",{className:M(t,`${O}-cart-footer`),children:N||"Shipping and taxes calculated at checkout."})]})},K9=({image:e,alt:t,globalClassName:n})=>{const[r,s]=B.useState(e.src),[a,u]=B.useState(!1),c=()=>{e.fallbackSrc&&r!==e.fallbackSrc&&s(e.fallbackSrc)};return _.jsx("img",{className:M(n,`${O}-pdp-gallery__image`,{[`${O}-pdp-gallery__image--loaded`]:a}),src:r,alt:t,loading:"lazy",onLoad:()=>u(!0),onError:c})},J9=({images:e,altText:t,globalClassName:n})=>{if(e.length===0)return null;const r=e.length>1;return _.jsxs(Jh,{className:M(n,`${O}-pdp-gallery`),slidesPerPage:1,slidesPerMove:1,slideCount:e.length,loop:!0,"aria-label":t||"Product images",children:[_.jsx(Xh,{className:M(n,`${O}-pdp-gallery__item-group`),children:e.map((s,a)=>_.jsx(Gh,{index:a,className:M(n,`${O}-pdp-gallery__item`),children:_.jsx(K9,{image:s,alt:t?`${t} (${a+1})`:`Product image ${a+1}`,globalClassName:n})},s.src))}),r&&_.jsxs(qh,{className:M(n,`${O}-pdp-gallery__control`),children:[_.jsx(Kh,{className:M(n,`${O}-pdp-gallery__prev-trigger`),"aria-label":"Previous image",children:_.jsx(db,{size:"16px"})}),_.jsx(Qh,{className:M(n,`${O}-pdp-gallery__next-trigger`),"aria-label":"Next image",children:_.jsx(fb,{size:"16px"})})]}),r&&_.jsx(Wh,{className:M(n,`${O}-pdp-gallery__indicator-group`),children:Array.from({length:e.length},(s,a)=>_.jsx(Yh,{index:a,className:M(n,`${O}-pdp-gallery__indicator`),"aria-label":`Go to image ${a+1}`},a))})]})},Ba="color",gp=(e,t)=>/^https?:\/\//i.test(t)||!e?t:`${e}${t}`,Z9=e=>e.replace(/(^|\/)large\//,"$1medium/"),mx=(e,t)=>!e.vattr||!t?!1:e.vattr.some(n=>n.id===Ba&&n.vals.includes(t)),gx=(e,t)=>{const n=Z9(t),r=gp(e,n);return n===t?{src:r}:{src:r,fallbackSrc:gp(e,t)}},eF=(e,t)=>{var c,d;const n=((c=e.imgGroups)!=null?c:[]).filter(f=>f.viewType==="large"),r=t&&n.find(f=>mx(f,t)),s=n.find(f=>f.vattr===null),a=r||s||n[0],u=((d=a==null?void 0:a.imgs)!=null?d:[]).map(f=>gx(e.baseUrl,f.url));return u.length>0?u:e.imageUrl?[gx(e.baseUrl,e.imageUrl)]:[]},tF=(e,t)=>{var s,a,u;const n=((s=e.imgGroups)!=null?s:[]).find(c=>c.viewType==="swatch"&&mx(c,t)),r=(u=(a=n==null?void 0:n.imgs)==null?void 0:a[0])==null?void 0:u.url;return r?gp(e.baseUrl,r):""},tc=(e,t,n,r={})=>!e||e.length===0||!t||!n?!1:e.some(s=>{var a;return((a=s.vars)==null?void 0:a[t])!==n||s.ord===!1?!1:Object.entries(r).every(([u,c])=>{var d;return u===t||((d=s.vars)==null?void 0:d[u])===c})}),nF=(e,t)=>{const n=Object.keys(t);return n.length===0?!0:!e||e.length===0?!1:e.some(r=>r.ord!==!1&&n.every(s=>{var a;return((a=r.vars)==null?void 0:a[s])===t[s]}))},rF=(e,t,n,r,s)=>{if(!e||e.length===0)return le(H({},s),{[n]:r});const a=e.find(c=>{var d;return((d=c.vars)==null?void 0:d[n])===r&&c.ord!==!1&&Object.keys(c.vars).length>=t.length&&Object.entries(s).every(([f,p])=>{var m;return f===n||((m=c.vars)==null?void 0:m[f])===p})});if(a)return H({},a.vars);const u=e.find(c=>{var d;return((d=c.vars)==null?void 0:d[n])===r&&c.ord!==!1&&Object.keys(c.vars).length>=t.length});return u?H({},u.vars):le(H({},s),{[n]:r})},Ex=(e,t)=>{var s,a,u,c;if(!(Array.isArray(e.vattr)&&e.vattr.length>0))return(s=e.id)!=null?s:null;if(!e.vmat||e.vmat.length===0)return(a=e.id)!=null?a:null;const r=e.vmat.find(d=>d.ord!==!1&&Object.entries(t).every(([f,p])=>{var m;return((m=d.vars)==null?void 0:m[f])===p}));return(c=(u=r==null?void 0:r.pid)!=null?u:e.id)!=null?c:null},iF=(e,t)=>{if(!e.vmat||e.vmat.length===0||Object.keys(t).length===0)return e.pr;const n=e.vmat.find(r=>r.ord!==!1&&Object.entries(t).every(([s,a])=>{var u;return((u=r.vars)==null?void 0:u[s])===a}));return n!=null&&n.pr?n.pr:e.pr},sF=e=>{var n;const t={};for(const r of(n=e.vattr)!=null?n:[]){const s=r.opts.find(u=>tc(e.vmat,r.id,u.val)),a=s!=null?s:r.opts[0];a&&(t[r.id]=a.val)}return t},oF=300,aF=({product:e,globalClassName:t,openLinksInNewTab:n,isCartMgmtSupported:r=!1})=>{var dt,Vt,Lt,Qt,kn,me,he;const{addToCart:s,sendMessage:a,loading:u}=sn(),{overrides:c,isInitialized:d}=mo(),f=go(),p=e.data,m=(dt=p.vattr)!=null?dt:[],[b,y]=B.useState(()=>sF(p)),x=nF(p.vmat,b),A=(Lt=(Vt=p.quantity)==null?void 0:Vt.minQuantity)!=null?Lt:1,v=(kn=(Qt=p.quantity)==null?void 0:Qt.maxQuantity)!=null?kn:Number.POSITIVE_INFINITY,w=(he=(me=p.quantity)==null?void 0:me.increment)!=null?he:1,[N,C]=B.useState(A),[j,X]=B.useState(!1),L=B.useRef(!1);B.useEffect(()=>{j&&(u?L.current=!0:L.current&&(L.current=!1,X(!1)))},[j,u]);const G=b[Ba],ne=B.useMemo(()=>eF(p,G),[p,G]),de=B.useMemo(()=>iF(p,b),[p,b]),z=m.find(W=>W.id===Ba),ae=m.filter(W=>W.id!==Ba),oe=Ex(p,b),[pe,ce]=B.useState(N),se=B.useRef(oe),Ae=se.current===oe?pe:N;B.useEffect(()=>{if(se.current!==oe){se.current=oe,ce(N);return}const W=window.setTimeout(()=>ce(N),oF);return()=>window.clearTimeout(W)},[N,oe]);const re=N===pe,Y=B.useMemo(()=>x&&(se.current!==oe||re)?z9(p.expressPaymentUrl,oe,Ae):null,[p.expressPaymentUrl,oe,Ae,x,re]),ie=B.useCallback(W=>{a(W?`I completed express payment. Show my order confirmation for order ${W}.`:"I completed express payment. Show my order confirmation.")},[a]),k=d?c.ProductDetailCard:void 0;if(k){const W={name:"ProductDetailCard",payload:e,api:f};return _.jsx(Eo,{tagName:k,props:W,label:"ProductDetailCard"})}const D=(W,fe)=>()=>{y(_e=>{const Xe=!tc(p.vmat,W,fe,_e);return W===Ba||Xe?rF(p.vmat,m,W,fe,_e):le(H({},_e),{[W]:fe})})},Z=()=>{if(u)return;const W=Ex(p,b);if(!W)return;const fe=m.map(_e=>{const Xe=_e.opts.find(ut=>ut.val===b[_e.id]);return Xe?{label:_e.lbl||_e.id,value:Xe.name||Xe.val}:null}).filter(_e=>_e!==null);X(!0),s({productName:p.name,sku:W,quantity:N,variants:fe})},P=!x||N-w<A,ke=!x||N+w>v,Ce=W=>{var _e;const fe=b[W.id];return(_e=W.opts.find(Xe=>Xe.val===fe))==null?void 0:_e.name},ge=()=>C(W=>Math.max(A,W-w)),Le=()=>C(W=>Math.min(v,W+w)),Be=W=>_.jsxs("div",{className:M(t,`${O}-msg-pdp__variant`),children:[_.jsxs("div",{className:M(t,`${O}-msg-pdp__variant-label`),children:[_.jsx("span",{id:`variant-label-${W.id}`,className:M(t,`${O}-msg-pdp__variant-name`),children:W.lbl||W.id}),Ce(W)&&_.jsx("span",{className:M(t,`${O}-msg-pdp__variant-value`),children:Ce(W)})]}),_.jsx("div",{role:"radiogroup","aria-labelledby":`variant-label-${W.id}`,className:M(t,`${O}-msg-pdp__chips`),children:W.opts.map(fe=>{const _e=tc(p.vmat,W.id,fe.val,b),Xe=b[W.id]===fe.val;return _.jsxs("label",{className:M(`${O}-msg-pdp__chip`,{selected:Xe,unavailable:!_e}),children:[_.jsx("input",{type:"radio",name:`variant-${W.id}`,value:fe.val,checked:Xe,"aria-description":_e?void 0:"unavailable",onChange:D(W.id,fe.val),className:`${O}-msg-pdp__radio-input`}),_.jsx("span",{children:fe.name||fe.val})]},fe.val)})})]},W.id),Ge=W=>_.jsxs("div",{className:M(t,`${O}-msg-pdp__variant`),children:[_.jsxs("div",{className:M(t,`${O}-msg-pdp__variant-label`),children:[_.jsx("span",{id:`variant-label-${W.id}`,className:M(t,`${O}-msg-pdp__variant-name`),children:W.lbl||"Color"}),Ce(W)&&_.jsx("span",{className:M(t,`${O}-msg-pdp__variant-value`),children:Ce(W)})]}),_.jsx("div",{role:"radiogroup","aria-labelledby":`variant-label-${W.id}`,className:M(t,`${O}-msg-pdp__swatches`),children:W.opts.map(fe=>{const _e=tc(p.vmat,W.id,fe.val,b),Xe=b[W.id]===fe.val,ut=tF(p,fe.val);return ut?_.jsxs("label",{className:M(`${O}-msg-pdp__swatch`,{selected:Xe,unavailable:!_e}),children:[_.jsx("input",{type:"radio",name:`variant-${W.id}`,value:fe.val,checked:Xe,"aria-label":fe.name||fe.val,"aria-description":_e?void 0:"unavailable",onChange:D(W.id,fe.val),className:`${O}-msg-pdp__radio-input`}),_.jsx("img",{className:M(t,`${O}-msg-pdp__swatch-image`),src:ut,alt:fe.name||fe.val,loading:"lazy"})]},fe.val):_.jsxs("label",{className:M(`${O}-msg-pdp__chip`,{selected:Xe,unavailable:!_e}),children:[_.jsx("input",{type:"radio",name:`variant-${W.id}`,value:fe.val,checked:Xe,"aria-description":_e?void 0:"unavailable",onChange:D(W.id,fe.val),className:`${O}-msg-pdp__radio-input`}),_.jsx("span",{children:fe.name||fe.val})]},fe.val)})})]});return _.jsx("div",{className:M(t,`${O}-msg-pdp`),children:_.jsxs("div",{className:M(t,`${O}-msg-pdp__card`),children:[_.jsx("div",{className:M(t,`${O}-msg-pdp__gallery`),children:_.jsx(J9,{images:ne,altText:p.name,globalClassName:t})}),_.jsxs("div",{className:M(t,`${O}-msg-pdp__content`),children:[p.slugUrl?_.jsx("a",{href:p.slugUrl,target:n?"_blank":"_self",rel:"noopener noreferrer",className:M(t,`${O}-msg-pdp__title-link`),"aria-label":`Go to product page for ${p.name}`,children:p.name}):_.jsx("p",{className:M(t,`${O}-msg-pdp__title`),children:p.name}),_.jsx(sp,{globalClassName:t,className:`${O}-msg-pdp__price`,retailPrice:de==null?void 0:de.orig,discountPrice:(de==null?void 0:de.cur)||(de==null?void 0:de.prom),currencyCode:p.ccy,fontSize:"14px"}),p.dscr&&_.jsx("div",{className:M(t,`${O}-msg-pdp__description`),children:_.jsx(po,{globalClassName:t,text:p.dscr})}),z&&Ge(z),ae.map(Be),r&&_.jsxs("div",{className:M(t,`${O}-msg-pdp__variant`),children:[_.jsxs("div",{className:M(t,`${O}-msg-pdp__variant-label`),children:[_.jsx("span",{className:M(t,`${O}-msg-pdp__variant-name`),children:"Quantity"}),_.jsx("span",{className:M(t,`${O}-msg-pdp__variant-value`),children:N})]}),_.jsxs("div",{className:M(t,`${O}-msg-pdp__stepper`),children:[_.jsx(ir,{className:`${O}-msg-pdp__stepper-btn`,ariaLabel:"Decrease quantity",icon:_.jsx(zk,{}),disabled:P,onClick:ge}),_.jsx("span",{className:M(t,`${O}-msg-pdp__quantity`),children:N}),_.jsx(ir,{className:`${O}-msg-pdp__stepper-btn`,ariaLabel:"Increase quantity",icon:_.jsx(Vk,{}),disabled:ke,onClick:Le})]})]}),r&&_.jsxs("div",{className:M(t,`${O}-msg-pdp__actions`),children:[Y&&_.jsx(px,{expressPaymentUrl:Y,globalClassName:t,onOrderComplete:ie},Y),_.jsx(el,{className:`${O}-msg-pdp__add-to-cart`,disabled:!x||u||j,onClick:Z,children:j?"Adding...":"Add to cart"})]})]})]})})},uF=e=>{if(e.imageUrl)return e.baseUrl?e.baseUrl+e.imageUrl:e.imageUrl},lF=({products:e,table:t,globalClassName:n,openLinksInNewTab:r,isCartMgmtSupported:s=!1})=>{const{addToCart:a,loading:u}=sn(),{overrides:c,isInitialized:d}=mo(),f=go(),p=d?c.ProductComparison:void 0;if(p){const x={name:"ProductComparison",payload:{products:e,table:t},api:f};return _.jsx(Eo,{tagName:p,props:x,label:"ProductComparison"})}if(!e.length)return null;const m=`auto repeat(${e.length}, 1fr)`,b=`${90+e.length*140}px`,y=x=>()=>{u||a({productName:x.name,sku:x.id})};return _.jsx("div",{className:M(n,`${O}-product-comparison`),children:_.jsxs("div",{className:`${O}-product-comparison__grid`,style:{gridTemplateColumns:m,minWidth:b},children:[_.jsxs("div",{className:`${O}-product-comparison__header`,children:[_.jsx("div",{className:`${O}-product-comparison__header-spacer`}),e.map(x=>{var v,w,N,C;const A=uF(x);return _.jsxs("div",{className:M(n,`${O}-product-comparison__product-col`),children:[A&&_.jsx("img",{className:M(n,`${O}-product-comparison__image`),src:A,alt:x.name||"Product image",loading:"eager"}),x.slugUrl?_.jsx("a",{href:x.slugUrl,target:r?"_blank":"_self",rel:"noopener",className:M(n,`${O}-product-comparison__name`),"aria-label":`Go to product page for ${x.name}`,children:x.name}):_.jsx("span",{className:M(n,`${O}-product-comparison__name`),children:x.name}),_.jsx(sp,{globalClassName:n,retailPrice:(v=x.pr)==null?void 0:v.orig,discountPrice:(C=(w=x.pr)==null?void 0:w.prom)!=null?C:(N=x.pr)==null?void 0:N.cur,currencyCode:x.ccy,fontSize:"0.875rem"})]},x.id)})]}),_.jsx("div",{className:`${O}-product-comparison__table`,children:t.map(x=>_.jsxs("div",{className:`${O}-product-comparison__row`,children:[_.jsx("div",{className:M(n,`${O}-product-comparison__row-label`),children:x.row_name}),e.map((A,v)=>_.jsx("div",{className:M(n,`${O}-product-comparison__row-value`),children:x.values[v]},`${x.row_name}-${A.id}`))]},x.row_name))}),s&&_.jsxs("div",{className:`${O}-product-comparison__footer`,children:[_.jsx("div",{className:`${O}-product-comparison__footer-spacer`}),e.map(x=>_.jsx("div",{className:M(n,`${O}-product-comparison__footer-cell`),children:_.jsxs(el,{className:`${O}-product-comparison__add-to-cart`,disabled:u,onClick:y(x),children:[_.jsx(Kk,{size:"14px"}),"Add to cart"]})},`cart-${x.id}`))]})]})})},yx=({content:e,messageId:t,globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s})=>{const{sendMessage:a,loading:u,cartUpdating:c}=sn(),{isCartMgmtSupported:d,logger:f}=at(),{overrides:p,isInitialized:m}=mo(),b=go(),y=B.useMemo(()=>e.response.map(x=>{var v,w;if(x.type!=="markdown")return x;const A=_g((w=(v=x.data)==null?void 0:v.content)!=null?w:"");return A&&A.type!=="markdown"?A:x}),[e.response]);return _.jsx(_.Fragment,{children:y.map((x,A)=>{var v,w,N,C,j,X,L,G,ne,de,z,ae,oe,pe,ce,se,Ae,re,Y,ie,k,D,Z,P,ke;switch(x.type){case"markdown":{const Ce=(w=(v=x.data)==null?void 0:v.content)!=null?w:"";return x.index===ji&&wg(Ce)?null:_.jsx(po,{text:Ce,globalClassName:n,openLinksInNewTab:r,showIsLoading:!1},`${x.type}-${(N=x.index)!=null?N:A}`)}case"product_carousel":return _.jsx(F9,{title:(j=(C=x.data)==null?void 0:C.title)!=null?j:"",products:(L=(X=x.data)==null?void 0:X.products)!=null?L:[],globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s,isCartMgmtSupported:d},`${x.type}-${(G=x.index)!=null?G:A}`);case"product_tile":return _.jsx(aF,{product:x.data,globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s,isCartMgmtSupported:d},`${x.type}-${(ne=x.index)!=null?ne:A}`);case"product_comparison":return _.jsx(lF,{products:(z=(de=x.data)==null?void 0:de.products)!=null?z:[],table:(oe=(ae=x.data)==null?void 0:ae.table)!=null?oe:[],globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s,isCartMgmtSupported:d},`${x.type}-${(pe=x.index)!=null?pe:A}`);case"cart":{const Ce=(Ae=(se=(ce=x.data)==null?void 0:ce.cart)==null?void 0:se.cartSummary)==null?void 0:Ae.cartDetails;return Ce?_.jsx(W9,{cart:Ce,messageId:t,productsToHighlight:x.data.products_to_highlight,globalClassName:n,openLinksInNewTab:r},`${x.type}-${(re=x.index)!=null?re:A}`):null}case"order_confirmation":{const Ce=(ie=(Y=x.data)==null?void 0:Y.order)==null?void 0:ie.orderDetails;return Ce?_.jsx(Q9,{order:Ce,globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s},`${x.type}-${(k=x.index)!=null?k:A}`):null}case"tool_results":{const Ce=x.data,ge=x.output_name,Le=m&&ge&&Object.prototype.hasOwnProperty.call(p,ge)?p[ge]:void 0,Be=typeof Le=="string"?Le:void 0;if(!Be||!ge)return f!=null&&f.isDevelopment&&(ge?f.warn(`🦜 tool_results "${ge}" rendered nothing — no override registered for that key. Register one in the overrides map: { "${ge}": "<your-tag-name>" }.`,{registeredKeys:Object.keys(p),payload:Ce}):f.warn("🦜 tool_results block has no output_name — nothing to route on",{payload:Ce})),null;const Ge={name:ge,payload:Ce,api:b};return _.jsx(I9,{overrideName:ge,children:_.jsx(Eo,{tagName:Be,props:Ge,label:`toolResult:${ge}`})},`${x.type}-${ge}-${(D=x.index)!=null?D:A}`)}case"suggestions":return _.jsx("div",{style:{marginTop:"0.5rem"},children:_.jsx(f8,{disabled:u||c,suggestions:(P=(Z=x.data)==null?void 0:Z.display_text)!=null?P:[],globalClassName:n,isWidgetStandalone:s,onSuggestionClick:a})},`${x.type}-${(ke=x.index)!=null?ke:A}`);default:return null}})})};class Tx extends B.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){yt(!0,"error","Message content threw during render:",t,n.componentStack)}render(){return this.state.hasError?_.jsx("p",{className:M(this.props.globalClassName,`${O}-reset-message`),children:"Oops, I had trouble displaying this response."}):this.props.children}}const cF=({message:e,globalClassName:t,openLinksInNewTab:n,isWidgetStandalone:r})=>{const{logger:s}=at(),a=B.useMemo(()=>{if(typeof e.content!="string")return null;const c=ju(e.content);if(c)return c;const d=_g(e.content);return d?{response:[d]}:null},[e.content]),u=B.useMemo(()=>{const c="Oops, I had trouble with your request.";if(typeof e.content!="string")return s==null||s.warn("Message content is not richtext format. Showing fallback text.",e.content),c;const d=e.content.trim();try{const f=JSON.parse(d);if(typeof f=="object"&&f!==null)return s==null||s.debug("Detected JSON object instead of array of responses in message content",e.content),f.text||f.message||c}catch(f){if(d.startsWith("{")||d.startsWith("["))return s==null||s.warn("Failed to parse JSON-like message content. Showing fallback text.",e.content),c}return e.content||c},[s,e.content]);switch(e.role){case"user":return _.jsx("div",{className:M(t,`${O}-message`,r?"standalone":"embedded"),children:_.jsx("div",{className:M(t,`${O}-user-message`,r?"standalone":"embedded"),children:_.jsxs("div",{className:M(t,`${O}-user-message-row`,r?"standalone":"embedded"),children:[_.jsx("span",{className:M(t,`${O}-message-icon user-message-icon`,r?"standalone":"embedded"),children:_.jsx(eN,{})}),_.jsx("p",{className:M(t,`${O}-user-message-text`,r?"standalone":"embedded"),children:e.content})]})})});case"agent":return _.jsx("div",{className:M(t,`${O}-message-group`,r?"standalone":"embedded"),children:_.jsx("div",{className:`${O}-message-group-child`,children:a?_.jsx(Tx,{globalClassName:t,children:_.jsx(yx,{content:a,messageId:e.id,globalClassName:t,openLinksInNewTab:n,isWidgetStandalone:r})}):_.jsx(po,{text:u,globalClassName:t,openLinksInNewTab:n,showIsLoading:!1})})});case"system":return _.jsx("div",{className:M(t,`${O}-message`,r?"standalone":"embedded"),children:_.jsx("p",{className:M(t,`${O}-reset-message`),children:e.content})})}},dF=({message:e,onRetry:t,globalClassName:n,isWidgetStandalone:r})=>_.jsxs("div",{className:M(n,`${O}-send-error`,r?"standalone":"embedded"),role:"alert",children:[_.jsx("span",{className:M(n,`${O}-send-error-text`),children:e}),_.jsxs("button",{type:"button",className:M(n,`${O}-retry-button`),onClick:t,children:[_.jsx(sN,{"aria-hidden":"true"})," Retry"]})]}),fF="You are offline or we couldn't reach the assistant. Check connection and try again.",Ep=({isWidgetStandalone:e})=>{var z,ae;const{globalClassName:t,openLinksInNewTab:n,logger:r,autoScroll:s}=at(),{messages:a,streamingBlocks:u,isAgentTyping:c,loading:d,progressMessage:f,connectionStatus:p,error:m,sendError:b,retryLastMessage:y,retryConnection:x}=sn(),A=B.useRef(null),v=a.length>0,w=u.some(NA),N=a[a.length-1],C=N?kA(N.content,"suggestions"):!1,j=v&&(d||c)&&!w&&!C,X=p==="reconnecting"&&!j,L=p==="error";let G=null;L?G={message:m!=null?m:fF,kind:"connection",onRetry:x}:b&&(G={message:b.message,kind:"send",onRetry:y}),B.useEffect(()=>{var oe;(oe=A.current)==null||oe.scrollIntoView({behavior:"smooth"})},[]),B.useEffect(()=>{var oe;s&&((oe=A.current)==null||oe.scrollIntoView({behavior:"smooth"}))},[a,u,b,m,s]);const ne=(z=G==null?void 0:G.message)!=null?z:null,de=(ae=G==null?void 0:G.kind)!=null?ae:null;return B.useEffect(()=>{ne&&(r==null||r.error("Error message shown to user",{message:ne,kind:de}))},[ne,de,r]),_.jsxs(_.Fragment,{children:[d&&!v&&_.jsx(E8,{globalClassName:t,isWidgetStandalone:e}),a.map(oe=>_.jsx(cF,{message:oe,globalClassName:t,openLinksInNewTab:n,isWidgetStandalone:e},oe.id)),G&&_.jsx(dF,{message:G.message,onRetry:G.onRetry,globalClassName:t,isWidgetStandalone:e}),w&&_.jsxs("div",{className:M(t,`${O}-message-group`,e?"standalone":"embedded"),children:[_.jsx(Tx,{globalClassName:t,children:_.jsx(yx,{content:{response:u},globalClassName:t,openLinksInNewTab:n,isWidgetStandalone:e})}),(d||c)&&_.jsx(op,{globalClassName:t,isWidgetStandalone:e})]}),j&&_.jsx(op,{globalClassName:t,isWidgetStandalone:e,loadingText:f}),X&&_.jsx(op,{globalClassName:t,isWidgetStandalone:e,loadingText:"Reconnecting..."}),_.jsx("div",{ref:A})]})},hF=()=>_.jsxs("svg",{className:`${O}-progress-step-check`,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[_.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),_.jsx("path",{d:"M5 8.5L7 10.5L11 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),pF=()=>_.jsx("svg",{className:`${O}-progress-step-starburst`,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:_.jsx("path",{d:"M8 1v3M8 12v3M1 8h3M12 8h3M3.05 3.05l2.12 2.12M10.83 10.83l2.12 2.12M3.05 12.95l2.12-2.12M10.83 5.17l2.12-2.12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),mF=(e,t)=>e===0?[]:e<0?t:t.slice(-e),yp=({progressStepsLimit:e,steps:t,globalClassName:n})=>{const{progressStepsLimit:r}=at(),s=e!=null?e:r,{overrides:a,isInitialized:u}=mo(),c=go();if(t.length===0||s===0)return null;const d=mF(s,t),f=u?a.ProgressSteps:void 0;if(f){const p={name:"ProgressSteps",payload:{steps:d},api:c};return _.jsx(Eo,{tagName:f,props:p,label:"ProgressSteps"})}return _.jsx("div",{className:M(n,`${O}-progress-steps-panel`),children:_.jsx("div",{className:`${O}-progress-steps`,children:_.jsx("ul",{className:`${O}-progress-steps-list`,children:d.map((p,m)=>{const b=m<d.length-1,y=m===d.length-1;return _.jsxs("li",{className:M(`${O}-progress-step`,y&&"active"),children:[y&&_.jsx("span",{className:`${O}-progress-step-arc`}),_.jsx("span",{className:`${O}-progress-step-text`,children:p}),_.jsx("span",{className:M(`${O}-progress-step-icon`,b?"done":"active"),children:b?_.jsx(hF,{}):_.jsx(pF,{})})]},`${m}-${p}`)})})})})},bx=()=>{const{globalClassName:e,themeVariables:t,messageAlignment:n,enableDownloadTranscript:r}=at(),{isAgentTyping:s,sendMessage:a,resetConversation:u,progressSteps:c,downloadTranscript:d}=sn(),f=s;return _.jsxs("div",{className:M(e,`${O}-container`,`${O}-embedded-chat`),style:t,children:[_.jsx("div",{className:M(e,`${O}-message-container`,`container-${n}`,"embedded"),children:_.jsx(Ep,{isWidgetStandalone:!1})}),_.jsx(yp,{steps:c,globalClassName:e}),_.jsx(uh,{componentType:"chat",className:"embedded-chat",isLoading:f,onSubmit:p=>a(p)}),_.jsx("div",{className:M(`${O}-embedded-chat-menu`),children:_.jsxs(pD,{componentType:"chat",children:[_.jsx(Fb,{componentType:"chat"}),_.jsx(Vy,{componentType:"chat",onClearChat:u}),r&&_.jsx(qy,{componentType:"chat",onDownloadTranscript:d})]})})]})},xx=e=>{var d;const{children:t,disabled:n}=e,[r,s]=B.useState((d=e.container)==null?void 0:d.current),a=B.useSyncExternalStore(EF,()=>!1,()=>!0),{getRootNode:u}=Yl();if(B.useEffect(()=>{s(()=>{var f;return(f=e.container)==null?void 0:f.current})},[e.container]),a||n)return _.jsx(_.Fragment,{children:t});const c=r!=null?r:gF(u);return _.jsx(_.Fragment,{children:B.Children.map(t,f=>Fs.createPortal(f,c))})},gF=e=>{const t=e==null?void 0:e(),n=t.getRootNode();return ts(n)?n:wr(t).body},EF=()=>()=>{},_x=()=>{const{globalClassName:e,themeVariables:t,messageAlignment:n}=at(),{mode:r,status:s,dialogPosition:a,isDialogFullHeight:u,dialogWidth:c}=ri(),{loading:d,isAgentTyping:f,sendMessage:p,resetConversation:m,progressSteps:b,downloadTranscript:y}=sn(),{isOpen:x}=s||{},A=!!s.isOpen,v=r==="standalone",w=f||d,N=()=>{Br(!1)};return A?_.jsx(Cb,{lazyMount:!0,unmountOnExit:!0,modal:!1,closeOnEscape:!1,closeOnInteractOutside:!1,open:A,children:_.jsx(xx,{children:_.jsx(tp,{className:M(e,`${O}-container`,`${O}-dialog`,a,u&&"full-height"),style:H(H({},t),c&&{width:c}),children:_.jsxs(Zh,{className:M(e,`${O}-dialog-content`,{standalone:v,embedded:!v}),children:[_.jsx(Lb,{componentType:"dialog",onClearChat:m,onClose:N,onDownloadTranscript:y}),_.jsx(ep,{className:M(e,`${O}-message-container`,`container-${n}`,{standalone:v,embedded:!v}),children:_.jsx(Ep,{isWidgetStandalone:v,isOpen:x})}),_.jsx(yp,{steps:b,globalClassName:e}),_.jsx(uh,{componentType:"dialog",isLoading:w,onSubmit:C=>p(C)})]})})})}):null},wx=()=>{const{globalClassName:e,themeVariables:t,messageAlignment:n}=at(),{mode:r,status:s,isModalFullscreen:a}=ri(),{loading:u,isAgentTyping:c,sendMessage:d,resetConversation:f,progressSteps:p,downloadTranscript:m}=sn(),{isOpen:b}=s||{},y=!!s.isOpen,x=r==="standalone",A=c||u,v=({open:N})=>{Br(N)},w=()=>{Br(!1)};return y?_.jsx(Cb,{lazyMount:!0,unmountOnExit:!0,open:y,onOpenChange:v,children:_.jsx(xx,{children:_.jsxs("div",{className:M(e,`${O}-modal-container`),style:t,children:[_.jsx(Sb,{className:M(e,`${O}-modal-backdrop`)}),_.jsx(tp,{className:M(e,`${O}-container`,`${O}-modal`,{fullscreen:a,standalone:x,embedded:!x}),children:_.jsxs(Zh,{className:M(e,`${O}-modal-content`,{standalone:x,embedded:!x}),children:[_.jsx(Lb,{componentType:"modal",onClearChat:f,onClose:w,onDownloadTranscript:m}),_.jsx(ep,{className:M(e,`${O}-message-container`,`container-${n}`,{standalone:x,embedded:!x}),children:_.jsx(Ep,{isWidgetStandalone:x,isOpen:b})}),_.jsx(yp,{steps:p,globalClassName:e}),_.jsx(uh,{componentType:"modal",isLoading:A,onSubmit:N=>d(N)})]})})]})})}):null},yF=()=>{const e=ri(),{status:{type:t,isMinimized:n}}=e||{status:{}};return n?_.jsx(Gk,{}):t==="dialog"?_.jsx(_x,{}):t==="modal"?_.jsx(wx,{}):_.jsx(bx,{})},TF=()=>{const{setIsOpen:e,setIsInline:t,setElementId:n,setEntryType:r,setParams:s}=s8();B.useEffect(()=>{const a=u=>{const{property:c,value:d}=u.detail||{};!c||d===void 0||(c==="isOpen"&&e(d),c==="isInline"&&t(d),c==="elementId"&&n(d),c==="entryType"&&r(d),c==="params"&&s(d))};return ZD(a),()=>{e8(a)}},[e,t,n,r,s])},Sx=(e,t,n)=>{n!==void 0?e(t,n):e(t)};function bF({isReady:e,hasError:t,transmit:n}){const r=B.useRef([]),s=B.useRef(e);s.current=e;const a=B.useRef(n);a.current=n;const u=B.useCallback((c,d)=>{s.current?Sx(a.current,c,d):r.current.push({prompt:c,options:d})},[]);return B.useEffect(()=>{if(e&&r.current.length){const c=r.current;r.current=[],c.forEach(({prompt:d,options:f})=>Sx(a.current,d,f))}},[e]),B.useEffect(()=>{t&&(r.current=[])},[t]),u}const vx={copilot:"Ask Copilot",messaging:"Ask a question"},xF=({onSubmit:e,disabled:t=!1})=>{const{globalClassName:n,mode:r}=at(),{placeholder:s,isResponseLoading:a}=Xl(),u=s||vx[r],[c,d]=B.useState(""),f=t||a,p=m=>{const b=c.trim();b&&(m.preventDefault(),e(b),d(""))};return _.jsxs("form",{className:M(n,`${O}-prompts-input-container`),name:`${O}-prompts-form`,onSubmit:p,children:[_.jsx("label",{htmlFor:`${O}-prompts-input`,"aria-label":u,children:_.jsx(Vh,{className:M(n,`${O}-prompts-input-icon`)})}),_.jsx("input",{id:`${O}-prompts-input`,className:M(n,`${O}-prompts-input`),name:`${O}-prompts-input`,placeholder:u,type:"text",disabled:f,value:c,onChange:m=>d(m.target.value)}),_.jsx(ir,{className:M(n,`${O}-prompts-input-submit-button`),type:"submit",ariaLabel:"Submit Prompt",icon:_.jsx(pf,{}),disabled:f})]})},_F=()=>{const{globalClassName:e,mode:t}=at(),{placeholder:n}=Xl(),r=n||vx[t];return _.jsxs("div",{className:M(e,`${O}-prompts-header`),children:[_.jsx(Vh,{className:M(e,`${O}-prompts-input-icon`),"aria-hidden":"true"}),_.jsx("span",{className:M(e,`${O}-prompts-header-text`),children:r})]})},Ax=({label:e,disabled:t=!1,onClick:n})=>{var c;const{globalClassName:r,suggestionButtonConfig:s}=at(),a=s==null?void 0:s.icon,u=(c=s==null?void 0:s.iconPosition)!=null?c:"left";return _.jsxs("button",{className:M(r,`${O}-prompts-button`,{"has-icon":!!a,"icon-right":!!a&&u==="right"}),disabled:t,onClick:n,children:[a&&_.jsx(Mb,{icon:a,className:`${O}-suggestion-button-icon`}),_.jsx("span",{children:e})]})},wF="Ask me something else",SF=({label:e,disabled:t=!1})=>_.jsx(Ax,{label:e||wF,disabled:t,onClick:()=>Br(!0)}),vF=({onPromptClick:e,disabled:t=!1})=>{const{globalClassName:n}=at(),{messages:r}=sn(),{staticQuestions:s,askElseButtonLabel:a,disableAskElseButton:u}=Xl(),c=B.useMemo(()=>{var y;const f=r.filter(x=>x.role==="agent");if(!f.length)return s;const m=f.map(x=>ju(x.content)).filter(Boolean).flatMap(x=>x==null?void 0:x.response.filter(A=>A.type==="suggestions"));if(!m.length)return s;const b=m[m.length-1];return(y=b==null?void 0:b.data.display_text)!=null?y:s},[r,s]);if(c.length===0)return null;const d=f=>()=>{const p=f.trim();p&&e(p)};return _.jsxs("div",{className:M(n,`${O}-prompts-button-group`),children:[c.map(f=>_.jsx(Ax,{label:f,disabled:t,onClick:d(f)},f)),!u&&_.jsx(SF,{label:a,disabled:t})]})},AF=()=>{const{globalClassName:e,themeVariables:t}=at(),{isOpen:n,elementId:r,promptsDisplay:s,staticQuestions:a}=Xl(),{isConnected:u,sendMessage:c,connectionStatus:d}=sn(),{productId:f}=i8(),p=s!=="buttons",m=s!=="input",[b,y]=B.useState(null),x=d==="error",A=d==="connecting",v=bF({isReady:u,hasError:x,transmit:c});B.useEffect(()=>{if(!r||b)return;const N=document.getElementById(r);N&&y(N)},[r,b]);const w=B.useCallback(N=>{Br(!0);const C=(a||[]).includes(N.trim());if(f&&C){v(`${N} (Viewing product details for: ${f})`,{displayContent:N});return}v(N)},[v,a,f]);return!n||!b?null:Fs.createPortal(_.jsxs("div",{className:M(e,`${O}-prompts-extension-container`),style:t,children:[p&&_.jsx(xF,{onSubmit:w,disabled:x}),!p&&_.jsx(_F,{}),m&&_.jsx(vF,{onPromptClick:w,disabled:x}),!x&&A&&_.jsx("p",{className:M(e,`${O}-prompts-connecting-message`),children:"Connecting to agent..."}),x&&_.jsx("p",{className:M(e,`${O}-prompts-error-message`),children:"Oops, an error occurred with our agent."})]}),b)},kF=()=>(TF(),_.jsx(AF,{})),kx=e=>_.jsxs(Qg,le(H({},e),{children:[_.jsx(yF,{}),_.jsx(kF,{})]}));var nc={},Nx;function NF(){if(Nx)return nc;Nx=1;var e=t1();return nc.createRoot=e.createRoot,nc.hydrateRoot=e.hydrateRoot,nc}var CF=NF();const Cx=(e,t,n,r)=>{CF.createRoot(e).render(_.jsx(kx,le(H({},t),{overridesUrl:n,inlineOverrides:r,mode:"messaging"})))},OF=a=>{var u=a,{elementId:e,timeout:t=5e3,overridesUrl:n,inlineOverrides:r}=u,s=yn(u,["elementId","timeout","overridesUrl","inlineOverrides"]);let c;const d=(p,m)=>{for(const b of p)if(b.type==="childList"&&b.addedNodes.length)for(const y of b.addedNodes)y.nodeType===Node.ELEMENT_NODE&&y.id===e&&(yt(!0,"log","Target element found, rendering Messaging Widget"),m.disconnect(),clearTimeout(c),Cx(y,s,n,r))},f=new MutationObserver(d);return f.observe(document.body,{childList:!0,subtree:!0}),c=setTimeout(()=>{f.disconnect(),yt(!0,"error",`Element with id: ${e} not found within ${t} milliseconds, stopping observation`)},t),f},IF=a=>{var u=a,{timeout:e,elementId:t,overridesUrl:n,overrides:r}=u,s=yn(u,["timeout","elementId","overridesUrl","overrides"]);if(!s.messagingConfig){yt(!0,"error","Messaging Widget requires messagingConfig");return}if(!s.messagingConfig.scrt2Url||!s.messagingConfig.orgId||!s.messagingConfig.esDeveloperName){yt(!0,"error","Messaging Widget requires messagingConfig.scrt2Url, messagingConfig.orgId, and messagingConfig.esDeveloperName");return}const c=document.getElementById(t);if(!c){yt(!0,"warn","Container element not found for id:",t),yt(!0,"warn","Beginning observation for element"),OF(H({elementId:t,timeout:e,overridesUrl:n,inlineOverrides:r},s));return}Cx(c,s,n,r)};class PF extends HTMLElement{constructor(){super(...arguments);Ye(this,"_props",null)}set props(n){this._props=n,this.render()}get props(){return this._props}connectedCallback(){this.render()}render(){}}const RF={components:{setEntryType:P0,toggleWidgetOpen:Br,toggleWidgetMinimized:Cu,toggleModalFullscreen:Pd,setWidgetType:Ou,setWidgetDialogPosition:Rd,loadPromptsComponent:r8,togglePromptsExtensionOpen:Rb}};Me.AgentForceWidget=kx,Me.AgentforceWidgetProvider=Qg,Me.CIMULATE_WIDGET_READY_EVENT=I0,Me.MessagingDialog=_x,Me.MessagingEmbed=bx,Me.MessagingModal=wx,Me.MessagingProvider=Pg,Me.OverrideElement=PF,Me.eventHandlers=RF,Me.injectMessagingWidget=IF,Me.useMessaging=sn,Object.defineProperty(Me,Symbol.toStringTag,{value:"Module"})}));
52
+ `))}function d(y,x,A,v){const w=A.enter("tableCell"),N=A.enter("phrasing"),C=A.containerPhrasing(y,le(H({},v),{before:a,after:a}));return N(),w(),C}function f(y,x){return nM(y,{align:x,alignDelimiters:r,padding:n,stringLength:s})}function p(y,x,A){const v=y.children;let w=-1;const N=[],C=x.enter("table");for(;++w<v.length;)N[w]=m(v[w],x,A);return C(),N}function m(y,x,A){const v=y.children;let w=-1;const N=[],C=x.enter("tableRow");for(;++w<v.length;)N[w]=d(v[w],y,x,A);return C(),N}function b(y,x,A){let v=nx.inlineCode(y,x,A);return A.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function zM(){return{exit:{taskListCheckValueChecked:ix,taskListCheckValueUnchecked:ix,paragraph:qM}}}function VM(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:YM}}}function ix(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function qM(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let a=-1,u;for(;++a<s.length;){const c=s[a];if(c.type==="paragraph"){u=c;break}}u===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function YM(e,t,n,r){const s=e.children[0],a=typeof e.checked=="boolean"&&s&&s.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);a&&c.move(u);let d=nx.listItem(e,t,n,H(H({},r),c.current()));return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),d;function f(p){return p+u}}function WM(){return[v8(),Y8(),Q8(),MM(),zM()]}function GM(e){return{extensions:[A8(),W8(e),K8(),$M(e),VM()]}}const XM={tokenize:t9,partial:!0},sx={tokenize:n9,partial:!0},ox={tokenize:r9,partial:!0},ax={tokenize:i9,partial:!0},QM={tokenize:s9,partial:!0},ux={name:"wwwAutolink",tokenize:ZM,previous:cx},lx={name:"protocolAutolink",tokenize:e9,previous:dx},qr={name:"emailAutolink",tokenize:JM,previous:fx},Or={};function KM(){return{text:Or}}let ls=48;for(;ls<123;)Or[ls]=qr,ls++,ls===58?ls=65:ls===91&&(ls=97);Or[43]=qr,Or[45]=qr,Or[46]=qr,Or[95]=qr,Or[72]=[qr,lx],Or[104]=[qr,lx],Or[87]=[qr,ux],Or[119]=[qr,ux];function JM(e,t,n){const r=this;let s,a;return u;function u(m){return!hp(m)||!fx.call(r,r.previous)||pp(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(m))}function c(m){return hp(m)?(e.consume(m),c):m===64?(e.consume(m),d):n(m)}function d(m){return m===46?e.check(QM,p,f)(m):m===45||m===95||an(m)?(a=!0,e.consume(m),d):p(m)}function f(m){return e.consume(m),s=!0,d}function p(m){return a&&s&&mn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function ZM(e,t,n){const r=this;return s;function s(u){return u!==87&&u!==119||!cx.call(r,r.previous)||pp(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(XM,e.attempt(sx,e.attempt(ox,a),n),n)(u))}function a(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function e9(e,t,n){const r=this;let s="",a=!1;return u;function u(m){return(m===72||m===104)&&dx.call(r,r.previous)&&!pp(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(m),e.consume(m),c):n(m)}function c(m){if(mn(m)&&s.length<5)return s+=String.fromCodePoint(m),e.consume(m),c;if(m===58){const b=s.toLowerCase();if(b==="http"||b==="https")return e.consume(m),d}return n(m)}function d(m){return m===47?(e.consume(m),a?f:(a=!0,d)):n(m)}function f(m){return m===null||rl(m)||ht(m)||Gi(m)||il(m)?n(m):e.attempt(sx,e.attempt(ox,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function t9(e,t,n){let r=0;return s;function s(u){return(u===87||u===119)&&r<3?(r++,e.consume(u),s):u===46&&r===3?(e.consume(u),a):n(u)}function a(u){return u===null?n(u):t(u)}}function n9(e,t,n){let r,s,a;return u;function u(f){return f===46||f===95?e.check(ax,d,c)(f):f===null||ht(f)||Gi(f)||f!==45&&il(f)?d(f):(a=!0,e.consume(f),u)}function c(f){return f===95?r=!0:(s=r,r=void 0),e.consume(f),u}function d(f){return s||r||!a?n(f):t(f)}}function r9(e,t){let n=0,r=0;return s;function s(u){return u===40?(n++,e.consume(u),s):u===41&&r<n?a(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(ax,t,a)(u):u===null||ht(u)||Gi(u)?t(u):(e.consume(u),s)}function a(u){return u===41&&r++,e.consume(u),s}}function i9(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),a):c===93?(e.consume(c),s):c===60||c===null||ht(c)||Gi(c)?t(c):n(c)}function s(c){return c===null||c===40||c===91||ht(c)||Gi(c)?t(c):r(c)}function a(c){return mn(c)?u(c):n(c)}function u(c){return c===59?(e.consume(c),r):mn(c)?(e.consume(c),u):n(c)}}function s9(e,t,n){return r;function r(a){return e.consume(a),s}function s(a){return an(a)?n(a):t(a)}}function cx(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ht(e)}function dx(e){return!mn(e)}function fx(e){return!(e===47||hp(e))}function hp(e){return e===43||e===45||e===46||e===95||an(e)}function pp(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const o9={tokenize:p9,partial:!0};function a9(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:d9,continuation:{tokenize:f9},exit:h9}},text:{91:{name:"gfmFootnoteCall",tokenize:c9},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:u9,resolveTo:l9}}}}function u9(e,t,n){const r=this;let s=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u;for(;s--;){const d=r.events[s][1];if(d.type==="labelImage"){u=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!u||!u._balanced)return n(d);const f=sr(r.sliceSerialize({start:u.end,end:r.now()}));return f.codePointAt(0)!==94||!a.includes(f.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function l9(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",a,t],["enter",u,t],["exit",u,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function c9(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,u;return c;function c(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),d}function d(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(m){if(a>999||m===93&&!u||m===null||m===91||ht(m))return n(m);if(m===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return s.includes(sr(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return ht(m)||(u=!0),a++,e.consume(m),m===92?p:f}function p(m){return m===91||m===92||m===93?(e.consume(m),a++,f):f(m)}}function d9(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,u=0,c;return d;function d(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(x)}function p(x){if(u>999||x===93&&!c||x===null||x===91||ht(x))return n(x);if(x===93){e.exit("chunkString");const A=e.exit("gfmFootnoteDefinitionLabelString");return a=sr(r.sliceSerialize(A)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return ht(x)||(c=!0),u++,e.consume(x),x===92?m:p}function m(x){return x===91||x===92||x===93?(e.consume(x),u++,p):p(x)}function b(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),s.includes(a)||s.push(a),tt(e,y,"gfmFootnoteDefinitionWhitespace")):n(x)}function y(x){return t(x)}}function f9(e,t,n){return e.check(la,t,e.attempt(o9,t,n))}function h9(e){e.exit("gfmFootnoteDefinition")}function p9(e,t,n){const r=this;return tt(e,s,"gfmFootnoteDefinitionIndent",5);function s(a){const u=r.events[r.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(a):n(a)}}function m9(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(u,c){let d=-1;for(;++d<u.length;)if(u[d][0]==="enter"&&u[d][1].type==="strikethroughSequenceTemporary"&&u[d][1]._close){let f=d;for(;f--;)if(u[f][0]==="exit"&&u[f][1].type==="strikethroughSequenceTemporary"&&u[f][1]._open&&u[d][1].end.offset-u[d][1].start.offset===u[f][1].end.offset-u[f][1].start.offset){u[d][1].type="strikethroughSequence",u[f][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},u[f][1].start),end:Object.assign({},u[d][1].end)},m={type:"strikethroughText",start:Object.assign({},u[f][1].end),end:Object.assign({},u[d][1].start)},b=[["enter",p,c],["enter",u[f][1],c],["exit",u[f][1],c],["enter",m,c]],y=c.parser.constructs.insideSpan.null;y&&Mn(b,b.length,0,sl(y,u.slice(f+1,d),c)),Mn(b,b.length,0,[["exit",m,c],["enter",u[d][1],c],["exit",u[d][1],c],["exit",p,c]]),Mn(u,f-1,d-f+3,b),d=f+b.length-2;break}}for(d=-1;++d<u.length;)u[d][1].type==="strikethroughSequenceTemporary"&&(u[d][1].type="data");return u}function a(u,c,d){const f=this.previous,p=this.events;let m=0;return b;function b(x){return f===126&&p[p.length-1][1].type!=="characterEscape"?d(x):(u.enter("strikethroughSequenceTemporary"),y(x))}function y(x){const A=js(f);if(x===126)return m>1?d(x):(u.consume(x),m++,y);if(m<2&&!n)return d(x);const v=u.exit("strikethroughSequenceTemporary"),w=js(x);return v._open=!w||w===2&&!!A,v._close=!A||A===2&&!!w,c(x)}}}class g9{constructor(){this.map=[]}add(t,n,r){E9(this,t,n,r)}consume(t){if(this.map.sort(function(a,u){return a[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const a of s)t.push(a);s=r.pop()}this.map.length=0}}function E9(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function y9(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function T9(){return{flow:{null:{name:"table",tokenize:b9,resolveAll:x9}}}}function b9(e,t,n){const r=this;let s=0,a=0,u;return c;function c(z){let ae=r.events.length-1;for(;ae>-1;){const ce=r.events[ae][1].type;if(ce==="lineEnding"||ce==="linePrefix")ae--;else break}const oe=ae>-1?r.events[ae][1].type:null,pe=oe==="tableHead"||oe==="tableRow"?L:d;return pe===L&&r.parser.lazy[r.now().line]?n(z):pe(z)}function d(z){return e.enter("tableHead"),e.enter("tableRow"),f(z)}function f(z){return z===124||(u=!0,a+=1),p(z)}function p(z){return z===null?n(z):He(z)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),y):n(z):Ze(z)?tt(e,p,"whitespace")(z):(a+=1,u&&(u=!1,s+=1),z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),u=!0,p):(e.enter("data"),m(z)))}function m(z){return z===null||z===124||ht(z)?(e.exit("data"),p(z)):(e.consume(z),z===92?b:m)}function b(z){return z===92||z===124?(e.consume(z),m):m(z)}function y(z){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(z):(e.enter("tableDelimiterRow"),u=!1,Ze(z)?tt(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):x(z))}function x(z){return z===45||z===58?v(z):z===124?(u=!0,e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),A):X(z)}function A(z){return Ze(z)?tt(e,v,"whitespace")(z):v(z)}function v(z){return z===58?(a+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),w):z===45?(a+=1,w(z)):z===null||He(z)?j(z):X(z)}function w(z){return z===45?(e.enter("tableDelimiterFiller"),N(z)):X(z)}function N(z){return z===45?(e.consume(z),N):z===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(z))}function C(z){return Ze(z)?tt(e,j,"whitespace")(z):j(z)}function j(z){return z===124?x(z):z===null||He(z)?!u||s!==a?X(z):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(z)):X(z)}function X(z){return n(z)}function L(z){return e.enter("tableRow"),G(z)}function G(z){return z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),G):z===null||He(z)?(e.exit("tableRow"),t(z)):Ze(z)?tt(e,G,"whitespace")(z):(e.enter("data"),ne(z))}function ne(z){return z===null||z===124||ht(z)?(e.exit("data"),G(z)):(e.consume(z),z===92?de:ne)}function de(z){return z===92||z===124?(e.consume(z),ne):ne(z)}}function x9(e,t){let n=-1,r=!0,s=0,a=[0,0,0,0],u=[0,0,0,0],c=!1,d=0,f,p,m;const b=new g9;for(;++n<e.length;){const y=e[n],x=y[1];y[0]==="enter"?x.type==="tableHead"?(c=!1,d!==0&&(hx(b,t,d,f,p),p=void 0,d=0),f={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},b.add(n,0,[["enter",f,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,m=void 0,a=[0,0,0,0],u=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},b.add(n,0,[["enter",p,t]])),s=x.type==="tableDelimiterRow"?2:p?3:1):s&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,u[2]===0&&(a[1]!==0&&(u[0]=u[1],m=Jl(b,t,a,s,void 0,m),a=[0,0,0,0]),u[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(u[0]=u[1],m=Jl(b,t,a,s,void 0,m)),a=u,u=[a[1],n,0,0])):x.type==="tableHead"?(c=!0,d=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(d=n,a[1]!==0?(u[0]=u[1],m=Jl(b,t,a,s,n,m)):u[1]!==0&&(m=Jl(b,t,u,s,n,m)),s=0):s&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(u[3]=n)}for(d!==0&&hx(b,t,d,f,p),b.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=y9(t.events,n))}return e}function Jl(e,t,n,r,s,a){const u=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(a.end=Object.assign({},ho(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=ho(t.events,n[1]);if(a={type:u,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const f=ho(t.events,n[2]),p=ho(t.events,n[3]),m={type:c,start:Object.assign({},f),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",m,t]]),r!==2){const b=t.events[n[2]],y=t.events[n[3]];if(b[1].end=Object.assign({},y[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,A=n[3]-n[2]-1;e.add(x,A,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return s!==void 0&&(a.end=Object.assign({},ho(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function hx(e,t,n,r,s){const a=[],u=ho(t.events,n);s&&(s.end=Object.assign({},u),a.push(["exit",s,t])),r.end=Object.assign({},u),a.push(["exit",r,t]),e.add(n+1,0,a)}function ho(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const _9={name:"tasklistCheck",tokenize:S9};function w9(){return{text:{91:_9}}}function S9(e,t,n){const r=this;return s;function s(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),a)}function a(d){return ht(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),u):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),u):n(d)}function u(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(d)}function c(d){return He(d)?t(d):Ze(d)?e.check({tokenize:v9},t,n)(d):n(d)}}function v9(e,t,n){return tt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function A9(e){return $1([KM(),a9(),m9(e),T9(),w9()])}const k9={};function N9(e){const t=this,n=e||k9,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(A9(n)),a.push(WM()),u.push(GM(n))}const C9=()=>_.jsx("span",{className:`${O}-blinking-cursor`,children:_.jsx("svg",{height:"16px",width:"16px",xmlns:"http://www.w3.org/2000/svg",children:_.jsx("circle",{r:"0.45rem",cx:"0.5rem",cy:"0.55rem",fill:"black"})})}),po=({globalClassName:e,openLinksInNewTab:t,showIsLoading:n,text:r})=>_.jsx(RE,{remarkPlugins:[N9],rehypePlugins:[Ly],components:{h1:({children:s})=>_.jsx("h1",{className:M(e,`${O}-header h1`),children:s}),h2:({children:s})=>_.jsx("h2",{className:M(e,`${O}-header h2`),children:s}),h3:({children:s})=>_.jsx("h3",{className:M(e,`${O}-header h3`),children:s}),ul:({children:s})=>_.jsx("ul",{className:M(e,`${O}-ul`),children:s}),ol:({children:s})=>_.jsx("ol",{className:M(e,`${O}-ol`),children:s}),li:({children:s})=>_.jsx("li",{className:M(e,`${O}-li`),children:s}),a:({href:s,children:a})=>_.jsx(jy,{globalClassName:e,openLinksInNewTab:t,href:s,children:a}),table:({children:s})=>_.jsx("div",{className:M(e,`${O}-table-container`),children:_.jsx("table",{className:M(e,`${O}-table`),children:s})}),thead:({children:s})=>_.jsx("thead",{className:M(e,`${O}-thead`),children:s}),tbody:({children:s})=>_.jsx("tbody",{className:M(e,`${O}-tbody`),children:s}),tr:({children:s})=>_.jsx("tr",{className:M(e,`${O}-tr`),children:s}),th:({children:s})=>_.jsx("th",{className:M(e,`${O}-th`),children:s}),td:({children:s})=>_.jsx("td",{className:M(e,`${O}-td`),children:s}),span:({className:s,children:a})=>s===`${O}-blinking-cursor`?_.jsx(C9,{}):_.jsx("span",{children:a})},children:r+(n?`<span className='${O}-blinking-cursor'></span>`:"")}),mo=()=>B.useContext(Xg),go=()=>{const{sendMessage:e,loading:t,isConnected:n}=sn(),{mode:r,status:s}=ri();return B.useMemo(()=>({sendMessage:e,isLoading:t,isConnected:n,componentType:s.type,mode:r}),[e,t,n,s.type,r])};function O9(e){return e.includes("-")&&e===e.toLowerCase()}function Eo({tagName:e,props:t,label:n}){const r=B.useRef(null),s=B.useRef(null),a=B.useRef(e),u=B.useRef(null);return B.useEffect(()=>{const c=r.current;if(!c)return;if(a.current!==e&&(a.current=e,s.current=null),!O9(e)){u.current!==e&&(u.current=e,yt(!0,"error",`[CimulateOverrides] ${n||"Override"} rejected: "${e}" is not a valid custom element name (must contain a hyphen and be lowercase, e.g. "product-card").`)),s.current=null,c.replaceChildren();return}const d=s.current;if(d&&d.isConnected)try{d.props=t;return}catch(f){yt(!0,"error",`[CimulateOverrides] ${n||"Override"} threw an error during props update:`,f),s.current=null,c.replaceChildren();return}try{const f=document.createElement(e);f.props=t,c.replaceChildren(f);const p=f.localName;s.current=typeof customElements!="undefined"&&customElements.get(p)?f:null}catch(f){yt(!0,"error",`[CimulateOverrides] ${n||"Override"} threw an error:`,f),s.current=null,c.replaceChildren()}},[e,t,n]),B.useEffect(()=>{const c=r.current;return()=>{s.current=null,c==null||c.replaceChildren()}},[]),_.jsx("div",{ref:r,"data-override":n||"custom"})}class I9 extends B.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){yt(!0,"error",`Override "${this.props.overrideName}" threw during render:`,t,n.componentStack)}render(){return this.state.hasError?null:this.props.children}}function P9(e){return ot({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Image_Off"},child:[{tag:"path",attr:{d:"M19.937,14.218l0,-8.654c0,-0.829 -0.672,-1.5 -1.5,-1.5l-10.628,-0c-0.276,-0 -0.5,-0.225 -0.5,-0.5c0,-0.276 0.224,-0.5 0.5,-0.5l10.628,-0c1.38,-0 2.5,1.118 2.5,2.5l0,10.624c0,0.276 -0.224,0.5 -0.5,0.501c-0.276,-0 -0.5,-0.225 -0.5,-0.5l0,-0.556l-4.583,-4.584c-0.456,-0.456 0.251,-1.163 0.707,-0.707c0.162,0.162 2.37,2.37 3.876,3.876Zm-0.121,6.304c-0.395,0.262 -0.869,0.415 -1.379,0.415l-12.874,-0c-1.381,-0 -2.5,-1.119 -2.5,-2.5l0,-12.873c0,-0.51 0.153,-0.984 0.414,-1.38l-0.263,-0.263c-0.456,-0.456 0.251,-1.163 0.707,-0.707c0.088,0.088 0.176,0.176 0.263,0.263c0.245,0.245 16.095,16.094 16.339,16.338l0.263,0.263c0.455,0.456 -0.252,1.163 -0.707,0.707c-0.088,-0.087 -0.175,-0.175 -0.263,-0.263Zm-11.104,-11.103l-2.001,-2.001c-0.094,0.196 -0.146,0.415 -0.146,0.647c-0,0.829 0.672,1.5 1.5,1.5c0.232,-0 0.451,-0.052 0.647,-0.146Zm-2.733,-2.733l-1.77,-1.77c-0.093,0.196 -0.146,0.416 -0.146,0.648l0,10.717l1.926,-1.926c0.587,-0.586 1.536,-0.586 2.122,-0l0.555,0.554c0.195,0.196 0.511,0.196 0.706,0l2.415,-2.415l-2.343,-2.343c-0.395,0.262 -0.869,0.414 -1.379,0.414c-1.38,-0 -2.5,-1.119 -2.5,-2.5c-0,-0.509 0.152,-0.983 0.414,-1.379Zm-1.916,11.009l0,0.741c0,0.829 0.671,1.5 1.5,1.5l12.874,0c0.232,0 0.451,-0.052 0.647,-0.145c-0.165,-0.165 -3.264,-3.263 -6.59,-6.59l-2.414,2.415c-0.585,0.586 -1.537,0.586 -2.122,0l-0.554,-0.554c-0.195,-0.196 -0.512,-0.196 -0.708,0l-2.633,2.633Z"},child:[]}]}]})(e)}const R9=({imageUrl:e,globalClassName:t,isCartMgmtSupported:n,productPageUrl:r,openLinksInNewTab:s,ariaLabel:a,name:u,showInWidgetDetails:c})=>{const{loading:d}=sn();return _.jsx("div",{className:M(t,`${O}-msg-product-card__image-wrapper`),children:e?n?_.jsx("button",{type:"button",className:M(t,`${O}-msg-product-card__image-button`),onClick:c,disabled:d,"aria-label":a,children:_.jsx("img",{className:M(t,`${O}-msg-product-card__image`),src:e,alt:u||"Product image",loading:"lazy"})}):r?_.jsx("a",{href:r,target:s?"_blank":"_self",rel:"noopener","aria-label":a,children:_.jsx("img",{className:M(t,`${O}-msg-product-card__image`),src:e,alt:u||"Product image",loading:"lazy"})}):_.jsx("img",{className:M(t,`${O}-msg-product-card__image`),src:e,alt:u||"Product image",loading:"lazy"}):_.jsx("div",{className:M(t,`${O}-msg-product-card__image-placeholder`),"aria-label":u?`No image for ${u}`:"No product image",role:"img",children:_.jsx(P9,{"aria-hidden":"true"})})})},L9=({name:e,globalClassName:t,isCartMgmtSupported:n,productPageUrl:r,openLinksInNewTab:s,ariaLabel:a,showInWidgetDetails:u})=>{const{loading:c}=sn();return n?_.jsx("button",{type:"button",disabled:c,onClick:u,className:M(t,`${O}-msg-product-card__title-link`),"aria-label":a,children:e}):r?_.jsx("a",{href:r,target:s?"_blank":"_self",rel:"noopener",className:M(t,`${O}-msg-product-card__title-link`),"aria-label":a,children:e}):_.jsx("p",{className:M(t,`${O}-msg-product-card__title`),children:e})},D9=({product:e,globalClassName:t,openLinksInNewTab:n,isCartMgmtSupported:r=!1,rawProduct:s})=>{const{showProductDescription:a}=at(),{overrides:u,isInitialized:c}=mo(),{sendMessage:d,loading:f}=sn(),p=go(),m=c?u.ProductTile:void 0;if(m){const z={name:"ProductTile",payload:s!=null?s:{},api:p};return _.jsx(Eo,{tagName:m,props:z,label:"ProductTile"})}const{id:b,name:y,imageUrl:x,description:A,productPageUrl:v,price:w,priceBreakdown:N,discountPrice:C,listPrice:j,currencyCode:X}=e,L=C!=null?C:w,G=c8({priceBreakdown:N,currencyCode:X}),ne=()=>{if(f)return;const z=y||"this product",ae=b?` [SKU: ${b}]`:"";d(`Show me details for ${z}${ae}`)},de=r?`View details for ${y}`:`Go to product page for ${y}`;return _.jsxs("div",{className:M(t,`${O}-msg-product-card`),children:[_.jsx(R9,{imageUrl:x||"",globalClassName:t,isCartMgmtSupported:r,productPageUrl:v,openLinksInNewTab:n,ariaLabel:de,name:y,showInWidgetDetails:ne}),_.jsxs("div",{className:M(t,`${O}-msg-product-card__content`),children:[_.jsxs("div",{className:M(t,`${O}-msg-product-card__content-header`),children:[_.jsx(L9,{name:y||b,globalClassName:t,isCartMgmtSupported:r,productPageUrl:v,openLinksInNewTab:n,ariaLabel:de,showInWidgetDetails:ne}),a&&A&&_.jsx("div",{className:M(t,`${O}-msg-product-card__description`),title:A,children:_.jsx(po,{globalClassName:t,text:A})})]}),_.jsx("div",{className:M(t,`${O}-msg-product-card__price-row`),children:G?_.jsx("span",{className:M(t,`${O}-msg-product-card__price`),"aria-label":`Price from ${G.low} to ${G.high}`,children:G.range}):_.jsx(sp,{globalClassName:t,retailPrice:j,discountPrice:L,currencyCode:X})})]})]})},M9=e=>{var t,n;return{id:e.id,name:e.data.name,label:e.caption,description:e.data.description,imageUrl:e.data.imageUrl,productPageUrl:e.data.productPageUrl,price:e.data.price,discountPrice:e.data.discountPrice,listPrice:(t=e.data.listPrice)!=null?t:void 0,priceBreakdown:(n=e.data.priceBreakdown)!=null?n:void 0,currencyCode:e.data.currencyCode}},F9=({title:e,products:t,globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s,isCartMgmtSupported:a=!1})=>{const{showProductCaptions:u}=at(),{overrides:c,isInitialized:d}=mo(),f=go(),p=d?c.ProductCarousel:void 0;if(p){const m={name:"ProductCarousel",payload:{title:e,products:t},api:f};return _.jsx(Eo,{tagName:p,props:m,label:"ProductCarousel"})}return _.jsxs("div",{style:{marginBottom:"1rem"},children:[e&&_.jsx("p",{className:M(n,`${O}-product-carousel-title`),children:e}),_.jsx(PD,{globalClassName:n,spacing:s?"0.5rem":"6px",ariaLabel:e||"Product recommendations",children:t.map(m=>_.jsxs("div",{className:M(n,`${O}-product-carousel-item`),children:[_.jsx(D9,{product:M9(m),rawProduct:m,globalClassName:n,openLinksInNewTab:r,isCartMgmtSupported:a}),u&&_.jsx("p",{className:M(n,`${O}-product-carousel-caption`),title:m.caption,children:m.caption})]},m.id))})]})},mp=44,B9=400,U9=e=>{const t=typeof e=="number"?e:Number(e);return!Number.isFinite(t)||t<=0?mp:Math.min(Math.max(Math.round(t),mp),B9)},H9=e=>{try{return new URL(e,window.location.href).origin}catch(t){return null}},j9="parentOrigin",$9=(e,t)=>{if(!t)return e;try{const n=new URL(e,window.location.href);return n.searchParams.set(j9,t),n.toString()}catch(n){return e}},z9=(e,t,n)=>{if(!e||!t)return null;try{const r=new URL(e,window.location.href);return r.origin!==window.location.origin||!/\/Payments-Express\/?$/.test(r.pathname)?null:(r.pathname=r.pathname.replace(/\/Payments-Express\/?$/,"/Payments-ExpressProduct"),r.searchParams.set("pid",t),r.searchParams.set("quantity",String(n)),r.toString())}catch(r){return null}},px=({expressPaymentUrl:e,globalClassName:t,onOrderComplete:n})=>{const r=B.useRef(null),[s,a]=B.useState(!1),[u,c]=B.useState(mp),d=typeof window!="undefined"?window.location.origin:"",f=$9(e,d),p=H9(e);return B.useEffect(()=>{const m=b=>{var x,A,v;if(p&&b.origin!==p||r.current&&b.source!==r.current.contentWindow)return;const y=b.data;if(!(!y||typeof y.type!="string"))switch(y.type){case"express.payment.available":a(!0),c(U9((x=y.payload)==null?void 0:x.height));break;case"express.payment.unavailable":a(!1);break;case"express.payment.success":n==null||n((v=(A=y.payload)==null?void 0:A.orderId)!=null?v:null);break}};return window.addEventListener("message",m),()=>window.removeEventListener("message",m)},[p,n]),_.jsx("div",{className:M(t,`${O}-cart-express`,{[`${O}-cart-express-ready`]:s}),style:s?{height:u}:void 0,"data-testid":"express-payment","aria-hidden":!s,children:_.jsx("iframe",{ref:r,className:M(t,`${O}-cart-express-frame`),src:f,title:"Express payment",allow:"payment *",scrolling:"no"})})};function V9(e){return typeof e=="string"?e:e&&typeof e.code=="string"?e.code:null}function Zl(e){return(e!=null?e:[]).map(V9).filter(t=>t!==null)}const ec=({code:e,globalClassName:t})=>_.jsxs("span",{className:M(t,`${O}-cart-chip`),children:[_.jsx(c1,{"aria-hidden":"true"}),_.jsx("span",{children:e})]}),An=({label:e,badge:t,value:n,currencyCode:r,globalClassName:s,emphasized:a,isDiscount:u,fallback:c,loading:d})=>{let f;if(typeof n=="number")n===0&&!u?f="Free":f=Vr(u?-n:n,r);else if(c)f=c;else return null;return _.jsxs("div",{className:M(s,`${O}-cart-total-row`,{emphasized:a}),children:[_.jsxs("span",{className:M(s,`${O}-cart-total-label`),children:[e,t&&_.jsx("span",{className:M(s,`${O}-cart-total-badge`),children:t})]}),_.jsx("span",{className:M(s,`${O}-cart-total-value`),children:d?_.jsx("span",{className:M(s,`${O}-cart-total-shimmer`)}):f})]})},q9=({quantity:e,loading:t,disabled:n,globalClassName:r,onChange:s})=>{const[a,u]=B.useState(e.toString());B.useEffect(()=>{u(e.toString())},[e]);const c=p=>{if(n)return;const m=p.target.value;/^\d*$/.test(m)&&u(m)},d=()=>{const p=parseInt(a,10);!n&&!isNaN(p)&&p>0&&p!==e?s(p):u(e.toString())},f=p=>{p.key==="Enter"&&(p.preventDefault(),d())};return _.jsx("div",{className:M(r,`${O}-cart-qty-input-wrapper`),children:t?_.jsx(Jk,{className:M(r,`${O}-cart-qty-spinner`),"aria-hidden":"true"}):_.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:M(r,`${O}-cart-qty-input`),value:a,disabled:n,onChange:c,onBlur:d,onKeyDown:f,"aria-label":"Quantity"})})},Y9=({item:e,currencyCode:t,loading:n,disabled:r,globalClassName:s,onRemove:a,onQuantityChange:u})=>{var f,p;const c=typeof e.originalSubtotal=="number"&&typeof e.itemSubtotal=="number"&&e.originalSubtotal>e.itemSubtotal,d=Zl(e.coupons);return _.jsxs("li",{className:M(s,`${O}-cart-item`),children:[e.imageUrl&&_.jsx("div",{className:M(s,`${O}-cart-item-image`),children:_.jsx("img",{src:e.imageUrl,alt:e.name||"Product image",loading:"lazy"})}),_.jsxs("div",{className:M(s,`${O}-cart-item-details`),children:[_.jsx("p",{className:M(s,`${O}-cart-item-name`),children:e.name}),_.jsxs("div",{className:M(s,`${O}-cart-item-attrs`),children:[((f=e.variants)!=null?f:[]).map(m=>_.jsxs("p",{className:M(s,`${O}-cart-item-attr`),children:[m.lbl,": ",m.value]},`${m.type}-${m.value}`)),((p=e.promotions)!=null?p:[]).map(m=>_.jsxs("p",{className:M(s,`${O}-cart-item-attr`),children:["Promotion: ",m]},m))]}),d.length>0&&_.jsx("div",{className:M(s,`${O}-cart-chips`),children:d.map(m=>_.jsx(ec,{code:m,globalClassName:s},m))}),_.jsx("span",{className:M(s,`${O}-cart-item-price`),children:n?_.jsx("span",{className:M(s,`${O}-cart-total-shimmer`)}):_.jsxs(_.Fragment,{children:[c&&_.jsx("span",{className:M(s,`${O}-cart-item-original-price`),children:Vr(e.originalSubtotal,t)}),_.jsx("span",{className:M(s,`${O}-cart-item-final-price`),children:Vr(e.itemSubtotal,t)})]})}),_.jsxs("div",{className:M(s,`${O}-cart-item-footer`),children:[_.jsx("span",{className:M(s,`${O}-cart-qty-heading`),children:"Quantity"}),_.jsx(q9,{quantity:e.quantity,loading:n,disabled:r,globalClassName:s,onChange:m=>u(e,m)}),_.jsx("button",{type:"button",className:M(s,`${O}-cart-item-remove`),disabled:r,onClick:()=>a(e),children:"Remove"})]})]})]})},W9=({cart:e,messageId:t,globalClassName:n,openLinksInNewTab:r})=>{const{sendMessage:s,loading:a,cartUpdating:u}=sn(),[c,d]=B.useState(!1),[f,p]=B.useState(""),[m,b]=B.useState(null),y=a||u,{items:x=[],currencyCode:A="USD",subtotal:v,total:w,taxes:N,shippingCost:C,shippingDiscount:j,shippingPromotions:X=[],promotionsDiscount:L,promotions:G=[],couponsDiscount:ne,bodyMessage:de,footerMessage:z,checkoutButtonUrl:ae,expressPaymentUrl:oe}=e,pe=Zl(e.couponsApplied),ce=Y=>{y||s(`Remove ${Y.name} from my cart`)},se=Y=>{s(Y?`I completed express payment. Show my order confirmation for order ${Y}.`:"I completed express payment. Show my order confirmation.")},Ae=(Y,ie)=>{y||m||ie<1||(b(Y.itemId),s(`Update ${Y.name} quantity to ${ie}`,{silent:!0,reconcileMessageId:t}).then(k=>{k.outcome==="success"?setTimeout(()=>b(null),300):b(null)}))},re=()=>{const Y=f.trim();!Y||y||(s(`Apply coupon code ${Y}`),p(""))};return _.jsxs("div",{className:M(n,`${O}-cart`),children:[_.jsxs("div",{className:M(n,`${O}-cart-box`),children:[de&&_.jsxs("button",{type:"button",className:M(n,`${O}-cart-summary`),"aria-expanded":c,onClick:()=>d(Y=>!Y),children:[_.jsx("span",{className:M(n,`${O}-cart-summary-text`),children:_.jsx(po,{text:de,globalClassName:n,openLinksInNewTab:r,showIsLoading:!1})}),_.jsx("span",{className:M(n,`${O}-cart-summary-toggle`),"aria-hidden":"true",children:c?_.jsx(u1,{}):_.jsx(l1,{})})]}),c&&_.jsxs("div",{className:M(n,`${O}-cart-expanded`),children:[_.jsxs("div",{className:M(n,`${O}-cart-items-section`),children:[_.jsx("ul",{className:M(n,`${O}-cart-items`),children:x.map(Y=>_.jsx(Y9,{item:Y,currencyCode:A,loading:m===Y.itemId,disabled:y||m===Y.itemId,globalClassName:n,onRemove:ce,onQuantityChange:Ae},Y.itemId))}),pe.length>0&&_.jsx("div",{className:M(n,`${O}-cart-chips`,`${O}-cart-applied-coupons`),children:pe.map(Y=>_.jsx(ec,{code:Y,globalClassName:n},Y))})]}),_.jsxs("div",{className:M(n,`${O}-cart-totals`),children:[_.jsx(An,{label:"Subtotal",value:v,currencyCode:A,globalClassName:n,loading:!!m}),_.jsx(An,{label:"Coupon",value:ne,currencyCode:A,globalClassName:n,isDiscount:!0,loading:!!m}),_.jsx(An,{label:"Promotions",badge:G[0],value:L,currencyCode:A,globalClassName:n,isDiscount:!0,loading:!!m}),_.jsx(An,{label:"Shipping",value:C,currencyCode:A,globalClassName:n,fallback:"TBD",loading:!!m}),_.jsx(An,{label:"Shipping Discount",badge:X[0],value:j,currencyCode:A,globalClassName:n,isDiscount:!0,loading:!!m}),_.jsx(An,{label:"Tax",value:N,currencyCode:A,globalClassName:n,fallback:"TBD",loading:!!m}),_.jsx(An,{label:"Total",value:w,currencyCode:A,globalClassName:n,emphasized:!0,loading:!!m})]})]})]}),_.jsxs("div",{className:M(n,`${O}-cart-coupon`),children:[_.jsxs("div",{className:M(n,`${O}-cart-coupon-field`),children:[_.jsx("span",{className:M(n,`${O}-cart-coupon-icon`),"aria-hidden":"true",children:_.jsx(c1,{})}),_.jsx("input",{type:"text",className:M(n,`${O}-cart-coupon-input`),placeholder:"Enter coupon code","aria-label":"Enter coupon code",value:f,disabled:y,onChange:Y=>p(Y.target.value),onKeyDown:Y=>{Y.key==="Enter"&&(Y.preventDefault(),re())}})]}),_.jsx("button",{type:"button",className:M(n,`${O}-cart-coupon-submit`),"aria-label":"Apply coupon",disabled:y||!f.trim(),onClick:re,children:_.jsx(tN,{"aria-hidden":"true"})})]}),oe&&_.jsx(px,{expressPaymentUrl:oe,globalClassName:n,onOrderComplete:se}),ae&&_.jsxs("a",{className:M(n,`${O}-cart-checkout-button`),href:ae,target:r?"_blank":"_self",rel:"noopener noreferrer",children:[_.jsx(Zk,{"aria-hidden":"true"}),_.jsx("span",{children:"Checkout"})]}),_.jsx("p",{className:M(n,`${O}-cart-footer`),children:z||"Shipping and taxes calculated at checkout."})]})},G9=({item:e,currencyCode:t,globalClassName:n})=>{var a,u;const r=typeof e.originalSubtotal=="number"&&typeof e.itemSubtotal=="number"&&e.originalSubtotal>e.itemSubtotal,s=Zl(e.coupons);return _.jsxs("li",{className:M(n,`${O}-cart-item`),children:[e.imageUrl&&_.jsx("div",{className:M(n,`${O}-cart-item-image`),children:_.jsx("img",{src:e.imageUrl,alt:e.name||"Product image",loading:"lazy"})}),_.jsxs("div",{className:M(n,`${O}-cart-item-details`),children:[_.jsx("p",{className:M(n,`${O}-cart-item-name`),children:e.name}),_.jsxs("div",{className:M(n,`${O}-cart-item-attrs`),children:[((a=e.variants)!=null?a:[]).map(c=>_.jsxs("p",{className:M(n,`${O}-cart-item-attr`),children:[c.lbl,": ",c.value]},`${c.type}-${c.value}`)),((u=e.promotions)!=null?u:[]).map(c=>_.jsxs("p",{className:M(n,`${O}-cart-item-attr`),children:["Promotion: ",c]},c))]}),s.length>0&&_.jsx("div",{className:M(n,`${O}-cart-chips`),children:s.map(c=>_.jsx(ec,{code:c,globalClassName:n},c))}),_.jsxs("span",{className:M(n,`${O}-cart-item-price`),children:[r&&_.jsx("span",{className:M(n,`${O}-cart-item-original-price`),children:Vr(e.originalSubtotal,t)}),_.jsx("span",{className:M(n,`${O}-cart-item-final-price`),children:Vr(e.itemSubtotal,t)})]}),_.jsx("div",{className:M(n,`${O}-cart-item-footer`),children:_.jsxs("span",{className:M(n,`${O}-cart-item-qty`),children:["Qty: ",e.quantity]})})]})]})},X9=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})},Q9=({order:e,globalClassName:t})=>{const[n,r]=B.useState(!0),{id:s,orderedOn:a,items:u=[],currencyCode:c="USD",subtotal:d,total:f,taxes:p,shippingCost:m,shippingDiscount:b,shippingPromotions:y=[],promotionsDiscount:x,promotions:A=[],couponsDiscount:v,bodyMessage:w,footerMessage:N}=e,C=Zl(e.couponsApplied);return _.jsxs("div",{className:M(t,`${O}-cart`),children:[_.jsxs("div",{className:M(t,`${O}-cart-banner`),children:[_.jsx("span",{className:M(t,`${O}-cart-banner-icon`),"aria-hidden":"true",children:_.jsx(nN,{})}),_.jsx("p",{className:M(t,`${O}-cart-banner-text`),children:"Your order is confirmed!"})]}),_.jsxs("div",{className:M(t,`${O}-order-confirmation-meta`),children:[_.jsxs("span",{children:["Order No: ",s]}),_.jsxs("span",{children:["Ordered On: ",X9(a)]})]}),_.jsxs("div",{className:M(t,`${O}-cart-box`),children:[w&&_.jsxs("button",{type:"button",className:M(t,`${O}-cart-summary`),"aria-expanded":n,onClick:()=>r(j=>!j),children:[_.jsx("span",{className:M(t,`${O}-cart-summary-text`),children:_.jsx(po,{text:w,globalClassName:t,showIsLoading:!1})}),_.jsx("span",{className:M(t,`${O}-cart-summary-toggle`),"aria-hidden":"true",children:n?_.jsx(u1,{}):_.jsx(l1,{})})]}),n&&_.jsxs("div",{className:M(t,`${O}-cart-expanded`),children:[_.jsx("ul",{className:M(t,`${O}-cart-items`),children:u.map(j=>_.jsx(G9,{item:j,currencyCode:c,globalClassName:t},j.itemId))}),C.length>0&&_.jsx("div",{className:M(t,`${O}-cart-chips`,`${O}-cart-applied-coupons`),children:C.map(j=>_.jsx(ec,{code:j,globalClassName:t},j))}),_.jsxs("div",{className:M(t,`${O}-cart-totals`),children:[_.jsx(An,{label:"Subtotal",value:d,currencyCode:c,globalClassName:t}),_.jsx(An,{label:"Coupon",value:v,currencyCode:c,globalClassName:t,isDiscount:!0}),_.jsx(An,{label:"Promotions",badge:A[0],value:x,currencyCode:c,globalClassName:t,isDiscount:!0}),_.jsx(An,{label:"Shipping",value:m,currencyCode:c,globalClassName:t,fallback:"TBD"}),_.jsx(An,{label:"Shipping Discount",badge:y[0],value:b,currencyCode:c,globalClassName:t,isDiscount:!0}),_.jsx(An,{label:"Tax",value:p,currencyCode:c,globalClassName:t,fallback:"TBD"}),_.jsx(An,{label:"Total",value:f,currencyCode:c,globalClassName:t,emphasized:!0})]})]})]}),_.jsx("p",{className:M(t,`${O}-cart-footer`),children:N||"Shipping and taxes calculated at checkout."})]})},K9=({image:e,alt:t,globalClassName:n})=>{const[r,s]=B.useState(e.src),[a,u]=B.useState(!1),c=()=>{e.fallbackSrc&&r!==e.fallbackSrc&&s(e.fallbackSrc)};return _.jsx("img",{className:M(n,`${O}-pdp-gallery__image`,{[`${O}-pdp-gallery__image--loaded`]:a}),src:r,alt:t,loading:"lazy",onLoad:()=>u(!0),onError:c})},J9=({images:e,altText:t,globalClassName:n})=>{if(e.length===0)return null;const r=e.length>1;return _.jsxs(Jh,{className:M(n,`${O}-pdp-gallery`),slidesPerPage:1,slidesPerMove:1,slideCount:e.length,loop:!0,"aria-label":t||"Product images",children:[_.jsx(Xh,{className:M(n,`${O}-pdp-gallery__item-group`),children:e.map((s,a)=>_.jsx(Gh,{index:a,className:M(n,`${O}-pdp-gallery__item`),children:_.jsx(K9,{image:s,alt:t?`${t} (${a+1})`:`Product image ${a+1}`,globalClassName:n})},s.src))}),r&&_.jsxs(qh,{className:M(n,`${O}-pdp-gallery__control`),children:[_.jsx(Kh,{className:M(n,`${O}-pdp-gallery__prev-trigger`),"aria-label":"Previous image",children:_.jsx(db,{size:"16px"})}),_.jsx(Qh,{className:M(n,`${O}-pdp-gallery__next-trigger`),"aria-label":"Next image",children:_.jsx(fb,{size:"16px"})})]}),r&&_.jsx(Wh,{className:M(n,`${O}-pdp-gallery__indicator-group`),children:Array.from({length:e.length},(s,a)=>_.jsx(Yh,{index:a,className:M(n,`${O}-pdp-gallery__indicator`),"aria-label":`Go to image ${a+1}`},a))})]})},Ba="color",gp=(e,t)=>/^https?:\/\//i.test(t)||!e?t:`${e}${t}`,Z9=e=>e.replace(/(^|\/)large\//,"$1medium/"),mx=(e,t)=>!e.vattr||!t?!1:e.vattr.some(n=>n.id===Ba&&n.vals.includes(t)),gx=(e,t)=>{const n=Z9(t),r=gp(e,n);return n===t?{src:r}:{src:r,fallbackSrc:gp(e,t)}},eF=(e,t)=>{var c,d;const n=((c=e.imgGroups)!=null?c:[]).filter(f=>f.viewType==="large"),r=t&&n.find(f=>mx(f,t)),s=n.find(f=>f.vattr===null),a=r||s||n[0],u=((d=a==null?void 0:a.imgs)!=null?d:[]).map(f=>gx(e.baseUrl,f.url));return u.length>0?u:e.imageUrl?[gx(e.baseUrl,e.imageUrl)]:[]},tF=(e,t)=>{var s,a,u;const n=((s=e.imgGroups)!=null?s:[]).find(c=>c.viewType==="swatch"&&mx(c,t)),r=(u=(a=n==null?void 0:n.imgs)==null?void 0:a[0])==null?void 0:u.url;return r?gp(e.baseUrl,r):""},tc=(e,t,n,r={})=>!e||e.length===0||!t||!n?!1:e.some(s=>{var a;return((a=s.vars)==null?void 0:a[t])!==n||s.ord===!1?!1:Object.entries(r).every(([u,c])=>{var d;return u===t||((d=s.vars)==null?void 0:d[u])===c})}),nF=(e,t)=>{const n=Object.keys(t);return n.length===0?!0:!e||e.length===0?!1:e.some(r=>r.ord!==!1&&n.every(s=>{var a;return((a=r.vars)==null?void 0:a[s])===t[s]}))},rF=(e,t,n,r,s)=>{if(!e||e.length===0)return le(H({},s),{[n]:r});const a=e.find(c=>{var d;return((d=c.vars)==null?void 0:d[n])===r&&c.ord!==!1&&Object.keys(c.vars).length>=t.length&&Object.entries(s).every(([f,p])=>{var m;return f===n||((m=c.vars)==null?void 0:m[f])===p})});if(a)return H({},a.vars);const u=e.find(c=>{var d;return((d=c.vars)==null?void 0:d[n])===r&&c.ord!==!1&&Object.keys(c.vars).length>=t.length});return u?H({},u.vars):le(H({},s),{[n]:r})},Ex=(e,t)=>{var s,a,u,c;if(!(Array.isArray(e.vattr)&&e.vattr.length>0))return(s=e.id)!=null?s:null;if(!e.vmat||e.vmat.length===0)return(a=e.id)!=null?a:null;const r=e.vmat.find(d=>d.ord!==!1&&Object.entries(t).every(([f,p])=>{var m;return((m=d.vars)==null?void 0:m[f])===p}));return(c=(u=r==null?void 0:r.pid)!=null?u:e.id)!=null?c:null},iF=(e,t)=>{if(!e.vmat||e.vmat.length===0||Object.keys(t).length===0)return e.pr;const n=e.vmat.find(r=>r.ord!==!1&&Object.entries(t).every(([s,a])=>{var u;return((u=r.vars)==null?void 0:u[s])===a}));return n!=null&&n.pr?n.pr:e.pr},sF=e=>{var n;const t={};for(const r of(n=e.vattr)!=null?n:[]){const s=r.opts.find(u=>tc(e.vmat,r.id,u.val)),a=s!=null?s:r.opts[0];a&&(t[r.id]=a.val)}return t},oF=300,aF=({product:e,globalClassName:t,openLinksInNewTab:n,isCartMgmtSupported:r=!1})=>{var dt,Vt,Lt,Qt,kn,me,he;const{addToCart:s,sendMessage:a,loading:u}=sn(),{overrides:c,isInitialized:d}=mo(),f=go(),p=e.data,m=(dt=p.vattr)!=null?dt:[],[b,y]=B.useState(()=>sF(p)),x=nF(p.vmat,b),A=(Lt=(Vt=p.quantity)==null?void 0:Vt.minQuantity)!=null?Lt:1,v=(kn=(Qt=p.quantity)==null?void 0:Qt.maxQuantity)!=null?kn:Number.POSITIVE_INFINITY,w=(he=(me=p.quantity)==null?void 0:me.increment)!=null?he:1,[N,C]=B.useState(A),[j,X]=B.useState(!1),L=B.useRef(!1);B.useEffect(()=>{j&&(u?L.current=!0:L.current&&(L.current=!1,X(!1)))},[j,u]);const G=b[Ba],ne=B.useMemo(()=>eF(p,G),[p,G]),de=B.useMemo(()=>iF(p,b),[p,b]),z=m.find(W=>W.id===Ba),ae=m.filter(W=>W.id!==Ba),oe=Ex(p,b),[pe,ce]=B.useState(N),se=B.useRef(oe),Ae=se.current===oe?pe:N;B.useEffect(()=>{if(se.current!==oe){se.current=oe,ce(N);return}const W=window.setTimeout(()=>ce(N),oF);return()=>window.clearTimeout(W)},[N,oe]);const re=N===pe,Y=B.useMemo(()=>x&&(se.current!==oe||re)?z9(p.expressPaymentUrl,oe,Ae):null,[p.expressPaymentUrl,oe,Ae,x,re]),ie=B.useCallback(W=>{a(W?`I completed express payment. Show my order confirmation for order ${W}.`:"I completed express payment. Show my order confirmation.")},[a]),k=d?c.ProductDetailCard:void 0;if(k){const W={name:"ProductDetailCard",payload:e,api:f};return _.jsx(Eo,{tagName:k,props:W,label:"ProductDetailCard"})}const D=(W,fe)=>()=>{y(_e=>{const Xe=!tc(p.vmat,W,fe,_e);return W===Ba||Xe?rF(p.vmat,m,W,fe,_e):le(H({},_e),{[W]:fe})})},Z=()=>{if(u)return;const W=Ex(p,b);if(!W)return;const fe=m.map(_e=>{const Xe=_e.opts.find(ut=>ut.val===b[_e.id]);return Xe?{label:_e.lbl||_e.id,value:Xe.name||Xe.val}:null}).filter(_e=>_e!==null);X(!0),s({productName:p.name,sku:W,quantity:N,variants:fe})},P=!x||N-w<A,ke=!x||N+w>v,Ce=W=>{var _e;const fe=b[W.id];return(_e=W.opts.find(Xe=>Xe.val===fe))==null?void 0:_e.name},ge=()=>C(W=>Math.max(A,W-w)),Le=()=>C(W=>Math.min(v,W+w)),Be=W=>_.jsxs("div",{className:M(t,`${O}-msg-pdp__variant`),children:[_.jsxs("div",{className:M(t,`${O}-msg-pdp__variant-label`),children:[_.jsx("span",{id:`variant-label-${W.id}`,className:M(t,`${O}-msg-pdp__variant-name`),children:W.lbl||W.id}),Ce(W)&&_.jsx("span",{className:M(t,`${O}-msg-pdp__variant-value`),children:Ce(W)})]}),_.jsx("div",{role:"radiogroup","aria-labelledby":`variant-label-${W.id}`,className:M(t,`${O}-msg-pdp__chips`),children:W.opts.map(fe=>{const _e=tc(p.vmat,W.id,fe.val,b),Xe=b[W.id]===fe.val;return _.jsxs("label",{className:M(`${O}-msg-pdp__chip`,{selected:Xe,unavailable:!_e}),children:[_.jsx("input",{type:"radio",name:`variant-${W.id}`,value:fe.val,checked:Xe,"aria-description":_e?void 0:"unavailable",onChange:D(W.id,fe.val),className:`${O}-msg-pdp__radio-input`}),_.jsx("span",{children:fe.name||fe.val})]},fe.val)})})]},W.id),Ge=W=>_.jsxs("div",{className:M(t,`${O}-msg-pdp__variant`),children:[_.jsxs("div",{className:M(t,`${O}-msg-pdp__variant-label`),children:[_.jsx("span",{id:`variant-label-${W.id}`,className:M(t,`${O}-msg-pdp__variant-name`),children:W.lbl||"Color"}),Ce(W)&&_.jsx("span",{className:M(t,`${O}-msg-pdp__variant-value`),children:Ce(W)})]}),_.jsx("div",{role:"radiogroup","aria-labelledby":`variant-label-${W.id}`,className:M(t,`${O}-msg-pdp__swatches`),children:W.opts.map(fe=>{const _e=tc(p.vmat,W.id,fe.val,b),Xe=b[W.id]===fe.val,ut=tF(p,fe.val);return ut?_.jsxs("label",{className:M(`${O}-msg-pdp__swatch`,{selected:Xe,unavailable:!_e}),children:[_.jsx("input",{type:"radio",name:`variant-${W.id}`,value:fe.val,checked:Xe,"aria-label":fe.name||fe.val,"aria-description":_e?void 0:"unavailable",onChange:D(W.id,fe.val),className:`${O}-msg-pdp__radio-input`}),_.jsx("img",{className:M(t,`${O}-msg-pdp__swatch-image`),src:ut,alt:fe.name||fe.val,loading:"lazy"})]},fe.val):_.jsxs("label",{className:M(`${O}-msg-pdp__chip`,{selected:Xe,unavailable:!_e}),children:[_.jsx("input",{type:"radio",name:`variant-${W.id}`,value:fe.val,checked:Xe,"aria-description":_e?void 0:"unavailable",onChange:D(W.id,fe.val),className:`${O}-msg-pdp__radio-input`}),_.jsx("span",{children:fe.name||fe.val})]},fe.val)})})]});return _.jsx("div",{className:M(t,`${O}-msg-pdp`),children:_.jsxs("div",{className:M(t,`${O}-msg-pdp__card`),children:[_.jsx("div",{className:M(t,`${O}-msg-pdp__gallery`),children:_.jsx(J9,{images:ne,altText:p.name,globalClassName:t})}),_.jsxs("div",{className:M(t,`${O}-msg-pdp__content`),children:[p.slugUrl?_.jsx("a",{href:p.slugUrl,target:n?"_blank":"_self",rel:"noopener noreferrer",className:M(t,`${O}-msg-pdp__title-link`),"aria-label":`Go to product page for ${p.name}`,children:p.name}):_.jsx("p",{className:M(t,`${O}-msg-pdp__title`),children:p.name}),_.jsx(sp,{globalClassName:t,className:`${O}-msg-pdp__price`,retailPrice:de==null?void 0:de.orig,discountPrice:(de==null?void 0:de.cur)||(de==null?void 0:de.prom),currencyCode:p.ccy,fontSize:"14px"}),p.dscr&&_.jsx("div",{className:M(t,`${O}-msg-pdp__description`),children:_.jsx(po,{globalClassName:t,text:p.dscr})}),z&&Ge(z),ae.map(Be),r&&_.jsxs("div",{className:M(t,`${O}-msg-pdp__variant`),children:[_.jsxs("div",{className:M(t,`${O}-msg-pdp__variant-label`),children:[_.jsx("span",{className:M(t,`${O}-msg-pdp__variant-name`),children:"Quantity"}),_.jsx("span",{className:M(t,`${O}-msg-pdp__variant-value`),children:N})]}),_.jsxs("div",{className:M(t,`${O}-msg-pdp__stepper`),children:[_.jsx(ir,{className:`${O}-msg-pdp__stepper-btn`,ariaLabel:"Decrease quantity",icon:_.jsx(zk,{}),disabled:P,onClick:ge}),_.jsx("span",{className:M(t,`${O}-msg-pdp__quantity`),children:N}),_.jsx(ir,{className:`${O}-msg-pdp__stepper-btn`,ariaLabel:"Increase quantity",icon:_.jsx(Vk,{}),disabled:ke,onClick:Le})]})]}),r&&_.jsxs("div",{className:M(t,`${O}-msg-pdp__actions`),children:[Y&&_.jsx(px,{expressPaymentUrl:Y,globalClassName:t,onOrderComplete:ie},Y),_.jsx(el,{className:`${O}-msg-pdp__add-to-cart`,disabled:!x||u||j,onClick:Z,children:j?"Adding...":"Add to cart"})]})]})]})})},uF=e=>{if(e.imageUrl)return e.baseUrl?e.baseUrl+e.imageUrl:e.imageUrl},lF=({products:e,table:t,globalClassName:n,openLinksInNewTab:r,isCartMgmtSupported:s=!1})=>{const{addToCart:a,loading:u}=sn(),{overrides:c,isInitialized:d}=mo(),f=go(),p=d?c.ProductComparison:void 0;if(p){const x={name:"ProductComparison",payload:{products:e,table:t},api:f};return _.jsx(Eo,{tagName:p,props:x,label:"ProductComparison"})}if(!e.length)return null;const m=`auto repeat(${e.length}, 1fr)`,b=`${90+e.length*140}px`,y=x=>()=>{u||a({productName:x.name,sku:x.id})};return _.jsx("div",{className:M(n,`${O}-product-comparison`),children:_.jsxs("div",{className:`${O}-product-comparison__grid`,style:{gridTemplateColumns:m,minWidth:b},children:[_.jsxs("div",{className:`${O}-product-comparison__header`,children:[_.jsx("div",{className:`${O}-product-comparison__header-spacer`}),e.map(x=>{var v,w,N,C;const A=uF(x);return _.jsxs("div",{className:M(n,`${O}-product-comparison__product-col`),children:[A&&_.jsx("img",{className:M(n,`${O}-product-comparison__image`),src:A,alt:x.name||"Product image",loading:"eager"}),x.slugUrl?_.jsx("a",{href:x.slugUrl,target:r?"_blank":"_self",rel:"noopener",className:M(n,`${O}-product-comparison__name`),"aria-label":`Go to product page for ${x.name}`,children:x.name}):_.jsx("span",{className:M(n,`${O}-product-comparison__name`),children:x.name}),_.jsx(sp,{globalClassName:n,retailPrice:(v=x.pr)==null?void 0:v.orig,discountPrice:(C=(w=x.pr)==null?void 0:w.prom)!=null?C:(N=x.pr)==null?void 0:N.cur,currencyCode:x.ccy,fontSize:"0.875rem"})]},x.id)})]}),_.jsx("div",{className:`${O}-product-comparison__table`,children:t.map(x=>_.jsxs("div",{className:`${O}-product-comparison__row`,children:[_.jsx("div",{className:M(n,`${O}-product-comparison__row-label`),children:x.row_name}),e.map((A,v)=>_.jsx("div",{className:M(n,`${O}-product-comparison__row-value`),children:x.values[v]},`${x.row_name}-${A.id}`))]},x.row_name))}),s&&_.jsxs("div",{className:`${O}-product-comparison__footer`,children:[_.jsx("div",{className:`${O}-product-comparison__footer-spacer`}),e.map(x=>_.jsx("div",{className:M(n,`${O}-product-comparison__footer-cell`),children:_.jsxs(el,{className:`${O}-product-comparison__add-to-cart`,disabled:u,onClick:y(x),children:[_.jsx(Kk,{size:"14px"}),"Add to cart"]})},`cart-${x.id}`))]})]})})},yx=({content:e,messageId:t,globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s})=>{const{sendMessage:a,loading:u,cartUpdating:c}=sn(),{isCartMgmtSupported:d,logger:f}=at(),{overrides:p,isInitialized:m}=mo(),b=go(),y=B.useMemo(()=>e.response.map(x=>{var v,w;if(x.type!=="markdown")return x;const A=_g((w=(v=x.data)==null?void 0:v.content)!=null?w:"");return A&&A.type!=="markdown"?A:x}),[e.response]);return _.jsx(_.Fragment,{children:y.map((x,A)=>{var v,w,N,C,j,X,L,G,ne,de,z,ae,oe,pe,ce,se,Ae,re,Y,ie,k,D,Z,P,ke;switch(x.type){case"markdown":{const Ce=(w=(v=x.data)==null?void 0:v.content)!=null?w:"";return x.index===ji&&wg(Ce)?null:_.jsx(po,{text:Ce,globalClassName:n,openLinksInNewTab:r,showIsLoading:!1},`${x.type}-${(N=x.index)!=null?N:A}`)}case"product_carousel":return _.jsx(F9,{title:(j=(C=x.data)==null?void 0:C.title)!=null?j:"",products:(L=(X=x.data)==null?void 0:X.products)!=null?L:[],globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s,isCartMgmtSupported:d},`${x.type}-${(G=x.index)!=null?G:A}`);case"product_tile":return _.jsx(aF,{product:x.data,globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s,isCartMgmtSupported:d},`${x.type}-${(ne=x.index)!=null?ne:A}`);case"product_comparison":return _.jsx(lF,{products:(z=(de=x.data)==null?void 0:de.products)!=null?z:[],table:(oe=(ae=x.data)==null?void 0:ae.table)!=null?oe:[],globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s,isCartMgmtSupported:d},`${x.type}-${(pe=x.index)!=null?pe:A}`);case"cart":{const Ce=(Ae=(se=(ce=x.data)==null?void 0:ce.cart)==null?void 0:se.cartSummary)==null?void 0:Ae.cartDetails;return Ce?_.jsx(W9,{cart:Ce,messageId:t,productsToHighlight:x.data.products_to_highlight,globalClassName:n,openLinksInNewTab:r},`${x.type}-${(re=x.index)!=null?re:A}`):null}case"order_confirmation":{const Ce=(ie=(Y=x.data)==null?void 0:Y.order)==null?void 0:ie.orderDetails;return Ce?_.jsx(Q9,{order:Ce,globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s},`${x.type}-${(k=x.index)!=null?k:A}`):null}case"tool_results":{const Ce=x.data,ge=x.output_name,Le=m&&ge&&Object.prototype.hasOwnProperty.call(p,ge)?p[ge]:void 0,Be=typeof Le=="string"?Le:void 0;if(!Be||!ge)return f!=null&&f.isDevelopment&&(ge?f.warn(`🦜 tool_results "${ge}" rendered nothing — no override registered for that key. Register one in the overrides map: { "${ge}": "<your-tag-name>" }.`,{registeredKeys:Object.keys(p),payload:Ce}):f.warn("🦜 tool_results block has no output_name — nothing to route on",{payload:Ce})),null;const Ge={name:ge,payload:Ce,api:b};return _.jsx(I9,{overrideName:ge,children:_.jsx(Eo,{tagName:Be,props:Ge,label:`toolResult:${ge}`})},`${x.type}-${ge}-${(D=x.index)!=null?D:A}`)}case"suggestions":return _.jsx("div",{style:{marginTop:"0.5rem"},children:_.jsx(f8,{disabled:u||c,suggestions:(P=(Z=x.data)==null?void 0:Z.display_text)!=null?P:[],globalClassName:n,isWidgetStandalone:s,onSuggestionClick:a})},`${x.type}-${(ke=x.index)!=null?ke:A}`);default:return null}})})};class Tx extends B.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){yt(!0,"error","Message content threw during render:",t,n.componentStack)}render(){return this.state.hasError?_.jsx("p",{className:M(this.props.globalClassName,`${O}-reset-message`),children:"Oops, I had trouble displaying this response."}):this.props.children}}const cF=({message:e,globalClassName:t,openLinksInNewTab:n,isWidgetStandalone:r})=>{const{logger:s}=at(),a=B.useMemo(()=>{if(typeof e.content!="string")return null;const c=ju(e.content);if(c)return c;const d=_g(e.content);return d?{response:[d]}:null},[e.content]),u=B.useMemo(()=>{const c="Oops, I had trouble with your request.";if(typeof e.content!="string")return s==null||s.warn("Message content is not richtext format. Showing fallback text.",e.content),c;const d=e.content.trim();try{const f=JSON.parse(d);if(typeof f=="object"&&f!==null)return s==null||s.debug("Detected JSON object instead of array of responses in message content",e.content),f.text||f.message||c}catch(f){if(d.startsWith("{")||d.startsWith("["))return s==null||s.warn("Failed to parse JSON-like message content. Showing fallback text.",e.content),c}return e.content||c},[s,e.content]);switch(e.role){case"user":return _.jsx("div",{className:M(t,`${O}-message`,r?"standalone":"embedded"),children:_.jsx("div",{className:M(t,`${O}-user-message`,r?"standalone":"embedded"),children:_.jsxs("div",{className:M(t,`${O}-user-message-row`,r?"standalone":"embedded"),children:[_.jsx("span",{className:M(t,`${O}-message-icon user-message-icon`,r?"standalone":"embedded"),children:_.jsx(eN,{})}),_.jsx("p",{className:M(t,`${O}-user-message-text`,r?"standalone":"embedded"),children:e.content})]})})});case"agent":return _.jsx("div",{className:M(t,`${O}-message-group`,r?"standalone":"embedded"),children:_.jsx("div",{className:`${O}-message-group-child`,children:a?_.jsx(Tx,{globalClassName:t,children:_.jsx(yx,{content:a,messageId:e.id,globalClassName:t,openLinksInNewTab:n,isWidgetStandalone:r})}):_.jsx(po,{text:u,globalClassName:t,openLinksInNewTab:n,showIsLoading:!1})})});case"system":return _.jsx("div",{className:M(t,`${O}-message`,r?"standalone":"embedded"),children:_.jsx("p",{className:M(t,`${O}-reset-message`),children:e.content})})}},dF=({message:e,onRetry:t,globalClassName:n,isWidgetStandalone:r})=>_.jsxs("div",{className:M(n,`${O}-send-error`,r?"standalone":"embedded"),role:"alert",children:[_.jsx("span",{className:M(n,`${O}-send-error-text`),children:e}),_.jsxs("button",{type:"button",className:M(n,`${O}-retry-button`),onClick:t,children:[_.jsx(sN,{"aria-hidden":"true"})," Retry"]})]}),fF="You are offline or we couldn't reach the assistant. Check connection and try again.",Ep=({isWidgetStandalone:e})=>{var z,ae;const{globalClassName:t,openLinksInNewTab:n,logger:r,autoScroll:s}=at(),{messages:a,streamingBlocks:u,isAgentTyping:c,loading:d,progressMessage:f,connectionStatus:p,error:m,sendError:b,retryLastMessage:y,retryConnection:x}=sn(),A=B.useRef(null),v=a.length>0,w=u.some(NA),N=a[a.length-1],C=N?kA(N.content,"suggestions"):!1,j=v&&(d||c)&&!w&&!C,X=p==="reconnecting"&&!j,L=p==="error";let G=null;L?G={message:m!=null?m:fF,kind:"connection",onRetry:x}:b&&(G={message:b.message,kind:"send",onRetry:y}),B.useEffect(()=>{var oe;(oe=A.current)==null||oe.scrollIntoView({behavior:"smooth"})},[]),B.useEffect(()=>{var oe;s&&((oe=A.current)==null||oe.scrollIntoView({behavior:"smooth"}))},[a,u,b,m,s]);const ne=(z=G==null?void 0:G.message)!=null?z:null,de=(ae=G==null?void 0:G.kind)!=null?ae:null;return B.useEffect(()=>{ne&&(r==null||r.error("Error message shown to user",{message:ne,kind:de}))},[ne,de,r]),_.jsxs(_.Fragment,{children:[d&&!v&&_.jsx(E8,{globalClassName:t,isWidgetStandalone:e}),a.map(oe=>_.jsx(cF,{message:oe,globalClassName:t,openLinksInNewTab:n,isWidgetStandalone:e},oe.id)),G&&_.jsx(dF,{message:G.message,onRetry:G.onRetry,globalClassName:t,isWidgetStandalone:e}),w&&_.jsxs("div",{className:M(t,`${O}-message-group`,e?"standalone":"embedded"),children:[_.jsx(Tx,{globalClassName:t,children:_.jsx(yx,{content:{response:u},globalClassName:t,openLinksInNewTab:n,isWidgetStandalone:e})}),(d||c)&&_.jsx(op,{globalClassName:t,isWidgetStandalone:e})]}),j&&_.jsx(op,{globalClassName:t,isWidgetStandalone:e,loadingText:f}),X&&_.jsx(op,{globalClassName:t,isWidgetStandalone:e,loadingText:"Reconnecting..."}),_.jsx("div",{ref:A})]})},hF=()=>_.jsxs("svg",{className:`${O}-progress-step-check`,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[_.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),_.jsx("path",{d:"M5 8.5L7 10.5L11 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),pF=()=>_.jsx("svg",{className:`${O}-progress-step-starburst`,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:_.jsx("path",{d:"M8 1v3M8 12v3M1 8h3M12 8h3M3.05 3.05l2.12 2.12M10.83 10.83l2.12 2.12M3.05 12.95l2.12-2.12M10.83 5.17l2.12-2.12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),mF=(e,t)=>e===0?[]:e<0?t:t.slice(-e),yp=({progressStepsLimit:e,steps:t,globalClassName:n})=>{const{progressStepsLimit:r}=at(),s=e!=null?e:r,{overrides:a,isInitialized:u}=mo(),c=go();if(t.length===0||s===0)return null;const d=mF(s,t),f=u?a.ProgressSteps:void 0;if(f){const p={name:"ProgressSteps",payload:{steps:d},api:c};return _.jsx(Eo,{tagName:f,props:p,label:"ProgressSteps"})}return _.jsx("div",{className:M(n,`${O}-progress-steps-panel`),children:_.jsx("div",{className:`${O}-progress-steps`,children:_.jsx("ul",{className:`${O}-progress-steps-list`,children:d.map((p,m)=>{const b=m<d.length-1,y=m===d.length-1;return _.jsxs("li",{className:M(`${O}-progress-step`,y&&"active"),children:[y&&_.jsx("span",{className:`${O}-progress-step-arc`}),_.jsx("span",{className:`${O}-progress-step-text`,children:p}),_.jsx("span",{className:M(`${O}-progress-step-icon`,b?"done":"active"),children:b?_.jsx(hF,{}):_.jsx(pF,{})})]},`${m}-${p}`)})})})})},bx=()=>{const{globalClassName:e,themeVariables:t,messageAlignment:n,enableDownloadTranscript:r}=at(),{isAgentTyping:s,sendMessage:a,resetConversation:u,progressSteps:c,downloadTranscript:d}=sn(),f=s;return _.jsxs("div",{className:M(e,`${O}-container`,`${O}-embedded-chat`),style:t,children:[_.jsx("div",{className:M(e,`${O}-message-container`,`container-${n}`,"embedded"),children:_.jsx(Ep,{isWidgetStandalone:!1})}),_.jsx(yp,{steps:c,globalClassName:e}),_.jsx(uh,{componentType:"chat",className:"embedded-chat",isLoading:f,onSubmit:p=>a(p)}),_.jsx("div",{className:M(`${O}-embedded-chat-menu`),children:_.jsxs(pD,{componentType:"chat",children:[_.jsx(Fb,{componentType:"chat"}),_.jsx(Vy,{componentType:"chat",onClearChat:u}),r&&_.jsx(qy,{componentType:"chat",onDownloadTranscript:d})]})})]})},xx=e=>{var d;const{children:t,disabled:n}=e,[r,s]=B.useState((d=e.container)==null?void 0:d.current),a=B.useSyncExternalStore(EF,()=>!1,()=>!0),{getRootNode:u}=Yl();if(B.useEffect(()=>{s(()=>{var f;return(f=e.container)==null?void 0:f.current})},[e.container]),a||n)return _.jsx(_.Fragment,{children:t});const c=r!=null?r:gF(u);return _.jsx(_.Fragment,{children:B.Children.map(t,f=>Fs.createPortal(f,c))})},gF=e=>{const t=e==null?void 0:e(),n=t.getRootNode();return ts(n)?n:wr(t).body},EF=()=>()=>{},_x=()=>{const{globalClassName:e,themeVariables:t,messageAlignment:n}=at(),{mode:r,status:s,dialogPosition:a,isDialogFullHeight:u,dialogWidth:c}=ri(),{loading:d,isAgentTyping:f,sendMessage:p,resetConversation:m,progressSteps:b,downloadTranscript:y}=sn(),{isOpen:x}=s||{},A=!!s.isOpen,v=r==="standalone",w=f||d,N=()=>{Br(!1)};return A?_.jsx(Cb,{lazyMount:!0,unmountOnExit:!0,modal:!1,closeOnEscape:!1,closeOnInteractOutside:!1,open:A,children:_.jsx(xx,{children:_.jsx(tp,{className:M(e,`${O}-container`,`${O}-dialog`,a,u&&"full-height"),style:H(H({},t),c&&{width:c}),children:_.jsxs(Zh,{className:M(e,`${O}-dialog-content`,{standalone:v,embedded:!v}),children:[_.jsx(Lb,{componentType:"dialog",onClearChat:m,onClose:N,onDownloadTranscript:y}),_.jsx(ep,{className:M(e,`${O}-message-container`,`container-${n}`,{standalone:v,embedded:!v}),children:_.jsx(Ep,{isWidgetStandalone:v,isOpen:x})}),_.jsx(yp,{steps:b,globalClassName:e}),_.jsx(uh,{componentType:"dialog",isLoading:w,onSubmit:C=>p(C)})]})})})}):null},wx=()=>{const{globalClassName:e,themeVariables:t,messageAlignment:n}=at(),{mode:r,status:s,isModalFullscreen:a}=ri(),{loading:u,isAgentTyping:c,sendMessage:d,resetConversation:f,progressSteps:p,downloadTranscript:m}=sn(),{isOpen:b}=s||{},y=!!s.isOpen,x=r==="standalone",A=c||u,v=({open:N})=>{Br(N)},w=()=>{Br(!1)};return y?_.jsx(Cb,{lazyMount:!0,unmountOnExit:!0,open:y,onOpenChange:v,children:_.jsx(xx,{children:_.jsxs("div",{className:M(e,`${O}-modal-container`),style:t,children:[_.jsx(Sb,{className:M(e,`${O}-modal-backdrop`)}),_.jsx(tp,{className:M(e,`${O}-container`,`${O}-modal`,{fullscreen:a,standalone:x,embedded:!x}),children:_.jsxs(Zh,{className:M(e,`${O}-modal-content`,{standalone:x,embedded:!x}),children:[_.jsx(Lb,{componentType:"modal",onClearChat:f,onClose:w,onDownloadTranscript:m}),_.jsx(ep,{className:M(e,`${O}-message-container`,`container-${n}`,{standalone:x,embedded:!x}),children:_.jsx(Ep,{isWidgetStandalone:x,isOpen:b})}),_.jsx(yp,{steps:p,globalClassName:e}),_.jsx(uh,{componentType:"modal",isLoading:A,onSubmit:N=>d(N)})]})})]})})}):null},yF=()=>{const e=ri(),{status:{type:t,isMinimized:n}}=e||{status:{}};return n?_.jsx(Gk,{}):t==="dialog"?_.jsx(_x,{}):t==="modal"?_.jsx(wx,{}):_.jsx(bx,{})},TF=()=>{const{setIsOpen:e,setIsInline:t,setElementId:n,setEntryType:r,setParams:s}=s8();B.useEffect(()=>{const a=u=>{const{property:c,value:d}=u.detail||{};!c||d===void 0||(c==="isOpen"&&e(d),c==="isInline"&&t(d),c==="elementId"&&n(d),c==="entryType"&&r(d),c==="params"&&s(d))};return ZD(a),()=>{e8(a)}},[e,t,n,r,s])},Sx=(e,t,n)=>{n!==void 0?e(t,n):e(t)};function bF({isReady:e,hasError:t,transmit:n}){const r=B.useRef([]),s=B.useRef(e);s.current=e;const a=B.useRef(n);a.current=n;const u=B.useCallback((c,d)=>{s.current?Sx(a.current,c,d):r.current.push({prompt:c,options:d})},[]);return B.useEffect(()=>{if(e&&r.current.length){const c=r.current;r.current=[],c.forEach(({prompt:d,options:f})=>Sx(a.current,d,f))}},[e]),B.useEffect(()=>{t&&(r.current=[])},[t]),u}const vx={copilot:"Ask Copilot",messaging:"Ask a question"},xF=({onSubmit:e,disabled:t=!1})=>{const{globalClassName:n,mode:r}=at(),{placeholder:s,isResponseLoading:a}=Xl(),u=s||vx[r],[c,d]=B.useState(""),f=t||a,p=m=>{const b=c.trim();b&&(m.preventDefault(),e(b),d(""))};return _.jsxs("form",{className:M(n,`${O}-prompts-input-container`),name:`${O}-prompts-form`,onSubmit:p,children:[_.jsx("label",{htmlFor:`${O}-prompts-input`,"aria-label":u,children:_.jsx(Vh,{className:M(n,`${O}-prompts-input-icon`)})}),_.jsx("input",{id:`${O}-prompts-input`,className:M(n,`${O}-prompts-input`),name:`${O}-prompts-input`,placeholder:u,type:"text",disabled:f,value:c,onChange:m=>d(m.target.value)}),_.jsx(ir,{className:M(n,`${O}-prompts-input-submit-button`),type:"submit",ariaLabel:"Submit Prompt",icon:_.jsx(pf,{}),disabled:f})]})},_F=()=>{const{globalClassName:e,mode:t}=at(),{placeholder:n}=Xl(),r=n||vx[t];return _.jsxs("div",{className:M(e,`${O}-prompts-header`),children:[_.jsx(Vh,{className:M(e,`${O}-prompts-input-icon`),"aria-hidden":"true"}),_.jsx("span",{className:M(e,`${O}-prompts-header-text`),children:r})]})},Ax=({label:e,disabled:t=!1,onClick:n})=>{var c;const{globalClassName:r,suggestionButtonConfig:s}=at(),a=s==null?void 0:s.icon,u=(c=s==null?void 0:s.iconPosition)!=null?c:"left";return _.jsxs("button",{className:M(r,`${O}-prompts-button`,{"has-icon":!!a,"icon-right":!!a&&u==="right"}),disabled:t,onClick:n,children:[a&&_.jsx(Mb,{icon:a,className:`${O}-suggestion-button-icon`}),_.jsx("span",{children:e})]})},wF="Ask me something else",SF=({label:e,disabled:t=!1})=>_.jsx(Ax,{label:e||wF,disabled:t,onClick:()=>Br(!0)}),vF=({onPromptClick:e,disabled:t=!1})=>{const{globalClassName:n}=at(),{messages:r}=sn(),{staticQuestions:s,askElseButtonLabel:a,disableAskElseButton:u}=Xl(),c=B.useMemo(()=>{var y;const f=r.filter(x=>x.role==="agent");if(!f.length)return s;const m=f.map(x=>ju(x.content)).filter(Boolean).flatMap(x=>x==null?void 0:x.response.filter(A=>A.type==="suggestions"));if(!m.length)return s;const b=m[m.length-1];return(y=b==null?void 0:b.data.display_text)!=null?y:s},[r,s]);if(c.length===0)return null;const d=f=>()=>{const p=f.trim();p&&e(p)};return _.jsxs("div",{className:M(n,`${O}-prompts-button-group`),children:[c.map(f=>_.jsx(Ax,{label:f,disabled:t,onClick:d(f)},f)),!u&&_.jsx(SF,{label:a,disabled:t})]})},AF=()=>{const{globalClassName:e,themeVariables:t}=at(),{isOpen:n,elementId:r,promptsDisplay:s,staticQuestions:a}=Xl(),{isConnected:u,sendMessage:c,connectionStatus:d}=sn(),{productId:f}=i8(),p=s!=="buttons",m=s!=="input",[b,y]=B.useState(null),x=d==="error",A=d==="connecting",v=bF({isReady:u,hasError:x,transmit:c});B.useEffect(()=>{if(!r||b)return;const N=document.getElementById(r);N&&y(N)},[r,b]);const w=B.useCallback(N=>{Br(!0);const C=(a||[]).includes(N.trim());if(f&&C){v(`${N} (Viewing product details for: ${f})`,{displayContent:N});return}v(N)},[v,a,f]);return!n||!b?null:Fs.createPortal(_.jsxs("div",{className:M(e,`${O}-prompts-extension-container`),style:t,children:[p&&_.jsx(xF,{onSubmit:w,disabled:x}),!p&&_.jsx(_F,{}),m&&_.jsx(vF,{onPromptClick:w,disabled:x}),!x&&A&&_.jsx("p",{className:M(e,`${O}-prompts-connecting-message`),children:"Connecting to agent..."}),x&&_.jsx("p",{className:M(e,`${O}-prompts-error-message`),children:"Oops, an error occurred with our agent."})]}),b)},kF=()=>(TF(),_.jsx(AF,{})),kx=e=>_.jsxs(Qg,le(H({},e),{children:[_.jsx(yF,{}),_.jsx(kF,{})]}));var nc={},Nx;function NF(){if(Nx)return nc;Nx=1;var e=t1();return nc.createRoot=e.createRoot,nc.hydrateRoot=e.hydrateRoot,nc}var CF=NF();const Cx=(e,t,n,r)=>{CF.createRoot(e).render(_.jsx(kx,le(H({},t),{overridesUrl:n,inlineOverrides:r,mode:"messaging"})))},OF=a=>{var u=a,{elementId:e,timeout:t=5e3,overridesUrl:n,inlineOverrides:r}=u,s=yn(u,["elementId","timeout","overridesUrl","inlineOverrides"]);let c;const d=(p,m)=>{for(const b of p)if(b.type==="childList"&&b.addedNodes.length)for(const y of b.addedNodes)y.nodeType===Node.ELEMENT_NODE&&y.id===e&&(yt(!0,"log","Target element found, rendering Messaging Widget"),m.disconnect(),clearTimeout(c),Cx(y,s,n,r))},f=new MutationObserver(d);return f.observe(document.body,{childList:!0,subtree:!0}),c=setTimeout(()=>{f.disconnect(),yt(!0,"error",`Element with id: ${e} not found within ${t} milliseconds, stopping observation`)},t),f},IF=a=>{var u=a,{timeout:e,elementId:t,overridesUrl:n,overrides:r}=u,s=yn(u,["timeout","elementId","overridesUrl","overrides"]);if(!s.messagingConfig){yt(!0,"error","Messaging Widget requires messagingConfig");return}if(!s.messagingConfig.scrt2Url||!s.messagingConfig.orgId||!s.messagingConfig.esDeveloperName){yt(!0,"error","Messaging Widget requires messagingConfig.scrt2Url, messagingConfig.orgId, and messagingConfig.esDeveloperName");return}const c=document.getElementById(t);if(!c){yt(!0,"warn","Container element not found for id:",t),yt(!0,"warn","Beginning observation for element"),OF(H({elementId:t,timeout:e,overridesUrl:n,inlineOverrides:r},s));return}Cx(c,s,n,r)};class PF extends HTMLElement{constructor(){super(...arguments);Ye(this,"_props",null)}set props(n){this._props=n,this.render()}get props(){return this._props}connectedCallback(){this.render()}render(){}}const RF={components:{setEntryType:P0,toggleWidgetOpen:Br,toggleWidgetMinimized:Cu,toggleModalFullscreen:Pd,setWidgetType:Ou,setWidgetDialogPosition:Rd,loadPromptsComponent:r8,togglePromptsExtensionOpen:Rb}};Me.AgentForceWidget=kx,Me.AgentforceWidgetProvider=Qg,Me.CIMULATE_WIDGET_READY_EVENT=I0,Me.MessagingDialog=_x,Me.MessagingEmbed=bx,Me.MessagingModal=wx,Me.MessagingProvider=Pg,Me.OverrideElement=PF,Me.eventHandlers=RF,Me.injectMessagingWidget=IF,Me.useMessaging=sn,Object.defineProperty(Me,Symbol.toStringTag,{value:"Module"})}));