[a-z]+):\]/.exec(e);if(!t||!gX.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return NX("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return"-"===e?function(e){return{type:"CharacterClassHyphen",raw:e}}(e):"&&"===e?function(e){return{type:"CharacterClassIntersector",raw:e}}(e):RX(fX(e),e)}function $X(e,{inCharClass:t}){let n=e[1];if("c"===n||"C"===n)return function(e){let t="c"===e[1]?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return RX(fX(t.toUpperCase())-64,e)}(e);if("dDhHsSwW".includes(n))return function(e){let t=e[1].toLowerCase();return NX({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}(e);if(e.startsWith(yX`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(3===e.length)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return function(e){let{p:t,neg:n,value:r}=/^\\(?[pP])\{(?\^?)(?[^}]+)/.exec(e).groups;return NX("property",e,{value:r,negate:"P"===t&&!n||"p"===t&&!!n})}(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join("");return RX(fX(e),t)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if("u"===n||"x"===n)return RX(function(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw new Error(`Incomplete or invalid escape "${e}"`);let t="{"===e[2]?/^\\x\{\s*(?\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}(e),e);if(jX.has(n))return RX(jX.get(n),e);if(/\d/.test(n))return function(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}(t,e);if("\\"===e)throw new Error(yX`Incomplete escape "\"`);if("M"===n)throw new Error(`Unsupported meta "${e}"`);if(2===[...e].length)return RX(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function AX(e){return{type:"Alternator",raw:e}}function SX(e,t){return{type:"Assertion",kind:e,raw:t}}function EX(e){return{type:"Backreference",raw:e}}function RX(e,t){return{type:"Character",value:e,raw:t}}function IX(e){return{type:"CharacterClassClose",raw:e}}function LX(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function NX(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function MX(e,t,n={}){return"keep"===e?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:bX(n.flags),raw:t}}function DX(e){return{type:"GroupClose",raw:e}}function PX(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function OX(e){return{type:"Subroutine",raw:e}}var FX=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),jX=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function BX(e,t){let{on:n,off:r}=/^\(\?(?[imx]*)(?:-(?[-imx]*))?/.exec(e).groups;r??="";let i=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),a=UX(n),o=UX(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(")"))return t.replaceCurrentModX(i),MX("flags",e,{flags:s});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,PX("group",e,{...(a||o)&&{flags:s}});throw new Error(`Unexpected flag modifier "${e}"`)}function zX(e){let t=/\(\*(?[A-Za-z_]\w*)?(?:\[(?(?:[A-Za-z_]\w*)?)\])?(?:\{(?[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(""===r)throw new Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(",").filter(e=>""!==e).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,l]=a,c=FX.has(n)?n.toLowerCase():"custom";switch(c){case"fail":case"mismatch":case"skip":if(a.length>0)throw new Error(`Named callout arguments not allowed "${a}"`);break;case"error":if(a.length>1)throw new Error(`Named callout allows only one argument "${a}"`);if("string"==typeof o)throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!a.length||a.length>2)throw new Error(`Named callout must have one or two arguments "${a}"`);if("string"==typeof o&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(2===a.length&&("number"==typeof s||!/^[<>X]$/.test(s)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case"count":case"total_count":if(a.length>1)throw new Error(`Named callout allows only one argument "${a}"`);if(1===a.length&&("number"==typeof o||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(3!==a.length)throw new Error(`Named callout must have three arguments "${a}"`);if("string"==typeof o&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if("number"==typeof s||!/^(?:[<>!=]=|[<>])$/.test(s))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if("string"==typeof l&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${c}"`)}return function(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}(c,r??null,i?.split(",")??null,e)}function qX(e){let t,n,r=null;if("{"===e[0]){let{minStr:i,maxStr:a}=/^\{(?\d*)(?:,(?\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw new Error("Quantifier value unsupported in Oniguruma");if(t=+i,n=void 0===a?+i:""===a?1/0:+a,t>n&&(r="possessive",[t,n]=[n,t]),e.endsWith("?")){if("possessive"===r)throw new Error('Unsupported possessive interval quantifier chain with "?"');r="lazy"}else r||(r="greedy")}else t="+"===e[0]?1:0,n="?"===e[0]?1:1/0,r="+"===e[1]?"possessive":"?"===e[1]?"lazy":"greedy";return function(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}(r,t,n,e)}function UX(e){let t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function WX(e){let t,n=[],r=new RegExp(_X,"gy");for(;t=r.exec(e);){let e=t[0];if("{"===e[0]){let t=/^\{(?\d+),(?\d+)\}\??$/.exec(e);if(t){let{min:i,max:a}=t.groups;if(+i>+a&&e.endsWith("?")){r.lastIndex--,n.push(qX(e.slice(0,-1)));continue}}}n.push(qX(e))}return n}function KX(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(1!==e.body.length)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}var VX=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function GX(e,t={}){let n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=function(e,t={}){let n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if("string"!=typeof e)throw new Error("String expected as pattern");let r,i=function(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;na.at(-1),numOpenGroups:0,popModX(){a.pop()},pushModX(e){a.push(e)},replaceCurrentModX(e){a[a.length-1]=e},singleline:n.rules.singleline},s=[];for(kX.lastIndex=0;r=kX.exec(e);){let t=CX(o,e,r[0],kX.lastIndex);t.tokens?s.push(...t.tokens):t.token&&s.push(t.token),void 0!==t.lastIndex&&(kX.lastIndex=t.lastIndex)}let l=[],c=0;s.filter(e=>"GroupOpen"===e.type).forEach(e=>{"capturing"===e.kind?e.number=++c:"("===e.raw&&l.push(e)}),c||l.forEach((e,t)=>{e.kind="capturing",e.number=t+1});let u=c||l.length;return{tokens:s.map(e=>"EscapedNumber"===e.type?function(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&("0"!==i&&1===i.length||"0"!==i[0]&&+i<=t))return[EX(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e127)throw new Error(yX`Octal encoded byte above 177 unsupported "${n}"`)}else t=fX(r);a.push(RX(t,(0===e?"\\":"")+r))}return a}(e,u):e).flat(),flags:i}}(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case"Alternator":return ZX();case"Assertion":return function({kind:e}){return YX(bX({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===yX`\B`||e===yX`\Y`})}(n);case"Backreference":return function({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i){if(!t.skipBackrefValidation)throw new Error(`Not enough capturing groups defined to the left "${e}"`);a=!0}return t.hasNumberedRef=!0,HX(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?-?)0*(?[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return HX(r)}return i(+r)}(n,a);case"Character":return QX(n.value,{useLastValid:!!t.isCheckingRangeEnd});case"CharacterClassHyphen":return function(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&"CharacterClass"!==o.type&&"CharacterClassRange"!==o.type&&s&&"CharacterClassOpen"!==s.type&&"CharacterClassClose"!==s.type&&"CharacterClassIntersector"!==s.type){let e=i(a,{...n,isCheckingRangeEnd:!0});if("Character"===o.type&&"Character"===e.type)return a.body.pop(),function(e,t){if(t.value1===e.body.length?e.body[0]:e)),t.nextIndex++,l}(n,a,t);case"CharacterSet":return function({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if("property"===e){let r=uQ(n);if(!gX.has(r)||o?.has(r))return aQ(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o});e="posix",n=r}return"posix"===e?function(e,t){let n=!!t?.negate;if(!gX.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}(n,{negate:t}):eQ(e,{negate:t})}(n,a);case"Directive":return function(e,t={}){if("keep"===e)return{type:"Directive",kind:e};if("flags"===e)return{type:"Directive",kind:e,flags:bX(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}(n.kind,{flags:n.flags});case"GroupOpen":return function(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,l=function({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case"absence_repeater":return{type:"AbsenceFunction",kind:"repeater",body:oQ(void 0)};case"atomic":return tQ({atomic:!0});case"capturing":return XX(i,{name:n});case"group":return tQ({flags:e});case"lookahead":case"lookbehind":return nQ({behind:"lookbehind"===t,negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}(e),c="AbsenceFunction"===l.type,u=cQ(l),p=u&&l.negate;if("CapturingGroup"===l.type&&(i.push(l),l.name&&function(e,t){return e.has(t)||e.set(t,[]),e.get(t)}(a,l.name).push(l)),c&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let d=dQ(r[t.nextIndex]);for(;"GroupClose"!==d.type;){if("Alternator"===d.type)l.body.push(ZX()),t.nextIndex++;else{let e=l.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||c,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||p});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e="Lookbehind includes a pattern not allowed by Oniguruma";if(p||n.isInNegLookbehind){if(lQ(t)||"CapturingGroup"===t.type)throw new Error(e)}else if(lQ(t)||cQ(t)&&t.negate)throw new Error(e)}}d=dQ(r[t.nextIndex])}return t.nextIndex++,l}(n,a,t);case"NamedCallout":return function(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}(n.kind,n.tag,n.arguments);case"Quantifier":return function({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!function(e){return VX.has(e.type)}(a))throw new Error("Quantifier requires a repeatable token");let o=rQ(e,t,n,a);return i.body.pop(),o}(n,a);case"Subroutine":return function({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?[-+]?)0*(?[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw new Error("Invalid subroutine number")}else"0"===i&&(i=0);let o=iQ(i);return r.push(o),o}(n,a);default:throw new Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=function(e){return{type:"Regex",body:oQ(void 0),flags:e}}(function(e){return{type:"Flags",...e}}(r.flags)),s=o.body[0];for(;a.nextIndexl.length)throw new Error("Subroutine uses a group number that's not defined");e&&(l[e-1].isSubroutined=!0)}else{if(!u.has(e))throw new Error(yX`Subroutine uses a group name that's not defined "\g<${e}>"`);if(u.get(e).length>1)throw new Error(yX`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}return o}function ZX(e){return{type:"Alternative",body:sQ(e?.body)}}function YX(e,t){let n={type:"Assertion",kind:e};return("word_boundary"===e||"text_segment_boundary"===e)&&(n.negate=!!t?.negate),n}function HX(e,t){let n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function XX(e,t){let n={name:void 0,isSubroutined:!1,...t};if(void 0!==n.name&&!function(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:oQ(t?.body)}}function QX(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(!n.useLastValid)throw e>1310719?new Error(`Invalid code point out of range "\\x{${t}}"`):new Error(`Invalid code point out of range in JS "\\x{${t}}"`);e=1114111}return{type:"Character",value:e}}function JX(e){let t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:sQ(e?.body)}}function eQ(e,t){let n=!!t?.negate,r={type:"CharacterSet",kind:e};return("digit"===e||"hex"===e||"newline"===e||"space"===e||"word"===e)&&(r.negate=n),("text_segment"===e||"newline"===e&&!n)&&(r.variableLength=!0),r}function tQ(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:oQ(e?.body)}}function nQ(e){let t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:oQ(e?.body)}}function rQ(e,t,n,r){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function iQ(e){return{type:"Subroutine",ref:e}}function aQ(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(uQ(e));if(!r)if(n.normalizeUnknownPropertyNames)r=function(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(yX`Invalid Unicode property "\p{${e}}"`);return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function oQ(e){if(void 0===e)e=[ZX()];else if(!Array.isArray(e)||!e.length||!e.every(e=>"Alternative"===e.type))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function sQ(e){if(void 0===e)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw new Error("Invalid body; expected array of nodes");return e}function lQ(e){return"LookaroundAssertion"===e.type&&"lookahead"===e.kind}function cQ(e){return"LookaroundAssertion"===e.type&&"lookbehind"===e.kind}function uQ(e){return e.replace(/[- _]+/g,"").toLowerCase()}function pQ(e,t){return bX(e,("Character"===t?.type&&93===t.value?"Empty":"Unclosed")+" character class")}function dQ(e){return bX(e,"Unclosed group")}function hQ(e,t,n=null){function r(e,t){for(let n=0;nmQ(l).splice(fQ(s)+1),removeAllPrevSiblings(){let e=fQ(s)+c;return c-=e,mQ(l).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;l?l[Math.max(0,fQ(s)+c)]=e:bX(o,"Can't replace root node")[s]=e,n&&i(e,o,s,l),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(mQ(l).splice(Math.max(0,fQ(s)+c),1,...e),c+=e.length-1,n){let t=0;for(let n=0;nA-Za-z\-]|<[=!]|\(DEFINE\))`;function yQ(e,t){for(let n=0;n=t&&e[n]++}function bQ(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var vQ=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function xQ(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),a=[!1],o=0,s="";for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;i||r&&r===vQ.DEFAULT!=!o?("["===e[0]?(o++,a.push("^"===e[1])):"]"===e&&o&&(o--,a.pop()),s+=e):s+=n instanceof Function?n(t,{context:o?vQ.CHAR_CLASS:vQ.DEFAULT,negated:a[a.length-1]}):n}return s}function _Q(e,t,n,r){xQ(e,t,n,r)}function kQ(e,t,n){return!!function(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;let i=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=n;let a,o=0;for(;a=i.exec(e);){let{0:e,groups:{$skip:t}}=a;if(!(t||r&&r===vQ.DEFAULT!=!o))return a;"["===e?o++:"]"===e&&o&&o--,i.lastIndex==a.index&&i.lastIndex++}return null}(e,t,0,n)}function wQ(e,t){let n=/\\?./gsu;n.lastIndex=t;let r,i=e.length,a=0,o=1;for(;r=n.exec(e);){let[e]=r;if("["===e)a++;else if(a)"]"===e&&a--;else if("("===e)o++;else if(")"===e&&(o--,!o)){i=r.index;break}}return e.slice(t,i)}var CQ=new RegExp(String.raw`(?${gQ})|(?\((?:\?<[^>]+>)?)|\\?.`,"gsu"),TQ=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,$Q=new RegExp(String.raw`
\\(?: \d+
| c[A-Za-z]
| [gk]<[^>]+>
| [pPu]\{[^\}]+\}
| u[A-Fa-f\d]{4}
| x[A-Fa-f\d]{2}
)
| \((?: \? (?: [:=!>]
| <(?:[=!]|[^>]+>)
| [A-Za-z\-]+:
| \(DEFINE\)
))?
| (?${TQ})(?[?+]?)(?[?*+\{]?)
| \\?.
`.replace(/\s+/g,""),"gsu"),AQ=String.raw,SQ=AQ`\\g<(?[^>&]+)&R=(?[^>]+)>`,EQ=AQ`\(\?R=(?[^\)]+)\)|${SQ}`,RQ=AQ`\(\?<(?![=!])(?[^>]+)>`,IQ=AQ`${RQ}|(?\()(?!\?)`,LQ=new RegExp(AQ`${RQ}|${EQ}|\(\?|\\?.`,"gsu"),NQ="Cannot use multiple overlapping recursions";function MQ(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if((e=+e)<2||e>100)throw new Error(t)}function DQ(e,t,n,r,i,a,o){let s=new Set;r&&_Q(e+t,RQ,({groups:{captureName:e}})=>{s.add(e)},vQ.DEFAULT);let l=[n,r?s:null,i,a,o];return`${e}${PQ(`(?:${e}`,"forward",...l)}(?:)${PQ(`${t})`,"backward",...l)}${t}`}function PQ(e,t,n,r,i,a,o){let s=e=>"forward"===t?e+2:n-e+2-1,l="";for(let t=0;t[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:l}})=>{if(l&&r&&!r.has(l))return e;let c=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),OQ(i,n),s?e:`(?<${t}${c}>`}return AQ`\k<${l}${c}>`},vQ.DEFAULT)}return l}function OQ(e,t){for(let n=0;n=t&&e[n]++}function FQ(e,t,n,r,i,a){if(e.size&&r){let o=0;_Q(t,IQ,()=>o++,vQ.DEFAULT);let s=a-o+i,l=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,c=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);l.set(c,u)}),l}return e}var jQ=String.fromCodePoint,BQ=String.raw,zQ={flagGroups:(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),unicodeSets:(()=>{try{new RegExp("[[]]","v")}catch{return!1}return!0})()};function qQ(e,{enable:t,disable:n}){return{dotAll:!(n?.dotAll||!t?.dotAll&&!e.dotAll),ignoreCase:!(n?.ignoreCase||!t?.ignoreCase&&!e.ignoreCase)}}function UQ(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function WQ(e,t){return KQ[e]>=KQ[t]}zQ.bugFlagVLiteralHyphenIsRange=!!zQ.unicodeSets&&(()=>{try{new RegExp(BQ`[\d\-a]`,"v")}catch{return!0}return!1})(),zQ.bugNestedClassIgnoresNegation=zQ.unicodeSets&&new RegExp("[[^a]]","v").test("a");var KQ={ES2025:2025,ES2024:2024,ES2018:2018},VQ={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function GQ(e={}){if("[object Object]"!=={}.toString.call(e))throw new Error("Unexpected options");if(void 0!==e.target&&!VQ[e.target])throw new Error(`Unexpected target "${e.target}"`);let t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return"auto"===t.target&&(t.target=zQ.flagGroups?"ES2025":zQ.unicodeSets?"ES2024":"ES2018"),t}var ZQ=new Set([jQ(304),jQ(305)]),YQ=BQ`[\p{L}\p{M}\p{N}\p{Pc}]`;function HQ(e){if(ZQ.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=eJ.get(n),a=QQ.get(n),o=JQ.get(n);return 1===[...r].length&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}var XQ=new Map("C Other\nCc Control cntrl\nCf Format\nCn Unassigned\nCo Private_Use\nCs Surrogate\nL Letter\nLC Cased_Letter\nLl Lowercase_Letter\nLm Modifier_Letter\nLo Other_Letter\nLt Titlecase_Letter\nLu Uppercase_Letter\nM Mark Combining_Mark\nMc Spacing_Mark\nMe Enclosing_Mark\nMn Nonspacing_Mark\nN Number\nNd Decimal_Number digit\nNl Letter_Number\nNo Other_Number\nP Punctuation punct\nPc Connector_Punctuation\nPd Dash_Punctuation\nPe Close_Punctuation\nPf Final_Punctuation\nPi Initial_Punctuation\nPo Other_Punctuation\nPs Open_Punctuation\nS Symbol\nSc Currency_Symbol\nSk Modifier_Symbol\nSm Math_Symbol\nSo Other_Symbol\nZ Separator\nZl Line_Separator\nZp Paragraph_Separator\nZs Space_Separator\nASCII\nASCII_Hex_Digit AHex\nAlphabetic Alpha\nAny\nAssigned\nBidi_Control Bidi_C\nBidi_Mirrored Bidi_M\nCase_Ignorable CI\nCased\nChanges_When_Casefolded CWCF\nChanges_When_Casemapped CWCM\nChanges_When_Lowercased CWL\nChanges_When_NFKC_Casefolded CWKCF\nChanges_When_Titlecased CWT\nChanges_When_Uppercased CWU\nDash\nDefault_Ignorable_Code_Point DI\nDeprecated Dep\nDiacritic Dia\nEmoji\nEmoji_Component EComp\nEmoji_Modifier EMod\nEmoji_Modifier_Base EBase\nEmoji_Presentation EPres\nExtended_Pictographic ExtPict\nExtender Ext\nGrapheme_Base Gr_Base\nGrapheme_Extend Gr_Ext\nHex_Digit Hex\nIDS_Binary_Operator IDSB\nIDS_Trinary_Operator IDST\nID_Continue IDC\nID_Start IDS\nIdeographic Ideo\nJoin_Control Join_C\nLogical_Order_Exception LOE\nLowercase Lower\nMath\nNoncharacter_Code_Point NChar\nPattern_Syntax Pat_Syn\nPattern_White_Space Pat_WS\nQuotation_Mark QMark\nRadical\nRegional_Indicator RI\nSentence_Terminal STerm\nSoft_Dotted SD\nTerminal_Punctuation Term\nUnified_Ideograph UIdeo\nUppercase Upper\nVariation_Selector VS\nWhite_Space space\nXID_Continue XIDC\nXID_Start XIDS".split(/\s/).map(e=>[uQ(e),e])),QQ=new Map([["s",jQ(383)],[jQ(383),"s"]]),JQ=new Map([[jQ(223),jQ(7838)],[jQ(107),jQ(8490)],[jQ(229),jQ(8491)],[jQ(969),jQ(8486)]]),eJ=new Map([nJ(453),nJ(456),nJ(459),nJ(498),...rJ(8072,8079),...rJ(8088,8095),...rJ(8104,8111),nJ(8124),nJ(8140),nJ(8188)]),tJ=new Map([["alnum",BQ`[\p{Alpha}\p{Nd}]`],["alpha",BQ`\p{Alpha}`],["ascii",BQ`\p{ASCII}`],["blank",BQ`[\p{Zs}\t]`],["cntrl",BQ`\p{Cc}`],["digit",BQ`\p{Nd}`],["graph",BQ`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",BQ`\p{Lower}`],["print",BQ`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",BQ`[\p{P}\p{S}]`],["space",BQ`\p{space}`],["upper",BQ`\p{Upper}`],["word",BQ`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",BQ`\p{AHex}`]]);function nJ(e){let t=jQ(e);return[t.toLowerCase(),t]}function rJ(e,t){return function(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}(e,t).map(e=>nJ(e))}var iJ=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]),aJ={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if("repeater"!==i)throw new Error('Unsupported absence function "(?~|"');{let e=tQ();e.body[0].body.push(nQ({negate:!0,body:r}),aQ("Any"));let i=tQ();i.body[0].body.push(rQ("greedy",0,1/0,e)),n(_J(i,t),{traverse:!0})}},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>"flags"===e.kind);for(let e=n+1;e\r\n|${i?BQ`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if("hex"===l)n(xJ(aQ("AHex",{negate:c}),t));else if("newline"===l)n(_J(bJ(c?"[^\n]":"(?>\r\n?|[\n\v\f
\u2028\u2029])"),t));else if("posix"===l)if(i||"graph"!==u&&"print"!==u)n(_J(vJ(bJ(tJ.get(u)),c),t));else{if("strict"===r)throw new Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:"!-~",print:" -~"}[u];c&&(e=`\0-${jQ(e.codePointAt(0)-1)}${jQ(e.codePointAt(2)+1)}-`),n(_J(bJ(`[${e}]`),t))}else if("property"===l)XQ.has(uQ(u))||(e.key="sc");else if("space"===l)n(xJ(aQ("space",{negate:c}),t));else{if("word"!==l)throw new Error(`Unexpected character set kind "${l}"`);n(_J(vJ(bJ(YQ),c),t))}}else n(xJ(eQ("word",{negate:c}),t));else n(_J(vJ(bJ("[\t-\r ]"),c),t));else n(xJ(eQ("digit",{negate:c}),t))},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:l}=e;if("flags"===s)if(l.enable||l.disable){let e=tQ({flags:l});e.body[0].body=o(),i(_J(e,t),{traverse:!0})}else r();else{if("keep"!==s)throw new Error(`Unexpected directive kind "${s}"`);{let e=n.body[0],r=1===n.body.length&&KX(e,{type:"Group"})&&1===e.body[0].body.length?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw new Error(BQ`Uses "\K" in a way that's unsupported`);let o=nQ({behind:!0});o.body[0].body=a(),i(_J(o,t))}}},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if("word"===e.textSegmentMode)throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;"lookbehind"===n&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if("fail"!==r)throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`);n(_J(nQ({negate:!0}),t))},Quantifier({node:e}){if("Quantifier"===e.body.type){let t=tQ();t.body[0].body.push(e.body),e.body=_J(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(1===t.body.length&&"search_start"===t.body[0].kind)t.body.pop();else{let e=fJ(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if("strict"===t&&n&&r)throw new Error(BQ`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;"string"==typeof n&&!yJ(n)&&(n=pJ(n,t),e.ref=n)}},oJ={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:l}){let c=i.get(e);if(c&&s.has(e.number)){let r=xJ(uJ(e.number),t);return l.set(r,s.get(e.number)),void n(r)}s.set(e.number,e),o.set(e.number,[]),e.name&&UQ(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t"Group"===e.type&&!!e.flags)),t=e?qQ(r.globalFlags,e):r.globalFlags;(function(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase})(t,r.currentFlags)||(c=tQ({flags:hJ(t)}),c.body[0].body.push(l))}n(_J(c,t),{traverse:!s})}},sJ={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan)return void(r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref));let i=r.reffedNodesByReferencer.get(e).filter(t=>function(e,t){let n=t;do{if("Regex"===n.type)return!1;if("Alternative"===n.type)continue;if(n===e)return!1;let t=mJ(n.parent);for(let r of t){if(r===n)break;if(r===e||gJ(r,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}(t,e));if(i.length)if(i.length>1){let e=tQ({atomic:!0,body:i.reverse().map(e=>ZX({body:[HX(e.number)]}))});n(_J(e,t))}else e.ref=i[0].number;else n(_J(nQ({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function hJ({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),e&&t||(n.disable={},!e&&(n.disable.dotAll=!0),t||(n.disable.ignoreCase=!0)),n}function mJ(e){if(!e)throw new Error("Node expected");let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function fJ(e){let t=e.find(e=>"search_start"===e.kind||function(e){let t={negate:null,negate:!1};return"LookaroundAssertion"===e.type&&(null===t.negate||e.negate===t.negate)&&1===e.body.length&&KX(e.body[0],{type:"Assertion",kind:"search_start"})}(e)||!function({type:e}){return"Assertion"===e||"Directive"===e||"LookaroundAssertion"===e}(e));if(!t)return null;if("search_start"===t.kind)return t;if("LookaroundAssertion"===t.type)return t.body[0].body[0];if("CapturingGroup"===t.type||"Group"===t.type){let e=[];for(let n of t.body){let t=fJ(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function gJ(e,t){let n=mJ(e)??[];for(let e of n)if(e===t||gJ(e,t))return!0;return!1}function yJ(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function bJ(e,t){let n=GX(e,{...t,unicodePropertyMap:XQ}).body;return n.length>1||n[0].body.length>1?tQ({body:n}):n[0].body[0]}function vJ(e,t){return e.negate=t,e}function xJ(e,t){return e.parent=t,e}function _J(e,t){return lJ(e),e.parent=t,e}var kJ={"*":{enter({node:e},t){if(LJ(e)){let n=t.getCurrentModI();t.pushModI(e.flags?qQ({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){LJ(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){EJ(jQ(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),RJ(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){"property"===e.kind&&iJ.has(e.value)&&t.setHasCasedChar()}},wJ={Alternative:({body:e},t,n)=>e.map(n).join(""),Assertion({kind:e,negate:t}){if("string_end"===e)return"$";if("string_start"===e)return"^";if("word_boundary"===e)return t?BQ`\B`:BQ`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if("number"!=typeof e)throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&"strict"===t.accuracy&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:""}${r.map(n).join("|")})`},Character({value:e},t){let n=jQ(e),r=IJ(e,{escDigit:"Backreference"===t.lastNode.type,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&EJ(n)){let e=HQ(n);return t.inCharClass?e.join(""):e.length>1?`[${e.join("")}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if("intersection"===r&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");zQ.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(NJ)&&(o=[QX(45),...o.filter(e=>!NJ(e))]);let s=()=>`[${i?"^":""}${o.map(n).join("intersection"===r?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||zQ.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>"CharacterClass"===e.type&&"union"===e.kind&&e.negate);if(t.length){let r=tQ(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=ZX({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let l=o[0];if("union"===r&&!i&&l&&((!t.useFlagV||!t.verbose)&&"union"===a.kind&&(!zQ.bugFlagVLiteralHyphenIsRange||!t.useFlagV)||!t.verbose&&"intersection"===a.kind&&1===o.length&&"CharacterClassRange"!==l.type))return o.map(n).join("");if(!t.useFlagV&&"CharacterClass"===a.type)throw new Error("Uses nested character class in a way that requires min target ES2024");return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=IJ(n,i),o=IJ(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&function(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e{s.add(Array.isArray(e)?`${IJ(e[0],i)}-${IJ(e[1],i)}`:IJ(e,i))}),`${a}-${o}${[...s].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if("dot"===e)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":BQ`[^\n]`;if("digit"===e)return t?BQ`\D`:BQ`\d`;if("property"===e){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&iJ.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?BQ`\P`:BQ`\p`}{${r?`${r}=`:""}${n}}`}if("word"===e)return t?BQ`\W`:BQ`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags:(e,t)=>(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":""),Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=qQ(o,n));let s=t.map(a).join("|"),l=i.verbose||1!==t.length||"Quantifier"===r.type||e||i.useFlagMods&&n?`(?${function(e,t,n){if(e)return">";let r="";if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?"i":"")+(e?.dotAll?"s":"")+(n?"-":"")+(n?.ignoreCase?"i":"")+(n?.dotAll?"s":"")}return`${r}:`}(e,n,i.useFlagMods)}${s})`:s;return i.currentFlags=o,l},LookaroundAssertion:({body:e,kind:t,negate:n},r,i)=>`(?${"lookahead"===t?"":"<"}${n?"!":"="}${e.map(i).join("|")})`,Quantifier:(e,t,n)=>n(e.body)+function({kind:e,max:t,min:n}){let r;return r=n||1!==t?n||t!==1/0?1===n&&t===1/0?"+":n===t?`{${n}}`:`{${n},${t===1/0?"":t}}`:"*":"?",r+{greedy:"",lazy:"?",possessive:"+"}[e]}(e),Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");let r=n.recursionLimit;return 0===t?`(?R=${r})`:BQ`\g<${t}&R=${r}>`}},CJ=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),TJ=new Set(["-","\\","]","^","["]),$J=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),AJ=new Map([[9,BQ`\t`],[10,BQ`\n`],[11,BQ`\v`],[12,BQ`\f`],[13,BQ`\r`],[8232,BQ`\u2028`],[8233,BQ`\u2029`],[65279,BQ`\uFEFF`]]),SJ=/^\p{Cased}$/u;function EJ(e){return SJ.test(e)}function RJ(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(65535===i||i>=131071)||65536===r&&i>=131071)return a;for(let e=r;e<=i;e++){let t=jQ(e);if(!EJ(t))continue;let o=HQ(t).filter(e=>{let t=e.codePointAt(0);return ti});if(o.length&&(a.push(...o),n))break}return a}function IJ(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(AJ.has(e))return AJ.get(e);if(e<32||e>126&&e<160||e>262143||t&&function(e){return e>47&&e<58}(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;let i=n?r?$J:TJ:CJ,a=jQ(e);return(i.has(a)?"\\":"")+a}function LJ({type:e}){return"CapturingGroup"===e||"Group"===e||"LookaroundAssertion"===e}function NJ({type:e,value:t}){return"Character"===e&&45===t}var MJ=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||"(?:)"}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?"":t,n),this.#n=t,this.#e=function(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)UQ(n,t,{}).transferTo=e;return n}(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if("clip_search"===this.#i&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(function(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n,r=[...t];t.length=1,this.hasIndices&&(n=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e\((?:\?<(?![=!])(?[^>]+)>|(?!\?)))|\\?./gsu,r=new Map,i=0,a=0;for(;t=n.exec(e);){let{0:e,groups:{capture:n,name:o}}=t;"["===e?i++:i?"]"===e&&i--:n&&(a++,o&&r.set(a,o))}return r}function PJ(e,t){let n=function(e,t){let n=GQ(t),r=function(e,t){let n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};lJ(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:WQ(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};hQ(e,aJ,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return hQ(e,oJ,a),hQ(e,sJ,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}(GX(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:XQ}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=function(e,t){let n=GQ(t),r=WQ(n.target,"ES2024"),i=WQ(n.target,"ES2025"),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];hQ(e,kJ,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let l={dotAll:e.flags.dotAll,ignoreCase:!(!e.flags.ignoreCase&&!o||s)},c=e,u={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!(i||!o||!s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function p(e){return u.lastNode=c,c=e,function(e,t){if(null==e)throw new Error(t??"Value expected");return e}(wJ[e.type],`Unexpected node type "${e.type}"`)(e,u,p)}let d={pattern:e.body.map(p).join("|"),flags:p(e.flags),options:{...e.options}};return r||(delete d.options.force.v,d.options.disable.v=!0,d.options.unicodeSetsPlugin=null),d._captureTransfers=new Map,d._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&d._hiddenCaptures.push(t),e.transferTo&&UQ(d._captureTransfers,e.transferTo,[]).push(t)}),d}(r,n),a=function(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t},i=t?.captureTransfers??new Map;if(!new RegExp(EQ,"su").test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if("plugin"===r&&kQ(e,AQ`\(\?\(DEFINE\)`,vQ.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");let a,o=[],s=kQ(e,AQ`\\[1-9]`,vQ.DEFAULT),l=new Map,c=[],u=!1,p=0,d=0;for(LQ.lastIndex=0;a=LQ.exec(e);){let{0:t,groups:{captureName:h,rDepth:m,gRNameOrNum:f,gRDepth:g}}=a;if("["===t)p++;else if(p)"]"===t&&p--;else{if(m){if(MQ(m),u)throw new Error(NQ);if(s)throw new Error(("external"===r?"Backrefs":"Numbered backrefs")+" cannot be used with global recursion");let t=e.slice(0,a.index),l=e.slice(LQ.lastIndex);if(kQ(l,EQ,vQ.DEFAULT))throw new Error(NQ);let c=+m-1;e=DQ(t,l,c,!1,n,o,d),i=FQ(i,t,c,o.length,0,d);break}if(f){MQ(g);let p=!1;for(let e of c)if(e.name===f||e.num===+f){if(p=!0,e.hasRecursedWithin)throw new Error(NQ);break}if(!p)throw new Error(AQ`Recursive \g cannot be used outside the referenced group "${"external"===r?f:AQ`\g<${f}&R=${g}>`}"`);let h=l.get(f),m=wQ(e,h);if(s&&kQ(m,AQ`${RQ}|\((?!\?)`,vQ.DEFAULT))throw new Error(("external"===r?"Backrefs":"Numbered backrefs")+" cannot be used with recursion of capturing groups");let y=e.slice(h,a.index),b=m.slice(y.length+t.length),v=o.length,x=+g-1,_=DQ(y,b,x,!0,n,o,d);i=FQ(i,y,x,o.length-v,v,d);let k=e.slice(0,h),w=e.slice(h+m.length);e=`${k}${_}${w}`,LQ.lastIndex+=_.length-t.length-y.length-b.length,c.forEach(e=>e.hasRecursedWithin=!0),u=!0}else if(h)d++,l.set(String(d),LQ.lastIndex),l.set(h,LQ.lastIndex),c.push({num:d,name:h});else if("("===t[0]){let e="("===t;e&&(d++,l.set(String(d),LQ.lastIndex)),c.push(e?{num:d}:{})}else")"===t&&c.pop()}}return n.push(...o),{pattern:e,captureTransfers:i,hiddenCaptures:n}}(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:"external"}),o=function(e){if(!new RegExp(`${TQ}\\+`).test(e))return{pattern:e};let t,n=[],r=null,i=null,a="",o=0;for($Q.lastIndex=0;t=$Q.exec(e);){let{0:s,index:l,groups:{qBase:c,qMod:u,invalidQ:p}}=t;if("["===s)o||(i=l),o++;else if("]"===s)o?o--:i=null;else if(!o)if("+"===u&&a&&!a.startsWith("(")){if(p)throw new Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(c))e=bQ(e,l+c.length,u,"");else{if(")"===a||"]"===a){let t=")"===a?r:i;if(null===t)throw new Error(`Invalid unmatched "${a}"`);e=`${e.slice(0,t)}(?>${e.slice(t,l)}${c})${e.slice(l+s.length)}`}else e=`${e.slice(0,l-a.length)}(?>${a}${c})${e.slice(l+s.length)}`;t+=4}$Q.lastIndex+=t}else"("===s[0]?n.push(l):")"===s&&(r=n.length?n.pop():null);a=s}return{pattern:e}}(a.pattern),s=function(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i,a=[0],o=[],s=0,l=0,c=NaN;do{i=!1;let t,u=0,p=0,d=!1;for(CQ.lastIndex=Number.isNaN(c)?0:c+7;t=CQ.exec(e);){let{0:h,index:m,groups:{capturingStart:f,noncapturingStart:g}}=t;if("["===h)u++;else if(u)"]"===h&&u--;else if("(?>"!==h||d){if(d&&g)p++;else if(f)d?p++:(s++,a.push(s+l));else if(")"===h&&d){if(!p){l++;let t=s+l;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,i=!0,o.push(t),yQ(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}p--}}else c=m,d=!0}}while(i);return n.push(...o),e=xQ(e,String.raw`\\(?[1-9]\d*)|<\$\$(?\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>a.length-1)throw new Error(`Backref "${e}" greater than number of captures`);return`\\${a[n]}`}return`\\${n}`},vQ.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}(o.pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),l={pattern:s.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${i.flags}${i.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{let e=s.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(s.captureTransfers),i=r._strategy,a=l.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(l.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return l}(e,t);return n.options?new MJ(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}var OJ,FJ=class{constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if("string"!=typeof e)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}regexps;findNextMatchSync(e,t,n){let r="string"==typeof e?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>null==e?{start:4294967295,end:4294967295,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;ee[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function jJ(e={}){let t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||=e=>function(e,t){return PJ(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}(e,{target:t.target}),{createScanner:e=>new FJ(e,t),createString:e=>({content:e})}}var BJ=(0,p.memo)(function({tokens:e,selectedLine:t}){let n=1===e.tokens.length;return(0,v.jsx)("code",{children:e.tokens.map((e,r)=>{let i=t?.number===r+1;return(0,v.jsx)("span",{ref:i?t?.ref:void 0,className:`line ${n?"inline":"block px-2"} ${i?`${jV} bg-primary-200/25`:""}`,children:0===e.length?(0,v.jsx)("br",{}):e.map((e,t)=>(0,v.jsx)("span",{className:"token",style:CH(e),children:e.content},t))},r)})})}),zJ=(0,p.memo)(function({code:e,selectedLine:t}){let n=e.split("\n"),r=1===n.length;return(0,v.jsx)("code",{children:n.map((e,n)=>{let i=t?.number===n+1;return(0,v.jsx)("span",{ref:i?t?.ref:void 0,className:`line ${r?"inline":"block px-3"} ${i?`${jV} bg-primary-200/25`:""}`,children:0===e.length?(0,v.jsx)("br",{}):e.split(" ").map((e,t)=>(0,v.jsx)("span",{className:"token",children:`${0===t?"":" "}${e}`},t))},n)})})}),qJ=(0,p.memo)(function({code:e,language:t,selectedLine:n}){let r=(void 0===OJ&&(OJ=wH({...mX,engine:jJ()})),OJ),i=r.getLoadedLanguages().includes(t),a=(0,p.useMemo)(()=>i?r.codeToTokens(e,{lang:t,theme:hX}):null,[r,i,e,t]);return a?(0,v.jsx)(BJ,{tokens:a,selectedLine:n}):(0,v.jsx)(zJ,{code:e,selectedLine:n})}),UJ=(0,p.memo)(function({code:e,language:t,lines:n,copyButton:r=!0,selectedLine:i,className:a,inline:o,size:s}){let l=o??(void 0===n&&1===e.split("\n").length),c=t?(0,v.jsx)(qJ,{code:e,language:t,selectedLine:i}):(0,v.jsx)(zJ,{code:e,selectedLine:i});return l?(0,v.jsx)(zV,{className:a,size:s,children:c}):(0,v.jsx)(BV,{code:e,lines:n,copyButton:r,className:a,size:s,selectedLine:i,children:c})});function WJ(e){return Array.isArray?Array.isArray(e):"[object Array]"===HJ(e)}function KJ(e){return"string"==typeof e}function VJ(e){return"number"==typeof e}function GJ(e){return"object"==typeof e}function ZJ(e){return null!=e}function YJ(e){return!e.trim().length}function HJ(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var XJ=Object.prototype.hasOwnProperty,QJ=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=JJ(e);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function JJ(e){let t=null,n=null,r=null,i=1,a=null;if(KJ(e)||WJ(e))r=e,t=e0(e),n=t0(e);else{if(!XJ.call(e,"name"))throw new Error("Missing name property in key");let o=e.name;if(r=o,XJ.call(e,"weight")&&(i=e.weight,i<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(o));t=e0(o),n=t0(o),a=e.getFn}return{path:t,id:n,weight:i,src:r,getFn:a}}function e0(e){return WJ(e)?e:e.split(".")}function t0(e){return WJ(e)?e.join("."):e}var n0={useExtendedSearch:!1,getFn:function(e,t){let n=[],r=!1,i=(e,t,a)=>{if(ZJ(e))if(t[a]){let o=e[t[a]];if(!ZJ(o))return;if(a===t.length-1&&(KJ(o)||VJ(o)||function(e){return!0===e||!1===e||function(e){return GJ(e)&&null!==e}(e)&&"[object Boolean]"==HJ(e)}(o)))n.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(o));else if(WJ(o)){r=!0;for(let e=0,n=o.length;ee.score===t.score?e.idx{this._keysMap[e.id]=t})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,KJ(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){let t=this.size();KJ(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,n=this.size();t{let i=t.getFn?t.getFn(e):this.getFn(e,t.path);if(ZJ(i))if(WJ(i)){let e=[],t=[{nestedArrIndex:-1,value:i}];for(;t.length;){let{nestedArrIndex:n,value:r}=t.pop();if(ZJ(r))if(KJ(r)&&!YJ(r)){let t={v:r,i:n,n:this.norm.get(r)};e.push(t)}else WJ(r)&&r.forEach((e,n)=>{t.push({nestedArrIndex:n,value:e})})}n.$[r]=e}else if(KJ(i)&&!YJ(i)){let e={v:i,n:this.norm.get(i)};n.$[r]=e}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}};function o0(e,t,{getFn:n=r0.getFn,fieldNormWeight:r=r0.fieldNormWeight}={}){let i=new a0({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(JJ)),i.setSources(t),i.create(),i}function s0(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:i=r0.distance,ignoreLocation:a=r0.ignoreLocation}={}){let o=t/e.length;if(a)return o;let s=Math.abs(r-n);return i?o+s/i:s?1:o}var l0=32;function c0(e){let t={};for(let n=0,r=e.length;ne.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e,p0=class{constructor(e,{location:t=r0.location,threshold:n=r0.threshold,distance:r=r0.distance,includeMatches:i=r0.includeMatches,findAllMatches:a=r0.findAllMatches,minMatchCharLength:o=r0.minMatchCharLength,isCaseSensitive:s=r0.isCaseSensitive,ignoreDiacritics:l=r0.ignoreDiacritics,ignoreLocation:c=r0.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:l,ignoreLocation:c},e=s?e:e.toLowerCase(),e=l?u0(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let u=(e,t)=>{this.chunks.push({pattern:e,alphabet:c0(e),startIndex:t})},p=this.pattern.length;if(p>l0){let e=0,t=p%l0,n=p-t;for(;e{let{isMatch:m,score:f,indices:g}=function(e,t,n,{location:r=r0.location,distance:i=r0.distance,threshold:a=r0.threshold,findAllMatches:o=r0.findAllMatches,minMatchCharLength:s=r0.minMatchCharLength,includeMatches:l=r0.includeMatches,ignoreLocation:c=r0.ignoreLocation}={}){if(t.length>l0)throw new Error("Pattern length exceeds max of 32.");let u,p=t.length,d=e.length,h=Math.max(0,Math.min(r,d)),m=a,f=h,g=s>1||l,y=g?Array(d):[];for(;(u=e.indexOf(t,f))>-1;){let e=s0(t,{currentLocation:u,expectedLocation:h,distance:i,ignoreLocation:c});if(m=Math.min(e,m),f=u+p,g){let e=0;for(;e=l;a-=1){let o=a-1,s=n[e.charAt(o)];if(g&&(y[o]=+!!s),k[a]=(k[a+1]<<1|1)&s,r&&(k[a]|=(b[a+1]|b[a])<<1|1|b[a+1]),k[a]&_&&(v=s0(t,{errors:r,currentLocation:o,expectedLocation:h,distance:i,ignoreLocation:c}),v<=m)){if(m=v,f=o,f<=h)break;l=Math.max(1,2*h-f)}}if(s0(t,{errors:r+1,currentLocation:h,expectedLocation:h,distance:i,ignoreLocation:c})>m)break;b=k}let k={isMatch:f>=0,score:Math.max(.001,v)};if(g){let e=function(e=[],t=r0.minMatchCharLength){let n=[],r=-1,i=-1,a=0;for(let o=e.length;a=t&&n.push([r,i]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}(y,s);e.length?l&&(k.indices=e):k.isMatch=!1}return k}(e,t,n,{location:i+h,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:l,includeMatches:r,ignoreLocation:c});m&&(d=!0),p+=f,m&&g&&(u=[...u,...g])});let h={isMatch:d,score:d?p/this.chunks.length:1};return d&&r&&(h.indices=u),h}},d0=class{constructor(e){this.pattern=e}static isMultiMatch(e){return h0(e,this.multiRegex)}static isSingleMatch(e){return h0(e,this.singleRegex)}search(){}};function h0(e,t){let n=e.match(t);return n?n[1]:null}var m0=class extends d0{constructor(e,{location:t=r0.location,threshold:n=r0.threshold,distance:r=r0.distance,includeMatches:i=r0.includeMatches,findAllMatches:a=r0.findAllMatches,minMatchCharLength:o=r0.minMatchCharLength,isCaseSensitive:s=r0.isCaseSensitive,ignoreDiacritics:l=r0.ignoreDiacritics,ignoreLocation:c=r0.ignoreLocation}={}){super(e),this._bitapSearch=new p0(e,{location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}},f0=class extends d0{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,n=0,r=[],i=this.pattern.length;for(;(t=e.indexOf(this.pattern,n))>-1;)n=t+i,r.push([t,n-1]);let a=!!r.length;return{isMatch:a,score:a?0:1,indices:r}}},g0=[class extends d0{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},f0,class extends d0{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends d0{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends d0{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends d0{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends d0{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},m0],y0=g0.length,b0=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,v0=new Set([m0.type,f0.type]),x0=[];function _0(e,t){for(let n=0,r=x0.length;n!(!e[k0]&&!e.$or),T0=e=>({[k0]:Object.keys(e).map(t=>({[t]:e[t]}))});function $0(e,t,{auto:n=!0}={}){let r=e=>{let i=Object.keys(e),a=(e=>!!e[w0])(e);if(!a&&i.length>1&&!C0(e))return r(T0(e));if((e=>!WJ(e)&&GJ(e)&&!C0(e))(e)){let r=a?e[w0]:i[0],o=a?e.$val:e[r];if(!KJ(o))throw new Error((e=>`Invalid value for key ${e}`)(r));let s={keyId:t0(r),pattern:o};return n&&(s.searcher=_0(o,t)),s}let o={children:[],operator:i[0]};return i.forEach(t=>{let n=e[t];WJ(n)&&n.forEach(e=>{o.children.push(r(e))})}),o};return C0(e)||(e=T0(e)),r(e)}function A0(e,t){let n=e.matches;t.matches=[],ZJ(n)&&n.forEach(e=>{if(!ZJ(e.indices)||!e.indices.length)return;let{indices:n,value:r}=e,i={indices:n,value:r};e.key&&(i.key=e.key.src),e.idx>-1&&(i.refIndex=e.idx),t.matches.push(i)})}function S0(e,t){t.score=e.score}var E0=class{constructor(e,t={},n){this.options={...r0,...t},this.options.useExtendedSearch,this._keyStore=new QJ(this.options.keys),this.setCollection(e,n)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof a0))throw new Error("Incorrect 'index' type");this._myIndex=t||o0(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){ZJ(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){let t=[];for(let n=0,r=this._docs.length;n{let n=1;e.matches.forEach(({key:e,norm:r,score:i})=>{let a=e?e.weight:null;n*=Math.pow(0===i&&a?Number.EPSILON:i,(a||1)*(t?1:r))}),e.score=n})}(s,{ignoreFieldNorm:o}),i&&s.sort(a),VJ(t)&&t>-1&&(s=s.slice(0,t)),function(e,t,{includeMatches:n=r0.includeMatches,includeScore:r=r0.includeScore}={}){let i=[];return n&&i.push(A0),r&&i.push(S0),e.map(e=>{let{idx:n}=e,r={item:t[n],refIndex:n};return i.length&&i.forEach(t=>{t(e,r)}),r})}(s,this._docs,{includeMatches:n,includeScore:r})}_searchStringList(e){let t=_0(e,this.options),{records:n}=this._myIndex,r=[];return n.forEach(({v:e,i:n,n:i})=>{if(!ZJ(e))return;let{isMatch:a,score:o,indices:s}=t.searchIn(e);a&&r.push({item:e,idx:n,matches:[{score:o,value:e,norm:i,indices:s}]})}),r}_searchLogical(e){let t=$0(e,this.options),n=(e,t,r)=>{if(!e.children){let{keyId:n,searcher:i}=e,a=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(t,n),searcher:i});return a&&a.length?[{idx:r,item:t,matches:a}]:[]}let i=[];for(let a=0,o=e.children.length;a{if(ZJ(e)){let o=n(t,e,r);o.length&&(i[r]||(i[r]={idx:r,item:e,matches:[]},a.push(i[r])),o.forEach(({matches:e})=>{i[r].matches.push(...e)}))}}),a}_searchObjectList(e){let t=_0(e,this.options),{keys:n,records:r}=this._myIndex,i=[];return r.forEach(({$:e,i:r})=>{if(!ZJ(e))return;let a=[];n.forEach((n,r)=>{a.push(...this._findMatches({key:n,value:e[r],searcher:t}))}),a.length&&i.push({idx:r,item:e,matches:a})}),i}_findMatches({key:e,value:t,searcher:n}){if(!ZJ(t))return[];let r=[];if(WJ(t))t.forEach(({v:t,i,n:a})=>{if(!ZJ(t))return;let{isMatch:o,score:s,indices:l}=n.searchIn(t);o&&r.push({score:s,key:e,value:t,idx:i,norm:a,indices:l})});else{let{v:i,n:a}=t,{isMatch:o,score:s,indices:l}=n.searchIn(i);o&&r.push({score:s,key:e,value:i,norm:a,indices:l})}return r}};E0.version="7.1.0",E0.createIndex=o0,E0.parseIndex=function(e,{getFn:t=r0.getFn,fieldNormWeight:n=r0.fieldNormWeight}={}){let{keys:r,records:i}=e,a=new a0({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a},E0.config=r0,E0.parseQuery=$0,function(...e){x0.push(...e)}(class{constructor(e,{isCaseSensitive:t=r0.isCaseSensitive,ignoreDiacritics:n=r0.ignoreDiacritics,includeMatches:r=r0.includeMatches,minMatchCharLength:i=r0.minMatchCharLength,ignoreLocation:a=r0.ignoreLocation,findAllMatches:o=r0.findAllMatches,location:s=r0.location,threshold:l=r0.threshold,distance:c=r0.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:i,findAllMatches:o,ignoreLocation:a,location:s,threshold:l,distance:c},e=t?e:e.toLowerCase(),e=n?u0(e):e,this.pattern=e,this.query=function(e,t={}){return e.split("|").map(e=>{let n=e.trim().split(b0).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=n.length;eu(!0),onChange:e=>o(e.target.value),onBlur:r=>{u(!1),t.onChange?.(r.target.value,{row:n,column:t,cell:e}),t.onCommit?.(r.target.value,{row:n,column:t,cell:e})},disabled:r,inline:!0})}function F0({value:e,column:t,row:n,disabled:r}){let i=kC(),a=void 0!==t.transform?t.transform(e):e,[o,s]=(0,p.useState)(a??""),[l,c]=(0,p.useState)(a),[u,d]=(0,p.useState)(!1);if(a!==l&&(c(a),u||s(a??"")),void 0===t.onChange){let e=null!==a?MF(a,{unit:t.unit,currency:t.currency,percent:t.percent,locale:i}).number:null;return(0,v.jsx)("div",{className:"flex items-center justify-end text-nowrap "+(r?"pointer-events-none opacity-50":""),children:(0,v.jsx)("span",{children:e})})}return(0,v.jsx)(oC,{className:"text-right",name:`cell-${n.number}-${t.name}`,type:"number",value:o,onFocus:()=>d(!0),onChange:e=>s(Number.isNaN(e.target.valueAsNumber)?"":e.target.valueAsNumber),onBlur:r=>{d(!1),t.onChange?.(r.target.valueAsNumber,{row:n,column:t,cell:e}),t.onCommit?.(r.target.valueAsNumber,{row:n,column:t,cell:e})},disabled:r,inline:!0})}function j0({value:e,column:t,row:n,disabled:r}){let i=void 0!==t.transform?t.transform(e):e;if(void 0===t.onChange){let e=t.options.find(e=>e.value===i)?.name??i;return(0,v.jsx)("div",{className:"flex items-center justify-start text-nowrap "+(r?"pointer-events-none opacity-50":""),children:(0,v.jsx)("span",{children:e?.toString()})})}return(0,v.jsx)(cC,{name:`cell-${n.number}-${t.name}`,options:t.options,value:i??void 0,onChange:r=>{t.onChange?.(r.currentTarget.value,{row:n,column:t,cell:e}),t.onCommit?.(r.currentTarget.value,{row:n,column:t,cell:e})},disabled:r,inline:!0})}function B0({value:e,column:t,row:n,disabled:r}){let i=!0===(void 0!==t.transform?t.transform(e):e);return void 0===t.onChange?(0,v.jsx)("div",{className:"flex items-center justify-center "+(r?"pointer-events-none opacity-50":""),children:i?(0,v.jsx)(UF,{}):(0,v.jsx)(VF,{})}):(0,v.jsx)("div",{className:"flex items-center justify-center",children:(0,v.jsx)(eC,{name:`cell-${n.number}-${t.name}`,checked:i,onChange:()=>{t.onChange?.(!i,{row:n,column:t,cell:e}),t.onCommit?.(!i,{row:n,column:t,cell:e})},disabled:r})})}function z0({value:e,column:t,row:n,disabled:r}){let i=void 0!==t.transform?t.transform(e):e,a=i?`${i.getUTCFullYear().toString().padStart(4,"0")}-${(i.getUTCMonth()+1).toString().padStart(2,"0")}-${i.getUTCDate().toString().padStart(2,"0")}`:"",o=i?`${i.getUTCHours().toString().padStart(2,"0")}:${i.getUTCMinutes().toString().padStart(2,"0")}:${i.getUTCSeconds().toString().padStart(2,"0")}`:"",s=t.date&&!t.time?a:!t.date&&t.time?o:`${a}T${o}`,[l,c]=(0,p.useState)(s),[u,d]=(0,p.useState)(s),[h,m]=(0,p.useState)(!1);if(s!==u&&(d(s),h||c(s)),void 0===t.onChange){let e="";return e=t.date&&!t.time?a:!t.date&&t.time?o:`${a} ${o}`,(0,v.jsx)("div",{className:"flex items-center justify-start text-nowrap "+(r?"pointer-events-none opacity-50":""),children:(0,v.jsx)("span",{children:e})})}let f=e=>{let n="";return n=t.date&&!t.time?e:!t.date&&t.time?`${a}T${e}:00.000Z`:`${e}:00.000Z`,new Date(n)};return(0,v.jsx)(oC,{name:`cell-${n.number}-${t.name}`,type:t.date&&!t.time?"date":!t.date&&t.time?"time":"datetime-local",value:l,onFocus:()=>m(!0),onChange:e=>c(e.target.value),onBlur:r=>{m(!1),t.onChange?.(f(r.target.value),{row:n,column:t,cell:e}),t.onCommit?.(f(r.target.value),{row:n,column:t,cell:e})},disabled:r,inline:!0})}function q0({column:e,row:t,disabled:n}){return(0,v.jsx)("div",{className:"flex items-center justify-center "+(n?"pointer-events-none opacity-50":""),children:e.render(t)})}function U0({justify:e}){return(0,v.jsx)("div",{className:`flex items-center ${e} text-nowrap opacity-50 select-none`,children:(0,v.jsx)("span",{children:"—"})})}(0,p.memo)(function({color:e,result:{category:{id:t,title:n,icon:r,color:i="primary"},items:a},focusCategory:o,focusItem:s,focusRef:l,onNavigate:c}){let u=(0,p.useCallback)(e=>o===t&&s===e,[o,s,t]);if(0!==a.length)return(0,v.jsxs)("div",{className:`border-b select-none ${js[e]}`,children:[(0,v.jsxs)("div",{className:`flex items-center justify-start gap-2 p-2 ${pl[i]}`,children:[r&&(0,v.jsx)("div",{className:"h-4 w-4",children:r}),(0,v.jsx)("div",{className:"font-alternative text-xs font-light uppercase",children:n})]}),(0,v.jsx)("ul",{children:a.map((e,t)=>(0,v.jsx)("li",{children:(0,v.jsx)(R0,{item:e,focus:u(t),ref:u(t)?l:void 0,onNavigate:c})},t))})]})}),(0,p.memo)(function({index:e,column:t,sort:n,onSort:r=()=>{},status:i,headColor:a,statusColor:o}){let s,l="loading"===i,c=null!==i;switch(t.type){case"string":s=(0,v.jsx)(I0,{column:t});break;case"select":s=(0,v.jsx)(M0,{column:t});break;case"number":s=(0,v.jsx)(L0,{column:t});break;case"boolean":s=(0,v.jsx)(N0,{column:t});break;case"date":s=(0,v.jsx)(D0,{column:t});break;case"node":s=(0,v.jsx)(P0,{column:t})}let u=["string","date","select"].includes(t.type)?"flex items-center justify-start":["boolean","node"].includes(t.type)?"flex items-center justify-center":"flex flex-row-reverse items-center justify-start",p=l?Is[o]:Is[a],d=dl[a];return(0,v.jsx)("th",{className:`group/table-head border-y px-4 transition-colors ${p} ${d} ${Fs} ${l?"pointer-events-none animate-pulse":c?"pointer-events-none opacity-50":""}`,"aria-busy":l,"aria-disabled":c||void 0,children:(0,v.jsxs)("div",{className:`gap-2 ${u}`,children:[(0,v.jsxs)("div",{className:"flex items-center gap-1",children:[s,t.description&&(0,v.jsx)(sj,{type:"help",size:"md",children:(0,v.jsx)("p",{className:"w-max max-w-full",children:t.description})})]}),t.sortable&&(0,v.jsx)("div",{className:"transition-opacity "+(n?.index===e?"opacity-100":"opacity-0 group-hover/table-head:opacity-100"),children:(0,v.jsx)(Bw,{size:"md",icon:(0,v.jsx)(Yo,{direction:n?.index===e&&"desc"===n?.direction?"down":"up"}),color:a,onClick:()=>!c&&r({column:t}),disabled:c})})]})})}),(0,p.memo)(function({checked:e,onCheck:t,checkColor:n,headColor:r}){let i=Is[r],a=dl[r];return(0,v.jsx)("th",{className:`h-8 w-8 border-y px-1.5 transition-colors ${i} ${Fs} ${a}`,children:(0,v.jsx)(eC,{id:"table-head-checkbox",name:"table-head-checkbox",size:"sm",icon:"all"===e?(0,v.jsx)(UF,{}):(0,v.jsx)(KF,{}),color:n,checked:["all","partial"].includes(e),onChange:()=>t({value:"all"!==e})})})});var W0=(0,p.memo)(function({value:e,column:t,row:n,alternate:r,checked:i,active:a,status:o,error:s,onActivate:l,activeColor:c,alternateColor:u,checkColor:p,indexColor:d,statusColor:h}){let m,f="loading"===o,g="loading"===o||"disabled"===o,y="boolean"===t.type||"node"===t.type,b="string"===t.type||"select"===t.type||"date"===t.type,x="number"===t.type?"justify-end":y?"justify-center":"justify-start";if(null===e&&"node"!==t.type)m=(0,v.jsx)(U0,{justify:x});else switch(t.type){case"string":m=(0,v.jsx)(O0,{value:e,column:t,row:n,disabled:g});break;case"select":m=(0,v.jsx)(j0,{value:e,column:t,row:n,disabled:g});break;case"number":m=(0,v.jsx)(F0,{value:e,column:t,row:n,disabled:g});break;case"boolean":m=(0,v.jsx)(B0,{value:e,column:t,row:n,disabled:g});break;case"date":m=(0,v.jsx)(z0,{value:e,column:t,row:n,disabled:g});break;case"node":m=(0,v.jsx)(q0,{column:t,row:n,disabled:g})}let _=f?Is[h]:i?Is[p]:a?Is[c]:r?Is[u]:"",k=s&&s.length>0?pl.flama:t.index?pl[d]:i?dl[p]:r?dl[u]:"",w=t.index?"font-semibold":"",C=f?"animate-pulse":"",T=s&&s.length>0&&(0,v.jsx)(sj,{type:"caution",size:"sm",children:(0,v.jsx)("ul",{className:"w-max max-w-full",children:s.map((e,t)=>(0,v.jsx)("li",{children:e},t))})});return(0,v.jsx)("td",{className:`border-y px-4 transition-colors ${_} ${k} ${Fs} ${w} ${C}`,onMouseOver:n=>!g&&l(n,{value:!0,cell:e,column:t}),onMouseMove:n=>!g&&l(n,{value:!0,cell:e,column:t}),onMouseLeave:n=>!g&&l(n,{value:!1,cell:e,column:t}),children:(0,v.jsxs)("div",{className:"flex items-center gap-1 "+(y?"justify-center":""),children:[b&&T,(0,v.jsx)("div",{className:y?"":"grow",children:m}),!b&&T]})})}),K0=(0,p.memo)(function({id:e,alternate:t,checked:n,onCheck:r,status:i=null,alternateColor:a,checkColor:o,statusColor:s}){let l=(0,p.useCallback)(()=>r({value:!n}),[n,r]),c="loading"===i,u="loading"===i||"disabled"===i,d=c?Is[s]:n?Is[o]:t?Is[a]:"",h=n?dl[o]:t?dl[a]:"";return(0,v.jsx)("td",{className:`h-8 w-8 border-y px-1.5 transition-colors ${d} ${h} ${Fs} ${c?"pointer-events-none animate-pulse":u?"pointer-events-none opacity-50":""}`,children:(0,v.jsx)(eC,{id:e,name:e,size:"sm",color:o,checked:n,onChange:l,disabled:u})})});(0,p.memo)(function({row:e,columns:t,position:n,isChecked:r,onCheck:i,isActive:a,onActivate:o,getStatus:s,getError:l,activeColor:c,alternateColor:u,checkColor:d,indexColor:h,statusColor:m}){let f=n%2!=0,g=e.cells.filter((e,n)=>t[n].index),y=s({row:e}),b=l({row:e}),x=(0,p.useCallback)(({value:t})=>i({value:t,rows:[e]}),[i,e]),_=(0,p.useCallback)(({cell:n,column:r})=>a?a({row:e,cell:n,column:r,indexes:e.cells.filter((e,n)=>t[n].index)}):null,[t,e,a]),k=(0,p.useCallback)((n,{value:r,cell:i,column:a})=>o?o(n,{value:r,row:e,cell:i,column:a,indexes:e.cells.filter((e,n)=>t[n].index)}):null,[t,e,o]);return(0,v.jsxs)("tr",{className:"h-8","aria-busy":"loading"===y,"aria-disabled":!!y||void 0,children:[null!==r&&(0,v.jsx)(K0,{id:`table-row-${n}-checkbox`,alternate:f,checked:r,onCheck:x,status:y,alternateColor:u,checkColor:d,statusColor:m}),t.map((t,n)=>{let i=e.cells[n]??null,a=s({column:t}),o=s({row:e,column:t,cell:i,indexes:g})??a??y,p=l({column:t}),x=l({row:e,column:t,cell:i,indexes:g})??p??b;return(0,v.jsx)(W0,{value:i,row:e,column:t,active:_({cell:i,column:t}),alternate:f,checked:r,status:o,error:x,onActivate:k,activeColor:c,alternateColor:u,checkColor:d,indexColor:h,statusColor:m},n)})]})});var V0={vortico:"after:bg-vortico-500",bosque:"after:bg-bosque-500",bruma:"after:bg-bruma-500",ciclon:"after:bg-ciclon-500",flama:"after:bg-flama-500",primary:"after:bg-primary-500","vortico-light":"after:bg-vortico-200","bosque-light":"after:bg-bosque-200","bruma-light":"after:bg-bruma-200","ciclon-light":"after:bg-ciclon-200","flama-light":"after:bg-flama-200","primary-light":"after:bg-primary-200","vortico-dark":"after:bg-vortico-800","bosque-dark":"after:bg-bosque-800","bruma-dark":"after:bg-bruma-800","ciclon-dark":"after:bg-ciclon-800","flama-dark":"after:bg-flama-800","primary-dark":"after:bg-primary-800"};(0,p.memo)(function({color:e,name:t,tab:n,selected:r,registerButton:i,onSelect:a,onKeyDown:o}){let s=(0,p.useCallback)(e=>i(n.id,e),[i,n.id]);return(0,v.jsxs)("button",{ref:s,type:"button",role:"tab",id:OF(t,n.id),"aria-selected":r,"aria-controls":FF(t,n.id),tabIndex:r?0:-1,className:`relative flex h-full cursor-pointer items-center justify-center gap-2 px-4 py-1 transition-colors lg:px-6 ${Ks} ${r?`after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:content-[''] ${V0[e]}`:""}`,onClick:()=>a(n.id),onKeyDown:e=>o(e,n.id),children:[(0,v.jsx)("div",{className:`h-4 transition-colors lg:h-5 ${rl} ${r?`${pl[e]}`:""}`,children:n.icon}),(0,v.jsx)("span",{className:`font-alternative hidden truncate font-medium text-nowrap uppercase transition-colors select-none lg:block ${Xs.sm} ${r?`${pl[e]}`:""}`,children:n.name})]})}),(0,p.memo)(function({id:e,type:t,message:n,onClose:r}){let i=(0,p.useCallback)(()=>r(e),[r,e]);return(0,v.jsx)(PV.div,{className:"w-full",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:(0,v.jsx)(oj,{type:t,onClose:i,children:n})})});var G0=["minimize","maximize","close"],Z0="bg-primary-900 shadow-primary-300 overflow-hidden shadow-md ring-1 ring-inset";function Y0({title:e,controls:t,onMinimize:n,onMaximize:r,onClose:i}){return(0,v.jsxs)("div",{className:"bg-primary-800 flex h-8 w-full flex-none items-center gap-4 px-4",children:[(0,v.jsx)("span",{className:"text-primary-200 font-alternative min-w-0 flex-1 truncate text-sm leading-8 font-semibold",children:e}),(0,v.jsxs)("div",{className:"flex flex-none items-center justify-end gap-x-2",children:[t.includes("minimize")&&(0,v.jsx)("button",{className:`h-4 w-4 cursor-pointer rounded-full ${Ws}`,onClick:n,"aria-label":"Minimize Window",children:(0,v.jsx)(HF,{className:"text-primary-300 hover:text-ciclon h-full w-full transition-colors duration-200"})}),t.includes("maximize")&&(0,v.jsx)("button",{className:`h-4 w-4 cursor-pointer rounded-full ${Ws}`,onClick:r,"aria-label":"Maximize Window",children:(0,v.jsx)(XF,{className:"text-primary-300 hover:text-bosque h-full w-full transition-colors duration-200"})}),t.includes("close")&&(0,v.jsx)("button",{className:`h-4 w-4 cursor-pointer rounded-full ${Ws}`,onClick:i,"aria-label":"Close Window",children:(0,v.jsx)(QF,{className:"text-primary-300 hover:text-flama h-full w-full transition-colors duration-200"})})]})]})}function H0({title:e,controls:t=G0,autoScroll:n,contentClassName:r,className:i,children:a}){let[o,s]=(0,p.useState)("open"),l=function(){!$V.current&&AV();let[e]=(0,p.useState)(TV.current);return e}(),c=(0,p.useCallback)(()=>s(e=>"open"===e?"closed":"open"),[]),u=(0,p.useCallback)(()=>s("full"),[]),d=(0,p.useCallback)(()=>s("closed"),[]);Nw({open:"full"===o,onClose:c,escape:!0,outsidePointer:!1});let h=(0,p.useCallback)(e=>{if(e&&n?.current){let t=e.scrollTop+(n.current.getBoundingClientRect().top-e.getBoundingClientRect().top)-e.clientHeight/2;e.scrollTo({top:t,left:0,behavior:"smooth"})}},[n]),m=l?{duration:0}:{type:"tween",duration:.25,ease:"easeOut"},f=l?{duration:0}:{type:"tween",duration:.2,ease:"easeOut"},g=l?{duration:0}:{type:"spring",stiffness:320,damping:32},y={title:e,controls:t,onMinimize:c,onMaximize:u,onClose:d};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(kj,{children:"full"===o&&(0,v.jsx)(PV.div,{className:"bg-primary-950/30 fixed inset-0 z-40 backdrop-blur-sm",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:f,"aria-hidden":!0,onClick:c},"backdrop")}),(0,v.jsx)(kj,{children:"full"===o&&(0,v.jsxs)(PV.div,{initial:{opacity:0,scale:.96},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.96},transition:g,"aria-modal":!0,role:"dialog",className:`${Z0} ${Hs} fixed inset-x-4 inset-y-[5vh] ${Ys} flex flex-col sm:inset-x-6 md:inset-x-8 ${i||""}`,children:[(0,v.jsx)(Y0,{...y}),(0,v.jsx)("div",{ref:h,className:`min-h-0 flex-1 overflow-auto ${r??"bg-primary-900"}`,children:a})]},"full-card")}),"full"!==o&&(0,v.jsxs)("div",{className:`${Z0} ${Hs} relative w-full ${i||""}`,children:[(0,v.jsx)(Y0,{...y}),(0,v.jsx)(PV.div,{initial:{height:"closed"===o?0:"auto"},animate:{height:"closed"===o?0:"auto"},transition:m,className:"bg-primary-900 w-full overflow-hidden",children:(0,v.jsx)("div",{ref:h,className:`w-full overflow-auto ${r??"max-h-[80vh]"}`,children:a})})]})]})}class X0{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function Q0(e,t){const n={},r={};for(const t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new X0(n,r,t)}function J0(e){return e.toLowerCase()}X0.prototype.normal={},X0.prototype.property={},X0.prototype.space=void 0;class e1{constructor(e,t){this.attribute=t,this.property=e}}e1.prototype.attribute="",e1.prototype.booleanish=!1,e1.prototype.boolean=!1,e1.prototype.commaOrSpaceSeparated=!1,e1.prototype.commaSeparated=!1,e1.prototype.defined=!1,e1.prototype.mustUseProperty=!1,e1.prototype.number=!1,e1.prototype.overloadedBoolean=!1,e1.prototype.property="",e1.prototype.spaceSeparated=!1,e1.prototype.space=void 0;let t1=0;const n1=c1(),r1=c1(),i1=c1(),a1=c1(),o1=c1(),s1=c1(),l1=c1();function c1(){return 2**++t1}const u1=Object.keys(r);class p1 extends e1{constructor(e,t,n,i){let a=-1;if(super(e,t),d1(this,"space",i),"number"==typeof n)for(;++a"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function f1(e,t){return t in e?e[t]:t}function g1(e,t){return f1(e,t.toLowerCase())}const y1=h1({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:s1,acceptCharset:o1,accessKey:o1,action:null,allow:null,allowFullScreen:n1,allowPaymentRequest:n1,allowUserMedia:n1,alpha:n1,alt:null,as:null,async:n1,autoCapitalize:null,autoComplete:o1,autoFocus:n1,autoPlay:n1,blocking:o1,capture:null,charSet:null,checked:n1,cite:null,className:o1,closedBy:null,colorSpace:null,cols:a1,colSpan:a1,command:null,commandFor:null,content:null,contentEditable:r1,controls:n1,controlsList:o1,coords:a1|s1,crossOrigin:null,data:null,dateTime:null,decoding:null,default:n1,defer:n1,dir:null,dirName:null,disabled:n1,download:i1,draggable:r1,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:n1,formTarget:null,headers:o1,height:a1,hidden:i1,high:a1,href:null,hrefLang:null,htmlFor:o1,httpEquiv:o1,id:null,imageSizes:null,imageSrcSet:null,inert:n1,inputMode:null,integrity:null,is:null,isMap:n1,itemId:null,itemProp:o1,itemRef:o1,itemScope:n1,itemType:o1,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:n1,low:a1,manifest:null,max:null,maxLength:a1,media:null,method:null,min:null,minLength:a1,multiple:n1,muted:n1,name:null,nonce:null,noModule:n1,noValidate:n1,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:n1,optimum:a1,pattern:null,ping:o1,placeholder:null,playsInline:n1,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:n1,referrerPolicy:null,rel:o1,required:n1,reversed:n1,rows:a1,rowSpan:a1,sandbox:o1,scope:null,scoped:n1,seamless:n1,selected:n1,shadowRootClonable:n1,shadowRootCustomElementRegistry:n1,shadowRootDelegatesFocus:n1,shadowRootMode:null,shadowRootSerializable:n1,shape:null,size:a1,sizes:null,slot:null,span:a1,spellCheck:r1,src:null,srcDoc:null,srcLang:null,srcSet:null,start:a1,step:null,style:null,tabIndex:a1,target:null,title:null,translate:null,type:null,typeMustMatch:n1,useMap:null,value:r1,width:a1,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:o1,axis:null,background:null,bgColor:null,border:a1,borderColor:null,bottomMargin:a1,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:n1,declare:n1,event:null,face:null,frame:null,frameBorder:null,hSpace:a1,leftMargin:a1,link:null,longDesc:null,lowSrc:null,marginHeight:a1,marginWidth:a1,noResize:n1,noHref:n1,noShade:n1,noWrap:n1,object:null,profile:null,prompt:null,rev:null,rightMargin:a1,rules:null,scheme:null,scrolling:r1,standby:null,summary:null,text:null,topMargin:a1,valueType:null,version:null,vAlign:null,vLink:null,vSpace:a1,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:n1,disablePictureInPicture:n1,disableRemotePlayback:n1,exportParts:s1,part:o1,prefix:null,property:null,results:a1,security:null,unselectable:null},space:"html",transform:g1}),b1=h1({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:l1,accentHeight:a1,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:a1,amplitude:a1,arabicForm:null,ascent:a1,attributeName:null,attributeType:null,azimuth:a1,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:a1,by:null,calcMode:null,capHeight:a1,className:o1,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:a1,diffuseConstant:a1,direction:null,display:null,dur:null,divisor:a1,dominantBaseline:null,download:n1,dx:null,dy:null,edgeMode:null,editable:null,elevation:a1,enableBackground:null,end:null,event:null,exponent:a1,externalResourcesRequired:null,fill:null,fillOpacity:a1,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:s1,g2:s1,glyphName:s1,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:a1,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:a1,horizOriginX:a1,horizOriginY:a1,id:null,ideographic:a1,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:a1,k:a1,k1:a1,k2:a1,k3:a1,k4:a1,kernelMatrix:l1,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:a1,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:a1,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:a1,overlineThickness:a1,paintOrder:null,panose1:null,path:null,pathLength:a1,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:o1,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:a1,pointsAtY:a1,pointsAtZ:a1,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:l1,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:l1,rev:l1,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:l1,requiredFeatures:l1,requiredFonts:l1,requiredFormats:l1,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:a1,specularExponent:a1,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:a1,strikethroughThickness:a1,string:null,stroke:null,strokeDashArray:l1,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:a1,strokeOpacity:a1,strokeWidth:null,style:null,surfaceScale:a1,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:l1,tabIndex:a1,tableValues:null,target:null,targetX:a1,targetY:a1,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:l1,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:a1,underlineThickness:a1,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:a1,values:null,vAlphabetic:a1,vMathematical:a1,vectorEffect:null,vHanging:a1,vIdeographic:a1,version:null,vertAdvY:a1,vertOriginX:a1,vertOriginY:a1,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:a1,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:f1}),v1=h1({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),x1=h1({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:g1}),_1=h1({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),k1=Q0([m1,y1,v1,x1,_1],"html"),w1=Q0([m1,b1,v1,x1,_1],"svg");function C1(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){-1===r&&(r=n.length,a=!0);const e=n.slice(i,r).trim();!e&&a||t.push(e),i=r+1,r=n.indexOf(",",i)}return t}const T1=/[#.]/g,$1=/[A-Z]/g,A1=/-[a-z]/g,S1=/^data[-\w.:]+$/i;function E1(e,t){const n=J0(t);let r=t,i=e1;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&S1.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(A1,I1);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!A1.test(e)){let n=e.replace($1,R1);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=p1}return new i(r,t)}function R1(e){return"-"+e.toLowerCase()}function I1(e){return e.charAt(1).toUpperCase()}function L1(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function N1(e,t,n){const r=n?function(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}(n):void 0;return function(n,i,...a){let o;if(null==n){o={type:"root",children:[]};const e=i;a.unshift(e)}else{o=function(e,t){const n=e||"",r={};let i,a,o=0;for(;o":"")+")"})}return u;function u(){let c,u,p,d=u2;if((!t||a(i,s,l[l.length-1]||void 0))&&(d=function(e){return Array.isArray(e)?e:"number"==typeof e?[true,e]:null==e?u2:[e]}(n(i,l)),d[0]===p2))return d;if("children"in i&&i.children){const t=i;if(t.children&&"skip"!==d[0])for(u=(r?t.children.length:-1)+o,p=l.concat(t);u>-1&&ul&&(l=e):e&&(void 0!==l&&l>-1&&s.push("\n".repeat(l)||" "),l=-1,s.push(e))}return s.join("")}(u);let d;try{d=c2.default.renderToString(p,{...t,displayMode:l,throwOnError:!0})}catch(i){const a=i,o=a.name.toLowerCase();n.message("Could not render math with KaTeX",{ancestors:[...r,e],cause:a,place:e.position,ruleId:o,source:"rehype-katex"});try{d=c2.default.renderToString(p,{...t,displayMode:l,strict:"ignore",throwOnError:!1})}catch{d=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(i)},children:[{type:"text",value:p}]}]}}"string"==typeof d&&(d=function(e,t){return B1(t?.fragment?function(e){const t=document.createElement("template");return t.innerHTML=e,t.content}(e):U1.parseFromString(e,"text/html"),{})||{type:"root",children:[]}}(d,{fragment:!0}).children);const h=c.children.indexOf(u);return c.children.splice(h,1,...d),"skip"})}}function g2(){}function y2(){}const b2=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,v2=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,x2={};function _2(e,t){return((t||x2).jsx?v2:b2).test(e)}const k2=/[ \t\n\f\r]/g;function w2(e){return""===e.replace(k2,"")}const C2={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var T2=n(75333);const $2=S2("end"),A2=S2("start");function S2(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function E2(e){return e&&"object"==typeof e?"position"in e||"type"in e?I2(e.position):"start"in e||"end"in e?I2(e):"line"in e||"column"in e?R2(e):"":""}function R2(e){return L2(e&&e.line)+":"+L2(e&&e.column)}function I2(e){return R2(e&&e.start)+"-"+R2(e&&e.end)}function L2(e){return e&&"number"==typeof e?e:1}class N2 extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},a=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=o?o.line:void 0,this.name=E2(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}N2.prototype.file="",N2.prototype.name="",N2.prototype.reason="",N2.prototype.message="",N2.prototype.stack="",N2.prototype.column=void 0,N2.prototype.line=void 0,N2.prototype.ancestors=void 0,N2.prototype.cause=void 0,N2.prototype.fatal=void 0,N2.prototype.place=void 0,N2.prototype.ruleId=void 0,N2.prototype.source=void 0;const M2={}.hasOwnProperty,D2=new Map,P2=/[A-Z]/g,O2=new Set(["table","tbody","thead","tfoot","tr"]),F2=new Set(["td","th"]),j2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function B2(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let i=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(i=w1,e.schema=i),e.ancestors.push(t);const a=K2(e,t.tagName,!1),o=function(e,t){const n={};let r,i;for(i in t.properties)if("children"!==i&&M2.call(t.properties,i)){const a=W2(e,i,t.properties[i]);if(a){const[i,o]=a;e.tableCellAlignToStyle&&"align"===i&&"string"==typeof o&&F2.has(t.tagName)?r=o:n[i]=o}}return r&&((n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r),n}(e,t);let s=U2(e,t);return O2.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&w2(t.value):w2(t));var t})),z2(e,o,a,t),q2(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}V2(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let i=r;"svg"===t.name&&"html"===r.space&&(i=w1,e.schema=i),e.ancestors.push(t);const a=null===t.name?e.Fragment:K2(e,t.name,!0),o=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];g2(t.type);const i=t.expression;g2(i.type);const a=i.properties[0];g2(a.type),Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else V2(e,t.position);else{const i=r.name;let a;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];g2(t.type),a=e.evaluater.evaluateExpression(t.expression)}else V2(e,t.position);else a=null===r.value||r.value;n[i]=a}return n}(e,t),s=U2(e,t);return z2(e,o,a,t),q2(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);V2(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return q2(r,U2(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function z2(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function q2(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function U2(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:D2;for(;++ri?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o0?(e4(e,e.length,0,t),e):t}class n4{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&r4(this.left,n),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),r4(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),r4(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e-1&&e.test(String.fromCharCode(t))}}function w4(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return function(r){return v4(r)?(e.enter(n),o(r)):t(r)};function o(r){return v4(r)&&a++a))return;const n=t.events.length;let i,s,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(i){s=t.events[l][1].end;break}i=!0}for(y(o),e=n;er;){const r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function b(){r.write([null]),i=void 0,r=void 0,t.containerState._closeFlow=void 0}}},$4={tokenize:function(e,t,n){return w4(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},A4={partial:!0,tokenize:function(e,t,n){return function(t){return v4(t)?w4(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||y4(e)?t(e):n(e)}}},S4={resolve:function(e){return i4(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):y4(t)?e.check(E4,a,i)(t):(e.consume(t),r)}function i(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function a(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},E4={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),w4(e,i,"linePrefix")};function i(i){if(null===i||y4(i))return n(i);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}},R4={tokenize:function(e){const t=this,n=e.attempt(A4,function(r){if(null!==r)return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n;e.consume(r)},e.attempt(this.parser.constructs.flowInitial,r,w4(e,e.attempt(this.parser.constructs.flow,r,e.attempt(S4,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}},I4={resolveAll:D4()},L4=M4("string"),N4=M4("text");function M4(e){return{resolveAll:D4("text"===e?P4:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return l(e)?i(e):o(e)}function o(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),i(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;const t=r[e];let i=-1;if(t)for(;++i=3&&(null===a||y4(a))?(e.exit("thematicBreak"),t(a)):n(a)}function o(t){return t===r?(e.consume(t),i++,o):(e.exit("thematicBreakSequence"),v4(t)?w4(e,a,"whitespace")(t):a(t))}}},F4={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(A4,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,w4(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!v4(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(B4,t,i)(n))});function i(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,w4(e,e.attempt(F4,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,o=0;return function(t){const i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:m4(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(O4,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return m4(t)&&++o<10?(e.consume(t),s):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(A4,r.interrupt?n:c,e.attempt(j4,p,u))}function c(e){return r.containerState.initialBlankLine=!0,a++,p(e)}function u(t){return v4(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),p):n(t)}function p(n){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},j4={partial:!0,tokenize:function(e,t,n){const r=this;return w4(e,function(e){const i=r.events[r.events.length-1];return!v4(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},B4={partial:!0,tokenize:function(e,t,n){const r=this;return w4(e,function(e){const i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},z4={continuation:{tokenize:function(e,t,n){const r=this;return function(t){return v4(t)?w4(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):i(t)};function i(r){return e.attempt(z4,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return v4(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};function q4(e,t,n,r,i,a,o,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){return 60===t?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),p):null===t||32===t||41===t||h4(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),m(t))};function p(n){return 62===n?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(s),p(t)):null===t||60===t||y4(t)?n(t):(e.consume(t),92===t?h:d)}function h(t){return 60===t||62===t||92===t?(e.consume(t),d):d(t)}function m(i){return u||null!==i&&41!==i&&!b4(i)?u999||null===p||91===p||93===p&&!s||94===p&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):93===p?(e.exit(a),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):y4(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(t){return null===t||91===t||93===t||y4(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),s||(s=!v4(t)),92===t?p:u)}function p(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function W4(e,t,n,r,i,a){let o;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=40===t?41:t,s):n(t)};function s(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),s(o)):null===t?n(t):y4(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),w4(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===o||null===t||y4(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===o||92===t?(e.consume(t),c):c(t)}}function K4(e,t){let n;return function r(i){return y4(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):v4(i)?w4(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function V4(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const G4={name:"definition",tokenize:function(e,t,n){const r=this;let i;return function(t){return e.enter("definition"),function(t){return U4.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function a(t){return i=V4(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o):n(t)}function o(t){return b4(t)?K4(e,s)(t):s(t)}function s(t){return q4(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(Z4,c,c)(t)}function c(t){return v4(t)?w4(e,u,"whitespace")(t):u(t)}function u(a){return null===a||y4(a)?(e.exit("definition"),r.parser.defined.push(i),t(a)):n(a)}}},Z4={partial:!0,tokenize:function(e,t,n){return function(t){return b4(t)?K4(e,r)(t):n(t)};function r(t){return W4(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return v4(t)?w4(e,a,"whitespace")(t):a(t)}function a(e){return null===e||y4(e)?t(e):n(e)}}},Y4={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),w4(e,i,"linePrefix",5)(t)};function i(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?a(e):n(e)}function a(t){return null===t?s(t):y4(t)?e.attempt(H4,a,s)(t):(e.enter("codeFlowValue"),o(t))}function o(t){return null===t||y4(t)?(e.exit("codeFlowValue"),a(t)):(e.consume(t),o)}function s(n){return e.exit("codeIndented"),t(n)}}},H4={partial:!0,tokenize:function(e,t,n){const r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):y4(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):w4(e,a,"linePrefix",5)(t)}function a(e){const a=r.events[r.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):y4(e)?i(e):n(e)}}},X4={name:"headingAtx",resolve:function(e,t){let n,r,i=e.length-2,a=3;return"whitespace"===e[a][1].type&&(a+=2),i-2>a&&"whitespace"===e[i][1].type&&(i-=2),"atxHeadingSequence"===e[i][1].type&&(a===i-1||i-4>a&&"whitespace"===e[i-2][1].type)&&(i-=a+1===i?2:4),i>a&&(n={type:"atxHeadingText",start:e[a][1].start,end:e[i][1].end},r={type:"chunkText",start:e[a][1].start,end:e[i][1].end,contentType:"text"},e4(e,a,i-a+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),i(t)}(t)};function i(t){return 35===t&&r++<6?(e.consume(t),i):null===t||b4(t)?(e.exit("atxHeadingSequence"),a(t)):n(t)}function a(n){return 35===n?(e.enter("atxHeadingSequence"),o(n)):null===n||y4(n)?(e.exit("atxHeading"),t(n)):v4(n)?w4(e,a,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function o(t){return 35===t?(e.consume(t),o):(e.exit("atxHeadingSequence"),a(t))}function s(t){return null===t||35===t||b4(t)?(e.exit("atxHeadingText"),a(t)):(e.consume(t),s)}}},Q4={name:"setextUnderline",resolveTo:function(e,t){let n,r,i,a=e.length;for(;a--;)if("enter"===e[a][0]){if("content"===e[a][1].type){n=a;break}"paragraph"===e[a][1].type&&(r=a)}else"content"===e[a][1].type&&e.splice(a,1),i||"definition"!==e[a][1].type||(i=a);const o={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",o,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=o,e.push(["exit",o,t]),e},tokenize:function(e,t,n){const r=this;let i;return function(t){let o,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){o="paragraph"===r.events[s][1].type;break}return r.parser.lazy[r.now().line]||!r.interrupt&&!o?n(t):(e.enter("setextHeadingLine"),i=t,function(t){return e.enter("setextHeadingLineSequence"),a(t)}(t))};function a(t){return t===i?(e.consume(t),a):(e.exit("setextHeadingLineSequence"),v4(t)?w4(e,o,"lineSuffix")(t):o(t))}function o(r){return null===r||y4(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}},J4=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],e3=["pre","script","style","textarea"],t3={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){const r=this;let i,a,o,s,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(s){return 33===s?(e.consume(s),u):47===s?(e.consume(s),a=!0,h):63===s?(e.consume(s),i=3,r.interrupt?t:M):u4(s)?(e.consume(s),o=String.fromCharCode(s),m):n(s)}function u(a){return 45===a?(e.consume(a),i=2,p):91===a?(e.consume(a),i=5,s=0,d):u4(a)?(e.consume(a),i=4,r.interrupt?t:M):n(a)}function p(i){return 45===i?(e.consume(i),r.interrupt?t:M):n(i)}function d(i){return i==="CDATA[".charCodeAt(s++)?(e.consume(i),6===s?r.interrupt?t:$:d):n(i)}function h(t){return u4(t)?(e.consume(t),o=String.fromCharCode(t),m):n(t)}function m(s){if(null===s||47===s||62===s||b4(s)){const l=47===s,c=o.toLowerCase();return l||a||!e3.includes(c)?J4.includes(o.toLowerCase())?(i=6,l?(e.consume(s),f):r.interrupt?t(s):$(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?g(s):y(s)):(i=1,r.interrupt?t(s):$(s))}return 45===s||p4(s)?(e.consume(s),o+=String.fromCharCode(s),m):n(s)}function f(i){return 62===i?(e.consume(i),r.interrupt?t:$):n(i)}function g(t){return v4(t)?(e.consume(t),g):C(t)}function y(t){return 47===t?(e.consume(t),C):58===t||95===t||u4(t)?(e.consume(t),b):v4(t)?(e.consume(t),y):C(t)}function b(t){return 45===t||46===t||58===t||95===t||p4(t)?(e.consume(t),b):v(t)}function v(t){return 61===t?(e.consume(t),x):v4(t)?(e.consume(t),v):y(t)}function x(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,_):v4(t)?(e.consume(t),x):k(t)}function _(t){return t===l?(e.consume(t),l=null,w):null===t||y4(t)?n(t):(e.consume(t),_)}function k(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||b4(t)?v(t):(e.consume(t),k)}function w(e){return 47===e||62===e||v4(e)?y(e):n(e)}function C(t){return 62===t?(e.consume(t),T):n(t)}function T(t){return null===t||y4(t)?$(t):v4(t)?(e.consume(t),T):n(t)}function $(t){return 45===t&&2===i?(e.consume(t),R):60===t&&1===i?(e.consume(t),I):62===t&&4===i?(e.consume(t),D):63===t&&3===i?(e.consume(t),M):93===t&&5===i?(e.consume(t),N):!y4(t)||6!==i&&7!==i?null===t||y4(t)?(e.exit("htmlFlowData"),A(t)):(e.consume(t),$):(e.exit("htmlFlowData"),e.check(n3,P,A)(t))}function A(t){return e.check(r3,S,P)(t)}function S(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),E}function E(t){return null===t||y4(t)?A(t):(e.enter("htmlFlowData"),$(t))}function R(t){return 45===t?(e.consume(t),M):$(t)}function I(t){return 47===t?(e.consume(t),o="",L):$(t)}function L(t){if(62===t){const n=o.toLowerCase();return e3.includes(n)?(e.consume(t),D):$(t)}return u4(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),L):$(t)}function N(t){return 93===t?(e.consume(t),M):$(t)}function M(t){return 62===t?(e.consume(t),D):45===t&&2===i?(e.consume(t),M):$(t)}function D(t){return null===t||y4(t)?(e.exit("htmlFlowData"),P(t)):(e.consume(t),D)}function P(n){return e.exit("htmlFlow"),t(n)}}},n3={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(A4,t,n)}}},r3={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return y4(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},i3={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},a3={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,i={partial:!0,tokenize:function(e,t,n){let i=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(t){return e.enter("codeFencedFence"),v4(t)?w4(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===a?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===a?(i++,e.consume(t),c):i>=s?(e.exit("codeFencedFenceSequence"),v4(t)?w4(e,u,"whitespace")(t):u(t)):n(t)}function u(r){return null===r||y4(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let a,o=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return o=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,a=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===a?(s++,e.consume(t),l):s<3?n(t):(e.exit("codeFencedFenceSequence"),v4(t)?w4(e,c,"whitespace")(t):c(t))}function c(n){return null===n||y4(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(i3,h,b)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||y4(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):v4(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),w4(e,p,"whitespace")(t)):96===t&&t===a?n(t):(e.consume(t),u)}function p(t){return null===t||y4(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return null===t||y4(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===a?n(t):(e.consume(t),d)}function h(t){return e.attempt(i,b,m)(t)}function m(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),f}function f(t){return o>0&&v4(t)?w4(e,g,"linePrefix",o+1)(t):g(t)}function g(t){return null===t||y4(t)?e.check(i3,h,b)(t):(e.enter("codeFlowValue"),y(t))}function y(t){return null===t||y4(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),y)}function b(n){return e.exit("codeFenced"),t(n)}}},o3=document.createElement("i");function s3(e){const t="&"+e+";";o3.innerHTML=t;const n=o3.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}const l3={name:"characterReference",tokenize:function(e,t,n){const r=this;let i,a,o=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),i=31,a=p4,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,a=f4,c):(e.enter("characterReferenceValue"),i=7,a=m4,c(t))}function c(s){if(59===s&&o){const i=e.exit("characterReferenceValue");return a!==p4||s3(r.sliceSerialize(i))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return a(s)&&o++1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const p={...e[n][1].end},d={...e[u][1].start};v3(p,-s),v3(d,s),a={type:s>1?"strongSequence":"emphasisSequence",start:p,end:{...e[n][1].end}},o={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:d},i={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:s>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[n][1].end={...a.start},e[u][1].start={...o.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=t4(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=t4(l,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",i,t]]),l=t4(l,p3(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=t4(l,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=t4(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,e4(e,n-1,u-n+3,l),u=n+l.length-c-2;break}for(u=-1;++u-1){const e=o[0];"string"==typeof e?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}(o,e)}function m(){const{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function f(e){l=void 0,p=e,d=d(e)}function g(e,t){t.restore()}function y(e,t){return function(n,i,a){let o,p,d,h;return Array.isArray(n)?f(n):"tokenize"in n?f([n]):function(e){return function(t){const n=null!==t&&e[t],r=null!==t&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function f(e){return o=e,p=0,0===e.length?a:g(e[p])}function g(e){return function(n){return h=function(){const e=m(),t=u.previous,n=u.currentConstruct,i=u.events.length,a=Array.from(s);return{from:i,restore:function(){r=e,u.previous=t,u.currentConstruct=n,u.events.length=i,s=a,v()}}}(),d=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name)?b():e.tokenize.call(t?Object.assign(Object.create(u),t):u,c,y,b)(n)}}function y(t){return l=!0,e(d,h),i}function b(e){return l=!0,h.restore(),++p13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}const O3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function F3(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return P3(n.slice(t?2:1),t?16:10)}return s3(n)||e}const j3={}.hasOwnProperty;function B3(e,t,n){return t&&"object"==typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(b),autolinkProtocol:u,autolinkEmail:u,atxHeading:i(f),blockQuote:i(function(){return{type:"blockquote",children:[]}}),characterEscape:u,characterReference:u,codeFenced:i(m),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(m,a),codeText:i(function(){return{type:"inlineCode",value:""}},a),codeTextData:u,data:u,codeFlowValue:u,definition:i(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:i(g),hardBreakTrailing:i(g),htmlFlow:i(y,a),htmlFlowData:u,htmlText:i(y,a),htmlTextData:u,image:i(function(){return{type:"image",title:null,url:"",alt:null}}),label:a,link:i(b),listItem:i(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:i(v,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:i(v),paragraph:i(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(f),strong:i(function(){return{type:"strong",children:[]}}),thematicBreak:i(function(){return{type:"thematicBreak"}})},exit:{atxHeading:s(),atxHeadingSequence:function(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}},autolink:s(),autolinkEmail:function(e){p.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){p.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:s(),characterEscapeValue:p,characterReferenceMarkerHexadecimal:h,characterReferenceMarkerNumeric:h,characterReferenceValue:function(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;n?(r=P3(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):r=s3(t);this.stack[this.stack.length-1].value+=r},characterReference:function(e){this.stack.pop().position.end=z3(e.end)},codeFenced:s(function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){const e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){const e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:p,codeIndented:s(function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:s(function(){const e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:p,data:p,definition:s(),definitionDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=V4(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:s(),hardBreakEscape:s(d),hardBreakTrailing:s(d),htmlFlow:s(function(){const e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:p,htmlText:s(function(){const e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:p,image:s(function(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t},labelText:function(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(O3,F3)}(t),n.identifier=V4(t).toLowerCase()},lineEnding:function(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak)return n.children[n.children.length-1].position.end=z3(e.end),void(this.data.atHardBreak=void 0);!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(u.call(this,e),p.call(this,e))},link:s(function(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=V4(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:s(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:s(),thematicBreak:s()}};q3(t,(e||{}).mdastExtensions||[]);const n={};return function(e){let i={type:"root",children:[]};const s={stack:[i],tokenStack:[],config:t,enter:o,exit:l,buffer:a,resume:c,data:n},u=[];let p=-1;for(;++p0){const e=s.tokenStack[s.tokenStack.length-1];(e[1]||W3).call(s,void 0,e[0])}for(i.position={start:z3(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:z3(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new V3[e](t)},Z3=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{const e=n([],i);for(const t of o)e.push(r(t));return e}case 2:{const e=n({},i);for(const[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{const{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{const e=n(new Map,i);for(const[t,n]of o)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,i);for(const t of o)e.add(r(t));return e}case 7:{const{name:e,message:t}=o;return n("function"==typeof V3[e]?G3(e,t):new Error(t),i)}case 8:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(G3(a,o),i)};return r})(new Map,e)(0),Y3="",{toString:H3}={},{keys:X3}=Object,Q3=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=H3.call(e).slice(8,-1);switch(n){case"Array":return[1,Y3];case"Object":return[2,Y3];case"Date":return[3,Y3];case"RegExp":return[4,Y3];case"Map":return[5,Y3];case"Set":return[6,Y3];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:e instanceof Error?[7,e.name||"Error"]:[2,n]},J3=([e,t])=>0===e&&("function"===t||"symbol"===t),e5=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const i=(e,t)=>{const i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Q3(r);switch(o){case 0:{let t=r;switch(s){case"bigint":o=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return"DataView"===s?e=new Uint8Array(r.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(r)),i([s,[...e]],r)}const e=[],t=i([o,e],r);for(const t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case"BigInt":return i([s,r.toString()],r);case"Boolean":case"Number":case"String":return i([s,r.valueOf()],r)}if(t&&"toJSON"in r)return a(r.toJSON());const n=[],l=i([o,n],r);for(const t of X3(r))!e&&J3(Q3(r[t]))||n.push([a(t),a(r[t])]);return l}case 3:return i([o,isNaN(r.getTime())?Y3:r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{const t=[],n=i([o,t],r);for(const[n,i]of r)(e||!J3(Q3(n))&&!J3(Q3(i)))&&t.push([a(n),a(i)]);return n}case 6:{const t=[],n=i([o,t],r);for(const n of r)!e&&J3(Q3(n))||t.push(a(n));return n}}const{message:l}=r;return i([o,{name:s,message:l}],r)};return a})(!(t||n),!!t,new Map,r)(e),r},t5="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?Z3(e5(e,t)):structuredClone(e):(e,t)=>Z3(e5(e,t));function n5(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&a<57344){const t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function r5(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function i5(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function a5(e,t,n,r){let i,a,o;"function"==typeof t&&"function"!=typeof n?(a=void 0,o=t,i=n):(a=t,o=n,i=r),d2(e,a,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)},i)}function o5(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&"text"===a.type?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&"text"===o.type?o.value+=r:i.push({type:"text",value:r}),i}function s5(e){return e.spread??e.children.length>1}function l5(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(c5(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(c5(t.slice(i),i>0,!1)),a.join("")}function c5(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;9===t||32===t;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}const u5={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=n5(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,s=e.footnoteCounts.get(r);void 0===s?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return o5(e,t);const i={src:n5(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)},image:function(e,t){const n={src:n5(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return o5(e,t);const i={href:n5(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)},link:function(e,t){const n={href:n5(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let s=-1;for(;++s0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=A2(t.children[1]),o=$2(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",a=n&&"table"===n.type?n.align:void 0,o=a?a.length:t.children.length;let s=-1;const l=[];for(;++s0&&n.push({type:"text",value:"\n"}),n}function b5(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function v5(e,t){const n=function(e,t){const n=t||h5,r=new Map,i=new Map,a=new Map,o={...u5,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r0&&p.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,u);"string"==typeof e&&(e={type:"text",value:e}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const h=a[a.length-1];if(h&&"element"===h.type&&"p"===h.tagName){const e=h.children[h.children.length-1];e&&"text"===e.type?e.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...p)}else a.push(...p);const m={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...t5(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:"\n"},i),a}function x5(e,t){return e&&"run"in e?async function(n,r){const i=v5(n,{file:r,...t});await e.run(i,r)}:function(n,r){return v5(n,{file:r,...e||t})}}function _5(e){if(e)throw e}var k5=n.cjs(function(e,t){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},s=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var t,i=n.call(e,"constructor"),a=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!a)return!1;for(t in e);return void 0===t||n.call(e,t)},l=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,a,u,p=arguments[0],d=1,h=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});de.length){for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else i<0&&(n=!0,i=a+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let o=-1,s=t.length-1;for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else o<0&&(n=!0,o=a+1),s>-1&&(e.codePointAt(a)===t.codePointAt(s--)?s<0&&(i=a):(s=-1,i=o));return r===i?i=o:i<0&&(i=e.length),e.slice(r,i)},T5=function(e){if(E5(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},$5=function(e){E5(e);let t,n=e.length,r=-1,i=0,a=-1,o=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)r<0&&(t=!0,r=n+1),46===s?a<0?a=n:1!==o&&(o=1):a>-1&&(o=-1);else if(t){i=n+1;break}}return a<0||r<0||0===o||1===o&&a===r-1&&a===i+1?"":e.slice(a,r)},A5=function(...e){let t,n=-1;for(;++n2){if(r=i.lastIndexOf("/"),r!==i.length-1){r<0?(i="",a=0):(i=i.slice(0,r),a=i.length-1-i.lastIndexOf("/")),o=l,s=0;continue}}else if(i.length>0){i="",a=0,o=l,s=0;continue}t&&(i=i.length>0?i+"/..":"..",a=2)}else i.length>0?i+="/"+e.slice(o+1,l):i=e.slice(o+1,l),a=l-o-1;o=l,s=0}else 46===n&&s>-1?s++:s=-1}return i}(e,!t);return 0!==n.length||t||(n="."),n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},S5="/";function E5(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const R5=function(){return"/"};function I5(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}const L5=["history","path","basename","stem","extname","dirname"];class N5{constructor(e){let t;t=e?I5(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":R5(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++rt.length;let o;a&&t.push(r);try{o=e.apply(this,t)}catch(e){if(a&&n)throw e;return r(e)}a||(o&&o.then&&"function"==typeof o.then?o.then(i,r):o instanceof Error?r(o):i(o))};function r(e,...r){n||(n=!0,t(e,...r))}function i(e){r(null,e)}}(s,i)(...o):r(null,...o)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){const e=new j5;let t=-1;for(;++t0){let[r,...a]=t;const o=n[i][1];w5(o)&&w5(r)&&(r=k5(!0,o,r)),n[i]=[e,r,...a]}}}}const B5=(new j5).freeze();function z5(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function q5(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function U5(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 W5(e){if(!w5(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function K5(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function V5(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new N5(e)}const G5=[],Z5={allowDangerousHtml:!0},Y5=/^(https?|ircs?|mailto|xmpp)$/i,H5=[{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 X5(e){const t=function(e){const t=e.rehypePlugins||G5,n=e.remarkPlugins||G5,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Z5}:Z5;return B5().use(K3).use(n).use(x5,r).use(t)}(e),n=function(e){const t=e.children||"",n=new N5;return"string"==typeof t&&(n.value=t),n}(e);return function(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||Q5;for(const e of H5)Object.hasOwn(t,e.from)&&y2((e.from,e.to&&e.to,e.id));return a5(e,function(e,t,i){if("raw"===e.type&&i&&"number"==typeof t)return o?i.children.splice(t,1):i.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in Y2)if(Object.hasOwn(Y2,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=Y2[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=l(String(n||""),t,e))}}if("element"===e.type){let o=n?!n.includes(e.tagName):!!a&&a.includes(e.tagName);if(!o&&r&&"number"==typeof t&&(o=!r(e,t,i)),o&&i&&"number"==typeof t)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}),function(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return function(n,r,i,a){const o=Array.isArray(i.children),s=A2(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");i=t.jsx,a=t.jsxs,r=function(e,t,n,r){const o=Array.isArray(n.children)?a:i;return r?o(t,n,r):o(t,n)}}var i,a;const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?w1:k1,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},s=B2(o,e,void 0);return s&&"string"!=typeof s?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}(e,{Fragment:v.Fragment,components:i,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0})}(t.runSync(t.parse(n),n),e)}function Q5(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return-1===t||-1!==i&&t>i||-1!==n&&t>n||-1!==r&&t>r||Y5.test(e.slice(0,t))?e:""}function J5(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}function e6(e){return"string"==typeof e?new RegExp(function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e}function t6(e){return"function"==typeof e?e:function(){return e}}const n6="phrasing",r6=["autolink","link","image","label"];function i6(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function a6(e){this.config.enter.autolinkProtocol.call(this,e)}function o6(e){this.config.exit.autolinkProtocol.call(this,e)}function s6(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 l6(e){this.config.exit.autolinkEmail.call(this,e)}function c6(e){this.exit(e)}function u6(e){!function(e,t,n){const r=W1((n||{}).ignore||[]),i=function(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(;++r0?{type:"text",value:a}:void 0),!1===a?r.lastIndex=n+1:(s!==n&&u.push({type:"text",value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+p[0].length,c=!0),!r.global)break;p=r.exec(e.value)}return c?(s?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=J5(e,"(");let a=J5(e,")");for(;-1!==r&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}(n+r);if(!o[0])return!1;const s={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[s,{type:"text",value:o[1]}]:s}function d6(e,t,n,r){return!(!h6(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function h6(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||_4(n)||x4(n))&&(!t||47!==n)}function m6(){this.buffer()}function f6(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function g6(){this.buffer()}function y6(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function b6(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=V4(this.sliceSerialize(e)).toLowerCase(),n.label=t}function v6(e){this.exit(e)}function x6(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=V4(this.sliceSerialize(e)).toLowerCase(),n.label=t}function _6(e){this.exit(e)}function k6(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const o=n.enter("footnoteReference"),s=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),s(),o(),a+=i.move("]"),a}function w6(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,r,i){const a=r.createTracker(i);let o=a.move("[^");const s=r.enter("footnoteDefinition"),l=r.enter("label");return o+=a.move(r.safe(r.associationId(e),{before:o,after:"]"})),l(),o+=a.move("]:"),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?"\n":" ")+r.indentLines(r.containerFlow(e,a.current()),t?T6:C6))),s(),o},footnoteReference:k6},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}}function C6(e,t,n){return 0===t?e:T6(e,0,n)}function T6(e,t,n){return(n?"":" ")+e}k6.peek=function(){return"["};const $6=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function A6(e){this.enter({type:"delete",children:[]},e)}function S6(e){this.exit(e)}function E6(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function R6(e){return e.length}function I6(e){return null==e?"":String(e)}function L6(e){const t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:82===t||114===t?114:0}function N6(e,t,n){return">"+(n?"":" ")+e}function M6(e,t){return D6(e,t.inConstruct,!0)&&!D6(e,t.notInConstruct,!1)}function D6(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++ro&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function F6(e,t,n){return(n?"":" ")+e}function j6(e){const t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function B6(e){return""+e.toString(16).toUpperCase()+";"}function z6(e,t,n){const r=y3(e),i=y3(t);return void 0===r?void 0===i?"_"===n?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===i?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===r?void 0===i?{inside:!1,outside:!1}:1===i?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===i?{inside:!1,outside:!1}:1===i?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function q6(e,t,n,r){const i=function(e){const t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}(n),a=n.enter("emphasis"),o=n.createTracker(r),s=o.move(i);let l=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()}));const c=l.charCodeAt(0),u=z6(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=B6(c)+l.slice(1));const p=l.charCodeAt(l.length-1),d=z6(r.after.charCodeAt(0),p,i);d.inside&&(l=l.slice(0,-1)+B6(p));const h=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:d.outside,before:u.outside},s+l+h}function U6(e){return e.value||""}function W6(e,t,n,r){const i=j6(n),a='"'===i?"Quote":"Apostrophe",o=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${a}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),c+=l.move(")"),o(),c}function K6(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let o=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return o(),n.stack=u,a(),"full"!==i&&c&&c===p?"shortcut"===i?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(p+"]"),l}function V6(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a\u007F]/.test(e.url))}function Z6(e,t,n,r){const i=j6(n),a='"'===i?"Quote":"Apostrophe",o=n.createTracker(r);let s,l;if(G6(e,n)){const t=n.stack;n.stack=[],s=n.enter("autolink");let r=o.move("<");return r+=o.move(n.containerPhrasing(e,{before:r,after:">",...o.current()})),r+=o.move(">"),s(),n.stack=t,r}s=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${a}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),l()),c+=o.move(")"),s(),c}function Y6(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let o=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return o(),n.stack=u,a(),"full"!==i&&c&&c===p?"shortcut"===i?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(p+"]"),l}function H6(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 X6(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}E6.peek=function(){return"~"},q6.peek=function(e,t,n){return n.options.emphasis||"*"},U6.peek=function(){return"<"},W6.peek=function(){return"!"},K6.peek=function(){return"!"},V6.peek=function(){return"`"},Z6.peek=function(e,t,n){return G6(e,n)?"<":"["},Y6.peek=function(){return"["};const Q6=W1(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function J6(e,t,n,r){const i=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),a=n.enter("strong"),o=n.createTracker(r),s=o.move(i+i);let l=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()}));const c=l.charCodeAt(0),u=z6(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=B6(c)+l.slice(1));const p=l.charCodeAt(l.length-1),d=z6(r.after.charCodeAt(0),p,i);d.inside&&(l=l.slice(0,-1)+B6(p));const h=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:d.outside,before:u.outside},s+l+h}J6.peek=function(e,t,n){return n.options.strong||"*"};const e8={blockquote:function(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),N6);return i(),o},break:P6,code:function(e,t,n,r){const i=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),a=e.value||"",o="`"===i?"GraveAccent":"Tilde";if(function(e,t){return Boolean(!1===t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(a,F6);return e(),t}const s=n.createTracker(r),l=i.repeat(Math.max(O6(a,i)+1,3)),c=n.enter("codeFenced");let u=s.move(l);if(e.lang){const t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${o}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:"\n",encode:["`"],...s.current()})),t()}return u+=s.move("\n"),a&&(u+=s.move(a+"\n")),u+=s.move(l),c(),u},definition:function(e,t,n,r){const i=j6(n),a='"'===i?"Quote":"Apostrophe",o=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...l.current()}))),s(),e.title&&(s=n.enter(`title${a}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),o(),c},emphasis:q6,hardBreak:P6,heading:function(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(function(e,t){let n=!1;return a5(e,function(e){if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,!1}),Boolean((!e.depth||e.depth<3)&&X2(e)&&(t.options.setext||n))}(e,n)){const t=n.enter("headingSetext"),r=n.enter("phrasing"),o=n.containerPhrasing(e,{...a.current(),before:"\n",after:"\n"});return r(),t(),o+"\n"+(1===i?"=":"-").repeat(o.length-(Math.max(o.lastIndexOf("\r"),o.lastIndexOf("\n"))+1))}const o="#".repeat(i),s=n.enter("headingAtx"),l=n.enter("phrasing");a.move(o+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...a.current()});return/^[\t ]/.test(c)&&(c=B6(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),s(),c},html:U6,image:W6,imageReference:K6,inlineCode:V6,link:Z6,linkReference:Y6,list:function(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?function(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}(n):H6(n);const s=e.ordered?"."===o?")":".":function(e){const t=H6(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}(n);let l=!(!t||!n.bulletLastUsed)&&o===n.bulletLastUsed;if(!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==o&&"-"!==o||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(l=!0),X6(n)===o&&t){let t=-1;for(;++t-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+a);let o=a.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(o=4*Math.ceil(o/4));const s=n.createTracker(r);s.move(a+" ".repeat(o-a.length)),s.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),function(e,t,n){return t?(n?"":" ".repeat(o))+e:(n?a:a+" ".repeat(o-a.length))+e});return l(),c},paragraph:function(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o},root:function(e,t,n,r){const i=e.children.some(function(e){return Q6(e)});return(i?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:J6,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){const r=(X6(n)+(n.options.ruleSpaces?" ":"")).repeat(function(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}(n));return n.options.ruleSpaces?r.slice(0,-1):r}};function t8(e){const t=e._align;this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function n8(e){this.exit(e),this.data.inTable=void 0}function r8(e){this.enter({type:"tableRow",children:[]},e)}function i8(e){this.exit(e)}function a8(e){this.enter({type:"tableCell",children:[]},e)}function o8(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,s8));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function s8(e,t){return"|"===t?t:e}function l8(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=e8.inlineCode(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return s(function(e,t,n){const r=e.children;let i=-1;const a=[],o=t.enter("table");for(;++ic&&(c=e[u].length);++al[a])&&(l[a]=e)}t.push(o)}o[u]=t,s[u]=r}let p=-1;if("object"==typeof r&&"length"in r)for(;++pl[p]&&(l[p]=i),h[p]=i),d[p]=o}o.splice(1,0,d),s.splice(1,0,h),u=-1;const m=[];for(;++u0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}x8[43]=v8,x8[45]=v8,x8[46]=v8,x8[95]=v8,x8[72]=[v8,b8],x8[104]=[v8,b8],x8[87]=[v8,y8],x8[119]=[v8,y8];const A8={tokenize:function(e,t,n){const r=this;return w4(e,function(e){const i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function S8(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const e=r.events[i][1];if("labelImage"===e.type){o=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(i){if(!o||!o._balanced)return n(i);const s=V4(r.sliceSerialize({start:o.end,end:r.now()}));return 94===s.codePointAt(0)&&a.includes(s.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(i),e.exit("gfmFootnoteCallLabelMarker"),t(i)):n(i)}}function E8(e,t){let n,r=e.length;for(;r--;)if("labelImage"===e[r][1].type&&"enter"===e[r][0]){n=e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},l=[e[r+1],e[r+2],["enter",i,t],e[r+3],e[r+4],["enter",a,t],["exit",a,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(r,e.length-r+1,...l),e}function R8(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(s){if(o>999||93===s&&!a||null===s||91===s||b4(s))return n(s);if(93===s){e.exit("chunkString");const a=e.exit("gfmFootnoteCallString");return i.includes(V4(r.sliceSerialize(a)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return b4(s)||(a=!0),o++,e.consume(s),92===s?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),o++,l):l(t)}}function I8(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o,s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!o||null===t||91===t||b4(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return a=V4(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return b4(t)||(o=!0),s++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function p(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i.includes(a)||i.push(a),w4(e,d,"gfmFootnoteDefinitionWhitespace")):n(t)}function d(e){return t(e)}}function L8(e,t,n){return e.check(A4,t,e.attempt(A8,t,n))}function N8(e){e.exit("gfmFootnoteDefinition")}function M8(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,r){const i=this.previous,a=this.events;let o=0;return function(t){return 126===i&&"characterEscape"!==a[a.length-1][1].type?r(t):(e.enter("strikethroughSequenceTemporary"),s(t))};function s(a){const l=y3(i);if(126===a)return o>1?r(a):(e.consume(a),o++,s);if(o<2&&!t)return r(a);const c=e.exit("strikethroughSequenceTemporary"),u=y3(a);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(a)}},resolveAll:function(e,t){let n=-1;for(;++n0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(const t of r)e.push(t);r=n.pop()}this.map.length=0}}function P8(e,t){let n=!1;const r=[];for(;t-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const i=t>-1?r.events[t][1].type:null,a="tableHead"===i||"tableRow"===i?x:s;return a===x&&r.parser.lazy[r.now().line]?n(e):a(e)};function s(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){return 124===e||(i=!0,o+=1),l(e)}(t)}function l(t){return null===t?n(t):y4(t)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p):n(t):v4(t)?w4(e,l,"whitespace")(t):(o+=1,i&&(i=!1,a+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),i=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||b4(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),i=!1,v4(t)?w4(e,d,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):d(t))}function d(t){return 45===t||58===t?m(t):124===t?(i=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),h):v(t)}function h(t){return v4(t)?w4(e,m,"whitespace")(t):m(t)}function m(t){return 58===t?(o+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),f):45===t?(o+=1,f(t)):null===t||y4(t)?b(t):v(t)}function f(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):v(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(t))}function y(t){return v4(t)?w4(e,b,"whitespace")(t):b(t)}function b(n){return 124===n?d(n):(null===n||y4(n))&&i&&a===o?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):v(n)}function v(e){return n(e)}function x(t){return e.enter("tableRow"),_(t)}function _(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),_):null===n||y4(n)?(e.exit("tableRow"),t(n)):v4(n)?w4(e,_,"whitespace")(n):(e.enter("data"),k(n))}function k(t){return null===t||124===t||b4(t)?(e.exit("data"),_(t)):(e.consume(t),92===t?w:k)}function w(t){return 92===t||124===t?(e.consume(t),k):k(t)}}function F8(e,t){let n,r,i,a=-1,o=!0,s=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,p=0;const d=new D8;for(;++an[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",o,t]])}return void 0!==i&&(a.end=Object.assign({},z8(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function B8(e,t,n,r,i){const a=[],o=z8(t.events,n);i&&(i.end=Object.assign({},o),a.push(["exit",i,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function z8(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const q8={name:"tasklistCheck",tokenize:function(e,t,n){const r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i):n(t)};function i(t){return b4(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),a):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),a):n(t)}function a(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(t)}function o(r){return y4(r)?t(r):v4(r)?e.check({tokenize:U8},t,n)(r):n(r)}}};function U8(e,t,n){return w4(e,function(e){return null===e?n(e):t(e)},"whitespace")}const W8={};function K8(e){const t=e||W8,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),a=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(function(e){return s4([{text:x8},{document:{91:{name:"gfmFootnoteDefinition",tokenize:I8,continuation:{tokenize:L8},exit:N8}},text:{91:{name:"gfmFootnoteCall",tokenize:R8},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:S8,resolveTo:E8}}},M8(e),{flow:{null:{name:"table",tokenize:O8,resolveAll:F8}}},{text:{91:q8}}])}(t)),i.push([{transforms:[u6],enter:{literalAutolink:i6,literalAutolinkEmail:a6,literalAutolinkHttp:a6,literalAutolinkWww:a6},exit:{literalAutolink:c6,literalAutolinkEmail:l6,literalAutolinkHttp:o6,literalAutolinkWww:s6}},{enter:{gfmFootnoteCallString:m6,gfmFootnoteCall:f6,gfmFootnoteDefinitionLabelString:g6,gfmFootnoteDefinition:y6},exit:{gfmFootnoteCallString:b6,gfmFootnoteCall:v6,gfmFootnoteDefinitionLabelString:x6,gfmFootnoteDefinition:_6}},{canContainEols:["delete"],enter:{strikethrough:A6},exit:{strikethrough:S6}},{enter:{table:t8,tableData:a8,tableHeader:a8,tableRow:r8},exit:{codeText:o8,table:n8,tableData:i8,tableHeader:i8,tableRow:i8}},{exit:{taskListCheckValueChecked:c8,taskListCheckValueUnchecked:c8,paragraph:u8}}]),a.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:n6,notInConstruct:r6},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:n6,notInConstruct:r6},{character:":",before:"[ps]",after:"\\/",inConstruct:n6,notInConstruct:r6}]},w6(e),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:$6}],handlers:{delete:E6}},l8(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:p8}}]}}(t))}const V8={tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1],a=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0;let o=0;return function(t){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),s(t)};function s(t){return 36===t?(e.consume(t),o++,s):o<2?n(t):(e.exit("mathFlowFenceSequence"),w4(e,l,"whitespace")(t))}function l(t){return null===t||y4(t)?u(t):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return null===t||y4(t)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),u(t)):36===t?n(t):(e.consume(t),c)}function u(n){return e.exit("mathFlowFence"),r.interrupt?t(n):e.attempt(G8,p,f)(n)}function p(t){return e.attempt({tokenize:g,partial:!0},f,d)(t)}function d(t){return(a?w4(e,h,"linePrefix",a+1):h)(t)}function h(t){return null===t?f(t):y4(t)?e.attempt(G8,p,f)(t):(e.enter("mathFlowValue"),m(t))}function m(t){return null===t||y4(t)?(e.exit("mathFlowValue"),h(t)):(e.consume(t),m)}function f(n){return e.exit("mathFlow"),t(n)}function g(e,t,n){let i=0;return w4(e,function(t){return e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),a(t)},"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function a(t){return 36===t?(i++,e.consume(t),a):i{let r=!1;const a=setTimeout(()=>{(async()=>{const a=await async function(){return void 0===J8&&(J8=Promise.resolve().then(n.bind(n,49065)).then(({default:e})=>(e.initialize({startOnLoad:!1,securityLevel:"strict",theme:"base",themeVariables:{darkMode:!1,fontFamily:"var(--font-mono)",fontSize:"14px",background:"#28292f",primaryColor:"#e6e7ea",mainBkg:"#e6e7ea",primaryBorderColor:"#e25822",nodeBorder:"#e25822",primaryTextColor:"#1f1f24",nodeTextColor:"#1f1f24",textColor:"#1f1f24",lineColor:"#a5a6b1",secondaryColor:"#fba292",secondaryBorderColor:"#e25822",secondaryTextColor:"#1f1f24",tertiaryColor:"#c6c7cd",tertiaryBorderColor:"#656775",tertiaryTextColor:"#1f1f24",clusterBkg:"#c6c7cd",clusterBorder:"#656775",titleColor:"#1f1f24",edgeLabelBackground:"#e6e7ea"}}),e))),J8}();if(!r&&!1!==await a.parse(e,{suppressErrors:!0}))try{const{svg:n}=await a.render(t,e);r||i(n)}catch(e){}})()},150);return()=>{r=!0,clearTimeout(a)}},[e,t]),(0,v.jsx)(H0,{title:"Diagram",children:(0,v.jsx)("div",{className:"flex justify-center p-4 [&_svg]:h-auto [&_svg]:max-w-full",children:r?(0,v.jsx)("div",{dangerouslySetInnerHTML:{__html:r}}):(0,v.jsx)("pre",{className:"text-primary-300 text-xs whitespace-pre-wrap",children:e})})})}const t7={pre:({children:e})=>(0,v.jsx)(v.Fragment,{children:e}),a:({href:e,children:t})=>(0,v.jsx)("a",{href:e,target:"_blank",rel:"noreferrer",className:"text-flama-500 underline",children:t}),p:({children:e})=>(0,v.jsx)("p",{className:"my-1 w-full first:mt-0 last:mb-0",children:e}),ul:({children:e})=>(0,v.jsx)("ul",{className:"my-1 w-full list-outside list-disc ps-5 first:mt-0 last:mb-0",children:e}),ol:({children:e})=>(0,v.jsx)("ol",{className:"my-1 w-full list-outside list-decimal ps-5 first:mt-0 last:mb-0",children:e}),h1:({children:e})=>(0,v.jsx)("h1",{className:"my-2 w-full text-lg font-bold first:mt-0 last:mb-0",children:e}),h2:({children:e})=>(0,v.jsx)("h2",{className:"my-2 w-full text-base font-bold first:mt-0 last:mb-0",children:e}),h3:({children:e})=>(0,v.jsx)("h3",{className:"my-2 w-full text-base font-semibold first:mt-0 last:mb-0",children:e}),h4:({children:e})=>(0,v.jsx)("h4",{className:"my-2 w-full text-sm font-semibold first:mt-0 last:mb-0",children:e}),h5:({children:e})=>(0,v.jsx)("h5",{className:"my-2 w-full text-sm font-medium first:mt-0 last:mb-0",children:e}),h6:({children:e})=>(0,v.jsx)("h6",{className:"my-2 w-full text-xs font-medium first:mt-0 last:mb-0",children:e}),blockquote:({children:e})=>(0,v.jsx)("blockquote",{className:"border-primary-300 my-1 border-l-2 pl-3 italic",children:e}),hr:()=>(0,v.jsx)("div",{className:"border-primary-300 my-2 w-full border-t"}),code:({className:e,children:t})=>{var n,r;const i=null===(n=/language-(\w+)/.exec(null!=e?e:""))||void 0===n||null===(n=n[1])||void 0===n?void 0:n.toLowerCase();if("math"===i)return(0,v.jsx)(v.Fragment,{children:t});const a=String(t).replace(/\n$/,"");return"mermaid"===i?(0,v.jsx)(e7,{chart:a}):a.includes("\n")||null!==(r=null==e?void 0:e.includes("language-"))&&void 0!==r&&r?(0,v.jsx)(H0,{title:null!=i?i:"",children:(0,v.jsx)("div",{className:"p-2",children:(0,v.jsx)(UJ,{code:a,language:i,inline:!1,size:"xs"})})}):(0,v.jsx)(UJ,{code:a,inline:!0,size:"xs"})}};function n7({text:e}){return(0,v.jsx)(X5,{remarkPlugins:[K8,Q8],rehypePlugins:[[f2,{throwOnError:!1}]],components:t7,children:e})}const r7=h("outline","pencil","Pencil",[["path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4",key:"svg-0"}],["path",{d:"M13.5 6.5l4 4",key:"svg-1"}]]),i7=h("outline","refresh","Refresh",[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]]),a7=h("outline","check","Check",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]),o7=h("outline","copy","Copy",[["path",{d:"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]]);function s7({text:e,onEdit:t,onRedo:n,align:r,alwaysVisible:i=!1}){const[a,o]=(0,p.useState)(!1),s=(0,p.useCallback)(async()=>{e&&(await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3))},[e]);return e||t||n?(0,v.jsxs)("div",{className:`flex items-center gap-1 ${"end"===r?"justify-end":"justify-start"} ${i?"":"opacity-0 transition-opacity duration-200 group-hover/msg:opacity-100"}`,children:[t&&(0,v.jsx)(Bw,{icon:(0,v.jsx)(r7,{}),color:"primary",size:"sm","aria-label":"Edit message",onClick:t}),n&&(0,v.jsx)(Bw,{icon:(0,v.jsx)(i7,{}),color:"primary",size:"sm","aria-label":"Regenerate response",onClick:n}),e&&(0,v.jsx)(Bw,{icon:a?(0,v.jsx)(a7,{}):(0,v.jsx)(o7,{}),color:"primary",size:"sm","aria-label":"Copy to clipboard",onClick:()=>{s()}})]}):null}function l7({text:e,onRedo:t}){return(0,v.jsxs)("div",{className:"flex w-full flex-col items-start gap-1",children:[(0,v.jsx)(n7,{text:e}),(0,v.jsx)(s7,{align:"start",text:e,onRedo:t,alwaysVisible:!0})]})}const c7=h("outline","chevron-down","ChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]),u7=h("outline","chevron-right","ChevronRight",[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]]),p7=h("outline","brain","Brain",[["path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8",key:"svg-0"}],["path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8",key:"svg-1"}],["path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5",key:"svg-2"}],["path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0",key:"svg-3"}],["path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5",key:"svg-4"}],["path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10",key:"svg-5"}]]),d7=(0,p.createContext)({});function h7(e){const t=(0,p.useRef)(null);return null===t.current&&(t.current=e()),t.current}const m7="undefined"!=typeof window?p.useLayoutEffect:p.useEffect,f7=(0,p.createContext)(null),g7=e=>"object"==typeof e&&null!==e;function y7(e){return g7(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const b7=(0,p.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function v7(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class x7 extends p.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(y7(t)&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){const e=t.offsetParent,n=y7(e)&&e.offsetWidth||0,r=y7(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function _7({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){const o=(0,p.useId)(),s=(0,p.useRef)(null),l=(0,p.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:c}=(0,p.useContext)(b7),u=e.props?.ref??e?.ref,d=function(...e){return p.useCallback(function(...e){return t=>{let n=!1;const r=e.map(e=>{const r=v7(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t{const{width:e,height:u,top:p,left:d,right:h,bottom:m,direction:f}=l.current;if(t||!1===a||!s.current||!e||!u)return;const g="rtl"===f,y="left"===n?g?`right: ${h}`:`left: ${d}`:g?`left: ${d}`:`right: ${h}`,b="bottom"===r?`bottom: ${m}`:`top: ${p}`;s.current.dataset.motionPopId=o;const v=document.createElement("style");c&&(v.nonce=c);const x=i??document.head;return x.appendChild(v),v.sheet&&v.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${u}px !important;\n ${y}px !important;\n ${b}px !important;\n }\n `),()=>{s.current?.removeAttribute("data-motion-pop-id"),x.contains(v)&&x.removeChild(v)}},[t]),(0,v.jsx)(x7,{isPresent:t,childRef:s,sizeRef:l,pop:a,children:!1===a?e:p.cloneElement(e,{ref:d})})}const k7=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:l,root:c})=>{const u=h7(w7),d=(0,p.useId)(),h=(0,p.useRef)(n),m=(0,p.useRef)(r);m7(()=>{h.current=n,m.current=r});let f=!0,g=(0,p.useMemo)(()=>(f=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(const e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!h.current&&!u.size&&m.current?.()})}),[n,u,r]);return a&&f&&(g={...g}),(0,p.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),p.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,v.jsx)(_7,{pop:"popLayout"===o,isPresent:n,anchorX:s,anchorY:l,root:c,children:e}),(0,v.jsx)(f7.Provider,{value:g,children:e})};function w7(){return new Map}function C7(e=!0){const t=(0,p.useContext)(f7);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,a=(0,p.useId)();(0,p.useEffect)(()=>{if(e)return i(a)},[e]);const o=(0,p.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const T7=e=>e.key||"";function $7(e){const t=[];return p.Children.forEach(e,e=>{(0,p.isValidElement)(e)&&t.push(e)}),t}const A7=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a="sync",propagate:o=!1,anchorX:s="left",anchorY:l="top",root:c})=>{const[u,d]=C7(o),h=(0,p.useMemo)(()=>$7(e),[e]),m=o&&!u?[]:h.map(T7),f=(0,p.useRef)(!0),g=(0,p.useRef)(h),y=h7(()=>new Map),b=(0,p.useRef)(new Set),[x,_]=(0,p.useState)(h),[k,w]=(0,p.useState)(h);m7(()=>{f.current=!1,g.current=h;for(let e=0;e{const p=T7(e),x=!(o&&!u)&&(h===k||m.includes(p));return(0,v.jsx)(k7,{isPresent:x,initial:!(f.current&&!n)&&void 0,custom:t,presenceAffectsLayout:i,mode:a,root:c,onExitComplete:x?void 0:()=>{if(b.current.has(p))return;if(!y.has(p))return;b.current.add(p),y.set(p,!0);let e=!0;y.forEach(t=>{t||(e=!1)}),e&&(T?.(),w(g.current),o&&d?.(),r&&r())},anchorX:s,anchorY:l,children:e},p)})})},S7=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],E7=(()=>new Set([...S7,"pathRotation"]))(),R7=(e,t,n)=>n>t?t:n"number"==typeof e,parse:parseFloat,transform:e=>e},L7={...I7,transform:e=>R7(0,1,e)},N7={...I7,default:1},M7=e=>Math.round(1e5*e)/1e5,D7=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,P7=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,O7=(e,t)=>n=>Boolean("string"==typeof n&&P7.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),F7=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[i,a,o,s]=r.match(D7);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:void 0!==s?parseFloat(s):1}},j7={...I7,transform:e=>Math.round((e=>R7(0,255,e))(e))},B7={test:O7("rgb","red"),parse:F7("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+j7.transform(e)+", "+j7.transform(t)+", "+j7.transform(n)+", "+M7(L7.transform(r))+")"},z7={test:O7("#"),parse:function(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:B7.transform},q7=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),U7=q7("deg"),W7=q7("%"),K7=q7("px"),V7=q7("vh"),G7=q7("vw"),Z7=(()=>({...W7,parse:e=>W7.parse(e)/100,transform:e=>W7.transform(100*e)}))(),Y7={test:O7("hsl","hue"),parse:F7("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+W7.transform(M7(t))+", "+W7.transform(M7(n))+", "+M7(L7.transform(r))+")"},H7={test:e=>B7.test(e)||z7.test(e)||Y7.test(e),parse:e=>B7.test(e)?B7.parse(e):Y7.test(e)?Y7.parse(e):z7.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?B7.transform(e):Y7.transform(e),getAnimatableNone:e=>{const t=H7.parse(e);return t.alpha=0,H7.transform(t)}},X7=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Q7="number",J7="color",e9=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function t9(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const o=t.replace(e9,e=>(H7.test(e)?(r.color.push(a),i.push(J7),n.push(H7.parse(e))):e.startsWith("var(")?(r.var.push(a),i.push("var"),n.push(e)):(r.number.push(a),i.push(Q7),n.push(parseFloat(e))),++a,"${}")).split("${}");return{values:n,split:o,indexes:r,types:i}}function n9({split:e,types:t}){const n=e.length;return r=>{let i="";for(let a=0;a0},parse:function(e){return t9(e).values},createTransformer:function(e){return n9(t9(e))},getAnimatableNone:function(e){const t=t9(e);return n9(t)(t.values.map((e,n)=>((e,t)=>{return"number"==typeof e?t?.trim().endsWith("/")?e:0:"number"==typeof(n=e)?0:H7.test(n)?H7.getAnimatableNone(n):n;var n})(e,t.split[n])))}},i9=new Set(["brightness","contrast","saturate","opacity"]);function a9(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(D7)||[];if(!r)return e;const i=n.replace(r,"");let a=i9.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const o9=/\b([a-z-]*)\(.*?\)/gu,s9={...r9,getAnimatableNone:e=>{const t=e.match(o9);return t?t.map(a9).join(" "):e}},l9={...r9,getAnimatableNone:e=>{const t=r9.parse(e);return r9.createTransformer(e)(t.map(e=>"number"==typeof e?0:"object"==typeof e?{...e,alpha:1}:e))}},c9={...I7,transform:Math.round},u9={borderWidth:K7,borderTopWidth:K7,borderRightWidth:K7,borderBottomWidth:K7,borderLeftWidth:K7,borderRadius:K7,borderTopLeftRadius:K7,borderTopRightRadius:K7,borderBottomRightRadius:K7,borderBottomLeftRadius:K7,width:K7,maxWidth:K7,height:K7,maxHeight:K7,top:K7,right:K7,bottom:K7,left:K7,inset:K7,insetBlock:K7,insetBlockStart:K7,insetBlockEnd:K7,insetInline:K7,insetInlineStart:K7,insetInlineEnd:K7,padding:K7,paddingTop:K7,paddingRight:K7,paddingBottom:K7,paddingLeft:K7,paddingBlock:K7,paddingBlockStart:K7,paddingBlockEnd:K7,paddingInline:K7,paddingInlineStart:K7,paddingInlineEnd:K7,margin:K7,marginTop:K7,marginRight:K7,marginBottom:K7,marginLeft:K7,marginBlock:K7,marginBlockStart:K7,marginBlockEnd:K7,marginInline:K7,marginInlineStart:K7,marginInlineEnd:K7,fontSize:K7,backgroundPositionX:K7,backgroundPositionY:K7,rotate:U7,pathRotation:U7,rotateX:U7,rotateY:U7,rotateZ:U7,scale:N7,scaleX:N7,scaleY:N7,scaleZ:N7,skew:U7,skewX:U7,skewY:U7,distance:K7,translateX:K7,translateY:K7,translateZ:K7,x:K7,y:K7,z:K7,perspective:K7,transformPerspective:K7,opacity:L7,originX:Z7,originY:Z7,originZ:K7,zIndex:c9,fillOpacity:L7,strokeOpacity:L7,numOctaves:c9},p9={...u9,color:H7,backgroundColor:H7,outlineColor:H7,fill:H7,stroke:H7,borderColor:H7,borderTopColor:H7,borderRightColor:H7,borderBottomColor:H7,borderLeftColor:H7,filter:s9,WebkitFilter:s9,mask:l9,WebkitMask:l9},d9=e=>p9[e],h9=()=>({x:{min:0,max:0},y:{min:0,max:0}}),m9=e=>Boolean(e&&e.getVelocity),f9=new Set(["width","height","top","left","right","bottom",...S7]),g9=e=>t=>t.test(e),y9=[I7,K7,W7,U7,G7,V7,{test:e=>"auto"===e,parse:e=>e}],b9=e=>y9.find(g9(e)),v9=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),x9=e=>t=>"string"==typeof t&&t.startsWith(e),_9=x9("--"),k9=x9("var(--"),w9=e=>!!k9(e)&&C9.test(e.split("/*")[0].trim()),C9=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function T9(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}const $9=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function A9(e,t,n=1){const[r,i]=function(e){const t=$9.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const e=a.trim();return v9(e)?parseFloat(e):e}return w9(i)?A9(i,t,n+1):i}const S9=e=>180*e/Math.PI,E9=e=>{const t=S9(Math.atan2(e[1],e[0]));return I9(t)},R9={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:E9,rotateZ:E9,skewX:e=>S9(Math.atan(e[1])),skewY:e=>S9(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},I9=e=>((e%=360)<0&&(e+=360),e),L9=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),N9=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),M9={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:L9,scaleY:N9,scale:e=>(L9(e)+N9(e))/2,rotateX:e=>I9(S9(Math.atan2(e[6],e[5]))),rotateY:e=>I9(S9(Math.atan2(-e[2],e[0]))),rotateZ:E9,rotate:E9,skewX:e=>S9(Math.atan(e[4])),skewY:e=>S9(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function D9(e){return e.includes("scale")?1:0}function P9(e,t){if(!e||"none"===e)return D9(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=M9,i=n;else{const t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=R9,i=t}if(!i)return D9(t);const a=r[t],o=i[1].split(",").map(O9);return"function"==typeof a?a(o):o[a]}function O9(e){return parseFloat(e.trim())}const F9=e=>e===I7||e===K7,j9=new Set(["x","y","z"]),B9=S7.filter(e=>!j9.has(e)),z9={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const i=e.max-e.min;return"border-box"===r?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const i=e.max-e.min;return"border-box"===r?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>P9(t,"x"),y:(e,{transform:t})=>P9(t,"y")};z9.translateX=z9.x,z9.translateY=z9.y;const q9=e=>e,U9={},W9=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function K9(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=W9.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,i=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(l.schedule(t),e()),t(o)}const l={schedule:(e,i=!1,o=!1)=>{const s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r)return void(i=!0);r=!0;const a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,l.process(e))}};return l}(a),e),{}),{setup:s,read:l,resolveKeyframes:c,preUpdate:u,update:p,preRender:d,render:h,postRender:m}=o,f=()=>{const a=U9.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),l.process(i),c.process(i),u.process(i),p.process(i),d.process(i),h.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(f))};return{schedule:W9.reduce((t,a)=>{const s=o[a];return t[a]=(t,a=!1,o=!1)=>(n||(n=!0,r=!0,i.isProcessing||e(f)),s.schedule(t,a,o)),t},{}),cancel:e=>{for(let t=0;te.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{const t=function(e){const t=[];return B9.forEach(n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}Q9=!1,X9=!1,H9.forEach(e=>e.complete(J9)),H9.clear()}function tee(){H9.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Q9=!0)})}class nee{constructor(e,t,n,r,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(H9.add(this),X9||(X9=!0,V9.read(tee),V9.resolveKeyframes(eee))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(null===e[0]){const i=r?.get(),a=e[e.length-1];if(void 0!==i)e[0]=i;else if(n&&t){const r=n.readValue(t,a);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=a),r&&void 0===i&&r.set(e[0])}!function(e){for(let t=1;t/^0[^.\s]+$/u.test(e);function iee(e){return"number"==typeof e?0===e:null===e||"none"===e||"0"===e||ree(e)}const aee=new Set([s9,l9]);function oee(e,t){let n=d9(e);return aee.has(n)||(n=r9),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const see=new Set(["auto","none","0"]);class lee extends nee{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const cee=e=>1e3*e,uee=e=>e/1e3;function pee(e,t){-1===e.indexOf(t)&&e.push(t)}function dee(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class hee{constructor(){this.subscriptions=[]}add(e){return pee(this.subscriptions,e),()=>dee(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let i=0;ie.startsWith("--"))(t)?e.style.setProperty(t,n):e.style[t]=n}function fee(e){let t;return()=>(void 0===t&&(t=e()),t)}const gee={};function yee(e,t){const n=fee(e);return()=>gee[t]??n()}const bee=yee(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),vee=e=>null!==e;function xee(e,{repeat:t,repeatType:n="loop"},r,i=1){const a=e.filter(vee),o=i<0||t&&"loop"!==n&&t%2==1?0:a.length-1;return o&&void 0!==r?r:a[o]}class _ee{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const kee=e=>Array.isArray(e)&&"number"==typeof e[0],wee=yee(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),Cee=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let t=0;t`cubic-bezier(${e}, ${t}, ${n}, ${r})`,$ee={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Tee([0,.65,.55,1]),circOut:Tee([.55,0,1,.45]),backIn:Tee([.31,.01,.66,-.59]),backOut:Tee([.33,1.53,.69,.99])};function Aee(e,t){return e?"function"==typeof e?wee()?Cee(e,t):"ease-out":kee(e)?Tee(e):Array.isArray(e)?e.map(e=>Aee(e,t)||$ee.easeOut):$ee[e]:void 0}function See(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:s="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const p=Aee(s,i);Array.isArray(p)&&(u.easing=p);const d={delay:r,duration:i,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:a+1,direction:"reverse"===o?"alternate":"normal"};return c&&(d.pseudoElement=c),e.animate(u,d)}function Eee(e){return"function"==typeof e&&"applyToOptions"in e}class Ree extends _ee{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=Boolean(i),this.allowFlatten=a,this.options=e,e.type;const l=function({type:e,...t}){return Eee(e)&&wee()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=See(t,n,r,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const e=xee(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),mee(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return uee(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+uee(e)}get time(){return uee(Number(this.animation.currentTime)||0)}set time(e){const t=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=cee(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&bee()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),q9):r(this)}}const Iee=new Set(["opacity","clipPath","filter","transform"]),{schedule:Lee,cancel:Nee}=K9(queueMicrotask,!1);let Mee;function Dee(){Mee=void 0}const Pee={now:()=>(void 0===Mee&&Pee.set(Z9.isProcessing||U9.useManualTiming?Z9.timestamp:performance.now()),Mee),set:e=>{Mee=e,queueMicrotask(Dee)}},Oee=(e,t)=>t?e*(1e3/t):0,Fee={current:void 0};class jee{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{const t=Pee.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=Pee.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new hee);const n=this.events[e].add(t);return"change"===e?()=>{n(),V9.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Fee.current&&Fee.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=Pee.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Oee(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Bee(e,t){return new jee(e,t)}const zee=[...y9,H7,r9],qee=new WeakMap;function Uee(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function Wee(e){return"string"==typeof e||Array.isArray(e)}const Kee=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Vee=["initial",...Kee];function Gee(e){return Uee(e.animate)||Vee.some(t=>Wee(e[t]))}function Zee(e){return Boolean(Gee(e)||e.variants)}const Yee={current:null},Hee={current:!1},Xee="undefined"!=typeof window;function Qee(e){const t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Jee(e,t,n,r){if("function"==typeof t){const[i,a]=Qee(r);t=t(void 0!==n?n:e.custom,i,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[i,a]=Qee(r);t=t(void 0!==n?n:e.custom,i,a)}return t}const ete=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let tte={};function nte(e){tte=e}class rte{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=nee,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=Pee.now();this.renderScheduledAtthis.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Hee.current||function(){if(Hee.current=!0,Xee)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Yee.current=e.matches;e.addEventListener("change",t),t()}else Yee.current=!1}(),this.shouldReduceMotion=Yee.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),G9(this.notifyUpdate),G9(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Iee.has(e)&&this.current instanceof HTMLElement){const{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Ree({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:cee(o)}),l=n(s);return void this.valueSubscriptions.set(e,()=>{l(),s.cancel()})}const n=E7.has(e);n&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&V9.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in tte){const t=tte[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;tt.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Bee(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=n&&("string"==typeof n&&(v9(n)||ree(n))?n=parseFloat(n):(r=n,!zee.find(g9(r))&&r9.test(t)&&(n=oee(e,t))),this.setBaseTarget(e,m9(n)?n.get():n)),m9(n)?n.get():n;var r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){const{initial:t}=this.props;let n;if("string"==typeof t||"object"==typeof t){const r=Jee(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&void 0!==n)return n;const r=this.getBaseTargetFromProps(this.props,e);return void 0===r||m9(r)?void 0!==this.initialValues[e]&&void 0===n?void 0:this.baseTarget[e]:r}on(e,t){return this.events[e]||(this.events[e]=new hee),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Lee.render(this.render)}}class ite extends rte{constructor(){super(...arguments),this.KeyframeResolver=lee}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){const n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;m9(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}function ate(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const ote=(e,t)=>t&&"number"==typeof e?t.transform(e):e,ste={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},lte=S7.length;function cte(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let o=!1,s=!1;for(const e in t){const n=t[e];if(E7.has(e))o=!0;else if(_9(e))i[e]=n;else{const t=ote(n,u9[e]);e.startsWith("origin")?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=function(e,t,n){let r="",i=!0;for(let a=0;a"string"==typeof e&&"svg"===e.toLowerCase();function gte(e,{style:t,vars:n},r,i){const a=e.style;let o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}const yte=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function bte(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const vte={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!K7.test(e))return e;e=parseFloat(e)}return`${bte(e,t.target.x)}% ${bte(e,t.target.y)}%`}},xte=(e,t,n)=>e+(t-e)*n,_te={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=r9.parse(e);if(i.length>5)return r;const a=r9.createTransformer(e),o="number"!=typeof i[0]?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=l;const c=xte(s,l,.5);return"number"==typeof i[2+o]&&(i[2+o]/=c),"number"==typeof i[3+o]&&(i[3+o]/=c),a(i)}},kte={borderRadius:{...vte,applyTo:[...yte]},borderTopLeftRadius:vte,borderTopRightRadius:vte,borderBottomLeftRadius:vte,borderBottomRightRadius:vte,boxShadow:_te};function wte(e,{layout:t,layoutId:n}){return E7.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!kte[e]||"opacity"===e)}function Cte(e,t,n){const r=e.style,i=t?.style,a={};if(!r)return a;for(const t in r)(m9(r[t])||i&&m9(i[t])||wte(t,e)||void 0!==n?.getValue(t)?.liveStyle)&&(a[t]=r[t]);return a}function Tte(e,t,n){const r=Cte(e,t,n);for(const n in e)(m9(e[n])||m9(t[n]))&&(r[-1!==S7.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}class $te extends ite{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=h9}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(E7.has(t)){const e=d9(t);return e&&e.default||0}return t=mte.has(t)?t:ate(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Tte(e,t,n)}build(e,t,n){hte(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){!function(e,t,n,r){gte(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(mte.has(n)?n:ate(n),t.attrs[n])}(e,t,0,r)}mount(e){this.isSVGTag=fte(e.tagName),super.mount(e)}}function Ate({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ste(e){return void 0===e||1===e}function Ete({scale:e,scaleX:t,scaleY:n}){return!Ste(e)||!Ste(t)||!Ste(n)}function Rte(e){return Ete(e)||Ite(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ite(e){return Lte(e.x)||Lte(e.y)}function Lte(e){return e&&"0%"!==e}function Nte(e,t,n){return n+t*(e-n)}function Mte(e,t,n,r,i){return void 0!==i&&(e=Nte(e,i,r)),Nte(e,n,r)+t}function Dte(e,t=0,n=1,r,i){e.min=Mte(e.min,t,n,r,i),e.max=Mte(e.max,t,n,r,i)}function Pte(e,{x:t,y:n}){Dte(e.x,t.translate,t.scale,t.originPoint),Dte(e.y,n.translate,n.scale,n.originPoint)}const Ote=.999999999999,Fte=1.0000000000001;function jte(e,t){e.min+=t,e.max+=t}function Bte(e,t,n,r,i=.5){Dte(e,t,n,xte(e.min,e.max,i),r)}function zte(e,t){return"string"==typeof e?parseFloat(e)/100*(t.max-t.min):e}function qte(e,t,n){const r=n??e;Bte(e.x,zte(t.x,r.x),t.scaleX,t.scale,t.originX),Bte(e.y,zte(t.y,r.y),t.scaleY,t.scale,t.originY)}function Ute(e,t){return Ate(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}class Wte extends ite{constructor(){super(...arguments),this.type="html",this.renderInstance=gte}readValueFromInstance(e,t){if(E7.has(t))return this.projection?.isProjecting?D9(t):((e,t)=>{const{transform:n="none"}=getComputedStyle(e);return P9(n,t)})(e,t);{const r=(n=e,window.getComputedStyle(n)),i=(_9(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return Ute(e,t)}build(e,t,n){cte(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Cte(e,t,n)}}const Kte=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Vte(e){return"string"==typeof e&&!e.includes("-")&&!!(Kte.indexOf(e)>-1||/[A-Z]/u.test(e))}const Gte=(e,t)=>t.isSVG??Vte(e)?new $te(t):new Wte(t,{allowProjection:e!==p.Fragment}),Zte=(0,p.createContext)({strict:!1}),Yte=(0,p.createContext)({});function Hte(e){return Array.isArray(e)?e.join(" "):e}function Xte(e,t,n){for(const r in t)m9(t[r])||wte(r,n)||(e[r]=t[r])}function Qte(e,t){const n={},r=function(e,t){const n={};return Xte(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,p.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return cte(n,t,e),Object.assign({},n.vars,n.style)},[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function Jte(e,t,n,r){const i=(0,p.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return hte(n,t,fte(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};Xte(t,e.style,e),i.style={...t,...i.style}}return i}const ene=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function tne(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ene.has(e)}let nne=e=>!tne(e);try{"function"==typeof(rne=require("@emotion/is-prop-valid").default)&&(nne=e=>e.startsWith("on")?!tne(e):rne(e))}catch{}var rne;function ine(e,t,n,{latestValues:r},i,a=!1,o){const s=(o??Vte(e)?Jte:Qte)(t,r,i,e),l=function(e,t,n){const r={};for(const i in e)"values"===i&&"object"==typeof e.values||m9(e[i])||(nne(i)||!0===n&&tne(i)||!t&&!tne(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}(t,"string"==typeof e,a),c=e!==p.Fragment?{...l,...s,ref:n}:{},{children:u}=t,d=(0,p.useMemo)(()=>m9(u)?u.get():u,[u]);return(0,p.createElement)(e,{...c,children:d})}function ane(e){return m9(e)?e.get():e}function one(e,t,n,r){const i={},a=r(e,{});for(const e in a)i[e]=ane(a[e]);let{initial:o,animate:s}=e;const l=Gee(e),c=Zee(e);t&&c&&!l&&!1!==e.inherit&&(void 0===o&&(o=t.initial),void 0===s&&(s=t.animate));let u=!!n&&!1===n.initial;u=u||!1===o;const p=u?s:o;if(p&&"boolean"!=typeof p&&!Uee(p)){const t=Array.isArray(p)?p:[p];for(let n=0;n(t,n)=>{const r=(0,p.useContext)(Yte),i=(0,p.useContext)(f7),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:one(n,r,i,e),renderState:t()}}(e,t,r,i);return n?a():h7(a)},lne=sne({scrapeMotionValuesFromProps:Cte,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})}),cne=sne({scrapeMotionValuesFromProps:Tte,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}})}),une={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let pne=!1;function dne(){return function(){if(pne)return;const e={};for(const t in une)e[t]={isEnabled:e=>une[t].some(t=>!!e[t])};nte(e),pne=!0}(),tte}const hne=Symbol.for("motionComponentSymbol");function mne(e,t,n){const r=(0,p.useRef)(n);(0,p.useInsertionEffect)(()=>{r.current=n});const i=(0,p.useRef)(null);return(0,p.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());const a=r.current;if("function"==typeof a)if(n){const e=a(n);"function"==typeof e&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n)},[t])}const fne="data-"+ate("framerAppearId"),gne=(0,p.createContext)({});function yne(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function bne(e,t,n,r,i,a){const{visualElement:o}=(0,p.useContext)(Yte),s=(0,p.useContext)(Zte),l=(0,p.useContext)(f7),c=(0,p.useContext)(b7),u=c.reducedMotion,d=c.skipAnimations,h=(0,p.useRef)(null),m=(0,p.useRef)(!1);r=r||s.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),m.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const f=h.current,g=(0,p.useContext)(gne);!f||f.projection||!i||"html"!==f.type&&"svg"!==f.type||function(e,t,n,r){const{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:vne(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:Boolean(o)||s&&yne(s),visualElement:e,animationType:"string"==typeof a?a:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}(h.current,n,i,g);const y=(0,p.useRef)(!1);(0,p.useInsertionEffect)(()=>{f&&y.current&&f.update(n,l)});const b=n[fne],v=(0,p.useRef)(Boolean(b)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(b)&&window.MotionHasOptimisedAnimation?.(b));return m7(()=>{m.current=!0,f&&(y.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),v.current&&f.animationState&&f.animationState.animateChanges())}),(0,p.useEffect)(()=>{f&&(!v.current&&f.animationState&&f.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(b)}),v.current=!1),f.enteringChildren=void 0)}),f}function vne(e){if(e)return!1!==e.options.allowProjection?e.projection:vne(e.parent)}function xne(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&function(e){const t=dne();for(const n in e)t[n]={...t[n],...e[n]};nte(t)}(r);const a=n?"svg"===n:Vte(e),o=a?cne:lne;function s(n,r){let s;const l={...(0,p.useContext)(b7),...n,layoutId:_ne(n)},{isStatic:c}=l,u=function(e){const{initial:t,animate:n}=function(e,t){if(Gee(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Wee(t)?t:void 0,animate:Wee(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,p.useContext)(Yte));return(0,p.useMemo)(()=>({initial:t,animate:n}),[Hte(t),Hte(n)])}(n),d=o(n,c);if(!c&&"undefined"!=typeof window){(0,p.useContext)(Zte).strict;const t=function(e){const t=dne(),{drag:n,layout:r}=t;if(!n&&!r)return{};const i={...n,...r};return{MeasureLayout:n?.isEnabled(e)||r?.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(l);s=t.MeasureLayout,u.visualElement=bne(e,d,l,i,t.ProjectionNode,a)}return(0,v.jsxs)(Yte.Provider,{value:u,children:[s&&u.visualElement?(0,v.jsx)(s,{visualElement:u.visualElement,...l}):null,ine(e,n,mne(d,u.visualElement,r),d,c,t,a)]})}s.displayName=`motion.${"string"==typeof e?e:`create(${e.displayName??e.name??""})`}`;const l=(0,p.forwardRef)(s);return l[hne]=e,l}function _ne({layoutId:e}){const t=(0,p.useContext)(d7).id;return t&&void 0!==e?t+"-"+e:e}function kne(e,t){if("undefined"==typeof Proxy)return xne;const n=new Map,r=(n,r)=>xne(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>"create"===a?r:(n.has(a)||n.set(a,xne(a,void 0,e,t)),n.get(a))})}class wne{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Cne(e,t,n){const r=e.getProps();return Jee(r,t,void 0!==n?n:r.custom,e)}function Tne(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function $ne(e,t){const n=e?.[t]??e?.default??e;return n!==e?Tne(n,e):n}const Ane=e=>Array.isArray(e);function Sne(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Bee(n))}function Ene(e){return Ane(e)?e[e.length-1]||0:e}function Rne(e,t){const n=e.getValue("willChange");if(r=n,Boolean(m9(r)&&r.add))return n.add(t);if(!n&&U9.WillChange){const n=new U9.WillChange("auto");e.addValue("willChange",n),n.add(t)}var r}function Ine(e){return e.props[fne]}const Lne=(...e)=>e.reduce((e,t)=>n=>t(e(n)));function Nne(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Mne(e,t){return n=>n>0?t:e}const Dne=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Pne=[z7,B7,Y7];function One(e){const t=(n=e,Pne.find(e=>e.test(n)));var n;if(Boolean(t),!Boolean(t))return!1;let r=t.parse(e);return t===Y7&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let i=0,a=0,o=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Nne(s,r,e+1/3),a=Nne(s,r,e),o=Nne(s,r,e-1/3)}else i=a=o=n;return{red:Math.round(255*i),green:Math.round(255*a),blue:Math.round(255*o),alpha:r}}(r)),r}const Fne=(e,t)=>{const n=One(e),r=One(t);if(!n||!r)return Mne(e,t);const i={...n};return e=>(i.red=Dne(n.red,r.red,e),i.green=Dne(n.green,r.green,e),i.blue=Dne(n.blue,r.blue,e),i.alpha=xte(n.alpha,r.alpha,e),B7.transform(i))},jne=new Set(["none","hidden"]);function Bne(e,t){return n=>xte(e,t,n)}function zne(e){return"number"==typeof e?Bne:"string"==typeof e?w9(e)?Mne:H7.test(e)?Fne:Wne:Array.isArray(e)?qne:"object"==typeof e?H7.test(e)?Fne:Une:Mne}function qne(e,t){const n=[...e],r=n.length,i=e.map((e,n)=>zne(e)(e,t[n]));return e=>{for(let t=0;t{for(const t in r)n[t]=r[t](e);return n}}const Wne=(e,t)=>{const n=r9.createTransformer(t),r=t9(e),i=t9(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?jne.has(e)&&!i.values.length||jne.has(t)&&!r.values.length?function(e,t){return jne.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Lne(qne(function(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i{const t=({timestamp:t})=>e(t);return{start:(e=!0)=>V9.update(t,e),stop:()=>G9(t),now:()=>Z9.isProcessing?Z9.timestamp:Pee.now()}};function Gne(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}const Zne=.01,Yne=2,Hne=.005,Xne=.5;function Qne(e,t){return e*Math.sqrt(1-t*t)}const Jne=["duration","bounce"],ere=["stiffness","damping","mass"];function tre(e,t){return t.some(t=>void 0!==e[t])}function nre(e=.3,t=.3){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:c,mass:u,duration:p,velocity:d,isResolvedFromDuration:h}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!tre(e,ere)&&tre(e,Jne))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(1.2*n),i=r*r,a=2*R7(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:1,stiffness:i,damping:a}}else{const n=function({duration:e=800,bounce:t=.3,velocity:n=0,mass:r=1}){let i,a;cee(10);let o=1-t;o=R7(.05,1,o),e=R7(.01,10,uee(e)),o<1?(i=t=>{const r=t*o,i=r*e;return.001-(r-n)/Qne(t,o)*Math.exp(-i)},a=t=>{const r=t*o*e,a=r*n+n,s=Math.pow(o,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=Qne(Math.pow(t,2),o);return(.001-i(t)>0?-1:1)*((a-s)*l)/c}):(i=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,a=t=>Math.exp(-t*e)*(e*e*(n-t)));const s=function(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}(i,a,5/e);if(e=cee(e),isNaN(s))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(s,2)*r;return{stiffness:t,damping:2*o*Math.sqrt(r*t),duration:e}}}({...e,velocity:0});t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}({...n,velocity:-uee(n.velocity||0)}),m=d||0,f=c/(2*Math.sqrt(l*u)),g=o-a,y=uee(Math.sqrt(l/u)),b=Math.abs(g)<5;let v,x,_,k,w,C;if(r||(r=b?Zne:Yne),i||(i=b?Hne:Xne),f<1)_=Qne(y,f),k=(m+f*y*g)/_,v=e=>{const t=Math.exp(-f*y*e);return o-t*(k*Math.sin(_*e)+g*Math.cos(_*e))},w=f*y*k+g*_,C=f*y*g-k*_,x=e=>Math.exp(-f*y*e)*(w*Math.sin(_*e)+C*Math.cos(_*e));else if(1===f){v=e=>o-Math.exp(-y*e)*(g+(m+y*g)*e);const e=m+y*g;x=t=>Math.exp(-y*t)*(y*e*t-m)}else{const e=y*Math.sqrt(f*f-1);v=t=>{const n=Math.exp(-f*y*t),r=Math.min(e*t,300);return o-n*((m+f*y*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};const t=(m+f*y*g)/e,n=f*y*t-g*e,r=f*y*g-t*e;x=t=>{const i=Math.exp(-f*y*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}const T={calculatedDuration:h&&p||null,velocity:e=>cee(x(e)),next:e=>{if(!h&&f<1){const t=Math.exp(-f*y*e),n=Math.sin(_*e),a=Math.cos(_*e),l=o-t*(k*n+g*a),c=cee(t*(w*n+C*a));return s.done=Math.abs(c)<=r&&Math.abs(o-l)<=i,s.value=s.done?o:l,s}const t=v(e);if(h)s.done=e>=p;else{const n=cee(x(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{const e=Math.min(Gne(T),2e4),t=Cee(t=>T.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return T}function rre(e,t,n){const r=Math.max(t-5,0);return Oee(n-e(r),t-r)}function ire({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:l,restDelta:c=.5,restSpeed:u}){const p=e[0],d={done:!1,value:p},h=e=>void 0===s?l:void 0===l||Math.abs(s-e)-m*Math.exp(-e/r),b=e=>g+y(e),v=e=>{const t=y(e),n=b(e);d.done=Math.abs(t)<=c,d.value=d.done?g:n};let x,_;const k=e=>{var t;t=d.value,(void 0!==s&&tl)&&(x=e,_=nre({keyframes:[d.value,h(d.value)],velocity:rre(b,e,d.value),damping:i,stiffness:a,restDelta:c,restSpeed:u}))};return k(0),{calculatedDuration:null,next:e=>{let t=!1;return _||void 0!==x||(t=!0,v(e),k(e)),void 0!==x&&e>=x?_.next(e-x):(!t&&v(e),d)}}}nre.applyToOptions=e=>{const t=function(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(Gne(r),2e4);return{type:"keyframes",ease:e=>r.next(i*e).value/t,duration:uee(i)}}(e,100,nre);return e.ease=t.ease,e.duration=cee(t.duration),e.type="keyframes",e};const are=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function ore(e,t,n,r){if(e===t&&n===r)return q9;return i=>0===i||1===i?i:are(function(e,t,n,r,i){let a,o,s=0;do{o=t+(n-t)/2,a=are(o,r,i)-e,a>0?n=o:t=o}while(Math.abs(a)>1e-7&&++s<12);return o}(i,0,1,e,n),t,r)}const sre=ore(.42,0,1,1),lre=ore(0,0,.58,1),cre=ore(.42,0,.58,1),ure=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,pre=e=>t=>1-e(1-t),dre=ore(.33,1.53,.69,.99),hre=pre(dre),mre=ure(hre),fre=e=>e>=1?1:(e*=2)<1?.5*hre(e):.5*(2-Math.pow(2,-10*(e-1))),gre=e=>1-Math.sin(Math.acos(e)),yre=pre(gre),bre=ure(gre),vre={linear:q9,easeIn:sre,easeInOut:cre,easeOut:lre,circIn:gre,circInOut:bre,circOut:yre,backIn:hre,backInOut:mre,backOut:dre,anticipate:fre},xre=e=>{if(kee(e)){e.length;const[t,n,r,i]=e;return ore(t,n,r,i)}return"string"==typeof e?vre[e]:e},_re=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};function kre({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(xre):xre(r),a={done:!1,value:t[0]},o=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:function(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=_re(0,t,r);e.push(xte(n,1,i))}}(t,e.length-1),t}(t),e),s=function(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(t.length,1===a)return()=>t[0];if(2===a&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],i=n||U9.mix||Kne,a=e.length-1;for(let n=0;n{if(o&&n1)for(;rc(R7(e[0],e[a-1],t)):c}(o,t,{ease:Array.isArray(i)?i:(l=t,c=i,l.map(()=>c||cre).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(a.value=s(t),a.done=t>=e,a)}}const wre={decay:ire,inertia:ire,tween:kre,keyframes:kre,spring:nre};function Cre(e){"string"==typeof e.type&&(e.type=wre[e.type])}const Tre=e=>e/100;class $re extends _ee{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:e}=this.options;e&&e.updatedAt!==Pee.now()&&this.tick(Pee.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){const{options:e}=this;Cre(e);const{type:t=kre,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e;let{keyframes:o}=e;const s=t||kre;s!==kre&&"number"!=typeof o[0]&&(this.mixKeyframes=Lne(Tre,Kne(o[0],o[1])),o=[0,100]);const l=s({...e,keyframes:o});"mirror"===i&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),null===l.calculatedDuration&&(l.calculatedDuration=Gne(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=l}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:u,repeatType:p,repeatDelay:d,type:h,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=r);let b,v=this.currentTime,x=n;if(u){const e=Math.min(this.currentTime,r)/o;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,u+1),Boolean(t%2)&&("reverse"===p?(n=1-n,d&&(n-=d/o)):"mirror"===p&&(x=a)),v=R7(0,1,n)*o}y?(this.delayState.value=c[0],b=this.delayState):b=x.next(v),i&&!y&&(b.value=i(b.value));let{done:_}=b;y||null===s||(_=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const k=null===this.holdTime&&("finished"===this.state||"running"===this.state&&_);return k&&h!==ire&&(b.value=xee(c,this.options,f,this.speed)),m&&m(b.value),k&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return uee(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+uee(e)}get time(){return uee(this.currentTime)}set time(e){e=cee(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;return e<=0?this.options.velocity||0:this.generator.velocity?this.generator.velocity(e):rre(e=>this.generator.next(e).value,e,this.generator.next(e).value)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Pee.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=uee(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=Vne,startTime:t}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=t??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Pee.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}const Are={anticipate:fre,backInOut:mre,circInOut:bre};class Sre extends Ree{constructor(e){var t;"string"==typeof(t=e).ease&&t.ease in Are&&(t.ease=Are[t.ease]),Cre(e),super(e),void 0!==e.startTime&&!1!==e.autoplay&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);const o=new $re({...a,autoplay:!1}),s=Math.max(10,Pee.now()-this.startTime),l=R7(0,10,s-10),c=o.sample(s).value,{name:u}=this.options;i&&u&&mee(i,u,c),t.setWithVelocity(o.sample(Math.max(0,s-l)).value,c,l),o.stop()}}const Ere=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!r9.test(e)&&"0"!==e||e.startsWith("url(")));function Rre(e){e.duration=0,e.type="keyframes"}const Ire=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/,Lre=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Nre=fee(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Mre extends _ee{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:a="loop",keyframes:o,name:s,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Pee.now();const p={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:l,element:c,...u},d=c?.KeyframeResolver||nee;this.keyframeResolver=new d(o,(e,t,n)=>this.onKeyframesResolved(e,t,p,!n),s,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;const{name:i,type:a,velocity:o,delay:s,isHandoff:l,onUpdate:c}=n;this.resolvedAt=Pee.now();let u=!0;(function(e,t,n,r){const i=e[0];if(null===i)return!1;if("display"===t||"visibility"===t)return!0;const a=e[e.length-1],o=Ere(i,t),s=Ere(a,t);return!(!o||!s)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},d=u&&!l&&function(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,l=t?.owner?.current;if(!(l instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return Nre()&&n&&(Iee.has(n)||Lre.has(n)&&function(e){for(let t=0;t{this.notifyFinished()}).catch(q9),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),J9=!0,tee(),eee(),J9=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const Dre={type:"spring",stiffness:500,damping:25,restSpeed:10},Pre={type:"keyframes",duration:.8},Ore={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fre=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]),jre=(e,t,n,r={},i,a)=>o=>{const s=$ne(r,e)||{},l=s.delay||r.delay||0;let{elapsed:c=0}=r;c-=cee(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};(function(e){for(const t in e)if(!Fre.has(t))return!0;return!1})(s)||Object.assign(u,((e,{keyframes:t})=>t.length>2?Pre:E7.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Dre:Ore)(e,u)),u.duration&&(u.duration=cee(u.duration)),u.repeatDelay&&(u.repeatDelay=cee(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let p=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(Rre(u),0===u.delay&&(p=!0)),(U9.instantAnimations||U9.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(p=!0,Rre(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,p&&!a&&void 0!==t.get()){const e=xee(u.keyframes,s);if(void 0!==e)return void V9.update(()=>{u.onUpdate(e),u.onComplete()})}return s.isSync?new $re(u):new Mre(u)};function Bre({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function zre(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t;const l=e.getDefaultTransition();a=a?Tne(a,l):l;const c=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);const p=[],d=i&&e.animationState&&e.animationState.getState()[i],h=a?.path;h&&h.animateVisualElement(e,s,a,n,p);for(const t in s){const r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(void 0===i||d&&Bre(d,t))continue;const o={delay:n,...$ne(a||{},t)};u&&(o.skipAnimations=!0);const l=r.get();if(void 0!==l&&!r.isAnimating()&&!Array.isArray(i)&&i===l&&!o.velocity){V9.update(()=>r.set(i));continue}let h=!1;if(window.MotionHandoffAnimation){const n=Ine(e);if(n){const e=window.MotionHandoffAnimation(n,t,V9);null!==e&&(o.startTime=e,h=!0)}}Rne(e,t);const m=c??e.shouldReduceMotion;r.start(jre(t,r,i,m&&f9.has(t)?{type:!1}:o,e,h));const f=r.animation;f&&p.push(f)}if(o){const t=()=>V9.update(()=>{o&&function(e,t){const n=Cne(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const t in a)Sne(e,t,Ene(a[t]))}(e,o)});p.length?Promise.all(p).then(t):t()}return p}function qre(e,t,n,r=0,i=1){const a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return"function"==typeof n?n(a,o):1===i?a*r:s-a*r}function Ure(e,t,n={}){const r=Cne(e,t,"exit"===n.type?e.presenceContext?.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const a=r?()=>Promise.all(zre(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return function(e,t,n=0,r=0,i=0,a=1,o){const s=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),s.push(Ure(l,t,{...o,delay:n+("function"==typeof r?0:r)+qre(e.variantChildren,l,r,i,a)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(s)}(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){const[e,t]="beforeChildren"===s?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}const Wre=Vee.length;function Kre(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&Kre(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;nPromise.all(t.map(({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const i=t.map(t=>Ure(e,t,n));r=Promise.all(i)}else if("string"==typeof t)r=Ure(e,t,n);else{const i="function"==typeof t?Cne(e,t,n.custom):t;r=Promise.all(zre(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}(e,t,n)))}(e),n=Qre(),r=!0,i=!1;const a=t=>(n,r)=>{const i=Cne(e,r,"exit"===t?e.presenceContext?.custom:void 0);if(i){const{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(o){const{props:s}=e,l=Kre(e.parent)||{},c=[],u=new Set;let p={},d=1/0;for(let t=0;td&&g,_=!1;const k=Array.isArray(f)?f:[f];let w=k.reduce(a(h),{});!1===y&&(w={});const{prevResolvedValues:C={}}=m,T={...C,...w},$=t=>{x=!0,u.has(t)&&(_=!0,u.delete(t)),m.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in T){const t=w[e],n=C[e];if(p.hasOwnProperty(e))continue;let r=!1;r=Ane(t)&&Ane(n)?!Vre(t,n)||v:t!==n,r?null!=t?$(e):u.add(e):void 0!==t&&u.has(e)?$(e):m.protectedKeys[e]=!0}m.prevProp=f,m.prevResolvedValues=w,m.isActive&&(p={...p,...w}),(r||i)&&e.blockInitialAnimation&&(x=!1);const A=b&&v;x&&(!A||_)&&c.push(...k.map(t=>{const n={type:h};if("string"==typeof t&&(r||i)&&!A&&e.manuallyAnimateOnMount&&e.parent){const{parent:r}=e,i=Cne(r,t);if(r.enteringChildren&&i){const{delayChildren:t}=i.transition||{};n.delay=qre(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){const t={};if("boolean"!=typeof s.initial){const n=Cne(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{const r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),c.push({animation:t})}let h=Boolean(c.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(h=!1),r=!1,i=!1,h?t(c):Promise.resolve()}return{animateChanges:o,setActive:function(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;const i=o(t);for(const e in n)n[e].protectedKeys={};return i},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=Qre(),i=!0}}}function Hre(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Vre(t,e)}function Xre(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Qre(){return{animate:Xre(!0),whileInView:Xre(),whileHover:Xre(),whileTap:Xre(),whileDrag:Xre(),whileFocus:Xre(),exit:Xre()}}let Jre=0;const eie={animation:{Feature:class extends wne{constructor(e){super(e),e.animationState||(e.animationState=Yre(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Uee(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends wne{constructor(){super(...arguments),this.id=Jre++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&!1===n){if(this.isExitComplete){const{initial:e,custom:t}=this.node.getProps();if("string"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)){const n=Cne(this.node,e,t);if(n){const{transition:e,transitionEnd:t,...r}=n;for(const e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){const{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}},tie={x:!1,y:!1};function nie(){return tie.x||tie.y}function rie(e){return[e("x"),e("y")]}function iie(e){return e.max-e.min}function aie(e,t,n,r=.5){e.origin=r,e.originPoint=xte(t.min,t.max,e.origin),e.scale=iie(n)/iie(t),e.translate=xte(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function oie(e,t,n,r){aie(e.x,t.x,n.x,r?r.originX:void 0),aie(e.y,t.y,n.y,r?r.originY:void 0)}function sie(e,t,n,r=0){const i=r?xte(n.min,n.max,r):n.min;e.min=i+t.min,e.max=e.min+iie(t)}function lie(e,t,n,r=0){const i=r?xte(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+iie(t)}function cie(e,t,n,r){lie(e.x,t.x,n.x,r?.x),lie(e.y,t.y,n.y,r?.y)}const uie=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),pie=new Set(["INPUT","SELECT","TEXTAREA"]);function die(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function hie(e){return g7(e)&&"ownerSVGElement"in e}function mie(e,t,n){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){let r=document;t&&(r=t.current);const i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>null!=e)}const fie=new WeakMap;let gie;const yie=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+"Size"]:hie(r)&&"getBBox"in r?r.getBBox()[t]:r[n],bie=yie("inline","width","offsetWidth"),vie=yie("block","height","offsetHeight");function xie({target:e,borderBoxSize:t}){fie.get(e)?.forEach(n=>{n(e,{get width(){return bie(e,t)},get height(){return vie(e,t)}})})}function _ie(e){e.forEach(xie)}const kie=new Set;let wie;function Cie(e,t){return"function"==typeof e?(n=e,kie.add(n),wie||(wie=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};kie.forEach(t=>t(e))},window.addEventListener("resize",wie)),()=>{kie.delete(n),kie.size||"function"!=typeof wie||(window.removeEventListener("resize",wie),wie=void 0)}):function(e,t){gie||"undefined"!=typeof ResizeObserver&&(gie=new ResizeObserver(_ie));const n=mie(e);return n.forEach(e=>{let n=fie.get(e);n||(n=new Set,fie.set(e,n)),n.add(t),gie?.observe(e)}),()=>{n.forEach(e=>{const n=fie.get(e);n?.delete(t),n?.size||gie?.unobserve(e)})}}(e,t);var n}const Tie=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function $ie(e){return{point:{x:e.pageX,y:e.pageY}}}function Aie(e,t,n,r){return die(e,t,(e=>t=>Tie(t)&&e(t,$ie(t)))(n),r)}const Sie=({current:e})=>e?e.ownerDocument.defaultView:null,Eie=(e,t)=>Math.abs(e-t),Rie=new Set(["auto","scroll"]);class Iie{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Lie(this.lastRawMoveEventInfo,this.transformPagePoint));const e=Mie(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=Eie(e.x,t.x),r=Eie(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;const{point:r}=e,{timestamp:i}=Z9;this.history.push({...r,timestamp:i});const{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Lie(t,this.transformPagePoint),V9.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||i&&i(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const a=Mie("pointercancel"===e.type?this.lastMoveEventInfo:Lie(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Tie(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;const s=Lie($ie(e),this.transformPagePoint),{point:l}=s,{timestamp:c}=Z9;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=t;u&&u(e,Mie(s,this.history));const p={passive:!0,capture:!0};this.removeListeners=Lne(Aie(this.contextWindow,"pointermove",this.handlePointerMove,p),Aie(this.contextWindow,"pointerup",this.handlePointerUp,p),Aie(this.contextWindow,"pointercancel",this.handlePointerUp,p)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){const e=getComputedStyle(t);(Rie.has(e.overflowX)||Rie.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const t=this.scrollPositions.get(e);if(!t)return;const n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i=r.x-t.x,a=r.y-t.y;0===i&&0===a||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i,this.lastMoveEventInfo.point.y+=a):this.history.length>0&&(this.history[0].x-=i,this.history[0].y-=a),this.scrollPositions.set(e,r),V9.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),G9(this.updatePoint)}}function Lie(e,t){return t?{point:t(e.point)}:e}function Nie(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Mie({point:e},t){return{point:e,delta:Nie(e,Pie(t)),offset:Nie(e,Die(t)),velocity:Oie(t,.1)}}function Die(e){return e[0]}function Pie(e){return e[e.length-1]}function Oie(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=Pie(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>cee(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>2*cee(t)&&(r=e[1]);const a=uee(i.timestamp-r.timestamp);if(0===a)return{x:0,y:0};const o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Fie(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function jie(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min{t&&this.snapToCursor($ie(e).point),this.stopAnimation()},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(a=n)||"y"===a?tie[a]?null:(tie[a]=!0,()=>{tie[a]=!1}):tie.x||tie.y?null:(tie.x=tie.y=!0,()=>{tie.x=tie.y=!1}),!this.openDragLock))return;var a;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),rie(e=>{let t=this.getAxisMotionValue(e).get()||0;if(W7.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];r&&(t=iie(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&V9.update(()=>i(e,t),!1,!0),Rne(this.visualElement,"transform");const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:o}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(o),void(null!==this.currentDirection&&i&&i(this.currentDirection));this.updateAxis("x",t.point,o),this.updateAxis("y",t.point,o),this.visualElement.render(),a&&V9.update(()=>a(e,t),!1,!0)},onSessionEnd:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,distanceThreshold:n,contextWindow:Sie(this.visualElement),element:this.visualElement.current})}stop(e,t){const n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;const{velocity:a}=r;this.startAnimation(a);const{onDragEnd:o}=this.getProps();o&&V9.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!Kie(e,r,this.currentDirection))return;const i=this.getAxisMotionValue(e);let a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=function(e,{min:t,max:n},r){return void 0!==t&&en&&(e=r?xte(n,e,r.max):Math.min(e,n)),e}(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){const{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&yne(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!n)&&function(e,{top:t,left:n,bottom:r,right:i}){return{x:Fie(e.x,n,i),y:Fie(e.y,t,r)}}(n.layoutBox,e),this.elastic=function(e=.35){return!1===e?e=0:!0===e&&(e=.35),{x:Bie(e,"left","right"),y:Bie(e,"top","bottom")}}(t),r!==this.constraints&&!yne(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&rie(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!yne(e))return!1;const n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());const i=function(e,t,n){const r=Ute(e,n),{scroll:i}=t;return i&&(jte(r.x,i.offset.x),jte(r.y,i.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let a=function(e,t){return{x:jie(e.x,t.x),y:jie(e.y,t.y)}}(r.layout.layoutBox,i);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(a));this.hasMutatedConstraints=!!e,e&&(a=Ate(e))}return a}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},l=rie(o=>{if(!Kie(o,t,this.currentDirection))return;let l=s&&s[o]||{};!0!==a&&a!==o||(l={min:0,max:0});const c=r?200:1e6,u=r?40:1e7,p={type:"inertia",velocity:n?e[o]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(o,p)});return Promise.all(l).then(o)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return Rne(this.visualElement,e),n.start(jre(e,n,0,t,this.visualElement,!1))}stopAnimation(){rie(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){rie(t=>{const{drag:n}=this.getProps();if(!Kie(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-xte(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!yne(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};rie(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=iie(e),i=iie(t);return i>r?n=_re(t.min,t.max-r,e.min):r>i&&(n=_re(e.min,e.max-i,t.min)),R7(0,1,n)}({min:n,max:n},this.constraints[e])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),rie(t=>{if(!Kie(t,e,null))return;const n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(xte(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;qie.set(this.visualElement,this);const e=this.visualElement.current,t=Aie(e,"pointerdown",t=>{const{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&function(e){return pie.has(e.tagName)||!0===e.isContentEditable}(i);n&&r&&!a&&this.start(t)});let n;const r=()=>{const{dragConstraints:t}=this.getProps();yne(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(e,t,n){const r=Cie(e,Wie(n)),i=Cie(t,Wie(n));return()=>{r(),i()}}(e,t.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,a=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),V9.read(r);const o=die(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(rie(t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())});return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=.35,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}}function Wie(e){let t=!0;return()=>{t?t=!1:e()}}function Kie(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const Vie=e=>(t,n)=>{e&&V9.update(()=>e(t,n),!1,!0)},Gie={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Zie=!1;class Yie extends p.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Zie&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Gie.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Zie=!0,r||e.layoutDependency!==t||void 0===t||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||V9.postRender(()=>{const e=a.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Lee.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Zie=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Hie(e){const[t,n]=C7(),r=(0,p.useContext)(d7);return(0,v.jsx)(Yie,{...e,layoutGroup:r,switchLayoutGroup:(0,p.useContext)(gne),isPresent:t,safeToRemove:n})}const Xie={value:null,addProjectionMetrics:null};const Qie=yte.length,Jie=e=>"string"==typeof e?parseFloat(e):e,eae=e=>"number"==typeof e||K7.test(e);function tae(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const nae=iae(0,.5,yre),rae=iae(.5,.95,q9);function iae(e,t,n){return r=>rt?1:n(_re(e,t,r))}function aae(e,t){e.min=t.min,e.max=t.max}function oae(e,t){aae(e.x,t.x),aae(e.y,t.y)}function sae(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function lae(e,t,n,r,i){return e=Nte(e-=t,1/n,r),void 0!==i&&(e=Nte(e,1/i,r)),e}function cae(e,t,[n,r,i],a,o){!function(e,t=0,n=1,r=.5,i,a=e,o=e){if(W7.test(t)&&(t=parseFloat(t),t=xte(o.min,o.max,t/100)-o.min),"number"!=typeof t)return;let s=xte(a.min,a.max,r);e===a&&(s-=t),e.min=lae(e.min,t,n,s,i),e.max=lae(e.max,t,n,s,i)}(e,t[n],t[r],t[i],t.scale,a,o)}const uae=["x","scaleX","originX"],pae=["y","scaleY","originY"];function dae(e,t,n,r){cae(e.x,t,uae,n?n.x:void 0,r?r.x:void 0),cae(e.y,t,pae,n?n.y:void 0,r?r.y:void 0)}function hae(e){return 0===e.translate&&1===e.scale}function mae(e){return hae(e.x)&&hae(e.y)}function fae(e,t){return e.min===t.min&&e.max===t.max}function gae(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function yae(e,t){return gae(e.x,t.x)&&gae(e.y,t.y)}function bae(e){return iie(e.x)/iie(e.y)}function vae(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class xae{constructor(){this.members=[]}add(e){pee(this.members,e);for(let t=this.members.length-1;t>=0;t--){const n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;const r=n.instance;r&&!1!==r.isConnected||n.snapshot||(dee(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(dee(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent&&!1!==e.instance?.isConnected)return this.promote(e),!0}return!1}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();const{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;void 0!==r&&r===i||(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),!1===e.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const _ae=(e,t)=>e.depth-t.depth;class kae{constructor(){this.children=[],this.isDirty=!1}add(e){pee(this.children,e),this.isDirty=!0}remove(e){dee(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(_ae),this.isDirty=!1,this.children.forEach(e)}}const wae={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Cae=["","X","Y","Z"];let Tae=0;function $ae(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Aae(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Ine(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",V9,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Aae(r)}function Sae({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Tae++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Xie.value&&(wae.nodes=wae.calculatedTargetDeltas=wae.calculatedProjections=0),this.nodes.forEach(Iae),this.nodes.forEach(Bae),this.nodes.forEach(zae),this.nodes.forEach(Lae),Xie.addProjectionMetrics&&Xie.addProjectionMetrics(wae)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;V9.read(()=>{r=window.innerWidth}),e(t,()=>{const e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=Pee.now(),r=({timestamp:i})=>{const a=i-n;a>=t&&(G9(r),e(a-t))};return V9.setup(r,!0),()=>G9(r)}(i,250),Gie.hasAnimatedSinceResize&&(Gie.hasAnimatedSinceResize=!1,this.nodes.forEach(jae)))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&a&&(r||i)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const i=this.options.transition||a.getDefaultTransition()||Gae,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=a.getProps(),l=!this.targetLayout||!yae(this.targetLayout,r),c=!t&&n;if(this.options.layoutRoot||this.resumeFrom||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const t={...$ne(i,"layout"),onPlay:o,onComplete:s};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,c,t.path)}else t||jae(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),G9(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(qae),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Aae(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||iie(this.snapshot.measuredBox.x)||iie(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;eOte&&(t.x=1),t.yOte&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,t),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox,e.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:s}=e;s?(this.projectionDelta&&this.prevProjectionDelta?(sae(this.prevProjectionDelta.x,this.projectionDelta.x),sae(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),oie(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&vae(this.projectionDelta.x,this.prevProjectionDelta.x)&&vae(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",s)),Xie.value&&wae.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1,n){const r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s={x:{min:0,max:0},y:{min:0,max:0}},l=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),u=!c||c.members.length<=1,p=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(Vae));let d;this.animationProgress=0;const h=n?.interpolateProjection(e);this.mixTargetDelta=t=>{const n=t/1e3,r=h?.(n);r?(o.x.translate=r.x,o.x.scale=xte(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=xte(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Wae(o.x,e.x,n),Wae(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(cie(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),function(e,t,n,r){Kae(e.x,t.x,n.x,r),Kae(e.y,t.y,n.y,r)}(this.relativeTarget,this.relativeTargetOrigin,s,n),d&&function(e,t){return fae(e.x,t.x)&&fae(e.y,t.y)}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),oae(d,this.relativeTarget)),l&&(this.animationValues=a,function(e,t,n,r,i,a){i?(e.opacity=xte(0,n.opacity??1,nae(r)),e.opacityExit=xte(t.opacity??1,0,rae(r))):a&&(e.opacity=xte(t.opacity??1,n.opacity??1,r));for(let i=0;i{Gie.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Bee(0)),this.motionValue.jump(0,!1),this.currentAnimation=function(e,t,n){const r=m9(e)?e:Bee(e);return r.start(jre("",r,[0,1e3],n)),r.animation}(this.motionValue,0,{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&Xae(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=iie(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=iie(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}oae(t,n),qte(t,i),oie(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new xae),this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){const{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&$ae("z",e,r,this.animationValues);for(let t=0;te.currentAnimation?.stop()),this.root.nodes.forEach(Mae),this.root.sharedNodes.clear()}}}function Eae(e){e.updateLayout()}function Rae(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if("size"===i)rie(e=>{const r=a?t.measuredBox[e]:t.layoutBox[e],i=iie(r);r.min=n[e].min,r.max=r.min+i});else if("x"===i||"y"===i){const e="x"===i?"y":"x";aae(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Xae(i,t.layoutBox,n)&&rie(r=>{const i=a?t.measuredBox[r]:t.layoutBox[r],o=iie(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});const o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};oie(o,n,t.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};a?oie(s,e.applyTransform(r,!0),t.measuredBox):oie(s,n,t.layoutBox);const l=!mae(o);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:i,layout:a}=r;if(i&&a){const o=e.options.layoutAnchor||void 0,s={x:{min:0,max:0},y:{min:0,max:0}};cie(s,t.layoutBox,i.layoutBox,o);const l={x:{min:0,max:0},y:{min:0,max:0}};cie(l,n,a.layoutBox,o),yae(s,l)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Iae(e){Xie.value&&wae.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Lae(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Nae(e){e.clearSnapshot()}function Mae(e){e.clearMeasurements()}function Dae(e){e.isLayoutDirty=!0,e.updateLayout()}function Pae(e){e.isLayoutDirty=!1}function Oae(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Fae(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function jae(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Bae(e){e.resolveTargetDelta()}function zae(e){e.calcProjection()}function qae(e){e.resetSkewAndRotation()}function Uae(e){e.removeLeadSnapshot()}function Wae(e,t,n){e.translate=xte(t.translate,0,n),e.scale=xte(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Kae(e,t,n,r){e.min=xte(t.min,n.min,r),e.max=xte(t.max,n.max,r)}function Vae(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const Gae={duration:.45,ease:[.4,0,.1,1]},Zae=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Yae=Zae("applewebkit/")&&!Zae("chrome/")?Math.round:q9;function Hae(e){e.min=Yae(e.min),e.max=Yae(e.max)}function Xae(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=bae(t),i=bae(n),!(Math.abs(r-i)<=.2));var r,i}function Qae(e){return e!==e.root&&e.scroll?.wasRoot}const Jae=Sae({attachResizeListener:(e,t)=>die(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),eoe={current:void 0},toe=Sae({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!eoe.current){const e=new Jae({});e.mount(window),e.setOptions({layoutScroll:!0}),eoe.current=e}return eoe.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),noe={pan:{Feature:class extends wne{constructor(){super(...arguments),this.removePointerDownListener=q9}onPointerDown(e){this.session=new Iie(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Sie(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Vie(e),onStart:Vie(t),onMove:Vie(n),onEnd:(e,t)=>{delete this.session,r&&V9.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Aie(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends wne{constructor(e){super(e),this.removeGroupControls=q9,this.removeListeners=q9,this.controls=new Uie(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||q9}update(){const{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:toe,MeasureLayout:Hie}};function roe(e,t){const n=mie(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function ioe(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const i=r["onHover"+n];i&&V9.postRender(()=>i(t,$ie(t)))}const aoe=(e,t)=>!!t&&(e===t||aoe(e,t.parentElement)),ooe=new WeakSet;function soe(e){return t=>{"Enter"===t.key&&e(t)}}function loe(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function coe(e){return Tie(e)&&!nie()}const uoe=new WeakSet;function poe(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap","Start"===n);const i=r["onTap"+("End"===n?"":n)];i&&V9.postRender(()=>i(t,$ie(t)))}const doe=new WeakMap,hoe=new WeakMap,moe=e=>{const t=doe.get(e.target);t&&t(e)},foe=e=>{e.forEach(moe)};const goe={some:0,all:1},yoe={inView:{Feature:class extends wne{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:goe[r]};this.stopObserver=function(e,t,n){const r=function({root:e,...t}){const n=e||document;hoe.has(n)||hoe.set(n,{});const r=hoe.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(foe,{root:e,...t})),r[i]}(t);return doe.set(e,n),r.observe(e),()=>{doe.delete(e),r.unobserve(e)}}(this.node.current,a,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,i&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends wne{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=function(e,t,n={}){const[r,i,a]=roe(e,n),o=e=>{const r=e.currentTarget;if(!coe(e))return;if(uoe.has(e))return;ooe.add(r),n.stopPropagation&&uoe.add(e);const a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener("pointerup",l,o),window.removeEventListener("pointercancel",c,o),ooe.has(r)&&ooe.delete(r),coe(e)&&"function"==typeof a&&a(e,{success:t})},l=e=>{s(e,r===window||r===document||n.useGlobalTarget||aoe(r,e.target))},c=e=>{s(e,!1)};window.addEventListener("pointerup",l,o),window.addEventListener("pointercancel",c,o)};return r.forEach(e=>{var t;(n.useGlobalTarget?window:e).addEventListener("pointerdown",o,i),y7(e)&&(e.addEventListener("focus",e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const r=soe(()=>{if(ooe.has(n))return;loe(n,"down");const e=soe(()=>{loe(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>loe(n,"cancel"),t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)})(e,i)),t=e,uie.has(t.tagName)||!0===t.isContentEditable||e.hasAttribute("tabindex")||(e.tabIndex=0))}),a}(e,(e,t)=>(poe(this.node,t,"Start"),(e,{success:t})=>poe(this.node,e,t?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends wne{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Lne(die(this.node.current,"focus",()=>this.onFocus()),die(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends wne{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[r,i,a]=roe(e,n);return r.forEach(e=>{let n,r=!1,a=!1;const o=t=>{n&&(n(t),n=void 0),e.removeEventListener("pointerleave",l)},s=e=>{r=!1,window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s),a&&(a=!1,o(e))},l=e=>{"touch"!==e.pointerType&&(r?a=!0:o(e))};e.addEventListener("pointerenter",r=>{if("touch"===r.pointerType||nie())return;a=!1;const o=t(e,r);"function"==typeof o&&(n=o,e.addEventListener("pointerleave",l,i))},i),e.addEventListener("pointerdown",()=>{r=!0,window.addEventListener("pointerup",s,i),window.addEventListener("pointercancel",s,i)},i)}),a}(e,(e,t)=>(ioe(this.node,t,"Start"),e=>ioe(this.node,e,"End"))))}unmount(){}}}},boe=kne({...eie,...yoe,...noe,layout:{ProjectionNode:toe,MeasureLayout:Hie}},Gte);function voe({channel:e,state:[t,n]}){const r=t?(0,v.jsx)(c7,{size:14}):(0,v.jsx)(u7,{size:14});return(0,v.jsxs)("button",{type:"button",onClick:()=>n(e=>!e),className:"flex w-full items-center justify-start gap-2",children:[(0,v.jsx)(p7,{size:14}),(0,v.jsx)("span",{className:"flex-1 text-left",children:`${t?"Hide":"Show"} ${null!=e?e:"thinking"}`}),r]})}function xoe({channel:e,text:t,isActive:n}){const[r,i]=(0,p.useState)(!0),a=(0,p.useRef)(n);return(0,p.useEffect)(()=>{a.current&&!n&&i(!1),a.current=n},[n]),(0,v.jsxs)("div",{className:`max-w-full min-w-0 border p-2 ${Xs.sm} ${Ls["primary-light"]} ${js["primary-light"]} ${il} ${ol["primary-light"]}`,children:[(0,v.jsx)(voe,{channel:null!=e?e:"thinking",state:[r,i]}),(0,v.jsx)(A7,{initial:!1,children:r&&(0,v.jsx)(boe.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{type:"tween",duration:.2},className:"overflow-hidden",children:(0,v.jsx)("div",{className:"pt-2 italic select-text",children:(0,v.jsx)(n7,{text:t})})})})]})}const _oe=h("outline","tool","Tool",[["path",{d:"M7 10h3v-3l-3.5 -3.5a6 6 0 0 1 8 8l6 6a2 2 0 0 1 -3 3l-6 -6a6 6 0 0 1 -8 -8l3.5 3.5",key:"svg-0"}]]);function koe({tool:e,state:[t,n]}){const r=t?(0,v.jsx)(c7,{size:14}):(0,v.jsx)(u7,{size:14});return(0,v.jsxs)("button",{type:"button",onClick:()=>n(e=>!e),className:"flex w-full items-center justify-start gap-2",children:[(0,v.jsx)(_oe,{size:14}),(0,v.jsxs)("span",{className:"flex-1 text-left",children:[(t?"Hide":"Show")+" tool call: "," ",(0,v.jsx)("code",{className:"font-mono",children:e||"..."})]}),r]})}function woe({argument:[e,t]}){return(0,v.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,v.jsxs)("span",{className:"text-primary-500 font-medium",children:[e,":"]}),null===t?(0,v.jsx)("span",{className:"font-mono",children:"null"}):"string"==typeof t&&t.includes("\n")?(0,v.jsx)(UJ,{code:t}):null!==t&&"object"==typeof t?(0,v.jsx)(UJ,{code:JSON.stringify(t,null,2),language:"json"}):(0,v.jsx)("span",{className:"font-mono",children:"String(value)"})]})}function Coe({id:e,name:t,arguments:n}){const[r,i]=(0,p.useState)(!1);return(0,v.jsxs)("div",{className:`max-w-full min-w-0 border p-2 ${Xs.sm} ${Ls["primary-light"]} ${js["primary-light"]} ${il} ${ol["primary-light"]}`,children:[(0,v.jsx)(koe,{tool:t,state:[r,i]}),(0,v.jsx)(A7,{initial:!1,children:r&&(0,v.jsx)(boe.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{type:"tween",duration:.2},className:"overflow-hidden",children:(0,v.jsxs)("div",{className:"flex flex-col gap-2 pt-2",children:[(0,v.jsxs)("div",{className:"flex gap-2",children:[(0,v.jsx)("span",{className:"text-primary-500 font-medium",children:"id:"}),(0,v.jsx)("span",{className:"font-mono",children:e})]}),Object.entries(n).map(([e,t])=>(0,v.jsx)(woe,{argument:[e,t]},e))]})})})]})}function Toe({text:e,onEdit:t}){return(0,v.jsxs)("div",{className:"group/msg flex w-full flex-col items-end gap-1",children:[(0,v.jsx)("div",{className:`max-w-full min-w-0 border p-2 ${Xs.md} ${Ls.flama} ${js.flama} ${il} ${ol.flama}`,children:(0,v.jsx)(n7,{text:e})}),(0,v.jsx)(s7,{align:"end",text:e,onEdit:t})]})}function $oe({message:e,isLastAssistant:t}){var n;const{isStreaming:r,regenerate:i}=Rl(),a=r&&t;if(0===e.blocks.length&&!e.error)return a?(0,v.jsx)(ag,{}):null;const o=e.blocks.length-1,s=null===(n=e.blocks.filter(e=>"text"===e.kind&&"output"===e.channel).at(-1))||void 0===n?void 0:n.id,l=t&&!r;return(0,v.jsx)("div",{className:"flex max-w-full flex-col items-start justify-start gap-2",children:e.error?(0,v.jsx)(Ml,{text:e.error}):e.blocks.map((e,t)=>"tool"===e.kind?(0,v.jsx)(Coe,{id:e.id,name:e.name,arguments:e.arguments},e.id):"output"===e.channel?(0,v.jsx)(l7,{text:e.text,onRedo:l&&e.id===s?i:void 0},e.id):(0,v.jsx)(xoe,{channel:e.channel,text:e.text,isActive:t===o},e.id))})}function Aoe({message:e,isLastUser:t}){var n;const{isStreaming:r,editLast:i}=Rl(),a=null===(n=e.blocks.at(-1))||void 0===n?void 0:n.id,o=t&&!r;return(0,v.jsx)("div",{className:"flex max-w-full flex-col items-end justify-start gap-2",children:e.blocks.map(e=>(0,v.jsx)(Toe,{text:e.text,onEdit:o&&e.id===a?i:void 0},e.id))})}function Soe({message:e,isLastUser:t=!1,isLastAssistant:n=!1}){return"assistant"===e.role?(0,v.jsx)($oe,{message:e,isLastAssistant:n}):(0,v.jsx)(Aoe,{message:e,isLastUser:t})}function Eoe({onClick:e}){return(0,v.jsx)("button",{type:"button",onClick:e,"aria-label":"Jump to latest",className:`inline-flex cursor-pointer transition ${pl.flama} ${Ns.flama}`,children:(0,v.jsx)(Sw,{from:"center",color:"flama",className:`flex items-center justify-center ${tl.lg}`,children:(0,v.jsx)(c7,{size:Qs.lg})})})}function Roe({visible:e,onClick:t}){return e?(0,v.jsx)("div",{className:`border ${Rs} ${js.flama} ${il} ${ol.flama}`,children:(0,v.jsx)(Eoe,{onClick:t})}):null}function Ioe(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Loe(){var e;const{messages:t,isStreaming:n,pinToken:r}=Rl(),i=null===(e=t.findLast(e=>"user"===e.role))||void 0===e?void 0:e.id,a=t.at(-1),o="assistant"===(null==a?void 0:a.role)?a.id:void 0,s=(0,p.useRef)(null),l=(0,p.useRef)(null),c=(0,p.useRef)(null),[u,d]=(0,p.useState)(!0),h=(0,p.useCallback)(()=>{var e,t;return i&&null!==(e=null===(t=l.current)||void 0===t?void 0:t.querySelector(`[data-mid="${i}"]`))&&void 0!==e?e:null},[i]),m=(0,p.useCallback)(()=>{const e=s.current,t=l.current;if(!e||!t)return;const n=t.getBoundingClientRect().bottom-e.getBoundingClientRect().bottom;d(n<100)},[]),f=(0,p.useCallback)(()=>{const e=s.current,t=l.current,r=c.current;if(!e||!t||!r)return;const i=h();if(i){const a=t.getBoundingClientRect().bottom-i.getBoundingClientRect().top,o=n?e.clientHeight-24:e.clientHeight-a-24;r.style.height=`${Math.max(0,o)}px`}else r.style.height="0px";m()},[h,n,m]);(0,p.useEffect)(()=>{const e=s.current,t=l.current;if(!e||!t)return;const n=new ResizeObserver(()=>f());return n.observe(e),n.observe(t),()=>n.disconnect()},[f]),(0,p.useEffect)(()=>{const e=s.current;if(e)return e.addEventListener("scroll",m,{passive:!0}),()=>e.removeEventListener("scroll",m)},[m]),(0,p.useLayoutEffect)(()=>{f();const e=h();e&&e.scrollIntoView({block:"start",behavior:Ioe()?"auto":"smooth"})},[r]);const g=(0,p.useCallback)(()=>{const e=s.current,t=l.current;if(!e||!t)return;const r=n?e.scrollTop+t.getBoundingClientRect().bottom-e.getBoundingClientRect().bottom:e.scrollHeight;e.scrollTo({top:r,behavior:Ioe()?"auto":"smooth"})},[n]);return(0,v.jsxs)("div",{className:"relative min-h-0 flex-1",children:[(0,v.jsx)("div",{ref:s,className:"h-full overflow-y-auto [overflow-anchor:none] [scrollbar-gutter:stable] [scrollbar-width:thin]",children:(0,v.jsxs)("div",{className:"mx-auto max-w-5xl px-4 pt-6 sm:px-6 md:px-8",children:[(0,v.jsx)("div",{ref:l,className:"flex flex-col gap-4 pb-40",children:0===t.length?(0,v.jsx)("div",{className:"py-32",children:(0,v.jsx)(Ll,{})}):t.map(e=>(0,v.jsx)("div",{"data-mid":e.id,className:e.id===i?"scroll-mt-6":void 0,children:(0,v.jsx)(Soe,{message:e,isLastUser:e.id===i,isLastAssistant:e.id===o})},e.id))}),(0,v.jsx)("div",{ref:c,"aria-hidden":"true"})]})}),(0,v.jsx)("div",{className:"absolute bottom-24 left-1/2 z-20 -translate-x-1/2",children:(0,v.jsx)(Roe,{visible:!u,onClick:g})})]})}const Noe=h("filled","player-stop-filled","PlayerStopFilled",[["path",{d:"M17 4h-10a3 3 0 0 0 -3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3 -3v-10a3 3 0 0 0 -3 -3z",key:"svg-0"}]]),Moe=h("outline","send","Send",[["path",{d:"M10 14l11 -11",key:"svg-0"}],["path",{d:"M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5",key:"svg-1"}]]);function Doe({isStreaming:e,onClick:t}){return(0,v.jsx)("button",{type:"button",onClick:t,"aria-label":e?"Stop":"Send",className:`inline-flex shrink-0 cursor-pointer transition ${pl.flama} ${Ns.flama}`,children:(0,v.jsx)(Sw,{from:"center",color:"flama",className:`flex items-center justify-center ${tl.xl}`,children:e?(0,v.jsx)(Noe,{size:Qs.xl}):(0,v.jsx)(Moe,{size:Qs.xl})})})}function Poe(){const{input:e,setInput:t,submit:n,cancel:r,isStreaming:i,inputRef:a}=Rl();(0,p.useEffect)(()=>{a.current&&(a.current.style.height="auto",a.current.style.height=`${a.current.scrollHeight}px`)},[a,e]);const o=(0,p.useCallback)(e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),i||n())},[n,i]),s=(0,p.useCallback)(e=>t(e.target.value),[t]),l=(0,p.useCallback)(()=>i?r():n(),[i,r,n]);return(0,v.jsxs)(cg,{color:"flama",loading:i,className:`mx-auto flex max-h-48 min-h-10 w-full items-center justify-between gap-2 ${il} ${ol.flama} ${Rs}`,children:[(0,v.jsx)("div",{className:"prompt-field max-h-47.5 flex-1 overflow-y-auto",children:(0,v.jsx)(gC,{ref:a,name:"prompt",color:"flama",size:"md",rows:1,value:e,onChange:s,onKeyDown:o,inline:!0})}),(0,v.jsx)(Doe,{isStreaming:i,onClick:l})]})}function Ooe(){return(0,v.jsxs)("div",{className:"relative flex h-full flex-col",children:[(0,v.jsx)(Loe,{}),(0,v.jsxs)("div",{className:"pointer-events-none absolute bottom-0 left-0 right-2 z-10",children:[(0,v.jsx)("div",{className:"from-primary-50 h-32 bg-linear-to-t to-transparent"}),(0,v.jsx)("div",{className:`${Rs}`,children:(0,v.jsx)("div",{className:"pointer-events-auto mx-auto max-w-5xl px-4 pb-2 sm:px-6 md:px-8",children:(0,v.jsx)("div",{className:"mx-auto w-full sm:w-4/5",children:(0,v.jsx)(Poe,{})})})})]})]})}function Foe({streamUrl:e}){return(0,v.jsx)(El,{streamUrl:e,children:(0,v.jsx)(Ooe,{})})}class joe{constructor(){l(this,"streamUrl",void 0),this.streamUrl="||@ stream_url|safe @||"}}function Boe(){const e=new joe;return(0,v.jsxs)("div",{className:"flex h-screen flex-col",children:[(0,v.jsx)(xs,{}),(0,v.jsx)("div",{className:"mt-14.25 flex flex-1 flex-col overflow-hidden",children:(0,v.jsx)(Foe,{streamUrl:e.streamUrl})}),(0,v.jsx)(Es,{})]})}const zoe=document.getElementById("app");zoe&&a.createRoot(zoe).render((0,v.jsx)(Boe,{}))},20239(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(t,n){t.exports=e},function(e,t,n){"use strict";var r=n(0).FDLayoutConstants;function i(){}for(var a in r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TREE_REDUCTION_ON_INCREMENTAL=!1,e.exports=i},function(e,t,n){"use strict";var r=n(0).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},function(e,t,n){"use strict";var r=n(0).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},function(e,t,n){"use strict";var r=n(0).LGraphManager;function i(e){r.call(this,e)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},function(e,t,n){"use strict";var r=n(0).FDLayoutNode,i=n(0).IMath;function a(e,t,n,i){r.call(this,e,t,n,i)}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.move=function(){var e=this.graphManager.getLayout();this.displacementX=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),e.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},a.prototype.propogateDisplacementToChildren=function(e,t){for(var n,r=this.getChild().getNodes(),i=0;i0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},b.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%c.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},b.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n1)for(s=0;sr&&(r=Math.floor(o.y)),a=Math.floor(o.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(u.WORLD_CENTER_X-o.x/2,u.WORLD_CENTER_Y-o.y/2))},b.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);b.branchRadialLayout(t,null,0,359,0,r);var i=g.calculateBounds(e),a=new y;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var o=0;o1;){var y=g[0];g.splice(0,1);var v=u.indexOf(y);v>=0&&u.splice(v,1),m--,p--}d=null!=t?(u.indexOf(g[0])+1)%m:0;for(var x=Math.abs(r-n)/p,_=d;h!=p;_=++_%m){var k=u[_].getOtherEnd(e);if(k!=t){var w=(n+h*x)%360,C=(w+x)%360;b.branchRadialLayout(k,e,w,C,i+a,a),h++}}},b.maxDiagonalInTree=function(e){for(var t=m.MIN_VALUE,n=0;nt&&(t=r)}return t},b.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},b.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r="DummyCompound_"+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),a=new o(e.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=a;var s=e.getGraphManager().add(e.newGraph(),a),l=i.getChild();l.add(a);for(var c=0;c=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i)}},b.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach(function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a)})},b.prototype.getToBeTiled=function(e){var t=e.id;if(null!=this.toBeTiled[t])return this.toBeTiled[t];var n=e.getChild();if(null==n)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(null!=a.getChild()){if(!this.getToBeTiled(a))return this.toBeTiled[t]=!1,!1}else this.toBeTiled[a.id]=!1}return this.toBeTiled[t]=!0,!0},b.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;rl&&(l=u.rect.height)}n+=l+e.verticalPadding}},b.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(r){var i=t[r];n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height})},b.prototype.tileNodes=function(e,t){var n={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:l.TILING_PADDING_VERTICAL,horizontalPadding:l.TILING_PADDING_HORIZONTAL};e.sort(function(e,t){return e.rect.width*e.rect.height>t.rect.width*t.rect.height?-1:e.rect.width*e.rect.height0&&(a+=e.horizontalPadding),e.rowWidth[n]=a,e.width0&&(o+=e.verticalPadding);var s=0;o>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=o,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},b.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},b.prototype.canAddHorizontal=function(e,t,n){var r=this.getShortestRowIndex(e);if(r<0)return!0;var i=e.rowWidth[r];if(i+e.horizontalPadding+t<=e.width)return!0;var a,o,s=0;return e.rowHeight[r]0&&(s=n+e.verticalPadding-e.rowHeight[r]),a=e.width-i>=t+e.horizontalPadding?(e.height+s)/(i+t+e.horizontalPadding):(e.height+s)/e.width,s=n+e.verticalPadding,(o=e.widtha&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-a,e.rowWidth[n]=e.rowWidth[n]+a,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,s=0;so&&(o=r[s].height);t>0&&(o+=e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=o,e.rowHeight[n]0)for(var u=i;u<=a;u++)l[0]+=this.grid[u][o-1].length+this.grid[u][o].length-1;if(a0)for(u=o;u<=s;u++)l[3]+=this.grid[i-1][u].length+this.grid[i][u].length-1;for(var p,d,h=m.MAX_VALUE,f=0;f{"use strict";var t={45:(e,t,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),e.exports=r},806:(e,t,n)=>{var r=n(551).FDLayoutConstants;function i(){}for(var a in r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,e.exports=i},767:(e,t,n)=>{var r=n(551).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},880:(e,t,n)=>{var r=n(551).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},578:(e,t,n)=>{var r=n(551).LGraphManager;function i(e){r.call(this,e)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},765:(e,t,n)=>{var r=n(551).FDLayout,i=n(578),a=n(880),o=n(991),s=n(767),l=n(806),c=n(902),u=n(551).FDLayoutConstants,p=n(551).LayoutConstants,d=n(551).Point,h=n(551).PointD,m=n(551).DimensionD,f=n(551).Layout,g=n(551).Integer,y=n(551).IGeometry,b=n(551).LGraph,v=n(551).Transform,x=n(551).LinkedList;function _(){r.call(this),this.toBeTiled={},this.constraints={}}for(var k in _.prototype=Object.create(r.prototype),r)_[k]=r[k];_.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},_.prototype.newGraph=function(e){return new a(null,this.graphManager,e)},_.prototype.newNode=function(e){return new o(this.graphManager,e)},_.prototype.newEdge=function(e){return new s(null,null,e)},_.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=u.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=u.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},_.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},_.prototype.layout=function(){return p.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},_.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)l.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)}),this.graphManager.setAllNodesToApplyGravitation(n));else{var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},_.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%u.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),l.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),l.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},_.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n0&&this.updateDisplacements(),t=0;t0&&(r.fixedNodeWeight=a)}if(this.constraints.relativePlacementConstraint){var o=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(t){e.fixedNodesOnHorizontal.add(t),e.fixedNodesOnVertical.add(t)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var c=this.constraints.alignmentConstraint.vertical;for(n=0;n=2*e.length/3;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(t){if(t.left){var n=o.has(t.left)?o.get(t.left):t.left,r=o.has(t.right)?o.get(t.right):t.right;e.nodesInRelativeHorizontal.includes(n)||(e.nodesInRelativeHorizontal.push(n),e.nodeToRelativeConstraintMapHorizontal.set(n,[]),e.dummyToNodeForVerticalAlignment.has(n)?e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(n).getCenterX())),e.nodesInRelativeHorizontal.includes(r)||(e.nodesInRelativeHorizontal.push(r),e.nodeToRelativeConstraintMapHorizontal.set(r,[]),e.dummyToNodeForVerticalAlignment.has(r)?e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(r).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:t.gap}),e.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:t.gap})}else{var i=s.has(t.top)?s.get(t.top):t.top,a=s.has(t.bottom)?s.get(t.bottom):t.bottom;e.nodesInRelativeVertical.includes(i)||(e.nodesInRelativeVertical.push(i),e.nodeToRelativeConstraintMapVertical.set(i,[]),e.dummyToNodeForHorizontalAlignment.has(i)?e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(i).getCenterY())),e.nodesInRelativeVertical.includes(a)||(e.nodesInRelativeVertical.push(a),e.nodeToRelativeConstraintMapVertical.set(a,[]),e.dummyToNodeForHorizontalAlignment.has(a)?e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(a)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(a).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(i).push({bottom:a,gap:t.gap}),e.nodeToRelativeConstraintMapVertical.get(a).push({top:i,gap:t.gap})}});else{var p=new Map,d=new Map;this.constraints.relativePlacementConstraint.forEach(function(e){if(e.left){var t=o.has(e.left)?o.get(e.left):e.left,n=o.has(e.right)?o.get(e.right):e.right;p.has(t)?p.get(t).push(n):p.set(t,[n]),p.has(n)?p.get(n).push(t):p.set(n,[t])}else{var r=s.has(e.top)?s.get(e.top):e.top,i=s.has(e.bottom)?s.get(e.bottom):e.bottom;d.has(r)?d.get(r).push(i):d.set(r,[i]),d.has(i)?d.get(i).push(r):d.set(i,[r])}});var h=function(e,t){var n=[],r=[],i=new x,a=new Set,o=0;return e.forEach(function(s,l){if(!a.has(l)){n[o]=[],r[o]=!1;var c=l;for(i.push(c),a.add(c),n[o].push(c);0!=i.length;)c=i.shift(),t.has(c)&&(r[o]=!0),e.get(c).forEach(function(e){a.has(e)||(i.push(e),a.add(e),n[o].push(e))});o++}}),{components:n,isFixed:r}},m=h(p,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=m.components,this.fixedComponentsOnHorizontal=m.isFixed;var f=h(d,e.fixedNodesOnVertical);this.componentsOnVertical=f.components,this.fixedComponentsOnVertical=f.isFixed}}},_.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(t){var n=e.idToNodeMap.get(t.nodeId);n.displacementX=0,n.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var t=this.constraints.alignmentConstraint.vertical,n=0;n1)for(s=0;sr&&(r=Math.floor(o.y)),a=Math.floor(o.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new h(p.WORLD_CENTER_X-o.x/2,p.WORLD_CENTER_Y-o.y/2))},_.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);_.branchRadialLayout(t,null,0,359,0,r);var i=b.calculateBounds(e),a=new v;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var o=0;o1;){var g=f[0];f.splice(0,1);var b=u.indexOf(g);b>=0&&u.splice(b,1),m--,p--}d=null!=t?(u.indexOf(f[0])+1)%m:0;for(var v=Math.abs(r-n)/p,x=d;h!=p;x=++x%m){var k=u[x].getOtherEnd(e);if(k!=t){var w=(n+h*v)%360,C=(w+v)%360;_.branchRadialLayout(k,e,w,C,i+a,a),h++}}},_.maxDiagonalInTree=function(e){for(var t=g.MIN_VALUE,n=0;nt&&(t=r)}return t},_.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},_.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r="DummyCompound_"+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),a=new o(e.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=a;var s=e.getGraphManager().add(e.newGraph(),a),l=i.getChild();l.add(a);for(var c=0;ci?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):"right"==r.labelPosHorizontal&&r.setWidth(i+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(a+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>a?(r.rect.y-=(r.labelHeight-a)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-a)/2):"bottom"==r.labelPosVertical&&r.setHeight(a+r.labelHeight))}})},_.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop,a=t.labelMarginLeft,o=t.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i,a,o)}},_.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach(function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop,o=r.labelMarginLeft,s=r.labelMarginTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a,o,s)})},_.prototype.getToBeTiled=function(e){var t=e.id;if(null!=this.toBeTiled[t])return this.toBeTiled[t];var n=e.getChild();if(null==n)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(null!=a.getChild()){if(!this.getToBeTiled(a))return this.toBeTiled[t]=!1,!1}else this.toBeTiled[a.id]=!1}return this.toBeTiled[t]=!0,!0},_.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;ru&&(u=d.rect.height)}n+=u+e.verticalPadding}},_.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(r){var i=t[r];if(n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var a=i.rect.width,o=i.rect.height;i.labelWidth&&("left"==i.labelPosHorizontal?(i.rect.x-=i.labelWidth,i.setWidth(a+i.labelWidth),i.labelMarginLeft=i.labelWidth):"center"==i.labelPosHorizontal&&i.labelWidth>a?(i.rect.x-=(i.labelWidth-a)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-a)/2):"right"==i.labelPosHorizontal&&i.setWidth(a+i.labelWidth)),i.labelHeight&&("top"==i.labelPosVertical?(i.rect.y-=i.labelHeight,i.setHeight(o+i.labelHeight),i.labelMarginTop=i.labelHeight):"center"==i.labelPosVertical&&i.labelHeight>o?(i.rect.y-=(i.labelHeight-o)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-o)/2):"bottom"==i.labelPosVertical&&i.setHeight(o+i.labelHeight))}})},_.prototype.tileNodes=function(e,t){var n=this.tileNodesByFavoringDim(e,t,!0),r=this.tileNodesByFavoringDim(e,t,!1),i=this.getOrgRatio(n);return this.getOrgRatio(r)s&&(s=e.getWidth())});var c,u=a/i,p=o/i,d=Math.pow(n-r,2)+4*(u+r)*(p+n)*i,h=(r-n+Math.sqrt(d))/(2*(u+r));t?(c=Math.ceil(h))==h&&c++:c=Math.floor(h);var m=c*(u+r)-r;return s>m&&(m=s),m+2*r},_.prototype.tileNodesByFavoringDim=function(e,t,n){var r=l.TILING_PADDING_VERTICAL,i=l.TILING_PADDING_HORIZONTAL,a=l.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:r,horizontalPadding:i,centerX:0,centerY:0};a&&(o.idealRowWidth=this.calcIdealRowWidth(e,n));var s=function(e){return e.rect.width*e.rect.height},c=function(e,t){return s(t)-s(e)};e.sort(function(e,t){var n=c;return o.idealRowWidth?(n=a)(e.id,t.id):n(e,t)});for(var u=0,p=0,d=0;d0&&(a+=e.horizontalPadding),e.rowWidth[n]=a,e.width0&&(o+=e.verticalPadding);var s=0;o>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=o,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},_.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},_.prototype.canAddHorizontal=function(e,t,n){if(e.idealRowWidth){var r=e.rows.length-1;return e.rowWidth[r]+t+e.horizontalPadding<=e.idealRowWidth}var i=this.getShortestRowIndex(e);if(i<0)return!0;var a=e.rowWidth[i];if(a+e.horizontalPadding+t<=e.width)return!0;var o,s,l=0;return e.rowHeight[i]0&&(l=n+e.verticalPadding-e.rowHeight[i]),o=e.width-a>=t+e.horizontalPadding?(e.height+l)/(a+t+e.horizontalPadding):(e.height+l)/e.width,l=n+e.verticalPadding,(s=e.widtha&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-a,e.rowWidth[n]=e.rowWidth[n]+a,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,s=0;so&&(o=r[s].height);t>0&&(o+=e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=o,e.rowHeight[n]0)for(var p=i;p<=a;p++)c[0]+=this.grid[p][o-1].length+this.grid[p][o].length-1;if(a0)for(p=o;p<=s;p++)c[3]+=this.grid[i-1][p].length+this.grid[i][p].length-1;for(var d,h,m=g.MAX_VALUE,f=0;f{var r=n(551).FDLayoutNode,i=n(551).IMath;function a(e,t,n,i){r.call(this,e,t,n,i)}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},a.prototype.propogateDisplacementToChildren=function(e,t){for(var n,r=this.getChild().getNodes(),i=0;i{function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){var a=0;r.forEach(function(e){"horizontal"==t?(p.set(e,l.has(e)?c[l.get(e)]:i.get(e)),a+=p.get(e)):(p.set(e,l.has(e)?u[l.get(e)]:i.get(e)),a+=p.get(e))}),a/=r.length,e.forEach(function(e){n.has(e)||p.set(e,a)})}else{var o=0;e.forEach(function(e){o+="horizontal"==t?l.has(e)?c[l.get(e)]:i.get(e):l.has(e)?u[l.get(e)]:i.get(e)}),o/=e.length,e.forEach(function(e){p.set(e,o)})}});for(var m=function(){var r=h.shift();e.get(r).forEach(function(e){if(p.get(e.id)o&&(o=y),vs&&(s=v)}}catch(e){h=!0,m=e}finally{try{!d&&g.return&&g.return()}finally{if(h)throw m}}var x=(r+o)/2-(a+s)/2,_=!0,k=!1,w=void 0;try{for(var C,T=e[Symbol.iterator]();!(_=(C=T.next()).done);_=!0){var $=C.value;p.set($,p.get($)+x)}}catch(e){k=!0,w=e}finally{try{!_&&T.return&&T.return()}finally{if(k)throw w}}})}return p},y=function(e){var t=0,n=0,r=0,i=0;if(e.forEach(function(e){e.left?c[l.get(e.left)]-c[l.get(e.right)]>=0?t++:n++:u[l.get(e.top)]-u[l.get(e.bottom)]>=0?r++:i++}),t>n&&r>i)for(var a=0;an)for(var o=0;oi)for(var s=0;s1)t.fixedNodeConstraint.forEach(function(e,t){_[t]=[e.position.x,e.position.y],k[t]=[c[l.get(e.nodeId)],u[l.get(e.nodeId)]]}),w=!0;else if(t.alignmentConstraint)!function(){var e=0;if(t.alignmentConstraint.vertical){for(var n=t.alignmentConstraint.vertical,i=function(t){var i=new Set;n[t].forEach(function(e){i.add(e)});var a,o=new Set([].concat(r(i)).filter(function(e){return T.has(e)}));a=o.size>0?c[l.get(o.values().next().value)]:f(i).x,n[t].forEach(function(t){_[e]=[a,u[l.get(t)]],k[e]=[c[l.get(t)],u[l.get(t)]],e++})},a=0;a0?c[l.get(a.values().next().value)]:f(n).y,o[t].forEach(function(t){_[e]=[c[l.get(t)],i],k[e]=[c[l.get(t)],u[l.get(t)]],e++})},p=0;pE&&(E=S[I].length,R=I);if(E0){var G={x:0,y:0};t.fixedNodeConstraint.forEach(function(e,t){var n,r,i=(r={x:c[l.get(e.nodeId)],y:u[l.get(e.nodeId)]},{x:(n=e.position).x-r.x,y:n.y-r.y});G.x+=i.x,G.y+=i.y}),G.x/=t.fixedNodeConstraint.length,G.y/=t.fixedNodeConstraint.length,c.forEach(function(e,t){c[t]+=G.x}),u.forEach(function(e,t){u[t]+=G.y}),t.fixedNodeConstraint.forEach(function(e){c[l.get(e.nodeId)]=e.position.x,u[l.get(e.nodeId)]=e.position.y})}if(t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var Z=t.alignmentConstraint.vertical,Y=function(e){var t=new Set;Z[e].forEach(function(e){t.add(e)});var n,i=new Set([].concat(r(t)).filter(function(e){return T.has(e)}));n=i.size>0?c[l.get(i.values().next().value)]:f(t).x,t.forEach(function(e){T.has(e)||(c[l.get(e)]=n)})},H=0;H0?u[l.get(i.values().next().value)]:f(t).y,t.forEach(function(e){T.has(e)||(u[l.get(e)]=n)})},J=0;J{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var a=n[r]={exports:{}};return t[r](a,a.exports,e),a.exports}(45);return r})()},e.exports=r(n(22318))},67360(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(t,n){t.exports=e},function(e,t,n){"use strict";var r=n(0).layoutBase.LayoutConstants,i=n(0).layoutBase.FDLayoutConstants,a=n(0).CoSEConstants,o=n(0).CoSELayout,s=n(0).CoSENode,l=n(0).layoutBase.PointD,c=n(0).layoutBase.DimensionD,u={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function p(e){this.options=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}(u,e),d(this.options)}var d=function(e){null!=e.nodeRepulsion&&(a.DEFAULT_REPULSION_STRENGTH=i.DEFAULT_REPULSION_STRENGTH=e.nodeRepulsion),null!=e.idealEdgeLength&&(a.DEFAULT_EDGE_LENGTH=i.DEFAULT_EDGE_LENGTH=e.idealEdgeLength),null!=e.edgeElasticity&&(a.DEFAULT_SPRING_STRENGTH=i.DEFAULT_SPRING_STRENGTH=e.edgeElasticity),null!=e.nestingFactor&&(a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),null!=e.gravity&&(a.DEFAULT_GRAVITY_STRENGTH=i.DEFAULT_GRAVITY_STRENGTH=e.gravity),null!=e.numIter&&(a.MAX_ITERATIONS=i.MAX_ITERATIONS=e.numIter),null!=e.gravityRange&&(a.DEFAULT_GRAVITY_RANGE_FACTOR=i.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),null!=e.gravityCompound&&(a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),null!=e.gravityRangeCompound&&(a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),null!=e.initialEnergyOnIncremental&&(a.DEFAULT_COOLING_FACTOR_INCREMENTAL=i.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),"draft"==e.quality?r.QUALITY=0:"proof"==e.quality?r.QUALITY=2:r.QUALITY=1,a.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=r.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,a.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=r.DEFAULT_INCREMENTAL=!e.randomize,a.ANIMATE=i.ANIMATE=r.ANIMATE=e.animate,a.TILE=e.tile,a.TILING_PADDING_VERTICAL="function"==typeof e.tilingPaddingVertical?e.tilingPaddingVertical.call():e.tilingPaddingVertical,a.TILING_PADDING_HORIZONTAL="function"==typeof e.tilingPaddingHorizontal?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal};p.prototype.run=function(){var e,t,n=this.options,r=(this.idToLNode={},this.layout=new o),i=this;i.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var a=r.newGraphManager();this.gm=a;var s=this.options.eles.nodes(),l=this.options.eles.edges();this.root=a.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(s),r);for(var c=0;c0&&(o=n.getGraphManager().add(n.newGraph(),a),this.processChildrenList(o,p,n))}},p.prototype.stop=function(){return this.stopped=!0,this};var h=function(e){e("layout","cose-bilkent",p)};"undefined"!=typeof cytoscape&&h(cytoscape),e.exports=h}])},e.exports=r(n(20239))},63057(e,t,n){var r;r=function(e){return(()=>{"use strict";var t={658:e=>{e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=n(140).layoutBase.LinkedList,a={getTopMostNodes:function(e){for(var t={},n=0;n0&&c.merge(e)});for(var u=0;u1){c=s[0],u=c.connectedEdges().length,s.forEach(function(e){e.connectedEdges().length0&&r.set("dummy"+(r.size+1),h),m},relocateComponent:function(e,t,n){if(!n.fixedNodeConstraint){var i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;if("draft"==n.quality){var l=!0,c=!1,u=void 0;try{for(var p,d=t.nodeIndexes[Symbol.iterator]();!(l=(p=d.next()).done);l=!0){var h=p.value,m=r(h,2),f=m[0],g=m[1],y=n.cy.getElementById(f);if(y){var b=y.boundingBox(),v=t.xCoords[g]-b.w/2,x=t.xCoords[g]+b.w/2,_=t.yCoords[g]-b.h/2,k=t.yCoords[g]+b.h/2;va&&(a=x),_s&&(s=k)}}}catch(e){c=!0,u=e}finally{try{!l&&d.return&&d.return()}finally{if(c)throw u}}var w=e.x-(a+i)/2,C=e.y-(s+o)/2;t.xCoords=t.xCoords.map(function(e){return e+w}),t.yCoords=t.yCoords.map(function(e){return e+C})}else{Object.keys(t).forEach(function(e){var n=t[e],r=n.getRect().x,l=n.getRect().x+n.getRect().width,c=n.getRect().y,u=n.getRect().y+n.getRect().height;ra&&(a=l),cs&&(s=u)});var T=e.x-(a+i)/2,$=e.y-(s+o)/2;Object.keys(t).forEach(function(e){var n=t[e];n.setCenter(n.getCenterX()+T,n.getCenterY()+$)})}}},calcBoundingBox:function(e,t,n,r){for(var i=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,l=void 0,c=void 0,u=void 0,p=void 0,d=e.descendants().not(":parent"),h=d.length,m=0;m(l=t[r.get(f.id())]-f.width()/2)&&(i=l),a<(c=t[r.get(f.id())]+f.width()/2)&&(a=c),o>(u=n[r.get(f.id())]-f.height()/2)&&(o=u),s<(p=n[r.get(f.id())]+f.height()/2)&&(s=p)}var g={};return g.topLeftX=i,g.topLeftY=o,g.width=a-i,g.height=s-o,g},calcParentsWithoutChildren:function(e,t){var n=e.collection();return t.nodes(":parent").forEach(function(e){var t=!1;e.children().forEach(function(e){"none"!=e.css("display")&&(t=!0)}),t||n.merge(e)}),n}};e.exports=a},816:(e,t,n)=>{var r=n(548),i=n(140).CoSELayout,a=n(140).CoSENode,o=n(140).layoutBase.PointD,s=n(140).layoutBase.DimensionD,l=n(140).layoutBase.LayoutConstants,c=n(140).layoutBase.FDLayoutConstants,u=n(140).CoSEConstants;e.exports={coseLayout:function(e,t){var n=e.cy,p=e.eles,d=p.nodes(),h=p.edges(),m=void 0,f=void 0,g=void 0,y={};e.randomize&&(m=t.nodeIndexes,f=t.xCoords,g=t.yCoords);var b=function(e){return"function"==typeof e},v=function(e,t){return b(e)?e(t):e},x=r.calcParentsWithoutChildren(n,p);null!=e.nestingFactor&&(u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),null!=e.gravity&&(u.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=e.gravity),null!=e.numIter&&(u.MAX_ITERATIONS=c.MAX_ITERATIONS=e.numIter),null!=e.gravityRange&&(u.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),null!=e.gravityCompound&&(u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),null!=e.gravityRangeCompound&&(u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),null!=e.initialEnergyOnIncremental&&(u.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),null!=e.tilingCompareBy&&(u.TILING_COMPARE_BY=e.tilingCompareBy),"proof"==e.quality?l.QUALITY=2:l.QUALITY=0,u.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,u.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!e.randomize,u.ANIMATE=c.ANIMATE=l.ANIMATE=e.animate,u.TILE=e.tile,u.TILING_PADDING_VERTICAL="function"==typeof e.tilingPaddingVertical?e.tilingPaddingVertical.call():e.tilingPaddingVertical,u.TILING_PADDING_HORIZONTAL="function"==typeof e.tilingPaddingHorizontal?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal,u.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!0,u.PURE_INCREMENTAL=!e.randomize,l.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions,"transformed"==e.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!1),"enforced"==e.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!1),"cose"==e.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!0),"all"==e.step&&(e.randomize?u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0),e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint?u.TREE_REDUCTION_ON_INCREMENTAL=!1:u.TREE_REDUCTION_ON_INCREMENTAL=!0;var _=new i,k=_.newGraphManager();return function e(t,n,i,l){for(var c=n.length,u=0;u0&&e(i.getGraphManager().add(i.newGraph(),h),d,i,l)}}(k.addRoot(),r.getTopMostNodes(d),_,e),function(t,n,r){for(var i=0,a=0,o=0;o0?u.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=i/a:b(e.idealEdgeLength)?u.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:u.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=e.idealEdgeLength,u.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,u.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)}(_,k,h),function(e,t){t.fixedNodeConstraint&&(e.constraints.fixedNodeConstraint=t.fixedNodeConstraint),t.alignmentConstraint&&(e.constraints.alignmentConstraint=t.alignmentConstraint),t.relativePlacementConstraint&&(e.constraints.relativePlacementConstraint=t.relativePlacementConstraint)}(_,e),_.runLayout(),y}}},212:(e,t,n)=>{var r=function(){function e(e,t){for(var n=0;n0)if(p){var d=a.getTopMostNodes(e.eles.nodes());if((l=a.connectComponents(t,e.eles,d)).forEach(function(e){var t=e.boundingBox();c.push({x:t.x1+t.w/2,y:t.y1+t.h/2})}),e.randomize&&l.forEach(function(t){e.eles=t,r.push(o(e))}),"default"==e.quality||"proof"==e.quality){var h=t.collection();if(e.tile){var m=new Map,f=0,g={nodeIndexes:m,xCoords:[],yCoords:[]},y=[];if(l.forEach(function(e,t){0==e.edges().length&&(e.nodes().forEach(function(t,n){h.merge(e.nodes()[n]),t.isParent()||(g.nodeIndexes.set(e.nodes()[n].id(),f++),g.xCoords.push(e.nodes()[0].position().x),g.yCoords.push(e.nodes()[0].position().y))}),y.push(t))}),h.length>1){var b=h.boundingBox();c.push({x:b.x1+b.w/2,y:b.y1+b.h/2}),l.push(h),r.push(g);for(var v=y.length-1;v>=0;v--)l.splice(y[v],1),r.splice(y[v],1),c.splice(y[v],1)}}l.forEach(function(t,n){e.eles=t,i.push(s(e,r[n])),a.relocateComponent(c[n],i[n],e)})}else l.forEach(function(t,n){a.relocateComponent(c[n],r[n],e)});var x=new Set;if(l.length>1){var _=[],k=n.filter(function(e){return"none"==e.css("display")});l.forEach(function(t,n){var o=void 0;if("draft"==e.quality&&(o=r[n].nodeIndexes),t.nodes().not(k).length>0){var s={edges:[],nodes:[]},l=void 0;t.nodes().not(k).forEach(function(t){if("draft"==e.quality)if(t.isParent()){var c=a.calcBoundingBox(t,r[n].xCoords,r[n].yCoords,o);s.nodes.push({x:c.topLeftX,y:c.topLeftY,width:c.width,height:c.height})}else l=o.get(t.id()),s.nodes.push({x:r[n].xCoords[l]-t.boundingbox().w/2,y:r[n].yCoords[l]-t.boundingbox().h/2,width:t.boundingbox().w,height:t.boundingbox().h});else i[n][t.id()]&&s.nodes.push({x:i[n][t.id()].getLeft(),y:i[n][t.id()].getTop(),width:i[n][t.id()].getWidth(),height:i[n][t.id()].getHeight()})}),t.edges().forEach(function(t){var l=t.source(),c=t.target();if("none"!=l.css("display")&&"none"!=c.css("display"))if("draft"==e.quality){var u=o.get(l.id()),p=o.get(c.id()),d=[],h=[];if(l.isParent()){var m=a.calcBoundingBox(l,r[n].xCoords,r[n].yCoords,o);d.push(m.topLeftX+m.width/2),d.push(m.topLeftY+m.height/2)}else d.push(r[n].xCoords[u]),d.push(r[n].yCoords[u]);if(c.isParent()){var f=a.calcBoundingBox(c,r[n].xCoords,r[n].yCoords,o);h.push(f.topLeftX+f.width/2),h.push(f.topLeftY+f.height/2)}else h.push(r[n].xCoords[p]),h.push(r[n].yCoords[p]);s.edges.push({startX:d[0],startY:d[1],endX:h[0],endY:h[1]})}else i[n][l.id()]&&i[n][c.id()]&&s.edges.push({startX:i[n][l.id()].getCenterX(),startY:i[n][l.id()].getCenterY(),endX:i[n][c.id()].getCenterX(),endY:i[n][c.id()].getCenterY()})}),s.nodes.length>0&&(_.push(s),x.add(n))}});var w=u.packComponents(_,e.randomize).shifts;if("draft"==e.quality)r.forEach(function(e,t){var n=e.xCoords.map(function(e){return e+w[t].dx}),r=e.yCoords.map(function(e){return e+w[t].dy});e.xCoords=n,e.yCoords=r});else{var C=0;x.forEach(function(e){Object.keys(i[e]).forEach(function(t){var n=i[e][t];n.setCenter(n.getCenterX()+w[C].dx,n.getCenterY()+w[C].dy)}),C++})}}}else{var T=e.eles.boundingBox();if(c.push({x:T.x1+T.w/2,y:T.y1+T.h/2}),e.randomize){var $=o(e);r.push($)}"default"==e.quality||"proof"==e.quality?(i.push(s(e,r[0])),a.relocateComponent(c[0],i[0],e)):a.relocateComponent(c[0],r[0],e)}var A=function(t,n){if("default"==e.quality||"proof"==e.quality){"number"==typeof t&&(t=n);var a=void 0,o=void 0,s=t.data("id");return i.forEach(function(e){s in e&&(a={x:e[s].getRect().getCenterX(),y:e[s].getRect().getCenterY()},o=e[s])}),e.nodeDimensionsIncludeLabels&&(o.labelWidth&&("left"==o.labelPosHorizontal?a.x+=o.labelWidth/2:"right"==o.labelPosHorizontal&&(a.x-=o.labelWidth/2)),o.labelHeight&&("top"==o.labelPosVertical?a.y+=o.labelHeight/2:"bottom"==o.labelPosVertical&&(a.y-=o.labelHeight/2))),null==a&&(a={x:t.position("x"),y:t.position("y")}),{x:a.x,y:a.y}}var l=void 0;return r.forEach(function(e){var n=e.nodeIndexes.get(t.id());null!=n&&(l={x:e.xCoords[n],y:e.yCoords[n]})}),null==l&&(l={x:t.position("x"),y:t.position("y")}),{x:l.x,y:l.y}};if("default"==e.quality||"proof"==e.quality||e.randomize){var S=a.calcParentsWithoutChildren(t,n),E=n.filter(function(e){return"none"==e.css("display")});e.eles=n.not(E),n.nodes().not(":parent").not(E).layoutPositions(this,e,A),S.length>0&&S.forEach(function(e){e.position(A(e))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),e}();e.exports=c},657:(e,t,n)=>{var r=n(548),i=n(140).layoutBase.Matrix,a=n(140).layoutBase.SVD;e.exports={spectralLayout:function(e){var t=e.cy,n=e.eles,o=n.nodes(),s=n.nodes(":parent"),l=new Map,c=new Map,u=new Map,p=[],d=[],h=[],m=[],f=[],g=[],y=[],b=[],v=void 0,x=1e8,_=1e-9,k=e.piTol,w=e.samplingType,C=e.nodeSeparation,T=void 0,$=function(e,t,n){for(var r=[],i=0,a=0,o=0,s=void 0,l=[],u=0,d=1,h=0;h=i;){o=r[i++];for(var m=p[o],y=0;yu&&(u=f[_],d=_)}return d};r.connectComponents(t,n,r.getTopMostNodes(o),l),s.forEach(function(e){r.connectComponents(t,n,r.getTopMostNodes(e.descendants().intersection(n)),l)});for(var A=0,S=0;S0&&(r.isParent()?p[t].push(u.get(r.id())):p[t].push(r.id()))})});var P=function(e){var n=c.get(e),r=void 0;l.get(e).forEach(function(i){r=t.getElementById(i).isParent()?u.get(i):i,p[n].push(r),p[c.get(r)].push(e)})},O=!0,F=!1,j=void 0;try{for(var B,z=l.keys()[Symbol.iterator]();!(O=(B=z.next()).done);O=!0)P(B.value)}catch(e){F=!0,j=e}finally{try{!O&&z.return&&z.return()}finally{if(F)throw j}}var q=void 0;if((v=c.size)>2){T=v=1)break;c=l}for(var m=0;m=1)break;c=l}for(var y=0;y{var r=n(212),i=function(e){e&&e("layout","fcose",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},140:t=>{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var a=n[r]={exports:{}};return t[r](a,a.exports,e),a.exports}(579);return r})()},e.exports=r(n(57601))},82908(e){e.exports=function(){"use strict";var e=6e4,t=36e5,n="millisecond",r="second",i="minute",a="hour",o="day",s="week",l="month",c="quarter",u="year",p="date",d="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},g=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+g(r,2,"0")+":"+g(i,2,"0")},m:function e(t,n){if(t.date()1)return e(o[0])}else{var s=t.name;v[s]=t,i=s}return!r&&i&&(b=i),i||!r&&b},w=function(e,t){if(_(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new T(n)},C=y;C.l=k,C.i=_,C.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var T=function(){function f(e){this.$L=k(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var g=f.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(C.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(h);if(r){var i=r[2]-1||0,a=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return C},g.isValid=function(){return!(this.$d.toString()===d)},g.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},g.isAfter=function(e,t){return w(e)68?1900:2e3)},l=function(e){return function(t){this[e]=+t}},c=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},p=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},d={A:[a,function(e){this.afternoon=p(e,!1)}],a:[a,function(e){this.afternoon=p(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*+e}],SS:[r,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,l("seconds")],ss:[i,l("seconds")],m:[i,l("minutes")],mm:[i,l("minutes")],H:[i,l("hours")],h:[i,l("hours")],HH:[i,l("hours")],hh:[i,l("hours")],D:[i,l("day")],DD:[r,l("day")],Do:[a,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r)}],w:[i,l("week")],ww:[r,l("week")],M:[i,l("month")],MM:[r,l("month")],MMM:[a,function(e){var t=u("months"),n=(u("monthsShort")||t.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[a,function(e){var t=u("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,l("year")],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,l("year")],Z:c,ZZ:c};function h(n){var r,i;r=n,i=o&&o.formats;for(var a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,n){return t||n.slice(1)})})).match(t),s=a.length,l=0;l-1)return new Date(("X"===t?1e3:1)*e);var i=h(t)(e),a=i.year,o=i.month,s=i.day,l=i.hours,c=i.minutes,u=i.seconds,p=i.milliseconds,d=i.zone,m=i.week,f=new Date,g=s||(a||o?1:f.getDate()),y=a||f.getFullYear(),b=0;a&&!o||(b=o>0?o-1:f.getMonth());var v,x=l||0,_=c||0,k=u||0,w=p||0;return d?new Date(Date.UTC(y,b,g,x,_,k,w+60*d.offset*1e3)):n?new Date(Date.UTC(y,b,g,x,_,k,w)):(v=new Date(y,b,g,x,_,k,w),m&&(v=r(v).week(m).toDate()),v)}catch(e){return new Date("")}}(t,s,r,n),this.init(),p&&!0!==p&&(this.$L=this.locale(p).$L),u&&t!=this.format(s)&&(this.$d=new Date("")),o={}}else if(s instanceof Array)for(var d=s.length,m=1;m<=d;m+=1){a[1]=s[m-1];var f=n.apply(this,a);if(f.isValid()){this.$d=f.$d,this.$L=f.$L,this.init();break}m===d&&(this.$d=new Date(""))}else i.call(this,e)}}}()},88107(e){e.exports=function(){"use strict";var e,t,n=1e3,r=6e4,i=36e5,a=864e5,o=31536e6,s=2628e6,l=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,c=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,u={years:o,months:s,days:a,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},p=function(e){return e instanceof b},d=function(e,t,n){return new b(e,n,t.$l)},h=function(e){return t.p(e)+"s"},m=function(e){return e<0},f=function(e){return m(e)?Math.ceil(e):Math.floor(e)},g=function(e){return Math.abs(e)},y=function(e,t){return e?m(e)?{negative:!0,format:""+g(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},b=function(){function m(e,t,n){var r=this;if(this.$d={},this.$l=n,void 0===e&&(this.$ms=0,this.parseFromMilliseconds()),t)return d(e*u[h(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==typeof e)return Object.keys(e).forEach(function(t){r.$d[h(t)]=e[t]}),this.calMilliseconds(),this;if("string"==typeof e){var i=e.match(l);if(i){var a=i.slice(2).map(function(e){return null!=e?Number(e):0});return this.$d.years=a[0],this.$d.months=a[1],this.$d.weeks=a[2],this.$d.days=a[3],this.$d.hours=a[4],this.$d.minutes=a[5],this.$d.seconds=a[6],this.calMilliseconds(),this}}return this}var g=m.prototype;return g.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce(function(t,n){return t+(e.$d[n]||0)*u[n]},0)},g.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=f(e/o),e%=o,this.$d.months=f(e/s),e%=s,this.$d.days=f(e/a),e%=a,this.$d.hours=f(e/i),e%=i,this.$d.minutes=f(e/r),e%=r,this.$d.seconds=f(e/n),e%=n,this.$d.milliseconds=e},g.toISOString=function(){var e=y(this.$d.years,"Y"),t=y(this.$d.months,"M"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=y(n,"D"),i=y(this.$d.hours,"H"),a=y(this.$d.minutes,"M"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var s=y(o,"S"),l=e.negative||t.negative||r.negative||i.negative||a.negative||s.negative,c=i.format||a.format||s.format?"T":"",u=(l?"-":"")+"P"+e.format+t.format+r.format+c+i.format+a.format+s.format;return"P"===u||"-P"===u?"P0D":u},g.toJSON=function(){return this.toISOString()},g.format=function(e){var n=e||"YYYY-MM-DDTHH:mm:ss",r={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return n.replace(c,function(e,t){return t||String(r[e])})},g.as=function(e){return this.$ms/u[h(e)]},g.get=function(e){var t=this.$ms,n=h(e);return"milliseconds"===n?t%=1e3:t="weeks"===n?f(t/u[n]):this.$d[n],t||0},g.add=function(e,t,n){var r;return r=t?e*u[h(t)]:p(e)?e.$ms:d(e,this).$ms,d(this.$ms+r*(n?-1:1),this)},g.subtract=function(e,t){return this.add(e,t,!0)},g.locale=function(e){var t=this.clone();return t.$l=e,t},g.clone=function(){return d(this.$ms,this)},g.humanize=function(t){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!t)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get("milliseconds")},g.asMilliseconds=function(){return this.as("milliseconds")},g.seconds=function(){return this.get("seconds")},g.asSeconds=function(){return this.as("seconds")},g.minutes=function(){return this.get("minutes")},g.asMinutes=function(){return this.as("minutes")},g.hours=function(){return this.get("hours")},g.asHours=function(){return this.as("hours")},g.days=function(){return this.get("days")},g.asDays=function(){return this.as("days")},g.weeks=function(){return this.get("weeks")},g.asWeeks=function(){return this.as("weeks")},g.months=function(){return this.get("months")},g.asMonths=function(){return this.as("months")},g.years=function(){return this.get("years")},g.asYears=function(){return this.as("years")},m}(),v=function(e,t,n){return e.add(t.years()*n,"y").add(t.months()*n,"M").add(t.days()*n,"d").add(t.hours()*n,"h").add(t.minutes()*n,"m").add(t.seconds()*n,"s").add(t.milliseconds()*n,"ms")};return function(n,r,i){e=i,t=i().$utils(),i.duration=function(e,t){var n=i.locale();return d(e,{$l:n},t)},i.isDuration=p;var a=r.prototype.add,o=r.prototype.subtract;r.prototype.add=function(e,t){return p(e)?v(this,e,1):a.bind(this)(e,t)},r.prototype.subtract=function(e,t){return p(e)?v(this,e,-1):o.bind(this)(e,t)}}}()},71738(e){e.exports=function(){"use strict";var e="day";return function(t,n,r){var i=function(t){return t.add(4-t.isoWeekday(),e)},a=n.prototype;a.isoWeekYear=function(){return i(this).year()},a.isoWeek=function(t){if(!this.$utils().u(t))return this.add(7*(t-this.isoWeek()),e);var n,a,o,s=i(this),l=(n=this.isoWeekYear(),o=4-(a=(this.$u?r.utc:r)().year(n).startOf("year")).isoWeekday(),a.isoWeekday()>4&&(o+=7),a.add(o,e));return s.diff(l,"week")+1},a.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7)};var o=a.startOf;a.startOf=function(e,t){var n=this.$utils(),r=!!n.u(t)||t;return"isoweek"===n.p(e)?r?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):o.bind(this)(e,t)}}}()},59255(e){"use strict";var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g,c="";function u(e){return e?e.replace(l,c):c}e.exports=function(e,l){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];l=l||{};var p=1,d=1;function h(e){var t=e.match(n);t&&(p+=t.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function m(){var e={line:p,column:d};return function(t){return t.position=new f(e),b(),t}}function f(e){this.start=e,this.end={line:p,column:d},this.source=l.source}function g(t){var n=new Error(l.source+":"+p+":"+d+": "+t);if(n.reason=t,n.filename=l.source,n.line=p,n.column=d,n.source=e,!l.silent)throw n}function y(t){var n=t.exec(e);if(n){var r=n[0];return h(r),e=e.slice(r.length),n}}function b(){y(r)}function v(e){var t;for(e=e||[];t=x();)!1!==t&&e.push(t);return e}function x(){var t=m();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;c!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,c===e.charAt(n-1))return g("End of comment missing");var r=e.slice(2,n-2);return d+=2,h(r),e=e.slice(n),d+=2,t({type:"comment",comment:r})}}function _(){var e=m(),n=y(i);if(n){if(x(),!y(a))return g("property missing ':'");var r=y(o),l=e({type:"declaration",property:u(n[0].replace(t,c)),value:r?u(r[0].replace(t,c)):c});return y(s),l}}return f.prototype.content=e,b(),function(){var e,t=[];for(v(t);e=_();)!1!==e&&(t.push(e),v(t));return t}()}},81614(e){var t;t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=26)}([function(e,t,n){"use strict";function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(8),a=n(9);function o(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in o.prototype=Object.create(r.prototype),r)o[s]=r[s];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw"Node is not incident with this edge"},o.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var e=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=o},function(e,t,n){"use strict";e.exports=function(e){this.vGraphObject=e}},function(e,t,n){"use strict";var r=n(2),i=n(10),a=n(13),o=n(0),s=n(16),l=n(4);function c(e,t,n,o){null==n&&null==o&&(o=t),r.call(this,o),null!=e.graphManager&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=o,this.edges=[],this.graphManager=e,this.rect=null!=n&&null!=t?new a(t.x,t.y,n.width,n.height):new a}for(var u in c.prototype=Object.create(r.prototype),r)c[u]=r[u];c.prototype.getEdges=function(){return this.edges},c.prototype.getChild=function(){return this.child},c.prototype.getOwner=function(){return this.owner},c.prototype.getWidth=function(){return this.rect.width},c.prototype.setWidth=function(e){this.rect.width=e},c.prototype.getHeight=function(){return this.rect.height},c.prototype.setHeight=function(e){this.rect.height=e},c.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},c.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},c.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},c.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},c.prototype.getRect=function(){return this.rect},c.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},c.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},c.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},c.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},c.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},c.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},c.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.target==e){if(r.source!=n)throw"Incorrect edge source!";t.push(r)}}),t},c.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";r.target!=e&&r.source!=e||t.push(r)}),t},c.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach(function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw"Incorrect incidency!";e.add(n.source)}}),e},c.prototype.withChildren=function(){var e=new Set;if(e.add(this),null!=this.child)for(var t=this.child.getNodes(),n=0;nt&&(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)),this.labelHeight>n&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-n)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-n),this.setHeight(this.labelHeight))}}},c.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},c.prototype.transform=function(e){var t=this.rect.x;t>o.WORLD_BOUNDARY?t=o.WORLD_BOUNDARY:t<-o.WORLD_BOUNDARY&&(t=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},c.prototype.getLeft=function(){return this.rect.x},c.prototype.getRight=function(){return this.rect.x+this.rect.width},c.prototype.getTop=function(){return this.rect.y},c.prototype.getBottom=function(){return this.rect.y+this.rect.height},c.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},e.exports=c},function(e,t,n){"use strict";function r(e,t){null==e&&null==t?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(10),a=n(0),o=n(6),s=n(3),l=n(1),c=n(13),u=n(12),p=n(11);function d(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,null!=t&&t instanceof o?this.graphManager=t:null!=t&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var h in d.prototype=Object.create(r.prototype),r)d[h]=r[h];d.prototype.getNodes=function(){return this.nodes},d.prototype.getEdges=function(){return this.edges},d.prototype.getGraphManager=function(){return this.graphManager},d.prototype.getParent=function(){return this.parent},d.prototype.getLeft=function(){return this.left},d.prototype.getRight=function(){return this.right},d.prototype.getTop=function(){return this.top},d.prototype.getBottom=function(){return this.bottom},d.prototype.isConnected=function(){return this.isConnected},d.prototype.add=function(e,t,n){if(null==t&&null==n){var r=e;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(t.owner!=n.owner||t.owner!=this)throw"Both owners must be this graph!";return t.owner!=n.owner?null:(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i)},d.prototype.remove=function(e){var t=e;if(e instanceof s){if(null==t)throw"Node is null!";if(null==t.owner||t.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=t.edges.slice(),r=n.length,i=0;i-1&&u>-1))throw"Source and/or target doesn't know this edge!";if(a.source.edges.splice(c,1),a.target!=a.source&&a.target.edges.splice(u,1),-1==(o=a.source.owner.getEdges().indexOf(a)))throw"Not in owner's edge list!";a.source.owner.getEdges().splice(o,1)}},d.prototype.updateLeftTop=function(){for(var e,t,n,r=i.MAX_VALUE,a=i.MAX_VALUE,o=this.getNodes(),s=o.length,l=0;l(e=c.getTop())&&(r=e),a>(t=c.getLeft())&&(a=t)}return r==i.MAX_VALUE?null:(n=null!=o[0].getParent().paddingLeft?o[0].getParent().paddingLeft:this.margin,this.left=a-n,this.top=r-n,new u(this.left,this.top))},d.prototype.updateBounds=function(e){for(var t,n,r,a,o,s=i.MAX_VALUE,l=-i.MAX_VALUE,u=i.MAX_VALUE,p=-i.MAX_VALUE,d=this.nodes,h=d.length,m=0;m(t=f.getLeft())&&(s=t),l<(n=f.getRight())&&(l=n),u>(r=f.getTop())&&(u=r),p<(a=f.getBottom())&&(p=a)}var g=new c(s,u,l-s,p-u);s==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),o=null!=d[0].getParent().paddingLeft?d[0].getParent().paddingLeft:this.margin,this.left=g.x-o,this.right=g.x+g.width+o,this.top=g.y-o,this.bottom=g.y+g.height+o},d.calculateBounds=function(e){for(var t,n,r,a,o=i.MAX_VALUE,s=-i.MAX_VALUE,l=i.MAX_VALUE,u=-i.MAX_VALUE,p=e.length,d=0;d(t=h.getLeft())&&(o=t),s<(n=h.getRight())&&(s=n),l>(r=h.getTop())&&(l=r),u<(a=h.getBottom())&&(u=a)}return new c(o,l,s-o,u-l)},d.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){for(var e=0,t=this.nodes,n=t.length,r=0;r=this.nodes.length){var l=0;i.forEach(function(t){t.owner==e&&l++}),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},e.exports=d},function(e,t,n){"use strict";var r,i=n(1);function a(e){r=n(5),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(e,t,n,r,i){if(null==n&&null==r&&null==i){if(null==e)throw"Graph is null!";if(null==t)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),null!=e.parent)throw"Already has a parent!";if(null!=t.child)throw"Already has a child!";return e.parent=t,t.child=e,e}i=n,n=e;var a=(r=t).getOwner(),o=i.getOwner();if(null==a||a.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==o||o.getGraphManager()!=this)throw"Target not in this graph mgr!";if(a==o)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},a.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw"Graph not in this graph mgr";if(t!=this.rootGraph&&(null==t.parent||t.parent.graphManager!=this))throw"Invalid parent node!";for(var n,a=[],o=(a=a.concat(t.getEdges())).length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var a=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(a=1);var o=a*n[0],s=n[1]/a;n[0]o)return n[0]=r,n[1]=l,n[2]=a,n[3]=v,!1;if(ia)return n[0]=s,n[1]=i,n[2]=y,n[3]=o,!1;if(ra?(n[0]=u,n[1]=p,w=!0):(n[0]=c,n[1]=l,w=!0):T===A&&(r>a?(n[0]=s,n[1]=l,w=!0):(n[0]=d,n[1]=p,w=!0)),-$===A?a>r?(n[2]=b,n[3]=v,C=!0):(n[2]=y,n[3]=g,C=!0):$===A&&(a>r?(n[2]=f,n[3]=g,C=!0):(n[2]=x,n[3]=v,C=!0)),w&&C)return!1;if(r>a?i>o?(S=this.getCardinalDirection(T,A,4),E=this.getCardinalDirection($,A,2)):(S=this.getCardinalDirection(-T,A,3),E=this.getCardinalDirection(-$,A,1)):i>o?(S=this.getCardinalDirection(-T,A,1),E=this.getCardinalDirection(-$,A,3)):(S=this.getCardinalDirection(T,A,2),E=this.getCardinalDirection($,A,4)),!w)switch(S){case 1:I=l,R=r+-m/A,n[0]=R,n[1]=I;break;case 2:R=d,I=i+h*A,n[0]=R,n[1]=I;break;case 3:I=p,R=r+m/A,n[0]=R,n[1]=I;break;case 4:R=u,I=i+-h*A,n[0]=R,n[1]=I}if(!C)switch(E){case 1:N=g,L=a+-k/A,n[2]=L,n[3]=N;break;case 2:L=x,N=o+_*A,n[2]=L,n[3]=N;break;case 3:N=v,L=a+k/A,n[2]=L,n[3]=N;break;case 4:L=b,N=o+-_*A,n[2]=L,n[3]=N}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(null==i)return this.getIntersection2(e,t,n);var a,o,s,l,c,u,p,d=e.x,h=e.y,m=t.x,f=t.y,g=n.x,y=n.y,b=i.x,v=i.y;return 0===(p=(a=f-h)*(l=g-b)-(o=v-y)*(s=d-m))?null:new r((s*(u=b*y-g*v)-l*(c=m*h-d*f))/p,(o*c-a*u)/p)},i.angleOfVector=function(e,t,n,r){var i=void 0;return e!==n?(i=Math.atan((r-t)/(n-e)),n0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r},function(e,t,n){"use strict";function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(c[0]);s.length>0&&t;){var u=s[0];s.splice(0,1),o.add(u);var p=u.getEdges();for(a=0;a-1&&c.splice(f,1)}o=new Set,l=new Map}else e=[]}return e},d.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),a=0;a=0&&t.splice(p,1),u.getNeighborsList().forEach(function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;1==t&&l.push(e),r.set(e,t)}})}n=n.concat(l),1!=t.length&&2!=t.length||(i=!0,a=t[0])}return a},d.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=d},function(e,t,n){"use strict";function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},e.exports=r},function(e,t,n){"use strict";var r=n(4);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return 0!=n&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return 0!=n&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return 0!=n&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return 0!=n&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i},function(e,t,n){"use strict";var r=n(15),i=n(7),a=n(0),o=n(8),s=n(9);function l(){r.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=i.DEFAULT_EDGE_LENGTH,this.springConstant=i.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=i.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}for(var c in l.prototype=Object.create(r.prototype),r)l[c]=r[c];l.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},l.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,o,s,l=this.getGraphManager().getAllEdges(),c=0;ci.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e,t=this.getAllEdges(),n=0;n