@uniweb/runtime 0.11.1 → 0.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/package.json +5 -5
  2. package/dist/app/_importmap/@uniweb-core.js +0 -1
  3. package/dist/app/_importmap/@uniweb-runtime-default-fetcher.js +0 -1
  4. package/dist/app/_importmap/@uniweb-runtime-foundation-loader.js +0 -1
  5. package/dist/app/_importmap/@uniweb-runtime-provider.js +0 -1
  6. package/dist/app/_importmap/@uniweb-runtime-setup.js +0 -1
  7. package/dist/app/_importmap/@uniweb-theming.js +0 -53
  8. package/dist/app/_importmap/react-dom-client.js +0 -1
  9. package/dist/app/_importmap/react-dom-server.js +0 -53
  10. package/dist/app/_importmap/react-dom.js +0 -1
  11. package/dist/app/_importmap/react-jsx-dev-runtime.js +0 -1
  12. package/dist/app/_importmap/react-jsx-runtime.js +0 -1
  13. package/dist/app/_importmap/react-router-dom.js +0 -1
  14. package/dist/app/_importmap/react.js +0 -1
  15. package/dist/app/assets/_commonjsHelpers-CqkleIqs.js +0 -1
  16. package/dist/app/assets/_importmap_react-CrAkajDz.js +0 -1
  17. package/dist/app/assets/_importmap_react-router-dom-CLbp1nUY.js +0 -3
  18. package/dist/app/assets/client-CQjOKqaN.js +0 -9
  19. package/dist/app/assets/index-BjwnhO24.js +0 -1
  20. package/dist/app/assets/index-C_CSAb0x.js +0 -59
  21. package/dist/app/assets/index-CxUeIbEw.js +0 -1
  22. package/dist/app/assets/index-VvOM7xKK.js +0 -1
  23. package/dist/app/assets/index-n0uF7vTr.js +0 -74
  24. package/dist/app/assets/jsx-runtime-0PlsXv6K.js +0 -1
  25. package/dist/app/assets/normalize-DbApPPeG.js +0 -1
  26. package/dist/app/assets/setup-BeQi33In.js +0 -1
  27. package/dist/app/assets/shade-generator-BBzWo1IN.js +0 -1
  28. package/dist/app/index.html +0 -50
  29. package/dist/app/manifest.json +0 -33
  30. package/dist/shims/react-dom.js +0 -18
  31. package/dist/shims/react-jsx-runtime.js +0 -7
  32. package/dist/shims/react.js +0 -48
  33. package/dist/shims/uniweb-core.js +0 -35
  34. package/dist/worker-runtime-entry.js +0 -10
  35. package/dist/worker-runtime.js +0 -30554
@@ -1,59 +0,0 @@
1
- import{Y as j,i as Dt,a as W,b as jt,s as at,S as A,m as D,o as Te,p as Ne,c as Ce,M as Ft,d as B,e as Kt,f as Ut,g as ee,h as xe,j as Fe,l as qt,N as Ke,D as Ue,k as ae,n as Vt,q as Ht,A as ot,r as zt,t as O,P as oe,u as te,v as Y,w as qe,x as Gt,y as Wt,z as Yt,B as lt,L as Jt,C as Xt,E as Qt,F as ge,G as Zt,H as es}from"./index-n0uF7vTr.js";import"./shade-generator-BBzWo1IN.js";import{n as Ve}from"./normalize-DbApPPeG.js";const U={collection:"map",default:!0,nodeClass:j,tag:"tag:yaml.org,2002:map",resolve(n,e){return Dt(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>j.from(n,e,t)},q={collection:"seq",default:!0,nodeClass:W,tag:"tag:yaml.org,2002:seq",resolve(n,e){return jt(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>W.from(n,e,t)},le={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,s){return e=Object.assign({actualString:!0},e),at(n,e,t,s)}},ce={identify:n=>n==null,createNode:()=>new A(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new A(null),stringify:({source:n},e)=>typeof n=="string"&&ce.test.test(n)?n:e.options.nullStr},$e={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new A(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&$e.test.test(n)){const s=n[0]==="t"||n[0]==="T";if(e===s)return n}return e?t.options.trueStr:t.options.falseStr}};function N({format:n,minFractionDigits:e,tag:t,value:s}){if(typeof s=="bigint")return String(s);const i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let a=r.indexOf(".");a<0&&(a=r.length,r+=".");let o=e-(r.length-a-1);for(;o-- >0;)r+="0"}return r}const ct={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:N},ut={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():N(n)}},ft={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){const e=new A(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:N},ue=n=>typeof n=="bigint"||Number.isInteger(n),Oe=(n,e,t,{intAsBigInt:s})=>s?BigInt(n):parseInt(n.substring(e),t);function ht(n,e,t){const{value:s}=n;return ue(s)&&s>=0?t+s.toString(e):N(n)}const dt={identify:n=>ue(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>Oe(n,2,8,t),stringify:n=>ht(n,8,"0o")},pt={identify:ue,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>Oe(n,0,10,t),stringify:N},gt={identify:n=>ue(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>Oe(n,2,16,t),stringify:n=>ht(n,16,"0x")},ts=[U,q,le,ce,$e,dt,pt,gt,ct,ut,ft];function He(n){return typeof n=="bigint"||Number.isInteger(n)}const se=({value:n})=>JSON.stringify(n),ss=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:se},{identify:n=>n==null,createNode:()=>new A(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:se},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:se},{identify:He,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>He(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:se}],ns={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},is=[U,q].concat(ss,ns),Be={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof atob=="function"){const t=atob(n.replace(/[\n\r]/g,"")),s=new Uint8Array(t.length);for(let i=0;i<t.length;++i)s[i]=t.charCodeAt(i);return s}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},s,i,r){if(!t)return"";const a=t;let o;if(typeof btoa=="function"){let l="";for(let c=0;c<a.length;++c)l+=String.fromCharCode(a[c]);o=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=A.BLOCK_LITERAL),e!==A.QUOTE_DOUBLE){const l=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),c=Math.ceil(o.length/l),u=new Array(c);for(let f=0,h=0;f<c;++f,h+=l)u[f]=o.substr(h,l);o=u.join(e===A.BLOCK_LITERAL?`
2
- `:" ")}return at({comment:n,type:e,value:o},s,i,r)}};function mt({value:n,source:e},t){return e&&(n?yt:bt).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}const yt={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new A(!0),stringify:mt},bt={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new A(!1),stringify:mt},rs={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:N},as={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():N(n)}},os={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){const e=new A(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){const s=n.substring(t+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:N},Q=n=>typeof n=="bigint"||Number.isInteger(n);function fe(n,e,t,{intAsBigInt:s}){const i=n[0];if((i==="-"||i==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),s){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}const a=BigInt(n);return i==="-"?BigInt(-1)*a:a}const r=parseInt(n,t);return i==="-"?-1*r:r}function Ee(n,e,t){const{value:s}=n;if(Q(s)){const i=s.toString(e);return s<0?"-"+t+i.substr(1):t+i}return N(n)}const ls={identify:Q,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>fe(n,2,2,t),stringify:n=>Ee(n,2,"0b")},cs={identify:Q,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>fe(n,1,8,t),stringify:n=>Ee(n,8,"0")},us={identify:Q,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>fe(n,0,10,t),stringify:N},fs={identify:Q,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>fe(n,2,16,t),stringify:n=>Ee(n,16,"0x")};function Pe(n,e){const t=n[0],s=t==="-"||t==="+"?n.substring(1):n,i=a=>e?BigInt(a):Number(a),r=s.replace(/_/g,"").split(":").reduce((a,o)=>a*i(60)+i(o),i(0));return t==="-"?i(-1)*r:r}function kt(n){let{value:e}=n,t=a=>a;if(typeof e=="bigint")t=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return N(n);let s="";e<0&&(s="-",e*=t(-1));const i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),s+r.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const vt={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>Pe(n,t),stringify:kt},wt={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>Pe(n,!1),stringify:kt},he={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){const e=n.match(he.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,s,i,r,a,o]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(t,s-1,i,r||0,a||0,o||0,l);const u=e[8];if(u&&u!=="Z"){let f=Pe(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:n})=>n?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},ze=[U,q,le,ce,yt,bt,ls,cs,us,fs,rs,as,os,Be,D,Te,Ne,Ce,vt,wt,he],Ge=new Map([["core",ts],["failsafe",[U,q,le]],["json",is],["yaml11",ze],["yaml-1.1",ze]]),We={binary:Be,bool:$e,float:ft,floatExp:ut,floatNaN:ct,floatTime:wt,int:pt,intHex:gt,intOct:dt,intTime:vt,map:U,merge:D,null:ce,omap:Te,pairs:Ne,seq:q,set:Ce,timestamp:he},hs={"tag:yaml.org,2002:binary":Be,"tag:yaml.org,2002:merge":D,"tag:yaml.org,2002:omap":Te,"tag:yaml.org,2002:pairs":Ne,"tag:yaml.org,2002:set":Ce,"tag:yaml.org,2002:timestamp":he};function me(n,e,t){const s=Ge.get(e);if(s&&!n)return t&&!s.includes(D)?s.concat(D):s.slice();let i=s;if(!i)if(Array.isArray(n))i=[];else{const r=Array.from(Ge.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(n))for(const r of n)i=i.concat(r);else typeof n=="function"&&(i=n(i.slice()));return t&&(i=i.concat(D)),i.reduce((r,a)=>{const o=typeof a=="string"?We[a]:a;if(!o){const l=JSON.stringify(a),c=Object.keys(We).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(o)||r.push(o),r},[])}const ds=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0;class Me{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?me(e,"compat"):e?me(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?hs:{},this.tags=me(t,this.name,s),this.toStringOptions=o??null,Object.defineProperty(this,Ft,{value:U}),Object.defineProperty(this,B,{value:le}),Object.defineProperty(this,Kt,{value:q}),this.sortMapEntries=typeof a=="function"?a:a===!0?ds:null}clone(){const e=Object.create(Me.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function ps(n,e){const t=[];let s=e.directives===!0;if(e.directives!==!1&&n.directives){const l=n.directives.toString(n);l?(t.push(l),s=!0):n.directives.docStart&&(s=!0)}s&&t.push("---");const i=Ut(n,e),{commentString:r}=i.options;if(n.commentBefore){t.length!==1&&t.unshift("");const l=r(n.commentBefore);t.unshift(ee(l,""))}let a=!1,o=null;if(n.contents){if(xe(n.contents)){if(n.contents.spaceBefore&&s&&t.push(""),n.contents.commentBefore){const u=r(n.contents.commentBefore);t.push(ee(u,""))}i.forceBlockIndent=!!n.comment,o=n.contents.comment}const l=o?void 0:()=>a=!0;let c=Fe(n.contents,i,()=>o=null,l);o&&(c+=qt(c,"",r(o))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(Fe(n.contents,i));if(n.directives?.docEnd)if(n.comment){const l=r(n.comment);l.includes(`
3
- `)?(t.push("..."),t.push(ee(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=n.comment;l&&a&&(l=l.replace(/^\n+/,"")),l&&((!a||o)&&t[t.length-1]!==""&&t.push(""),t.push(ee(r(l),"")))}return t.join(`
4
- `)+`
5
- `}class de{constructor(e,t,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ke,{value:Ue});let i=null;typeof t=="function"||Array.isArray(t)?i=t:s===void 0&&t&&(s=t,t=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:a}=r;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new ae({version:a}),this.setSchema(a,s),this.contents=e===void 0?null:this.createNode(e,i,s)}clone(){const e=Object.create(de.prototype,{[Ke]:{value:Ue}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=xe(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){E(this.contents)&&this.contents.add(e)}addIn(e,t){E(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const s=Vt(this);e.anchor=!t||s.has(t)?Ht(t||"a",s):t}return new ot(e.anchor)}createNode(e,t,s){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){const g=v=>typeof v=="number"||v instanceof String||v instanceof Number,k=t.filter(g).map(String);k.length>0&&(t=t.concat(k)),i=t}else s===void 0&&t&&(s=t,t=void 0);const{aliasDuplicateObjects:r,anchorPrefix:a,flow:o,keepUndefined:l,onTagObj:c,tag:u}=s??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=Yt(this,a||"a"),m={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:p},d=zt(e,u,m);return o&&O(d)&&(d.flow=!0),h(),d}createPair(e,t,s={}){const i=this.createNode(e,null,s),r=this.createNode(t,null,s);return new oe(i,r)}delete(e){return E(this.contents)?this.contents.delete(e):!1}deleteIn(e){return te(e)?this.contents==null?!1:(this.contents=null,!0):E(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return O(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return te(e)?!t&&Y(this.contents)?this.contents.value:this.contents:O(this.contents)?this.contents.getIn(e,t):void 0}has(e){return O(this.contents)?this.contents.has(e):!1}hasIn(e){return te(e)?this.contents!==void 0:O(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=qe(this.schema,[e],t):E(this.contents)&&this.contents.set(e,t)}setIn(e,t){te(e)?this.contents=t:this.contents==null?this.contents=qe(this.schema,Array.from(e),t):E(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ae({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new ae({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(s)this.schema=new Me(Object.assign(s,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:i,onAnchor:r,reviver:a}={}){const o={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Gt(this.contents,t??"",o);if(typeof r=="function")for(const{count:c,res:u}of o.anchors.values())r(u,c);return typeof a=="function"?Wt(a,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return ps(this,e)}}function E(n){if(O(n))return!0;throw new Error("Expected a YAML collection as document contents")}class It extends Error{constructor(e,t,s,i){super(),this.name=e,this.code=s,this.message=i,this.pos=t}}class z extends It{constructor(e,t,s){super("YAMLParseError",e,t,s)}}class gs extends It{constructor(e,t,s){super("YAMLWarning",e,t,s)}}const Ye=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(o=>e.linePos(o));const{line:s,col:i}=t.linePos[0];t.message+=` at line ${s}, column ${i}`;let r=i-1,a=n.substring(e.lineStarts[s-1],e.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&a.length>80){const o=Math.min(r-39,a.length-79);a="…"+a.substring(o),r-=o-1}if(a.length>80&&(a=a.substring(0,79)+"…"),s>1&&/^ *$/.test(a.substring(0,r))){let o=n.substring(e.lineStarts[s-2],e.lineStarts[s-1]);o.length>80&&(o=o.substring(0,79)+`…
6
- `),a=o+a}if(/[^ ]/.test(a)){let o=1;const l=t.linePos[1];l?.line===s&&l.col>i&&(o=Math.max(1,Math.min(l.col-i,80-r)));const c=" ".repeat(r)+"^".repeat(o);t.message+=`:
7
-
8
- ${a}
9
- ${c}
10
- `}};function F(n,{flow:e,indicator:t,next:s,offset:i,onError:r,parentIndent:a,startOnNewline:o}){let l=!1,c=o,u=o,f="",h="",p=!1,m=!1,d=null,g=null,k=null,v=null,S=null,I=null,w=null;for(const y of n)switch(m&&(y.type!=="space"&&y.type!=="newline"&&y.type!=="comma"&&r(y.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),d&&(c&&y.type!=="comment"&&y.type!=="newline"&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=null),y.type){case"space":!e&&(t!=="doc-start"||s?.type!=="flow-collection")&&y.source.includes(" ")&&(d=y),u=!0;break;case"comment":{u||r(y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const L=y.source.substring(1)||" ";f?f+=h+L:f=L,h="",c=!1;break}case"newline":c?f?f+=y.source:(!I||t!=="seq-item-ind")&&(l=!0):h+=y.source,c=!0,p=!0,(g||k)&&(v=y),u=!0;break;case"anchor":g&&r(y,"MULTIPLE_ANCHORS","A node can have at most one anchor"),y.source.endsWith(":")&&r(y.offset+y.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=y,w??(w=y.offset),c=!1,u=!1,m=!0;break;case"tag":{k&&r(y,"MULTIPLE_TAGS","A node can have at most one tag"),k=y,w??(w=y.offset),c=!1,u=!1,m=!0;break}case t:(g||k)&&r(y,"BAD_PROP_ORDER",`Anchors and tags must be after the ${y.source} indicator`),I&&r(y,"UNEXPECTED_TOKEN",`Unexpected ${y.source} in ${e??"collection"}`),I=y,c=t==="seq-item-ind"||t==="explicit-key-ind",u=!1;break;case"comma":if(e){S&&r(y,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=y,c=!1,u=!1;break}default:r(y,"UNEXPECTED_TOKEN",`Unexpected ${y.type} token`),c=!1,u=!1}const b=n[n.length-1],_=b?b.offset+b.source.length:i;return m&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d&&(c&&d.indent<=a||s?.type==="block-map"||s?.type==="block-seq")&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:I,spaceBefore:l,comment:f,hasNewline:p,anchor:g,tag:k,newlineAfterProp:v,end:_,start:w??_}}function J(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
11
- `))return!0;if(n.end){for(const e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of n.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(J(e.key)||J(e.value))return!0}return!1;default:return!0}}function Ie(n,e,t){if(e?.type==="flow-collection"){const s=e.end[0];s.indent===n&&(s.source==="]"||s.source==="}")&&J(e)&&t(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function St(n,e,t){const{uniqueKeys:s}=n.options;if(s===!1)return!1;const i=typeof s=="function"?s:(r,a)=>r===a||Y(r)&&Y(a)&&r.value===a.value;return e.some(r=>i(r.key,t))}const Je="All mapping items must start at the same column";function ms({composeNode:n,composeEmptyNode:e},t,s,i,r){const a=r?.nodeClass??j,o=new a(t.schema);t.atRoot&&(t.atRoot=!1);let l=s.offset,c=null;for(const u of s.items){const{start:f,key:h,sep:p,value:m}=u,d=F(f,{indicator:"explicit-key-ind",next:h??p?.[0],offset:l,onError:i,parentIndent:s.indent,startOnNewline:!0}),g=!d.found;if(g){if(h&&(h.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==s.indent&&i(l,"BAD_INDENT",Je)),!d.anchor&&!d.tag&&!p){c=d.end,d.comment&&(o.comment?o.comment+=`
12
- `+d.comment:o.comment=d.comment);continue}(d.newlineAfterProp||J(h))&&i(h??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==s.indent&&i(l,"BAD_INDENT",Je);t.atKey=!0;const k=d.end,v=h?n(t,h,d,i):e(t,k,f,null,d,i);t.schema.compat&&Ie(s.indent,h,i),t.atKey=!1,St(t,o.items,v)&&i(k,"DUPLICATE_KEY","Map keys must be unique");const S=F(p??[],{indicator:"map-value-ind",next:m,offset:v.range[2],onError:i,parentIndent:s.indent,startOnNewline:!h||h.type==="block-scalar"});if(l=S.end,S.found){g&&(m?.type==="block-map"&&!S.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&d.start<S.found.offset-1024&&i(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const I=m?n(t,m,S,i):e(t,l,p,null,S,i);t.schema.compat&&Ie(s.indent,m,i),l=I.range[2];const w=new oe(v,I);t.options.keepSourceTokens&&(w.srcToken=u),o.items.push(w)}else{g&&i(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),S.comment&&(v.comment?v.comment+=`
13
- `+S.comment:v.comment=S.comment);const I=new oe(v);t.options.keepSourceTokens&&(I.srcToken=u),o.items.push(I)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),o.range=[s.offset,l,c??l],o}function ys({composeNode:n,composeEmptyNode:e},t,s,i,r){const a=r?.nodeClass??W,o=new a(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=s.offset,c=null;for(const{start:u,value:f}of s.items){const h=F(u,{indicator:"seq-item-ind",next:f,offset:l,onError:i,parentIndent:s.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||f)f?.type==="block-seq"?i(h.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=h.end,h.comment&&(o.comment=h.comment);continue}const p=f?n(t,f,h,i):e(t,h.end,u,null,h,i);t.schema.compat&&Ie(s.indent,f,i),l=p.range[2],o.items.push(p)}return o.range=[s.offset,l,c??l],o}function Z(n,e,t,s){let i="";if(n){let r=!1,a="";for(const o of n){const{source:l,type:c}=o;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&s(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const u=l.substring(1)||" ";i?i+=a+u:i=u,a="";break}case"newline":i&&(a+=l),r=!0;break;default:s(o,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}const ye="Block collections are not allowed within flow collections",be=n=>n&&(n.type==="block-map"||n.type==="block-seq");function bs({composeNode:n,composeEmptyNode:e},t,s,i,r){const a=s.start.source==="{",o=a?"flow map":"flow sequence",l=r?.nodeClass??(a?j:W),c=new l(t.schema);c.flow=!0;const u=t.atRoot;u&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=s.offset+s.start.source.length;for(let g=0;g<s.items.length;++g){const k=s.items[g],{start:v,key:S,sep:I,value:w}=k,b=F(v,{flow:o,indicator:"explicit-key-ind",next:S??I?.[0],offset:f,onError:i,parentIndent:s.indent,startOnNewline:!1});if(!b.found){if(!b.anchor&&!b.tag&&!I&&!w){g===0&&b.comma?i(b.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):g<s.items.length-1&&i(b.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),b.comment&&(c.comment?c.comment+=`
14
- `+b.comment:c.comment=b.comment),f=b.end;continue}!a&&t.options.strict&&J(S)&&i(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)b.comma&&i(b.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(b.comma||i(b.start,"MISSING_CHAR",`Missing , between ${o} items`),b.comment){let _="";e:for(const y of v)switch(y.type){case"comma":case"space":break;case"comment":_=y.source.substring(1);break e;default:break e}if(_){let y=c.items[c.items.length-1];lt(y)&&(y=y.value??y.key),y.comment?y.comment+=`
15
- `+_:y.comment=_,b.comment=b.comment.substring(_.length+1)}}if(!a&&!I&&!b.found){const _=w?n(t,w,b,i):e(t,b.end,I,null,b,i);c.items.push(_),f=_.range[2],be(w)&&i(_.range,"BLOCK_IN_FLOW",ye)}else{t.atKey=!0;const _=b.end,y=S?n(t,S,b,i):e(t,_,v,null,b,i);be(S)&&i(y.range,"BLOCK_IN_FLOW",ye),t.atKey=!1;const L=F(I??[],{flow:o,indicator:"map-value-ind",next:w,offset:y.range[2],onError:i,parentIndent:s.indent,startOnNewline:!1});if(L.found){if(!a&&!b.found&&t.options.strict){if(I)for(const T of I){if(T===L.found)break;if(T.type==="newline"){i(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}b.start<L.found.offset-1024&&i(L.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else w&&("source"in w&&w.source?.[0]===":"?i(w,"MISSING_CHAR",`Missing space after : in ${o}`):i(L.start,"MISSING_CHAR",`Missing , or : between ${o} items`));const x=w?n(t,w,L,i):L.found?e(t,L.end,I,null,L,i):null;x?be(w)&&i(x.range,"BLOCK_IN_FLOW",ye):L.comment&&(y.comment?y.comment+=`
16
- `+L.comment:y.comment=L.comment);const V=new oe(y,x);if(t.options.keepSourceTokens&&(V.srcToken=k),a){const T=c;St(t,T.items,y)&&i(_,"DUPLICATE_KEY","Map keys must be unique"),T.items.push(V)}else{const T=new j(t.schema);T.flow=!0,T.items.push(V);const je=(x??y).range;T.range=[y.range[0],je[1],je[2]],c.items.push(T)}f=x?x.range[2]:L.end}}const h=a?"}":"]",[p,...m]=s.end;let d=f;if(p?.source===h)d=p.offset+p.source.length;else{const g=o[0].toUpperCase()+o.substring(1),k=u?`${g} must end with a ${h}`:`${g} in block collection must be sufficiently indented and end with a ${h}`;i(f,u?"MISSING_CHAR":"BAD_INDENT",k),p&&p.source.length!==1&&m.unshift(p)}if(m.length>0){const g=Z(m,d,t.options.strict,i);g.comment&&(c.comment?c.comment+=`
17
- `+g.comment:c.comment=g.comment),c.range=[s.offset,d,g.offset]}else c.range=[s.offset,d,d];return c}function ke(n,e,t,s,i,r){const a=t.type==="block-map"?ms(n,e,t,s,r):t.type==="block-seq"?ys(n,e,t,s,r):bs(n,e,t,s,r),o=a.constructor;return i==="!"||i===o.tagName?(a.tag=o.tagName,a):(i&&(a.tag=i),a)}function ks(n,e,t,s,i){const r=s.tag,a=r?e.directives.tagName(r.source,h=>i(r,"TAG_RESOLVE_FAILED",h)):null;if(t.type==="block-seq"){const{anchor:h,newlineAfterProp:p}=s,m=h&&r?h.offset>r.offset?h:r:h??r;m&&(!p||p.offset<m.offset)&&i(m,"MISSING_CHAR","Missing newline after block sequence props")}const o=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!a||a==="!"||a===j.tagName&&o==="map"||a===W.tagName&&o==="seq")return ke(n,e,t,i,a);let l=e.schema.tags.find(h=>h.tag===a&&h.collection===o);if(!l){const h=e.schema.knownTags[a];if(h?.collection===o)e.schema.tags.push(Object.assign({},h,{default:!1})),l=h;else return h?i(r,"BAD_COLLECTION_TYPE",`${h.tag} used for ${o} collection, but expects ${h.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),ke(n,e,t,i,a)}const c=ke(n,e,t,i,a,l),u=l.resolve?.(c,h=>i(r,"TAG_RESOLVE_FAILED",h),e.options)??c,f=xe(u)?u:new A(u);return f.range=c.range,f.tag=a,l?.format&&(f.format=l.format),f}function vs(n,e,t){const s=e.offset,i=ws(e,n.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};const r=i.mode===">"?A.BLOCK_FOLDED:A.BLOCK_LITERAL,a=e.source?Is(e.source):[];let o=a.length;for(let d=a.length-1;d>=0;--d){const g=a[d][1];if(g===""||g==="\r")o=d;else break}if(o===0){const d=i.chomp==="+"&&a.length>0?`
18
- `.repeat(Math.max(1,a.length-1)):"";let g=s+i.length;return e.source&&(g+=e.source.length),{value:d,type:r,comment:i.comment,range:[s,g,g]}}let l=e.indent+i.indent,c=e.offset+i.length,u=0;for(let d=0;d<o;++d){const[g,k]=a[d];if(k===""||k==="\r")i.indent===0&&g.length>l&&(l=g.length);else{g.length<l&&t(c+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=g.length),u=d,l===0&&!n.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=g.length+k.length+1}for(let d=a.length-1;d>=o;--d)a[d][0].length>l&&(o=d+1);let f="",h="",p=!1;for(let d=0;d<u;++d)f+=a[d][0].slice(l)+`
19
- `;for(let d=u;d<o;++d){let[g,k]=a[d];c+=g.length+k.length+1;const v=k[k.length-1]==="\r";if(v&&(k=k.slice(0,-1)),k&&g.length<l){const I=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-k.length-(v?2:1),"BAD_INDENT",I),g=""}r===A.BLOCK_LITERAL?(f+=h+g.slice(l)+k,h=`
20
- `):g.length>l||k[0]===" "?(h===" "?h=`
21
- `:!p&&h===`
22
- `&&(h=`
23
-
24
- `),f+=h+g.slice(l)+k,h=`
25
- `,p=!0):k===""?h===`
26
- `?f+=`
27
- `:h=`
28
- `:(f+=h+k,h=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let d=o;d<a.length;++d)f+=`
29
- `+a[d][0].slice(l);f[f.length-1]!==`
30
- `&&(f+=`
31
- `);break;default:f+=`
32
- `}const m=s+i.length+e.source.length;return{value:f,type:r,comment:i.comment,range:[s,m,m]}}function ws({offset:n,props:e},t,s){if(e[0].type!=="block-scalar-header")return s(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=e[0],r=i[0];let a=0,o="",l=-1;for(let h=1;h<i.length;++h){const p=i[h];if(!o&&(p==="-"||p==="+"))o=p;else{const m=Number(p);!a&&m?a=m:l===-1&&(l=n+h)}}l!==-1&&s(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,u="",f=i.length;for(let h=1;h<e.length;++h){const p=e[h];switch(p.type){case"space":c=!0;case"newline":f+=p.source.length;break;case"comment":t&&!c&&s(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=p.source.length,u=p.source.substring(1);break;case"error":s(p,"UNEXPECTED_TOKEN",p.message),f+=p.source.length;break;default:{const m=`Unexpected token in block scalar header: ${p.type}`;s(p,"UNEXPECTED_TOKEN",m);const d=p.source;d&&typeof d=="string"&&(f+=d.length)}}}return{mode:r,indent:a,chomp:o,comment:u,length:f}}function Is(n){const e=n.split(/\n( *)/),t=e[0],s=t.match(/^( *)/),r=[s?.[1]?[s[1],t.slice(s[1].length)]:["",t]];for(let a=1;a<e.length;a+=2)r.push([e[a],e[a+1]]);return r}function Ss(n,e,t){const{offset:s,type:i,source:r,end:a}=n;let o,l;const c=(h,p,m)=>t(s+h,p,m);switch(i){case"scalar":o=A.PLAIN,l=_s(r,c);break;case"single-quoted-scalar":o=A.QUOTE_SINGLE,l=As(r,c);break;case"double-quoted-scalar":o=A.QUOTE_DOUBLE,l=Ls(r,c);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[s,s+r.length,s+r.length]}}const u=s+r.length,f=Z(a,u,e,t);return{value:l,type:o,comment:f.comment,range:[s,u,f.offset]}}function _s(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),_t(n)}function As(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),_t(n.slice(1,-1)).replace(/''/g,"'")}function _t(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
33
- `,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
34
- `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=e.exec(n);if(!s)return n;let i=s[1],r=" ",a=e.lastIndex;for(t.lastIndex=a;s=t.exec(n);)s[1]===""?r===`
35
- `?i+=r:r=`
36
- `:(i+=r+s[1],r=" "),a=t.lastIndex;const o=/[ \t]*(.*)/sy;return o.lastIndex=a,s=o.exec(n),i+r+(s?.[1]??"")}function Ls(n,e){let t="";for(let s=1;s<n.length-1;++s){const i=n[s];if(!(i==="\r"&&n[s+1]===`
37
- `))if(i===`
38
- `){const{fold:r,offset:a}=Ts(n,s);t+=r,s=a}else if(i==="\\"){let r=n[++s];const a=Ns[r];if(a)t+=a;else if(r===`
39
- `)for(r=n[s+1];r===" "||r===" ";)r=n[++s+1];else if(r==="\r"&&n[s+1]===`
40
- `)for(r=n[++s+1];r===" "||r===" ";)r=n[++s+1];else if(r==="x"||r==="u"||r==="U"){const o={x:2,u:4,U:8}[r];t+=Cs(n,s+1,o,e),s+=o}else{const o=n.substr(s-1,2);e(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),t+=o}}else if(i===" "||i===" "){const r=s;let a=n[s+1];for(;a===" "||a===" ";)a=n[++s+1];a!==`
41
- `&&!(a==="\r"&&n[s+2]===`
42
- `)&&(t+=s>r?n.slice(r,s+1):i)}else t+=i}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function Ts(n,e){let t="",s=n[e+1];for(;(s===" "||s===" "||s===`
43
- `||s==="\r")&&!(s==="\r"&&n[e+2]!==`
44
- `);)s===`
45
- `&&(t+=`
46
- `),e+=1,s=n[e+1];return t||(t=" "),{fold:t,offset:e}}const Ns={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
47
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Cs(n,e,t,s){const i=n.substr(e,t),a=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){const o=n.substr(e-2,t+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}return String.fromCodePoint(a)}function At(n,e,t,s){const{value:i,type:r,comment:a,range:o}=e.type==="block-scalar"?vs(n,e,s):Ss(e,n.options.strict,s),l=t?n.directives.tagName(t.source,f=>s(t,"TAG_RESOLVE_FAILED",f)):null;let c;n.options.stringKeys&&n.atKey?c=n.schema[B]:l?c=xs(n.schema,i,l,t,s):e.type==="scalar"?c=$s(n,i,e,s):c=n.schema[B];let u;try{const f=c.resolve(i,h=>s(t??e,"TAG_RESOLVE_FAILED",h),n.options);u=Y(f)?f:new A(f)}catch(f){const h=f instanceof Error?f.message:String(f);s(t??e,"TAG_RESOLVE_FAILED",h),u=new A(i)}return u.range=o,u.source=i,r&&(u.type=r),l&&(u.tag=l),c.format&&(u.format=c.format),a&&(u.comment=a),u}function xs(n,e,t,s,i){if(t==="!")return n[B];const r=[];for(const o of n.tags)if(!o.collection&&o.tag===t)if(o.default&&o.test)r.push(o);else return o;for(const o of r)if(o.test?.test(e))return o;const a=n.knownTags[t];return a&&!a.collection?(n.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[B])}function $s({atKey:n,directives:e,schema:t},s,i,r){const a=t.tags.find(o=>(o.default===!0||n&&o.default==="key")&&o.test?.test(s))||t[B];if(t.compat){const o=t.compat.find(l=>l.default&&l.test?.test(s))??t[B];if(a.tag!==o.tag){const l=e.tagString(a.tag),c=e.tagString(o.tag),u=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",u,!0)}}return a}function Os(n,e,t){if(e){t??(t=e.length);for(let s=t-1;s>=0;--s){let i=e[s];switch(i.type){case"space":case"comment":case"newline":n-=i.source.length;continue}for(i=e[++s];i?.type==="space";)n+=i.source.length,i=e[++s];break}}return n}const Bs={composeNode:Lt,composeEmptyNode:Re};function Lt(n,e,t,s){const i=n.atKey,{spaceBefore:r,comment:a,anchor:o,tag:l}=t;let c,u=!0;switch(e.type){case"alias":c=Es(n,e,s),(o||l)&&s(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=At(n,e,l,s),o&&(c.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=ks(Bs,n,e,t,s),o&&(c.anchor=o.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);s(e,"RESOURCE_EXHAUSTION",h)}break;default:{const f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",f),u=!1}}return c??(c=Re(n,e.offset,void 0,null,t,s)),o&&c.anchor===""&&s(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&n.options.stringKeys&&(!Y(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&s(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?c.comment=a:c.commentBefore=a),n.options.keepSourceTokens&&u&&(c.srcToken=e),c}function Re(n,e,t,s,{spaceBefore:i,comment:r,anchor:a,tag:o,end:l},c){const u={type:"scalar",offset:Os(e,t,s),indent:-1,source:""},f=At(n,u,o,c);return a&&(f.anchor=a.source.substring(1),f.anchor===""&&c(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=l),f}function Es({options:n},{offset:e,source:t,end:s},i){const r=new ot(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=e+t.length,o=Z(s,a,n.strict,i);return r.range=[e,a,o.offset],o.comment&&(r.comment=o.comment),r}function Ps(n,e,{offset:t,start:s,value:i,end:r},a){const o=Object.assign({_directives:e},n),l=new de(void 0,o),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=F(s,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:a,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&a(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?Lt(c,i,u,a):Re(c,u.end,s,null,u,a);const f=l.contents.range[2],h=Z(r,f,!1,a);return h.comment&&(l.comment=h.comment),l.range=[t,f,h.offset],l}function H(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];const{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function Xe(n){let e="",t=!1,s=!1;for(let i=0;i<n.length;++i){const r=n[i];switch(r[0]){case"#":e+=(e===""?"":s?`
48
-
49
- `:`
50
- `)+(r.substring(1)||" "),t=!0,s=!1;break;case"%":n[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(s=!0),t=!1}}return{comment:e,afterEmptyLine:s}}class Ms{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,s,i,r)=>{const a=H(t);r?this.warnings.push(new gs(a,s,i)):this.errors.push(new z(a,s,i))},this.directives=new ae({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:s,afterEmptyLine:i}=Xe(this.prelude);if(s){const r=e.contents;if(t)e.comment=e.comment?`${e.comment}
51
- ${s}`:s;else if(i||e.directives.docStart||!r)e.commentBefore=s;else if(O(r)&&!r.flow&&r.items.length>0){let a=r.items[0];lt(a)&&(a=a.key);const o=a.commentBefore;a.commentBefore=o?`${s}
52
- ${o}`:s}else{const a=r.commentBefore;r.commentBefore=a?`${s}
53
- ${a}`:s}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Xe(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(const i of e)yield*this.next(i);yield*this.end(t,s)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,s,i)=>{const r=H(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",s,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=Ps(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new z(H(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new z(H(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const t=Z(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const s=this.doc.comment;this.doc.comment=s?`${s}
54
- ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new z(H(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const s=Object.assign({_directives:this.directives},this.options),i=new de(void 0,s);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}}class Rs{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,s=this.lineStarts.length;for(;t<s;){const r=t+s>>1;this.lineStarts[r]<e?t=r+1:s=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};const i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}}function $(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function Qe(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Tt(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function ne(n){switch(n.type){case"document":return n.start;case"block-map":{const e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function P(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function Ze(n){if(n.start.type==="flow-seq-start")for(const e of n.items)e.sep&&!e.value&&!$(e.start,"explicit-key-ind")&&!$(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Tt(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class Ds{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Jt,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(e,t))yield*this.next(s);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const t=Xt(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{const s=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in s?s.indent:0:t.type==="flow-collection"&&s.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Ze(t),s.type){case"document":s.value=t;break;case"block-scalar":s.props.push(t);break;case"block-map":{const i=s.items[s.items.length-1];if(i.value){s.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=s.items[s.items.length-1];i.value?s.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{const i=s.items[s.items.length-1];!i||i.value?s.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Qe(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(s.type==="document"?s.end=i.start:s.items.push({start:i.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Qe(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const t=ne(this.peek(2)),s=P(t);let i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
55
- `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
56
- `,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const s=!this.onKeyLine&&this.indent===e.indent,i=s&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let r=[];if(i&&t.sep&&!t.value){const a=[];for(let o=0;o<t.sep.length;++o){const l=t.sep[o];switch(l.type){case"newline":a.push(o);break;case"space":break;case"comment":l.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(r=t.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(r.push(this.sourceToken),e.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if($(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(Tt(t.key)&&!$(t.sep,"newline")){const a=P(t.start),o=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:o,sep:l}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if($(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const a=P(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):$(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:a,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(a):(Object.assign(t,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{const a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!t.explicitKey&&t.sep&&!$(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&e.items.push({start:r});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||$(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const s=this.startBlockValue(e);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const i=ne(s),r=P(i);Ze(e);const a=e.end.splice(1,e.end.length);a.push(this.sourceToken);const o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
57
- `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
58
- `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=ne(e),s=P(t);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=ne(e),s=P(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function js(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new Rs||null,prettyErrors:e}}function Fs(n,e={}){const{lineCounter:t,prettyErrors:s}=js(e),i=new Ds(t?.addNewLine),r=new Ms(e);let a=null;for(const o of r.compose(i.parse(n),!0,n.length))if(!a)a=o;else if(a.options.logLevel!=="silent"){a.errors.push(new z(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&t&&(a.errors.forEach(Ye(n,t)),a.warnings.forEach(Ye(n,t))),a}function Ks(n,e,t){let s;const i=Fs(n,t);if(!i)return null;if(i.warnings.forEach(r=>Qt(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},t))}function Us(n){return String(n).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function qs(n,e){const{language:t,tag:s,data:i}=e||{};if(!s)return n;if(i!==void 0)return i;const r=(t||"").toLowerCase();if(r==="json")try{return JSON.parse(n)}catch{return n}if(r==="yaml"||r==="yml")try{return Ks(n)}catch{return n}return n}function X(n){return n.type==="UniwebIcon"||n.type==="image"&&n.attrs?.role==="icon"}function M(n,e={}){const t=[];return Vs(n,t,e),t}function Vs(n,e,t){n.content&&Array.isArray(n.content)&&n.content?.forEach(s=>{const i=Hs(s,t);i&&(Array.isArray(i)?e.push(...i):e.push(i))})}function Hs(n,e={}){const t=n.attrs,s=n.content,i=sn(n);if(i)return{type:"link",attrs:i};const r=nn(n);if(r)return r;const a=rn(n);if(a)return a;switch(n.type){case"heading":return{type:"heading",level:n.attrs.level,text:R(s,e),children:G(s),attrs:t};case"paragraph":return{type:"paragraph",text:R(s,e),children:G(s),attrs:t};case"blockquote":return{type:"blockquote",children:M({content:s}),attrs:t};case"inset_block":{const{component:l,...c}=t||{};return{type:"inset_block",component:l,params:c,children:M({content:s})}}case"concept_block":return{type:"concept_block",tag:t?.tag,children:M({content:s},e)};case"dataBlock":return{type:"dataBlock",data:t.data,tag:t.tag};case"codeBlock":{const l=R(s,e);return t?.tag?{type:"dataBlock",tag:t.tag,data:qs(l,t)}:{type:"codeBlock",text:l,attrs:t}}case"inset_placeholder":return{type:"inset",refId:t.refId};case"math_display":return{type:"math",display:!0,id:n.attrs?.id||null,latex:n.attrs?.latex||"",mathml:n.attrs?.mathml||"",attrs:t};case"ImageBlock":return{type:"image",attrs:Se(t)};case"image":return t?.role==="video"?{type:"video",attrs:Ct(t)}:{type:"image",attrs:Se(t||{})};case"Video":return{type:"video",attrs:tn(t)};case"bulletList":case"orderedList":{const l=s.map(c=>c.type==="listItem"&&c.content?c.content:null).filter(Boolean);return{type:"list",style:n.type==="bulletList"?"bullet":"ordered",children:l.map(c=>M({content:c})),attrs:t}}case"table":return{type:"table",rows:(s||[]).filter(c=>c.type==="tableRow").map(c=>({cells:(c.content||[]).filter(u=>u.type==="tableCell").map(u=>({children:M({content:u.content},e),header:u.attrs?.header===!0,align:u.attrs?.align||null,colspan:u.attrs?.colspan||1,rowspan:u.attrs?.rowspan||1}))})),attrs:t};case"divider":case"DividerBlock":case"horizontalRule":return{type:"divider",attrs:t};case"card-group":return{type:"card-group",cards:n.content?.filter(l=>l.type==="card"&&!l.attrs?.hidden).map(l=>Qs(l.attrs))||[]};case"document-group":return{type:"document-group",documents:n.content?.filter(l=>l.type==="document").map(l=>Zs(l.attrs))||[]};case"StructuredContent":case"FormBlock":let o=t?.data;if(typeof o=="string")try{o=JSON.parse(o)}catch{}return{type:"form",schemaId:t?.activeSchemaId||null,data:o,attrs:t};case"button":{let l=R(s,e);return l?{type:"button",text:l,children:G(s),attrs:t}:null}case"UniwebIcon":return{type:"icon",attrs:pe(t)};case"Icon":return{type:"icon",attrs:en(t)};default:return{type:n.type,content:R(s,e)}}}const zs=["pdf","doc","docx","xls","xlsx","ppt","pptx","jpg","jpeg","png","webp","gif","svg","mp4","mp3","wav","mov","zip"];function Gs(n){return(n?.marks||[]).find(e=>e.type==="link")||null}function Ws(n,e){return!n||!e?!1:JSON.stringify(n.attrs||{})===JSON.stringify(e.attrs||{})}function Ys(n,e){const t=e.attrs.href,s=e.attrs.target||"_self",i=t.split(".").pop()?.toLowerCase(),r=zs.includes(i);return`<a href="${t}" target="${s}"${r?" download":""}>${n}</a>`}function R(n,e={}){if(!n)return"";const t=[];for(const s of n){const i=s?.type==="text"?Gs(s):null,r=t[t.length-1];i&&r?.link&&Ws(r.link,i)?r.nodes.push(s):t.push({link:i,nodes:[s]})}return t.reduce((s,i)=>{const r=i.nodes.reduce((a,o)=>a+Js(o),"");return!r&&!i.link?s:s+(i.link?Ys(r,i.link):r)},"").trim()}function Js(n){return[n].reduce((e,t)=>{const{type:s,marks:i=[],text:r}=t;if(s==="text"){let a=r||"";if(i.some(o=>o.type==="textStyle")){const o=i.find(l=>l.type==="textStyle")?.attrs?.color;o&&(a=`<span style="color: var(--${o})">${a}</span>`)}if(i.some(o=>o.type==="highlight")&&(a=`<span style="background-color: var(--highlight)">${a}</span>`),i.some(o=>o.type==="span")){const l=i.find(h=>h.type==="span")?.attrs||{},c=[],u=[];l.class&&c.push(`class="${l.class}"`),l.id&&c.push(`id="${l.id}"`);for(const[h,p]of Object.entries(l))h==="class"||h==="id"||(h==="color"?u.push(`color: ${p}`):h==="bg"?u.push(`background: ${p}`):c.push(`${h}="${p}"`));u.length>0&&c.push(`style="${u.join("; ")}"`),a=`<span${c.length>0?` ${c.join(" ")}`:""}>${a}</span>`}return i.some(o=>o.type==="code")&&(a=`<code>${a}</code>`),i.some(o=>o.type==="bold")&&(a=`<strong>${a}</strong>`),i.some(o=>o.type==="italic")&&(a=`<em>${a}</em>`),e+a}else if(s==="math_inline"){const a=Us(t.attrs?.latex||""),o=t.attrs?.mathml||"";return e+`<span data-type="math" data-latex="${a}" data-display="false">${o}</span>`}else if(s==="inset_placeholder"){const a=t.attrs?.refId;return a?e+`<uniweb-inset data-ref-id="${a}"></uniweb-inset>`:e}else return s==="hardBreak"?e+"<br>":e},"")}function G(n){if(!n)return[];const e=[];for(const t of n)if(X(t))e.push({type:"icon",attrs:pe(t.attrs)});else if(t.type==="image"||t.type==="ImageBlock"){const s=t.attrs?.role==="video";e.push({type:s?"video":"image",attrs:s?Ct(t.attrs):Se(t.attrs||{})})}else if(t.type==="math-inline"||t.type==="math_inline")e.push(t);else if(t.type==="inset_placeholder")e.push({type:"inset",refId:t.attrs?.refId,embedKind:t.attrs?.embedKind||"visual"});else if(t.type==="text"&&t.marks){const s=t.marks.find(i=>i.type==="link");s&&e.push({type:"link",attrs:{...s.attrs,label:t.text||""}})}return e}const Xs="https://assets.uniweb.app/";function Nt(n){if(!n||typeof n!="string")return"";const[e,t]=n.split("/");if(!t)return"";const s=t.substring(t.lastIndexOf(".")+1);return`${Xs}dist/${e}/base.${s}`}function K(n){const e=n?.src||n?.url||"";return e||(n?.identifier?Nt(n.identifier):"")}function Qs(n){const{address:e,...t}=n;let s=null;try{e&&(s=JSON.parse(e))}catch{}const{coverImg:i=null,icon:r}=t;return r&&(t.icon=pe(r)),{...t,address:s,coverImg:K(i)}}function Zs(n){const{src:e,info:t={},coverImg:s=null,...i}=n;let r={...i,coverImg:K(s)};if(e)r.href=e;else{const{identifier:a=""}=t;a&&(r.downloadUrl=Nt(a))}return r}function pe(n){const{svg:e,url:t,src:s,size:i,color:r,preserveColors:a,href:o,target:l,library:c,name:u}=n||{},f={};e&&(f.svg=e),(t||s)&&(f.url=t||s),i&&(f.size=i),r&&(f.color=r),a&&(f.preserveColors=a),o&&(f.href=o),l&&(f.target=l);let h=c,p=u;if(!h&&typeof u=="string"&&u.includes(":")){const[m,...d]=u.split(":");h=m,p=d.join(":")}return h&&(f.library=h),p&&(f.name=p),f}function en(n){const{svg:e,theme:t}=n||{},s={};return e&&(s.svg=e),t&&(s.theme=t),s}function Se(n){let{info:e,targetId:t,caption:s="",direction:i,filter:r,alt:a="",src:o,url:l,href:c="",target:u="",theme:f,role:h,credit:p="",id:m,width:d,height:g,loading:k,fit:v,position:S,preview:I,author:w,description:b}=n,{contentType:_,viewType:y,contentId:L,identifier:x}=e||{};const V={center:"basic",wide:"lg",fill:"full"};return s=xt(s),x?l=K(e):!l&&o&&(l=o),{contentType:_,viewType:y,contentId:t||L,url:l,value:x||"",alt:a||s,caption:s,direction:i,filter:r,imgPos:i==="left"||i==="right"?i:"",size:V[i]||"basic",href:c,target:u,theme:f,role:h,credit:p,id:m||void 0,...d!=null&&{width:d},...g!=null&&{height:g},...k&&{loading:k},...v&&{fit:v},...S&&{position:S},...I&&{preview:I},...w&&{author:w},...b&&{description:b}}}function Ct(n){const{src:e,url:t,info:s,poster:i,alt:r="",caption:a="",autoplay:o,muted:l,loop:c,controls:u,href:f="",target:h="",role:p,id:m}=n||{},d={src:K({src:t||e,...s}),alt:r,caption:xt(a),role:p,href:f,target:h};return i&&(d.poster=i),o!==void 0&&(d.autoplay=o),l!==void 0&&(d.muted=l),c!==void 0&&(d.loop=c),u!==void 0&&(d.controls=u),m&&(d.id=m),d}function tn(n){let{src:e,caption:t="",direction:s,info:i={},coverImg:r={},alt:a,href:o="",target:l=""}=n;return{src:K({src:e,...i}),caption:t,direction:s,coverImg:K(r),alt:a,href:o,target:l}}function xt(n){return!n||typeof n!="string"?"":n.replace(/<[^>]*>/g,"").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&apos;/g,"'").replace(/&nbsp;/g," ").replace(/&#(\d+);/g,(t,s)=>String.fromCharCode(Number(s))).replace(/&#x([0-9a-fA-F]+);/g,(t,s)=>String.fromCharCode(parseInt(s,16)))}function sn(n){if(["paragraph","heading"].includes(n.type)){const e=n?.content||[],t=e.filter(s=>X(s)?!1:s.type==="text"?(s.text||"").trim()!=="":!0);if(t.length===1){let s=t[0],i=s?.marks||[];for(let r=0;r<i.length;r++){let a=i[r];if(a?.type==="link"){const o=e.findIndex(u=>u.type==="text"&&u.text===s.text);let l=null,c=null;for(let u=0;u<e.length;u++)if(X(e[u])){const f=pe(e[u].attrs);u<o?l=f:u>o&&(c||(c=f))}return{...a?.attrs,label:s?.text||"",iconBefore:l,iconAfter:c,children:G(e)}}}}}return!1}function nn(n){if(n.type!=="paragraph")return!1;const e=n?.content||[];if(!e.length)return!1;const t=e.filter(i=>!(X(i)||i.type==="text"&&!(i.text||"").trim()));return t.length<2||!t.every(i=>i.type!=="text"?!1:i.marks?.some(a=>a.type==="link"))?!1:t.map(i=>({type:"link",attrs:{...i.marks.find(a=>a.type==="link")?.attrs,label:i.text||""}}))}function rn(n){if(!["paragraph","heading"].includes(n.type))return!1;let e=n?.content||[];if(!e.length)return!1;e=e.filter(o=>!X(o));let t=e[0]?.marks?.find(o=>o.type==="link"&&o.attrs);if(!t||!e.every(o=>o?.marks?.some(l=>l.type==="link"&&l.attrs?.href===t.attrs?.href)||!1))return!1;const{href:s,target:i}=t.attrs,r=e.map(o=>{const l=o.marks?.filter(c=>c.type!=="link")||[];return{...o,marks:l}});let a=R(r);return a?{type:"paragraph",children:G(n.content),text:`<a target="${i}" href="${s}">${a}</a>`,attrs:n.attrs}:!1}function et(n){if(!n)return null;const e={title:n.header.title||"",pretitle:n.header.pretitle||"",subtitle:n.header.subtitle||"",paragraphs:n.body.paragraphs||[],links:n.body.links||[],images:n.body.images||[],icons:n.body.icons||[],lists:n.body.lists||[],videos:n.body.videos||[],insets:n.body.insets||[],snippets:n.body.snippets||[],data:n.body.data||{},quotes:n.body.quotes||[],headings:n.body.headings||[]};return n.body.math&&n.body.math.length&&(e.math=n.body.math),n.body.tables&&n.body.tables.length&&(e.tables=n.body.tables),e}function $t(n,e={}){if(!n.length)return{title:"",pretitle:"",subtitle:"",paragraphs:[],links:[],images:[],icons:[],lists:[],videos:[],insets:[],snippets:[],data:{},quotes:[],headings:[],items:[]};const s=an(n,e).map(c=>_e(c));let i=null,r=[];(e.alwaysItems?!1:un(s))?(i=s[0],r=s.slice(1)):r=s;const o=et(i)||{title:"",pretitle:"",subtitle:"",paragraphs:[],links:[],images:[],icons:[],lists:[],videos:[],insets:[],data:{},quotes:[],headings:[]},l=r.map(et);return{...o,items:l}}function an(n,e={}){const t=[];let s=[];for(let i=0;i<n.length;i++){const r=n[i];if(r.type==="divider"){s.length>0&&(t.push(s),s=[]);continue}if(r.type==="heading"){const a=i===1&&ln(n,0);s.length>0&&!a&&(t.push(s),s=[]);const o=cn(n,i,e);s.push(...o),i+=o.length-1}else s.push(r)}return s.length>0&&t.push(s),t}function on(n,e){return e+1<n.length&&n[e].type==="heading"&&n[e+1].type==="heading"&&n[e].level>n[e+1].level}function ln(n,e){return e+1<n.length&&n[e].type==="image"&&(n[e].role==="banner"||n[e+1].type==="heading")}function cn(n,e,t={}){const s=[n[e]];let i=!1;for(let r=e+1;r<n.length;r++){const a=n[r],o=s[s.length-1];if(a.type!=="heading")break;if(a.level-o.level===1){i=!0,s.push(a);continue}if(s.length===1&&a.level<o.level){s.push(a);continue}if(a.level===o.level&&!i&&!t.alwaysItems){s.push(a);continue}break}return s}function _e(n){const e={pretitle:"",title:"",subtitle:""},t={images:[],icons:[],videos:[],insets:[],snippets:[],paragraphs:[],links:[],lists:[],data:{},quotes:[],headings:[]},s={level:null,contentTypes:new Set};if(!n)return{header:e,body:t,metadata:s};let i=null,r=null;for(let a=0;a<n.length;a++){on(n,a)&&!e.pretitle&&(e.pretitle=n[a].text,a++);const o=n[a];if(o.type==="heading"){if(o.children&&Array.isArray(o.children)&&ve(o.children,t),s.level??=o.level,r!==null&&o.level===r&&i){const l=e[i];Array.isArray(l)?l.push(o.text):e[i]=[l,o.text]}else e.title?e.subtitle?(t.headings.push(o.text),i=null):(e.subtitle=o.text,i="subtitle"):(e.title=o.text,i="title");r=o.level}else if(o.type==="list"){const l=o.children;t.lists.push(l.map(c=>_e(c).body))}else{let l={...o.attrs};switch(o.type){case"paragraph":o.children&&Array.isArray(o.children)&&ve(o.children,t),o.text&&t.paragraphs.push(o.text);break;case"image":o.attrs?.role==="icon"?t.icons.push(o.attrs):t.images.push(l);break;case"video":t.videos.push(l);break;case"link":o.children&&Array.isArray(o.children)&&ve(o.children,t),t.links.push(l);break;case"icon":t.icons.push(o.attrs);break;case"button":t.links.push({href:o.attrs?.href||"",label:o.text||"",role:o.attrs?.variant?`button-${o.attrs.variant}`:"button",variant:o.attrs?.variant||"primary",size:o.attrs?.size,icon:o.attrs?.icon,target:o.attrs?.target,class:o.attrs?.class});break;case"blockquote":const c=_e(o.children);t.quotes.push(c.body);break;case"concept_block":{const u=o.children||[];t.data[o.tag]={items:$t(u,{alwaysItems:!0}).items,sequence:u};break}case"dataBlock":t.data[o.tag]=o.data;break;case"codeBlock":t.snippets.push({language:o.attrs?.language||"",code:typeof o.text=="string"?o.text:""});break;case"math":(t.math||=[]).push({id:o.id||null,latex:o.latex||"",mathml:o.mathml||""});break;case"table":(t.tables||=[]).push({rows:o.rows||[],attrs:o.attrs||{}});break;case"inset":t.insets.push({refId:o.refId});break;case"form":{const u=o.data||o.attrs,f=o.schemaId||"form";t.data[f]=u}break;case"card-group":(o.cards||[]).forEach(u=>{const f=u.cardType||"card";t.data[f]||(t.data[f]=[]);const{cardType:h,...p}=u;t.data[f].push(p)});break;case"document-group":o.documents.forEach(u=>{t.links.push({href:u.href||u.downloadUrl||"",label:u.title||"",role:"document",download:!0,preview:u.coverImg,fileType:u.fileType})});break}}}return{header:e,body:t,metadata:s}}function un(n){if(n.length===0)return!1;if(n.length===1)return!0;const e=n[0].metadata.level,t=n[1].metadata.level;return!!(e&&(!t||e<t)||!e&&t)}function ve(n,e){n.forEach(t=>{t.type==="icon"?e.icons.push(t.attrs):t.type==="image"?t.attrs?.role==="icon"?e.icons.push(t.attrs):e.images.push(t.attrs):t.type==="video"?e.videos.push(t.attrs):t.type==="link"&&e.links.push(t.attrs)})}function fn(n,e={}){const t={...e},s=M(n,t),i=$t(s,t);return{raw:n,sequence:s,...i}}function hn(n){if(!n||!Array.isArray(n.content))return{content:n,refs:[]};const e=[],t=i=>{let r=!1;const a=i.map(o=>{if(!o)return o;if(o.type==="inset_block"){const{component:l,...c}=o.attrs||{},u=`container_${e.length}`;return e.push({refId:u,type:l,params:c,content:{type:"doc",content:o.content||[]}}),r=!0,{type:"inset_placeholder",attrs:{refId:u,embedKind:"block"}}}if(Array.isArray(o.content)){const l=t(o.content);if(l!==o.content)return r=!0,{...o,content:l}}return o});return r?a:i},s=t(n.content);return s===n.content?{content:n,refs:e}:{content:{...n,content:s},refs:e}}class C{constructor(e,t,s){this.id=t,this.stableId=e.stableId||null,this.page=s,this.website=s.website,this.type=e.type||this.website.getDefaultBlockType(),this.Component=null;const i=hn(e.content);this.rawContent=i.content||{},this.parsedContent=this.parseContent(i.content),e.parsedContent?.data&&(this.parsedContent.data={...this.parsedContent.data||{},...e.parsedContent.data}),this.items=this.parsedContent.items||[];const r=e.params||e.config||{};this.preset=e.preset;const a=r.theme;if(a&&typeof a=="object"){const{mode:c,...u}=a;if(this.themeName=c||"",Object.keys(u).length>0){for(const f of Object.keys(u))u[f]=Ve(u[f]);this.contextOverrides=u}else this.contextOverrides=null}else this.themeName=a??"",this.contextOverrides=null;this.standardOptions=r.standardOptions||{},this.properties=r.properties||r,this.properties.theme&&typeof this.properties.theme=="object"&&(this.properties={...this.properties,theme:this.themeName});const o=r.background;o&&!this.standardOptions.background&&(this.standardOptions={...this.standardOptions,background:C.normalizeBackground(o)}),this.childBlocks=e.subsections?e.subsections.map((c,u)=>new C(c,`${t}_${u}`,this.page)):[],this.insets=[];const l=e.insets;if(l?.length>0)for(let c=0;c<l.length;c++){const u=l[c],f=u.title||"",h=new C({type:u.type,params:u.params||{},content:{title:f},stableId:u.refId,refId:u.refId},`${t}_inset_${c}`,this.page);this.insets.push(h)}for(let c=0;c<i.refs.length;c++){const u=i.refs[c];this.insets.push(new C({type:u.type,params:u.params||{},content:u.content,stableId:u.refId,refId:u.refId},`${t}_container_${c}`,this.page))}this.fetch=e.fetch||null,this.dataLoading=!1,this.hasBackground=!1,this.refId=e.refId||null,this.dynamicContext=e.dynamicContext||null,this.startState=null,this.state=null,this.resetStateHook=null,this.context=null,this.componentVars=null,Object.seal(this)}get path(){return this.page.getNavRoute()}get key(){return`${this.path}-${this.id}`}get parentPath(){return this.dynamicContext?.templateRoute?this.dynamicContext.templateRoute.split("/").slice(0,-1).join("/")||"/":this.path.split("/").slice(0,-1).join("/")||"/"}parseContent(e){return e?.groups?e.groups:e?.type==="doc"?this.extractFromProseMirror(e):e?.doc?.type==="doc"?this.extractFromProseMirror(e.doc):e&&typeof e=="object"&&!Array.isArray(e)?e:{title:"",paragraphs:[],items:[],sequence:[]}}extractFromProseMirror(e){try{return fn(e)}catch(t){return console.warn("[Block] Semantic parser error, using fallback:",t.message),this.extractFromProseMirrorFallback(e)}}extractFromProseMirrorFallback(e){const t={title:"",pretitle:"",subtitle:"",paragraphs:[],links:[],images:[],lists:[],icons:[],items:[],sequence:[]};if(!e.content)return t;for(const s of e.content)if(s.type==="heading"){const i=this.extractText(s);s.attrs?.level===1?t.title=i:s.attrs?.level===2&&(t.subtitle=i)}else if(s.type==="paragraph"){const i=this.extractText(s);t.paragraphs.push(i)}return t}extractText(e){return e.content?e.content.filter(t=>t.type==="text").map(t=>t.text).join(""):""}initComponent(){if(this.Component)return this.Component;if(this.Component=globalThis.uniweb?.getComponent(this.type),!this.Component)return console.warn(`[Block] Component not found: ${this.type}`),null;const e=globalThis.uniweb?.getComponentMeta(this.type)||{},t=e.initialState;return this.startState=t?{...t}:null,this.initState(),this.context=e.context?{...e.context}:null,e.vars&&(this.componentVars=C.mergeComponentVars(e.vars,this.properties.vars)),this.Component}getBlockProperties(){return this.properties}getInset(e){return this.insets.find(t=>t.refId===e)||null}getChildBlockRenderer(){return globalThis.uniweb.childBlockRenderer}getBlockLinks(e={}){const t=globalThis.uniweb?.activeWebsite,s=this.parsedContent||{};if(e.nested){const a=(s.lists||[])[0];return C.parseNestedLinks(a,t)}return(s.links||[]).map(r=>({route:t?.makeHref(r.href)||r.href,label:r.label}))}initState(){this.state=this.startState,this.resetStateHook&&this.resetStateHook()}getIndex(){return this.page?this.page.getBlockIndex(this):-1}getBlockInfo(){return{type:this.type,theme:this.themeName,contextOverrides:this.contextOverrides,state:this.state,context:this.context}}getNextBlockInfo(){const e=this.website?.activePage;if(e&&e!==this.page)return e.getFirstBodyBlockInfo();const t=this.getIndex();return t<0||!this.page?null:this.page.getBlockInfo(t+1)}getPrevBlockInfo(){const e=this.website?.activePage;if(e&&e!==this.page)return e.getLastBodyBlockInfo();const t=this.getIndex();return t<=0||!this.page?null:this.page.getBlockInfo(t-1)}useBlockState(e,t){t!==void 0&&this.startState===null?(this.startState=t,this.state=t):t=this.startState;const[s,i]=e(t);return this.resetStateHook=()=>i(t),[s,r=>i(this.state=r)]}getDynamicContext(){return this.dynamicContext}static mergeComponentVars(e,t={}){const s={};for(const[i,r]of Object.entries(e)){const a=typeof r=="string"?r:r?.default;a!=null&&(s[i]=a)}if(t&&typeof t=="object")for(const[i,r]of Object.entries(t))r!=null&&i in e&&(s[i]=String(r));return Object.keys(s).length>0?s:null}static normalizeBackground(e){if(typeof e=="string"){if(/^(\/|\.\/|\.\.\/|https?:\/\/)/.test(e)||/\.(jpe?g|png|webp|gif|svg|avif|mp4|webm|ogv|ogg)$/i.test(e)){const t=e.split(".").pop()?.toLowerCase();return["mp4","webm","ogv","ogg"].includes(t)?{mode:"video",video:{src:e}}:{mode:"image",image:{src:e}}}return/^(linear|radial|conic)-gradient\(/.test(e)?{mode:"gradient",gradient:e}:{mode:"color",color:Ve(e)}}if(e.mode)return e;if(typeof e.overlay=="number"&&(e={...e,overlay:{enabled:!0,type:"dark",opacity:e.overlay}}),e.video||e.sources)return{mode:"video",...e};if(e.image||e.src){if(e.src){const{src:t,position:s,size:i,lazy:r,...a}=e;return{mode:"image",image:{src:t,position:s,size:i,lazy:r},...a}}if(typeof e.image=="string"){const{image:t,...s}=e;return{mode:"image",image:{src:t},...s}}return{mode:"image",...e}}return e.gradient?{mode:"gradient",...e}:e.color?{mode:"color",...e}:e}static parseNestedLinks(e,t){const s=[];if(!e?.length)return s;for(const i of e){const{links:r=[],lists:a=[],paragraphs:o=[]}=i,l=r[0],c=a[0],u=o[0];let f="",h="",p=[],m=!0;l?(f=l.label,h=l.href,c&&(p=C.parseNestedLinks(c,t))):(f=u,m=!1,c&&(p=C.parseNestedLinks(c,t))),s.push({label:f,route:t?.makeHref(h)||h,child_items:p,hasData:m})}return s}}class Ot{constructor(){this._values=new Map,this._keyListeners=new Map,Object.seal(this)}get(e){return this._values.get(e)}has(e){return this._values.has(e)}set(e,t){this._values.has(e)&&this._values.get(e)===t||(this._values.set(e,t),this._notify(e))}delete(e){return this._values.has(e)?(this._values.delete(e),this._notify(e),!0):!1}subscribe(e,t){let s=this._keyListeners.get(e);return s||(s=new Set,this._keyListeners.set(e,s)),s.add(t),()=>{s.delete(t),s.size===0&&this._keyListeners.delete(e)}}_notify(e){const t=this._keyListeners.get(e);if(t)for(const s of t)s()}}function Bt(n){const e=n||{};return{noindex:e.noindex||!1,image:e.image||null,ogTitle:e.ogTitle||null,ogDescription:e.ogDescription||null,canonical:e.canonical||null,changefreq:e.changefreq||null,priority:e.priority||null}}function dn(n){const e=[],t=new Set,s=r=>{typeof r=="string"&&r&&!t.has(r)&&(t.add(r),e.push(r))},i=n.hideIn;return Array.isArray(i)?i.forEach(s):s(i),n.hideInHeader&&s("header"),n.hideInFooter&&s("footer"),e}class ie{constructor(e,t,s){this.id=t,this.stableId=e.id||null,this.route=e.route,this.sourcePath=e.sourcePath||null,this.isIndex=e.isIndex||!1,this.parentRoute=e.parent||null,this.title=e.title||"",this.description=e.description||"",this.label=e.label||null,this.keywords=e.keywords||null,this.lastModified=e.lastModified||null,this.redirect=e.redirect||null,this.rewrite=e.rewrite||null,this.hidden=e.hidden||!1,this.hideIn=dn(e),this.hideInHeader=this.hideIn.includes("header"),this.hideInFooter=this.hideIn.includes("footer"),this.layout={name:e.layout?.name||null,hide:e.layout?.hide||[],params:e.layout?.params||{}},this.seo=Bt(e.seo),this.parent=null,this.children=[],this.website=s,this.scrollY=0,this.fetch=e.fetch||null,this.dynamicContext=e.dynamicContext||null,this.version=e.version||null,this.versionMeta=e.versionMeta||null,this.versionScope=e.versionScope||null,this._hasContent=e.hasContent??e.sections?.length>0,this._bodySections=e.sections,this._bodyBlocks=null,this._loadingContent=null,this._state=null,Object.seal(this)}get state(){return this._state||(this._state=new Ot),this._state}get bodyBlocks(){if(!this._bodyBlocks){if(this._bodySections===void 0)return[];this._bodyBlocks=(this._bodySections||[]).map((e,t)=>new C(e,t,this))}return this._bodyBlocks}getHeadMeta(){const e=this.getTitle(),t=this.website?.seo||{},s=this.website?.keywords||null;return{title:e,description:this.description,keywords:this.keywords||s,canonical:this.seo.canonical,robots:this.seo.noindex||t.noindex?"noindex, nofollow":null,og:{title:this.seo.ogTitle||e||t.ogTitle,description:this.seo.ogDescription||this.description||t.ogDescription,image:this.seo.image||t.image,url:this.route}}}isDynamicPage(){return this.dynamicContext!==null}getDynamicContext(){return this.dynamicContext}getDynamicParam(){return this.dynamicContext?.paramValue||null}getLayoutName(){return this.layout.name||this.website?.getDefaultLayoutName()||null}getBlockGroups(){return{body:this.bodyBlocks,...this.getLayoutAreas()}}getBlockIndex(e){return this.getPageBlocks().indexOf(e)}getBlockInfo(e){return this.getPageBlocks()[e]?.getBlockInfo()||null}getFirstBodyBlockInfo(){return this.bodyBlocks?.[0]?.getBlockInfo()||null}getLastBodyBlockInfo(){const e=this.bodyBlocks;return e?.[e.length-1]?.getBlockInfo()||null}getPageBlocks(){const e=[],t=this.getLayoutAreas(),s=t.header,i=t.footer;return s&&e.push(...s),e.push(...this.bodyBlocks),i&&e.push(...i),e}getBodyBlocks(){return this.bodyBlocks}getAreaBlocks(e){return this.layout.hide.includes(e)?null:this.website.getAreaBlocks(e,this.getLayoutName())}getLayoutAreas(){const e=this.website.getLayoutAreas(this.getLayoutName()),t={};for(const[s,i]of Object.entries(e))this.layout.hide.includes(s)||(t[s]=i);return t}getLayoutParams(){return this.layout.params}resetBlockStates(){const e=this.getLayoutAreas(),t=[...this.bodyBlocks,...Object.values(e).flat()];for(const s of t)typeof s.initState=="function"&&s.initState()}getNavRoute(){return this.isIndex&&this.route.endsWith("/index")?this.route.slice(0,-6)||"/":this.route}getTitle(){if(this.isIndex&&this.route.endsWith("/index")){const e=this.title?.trim();if(!e||e.toLowerCase()==="index")return this.parent?.title||e||""}return this.title}getLabel(){return this.label||this.getTitle()}isHidden(){return this.hidden}showInNav(e){return!this.hidden&&!this.hideIn.includes("*")&&!this.hideIn.includes(e)}showInHeader(){return this.showInNav("header")}showInFooter(){return this.showInNav("footer")}hasChildren(){return this.children.length>0}hasContent(){return this._hasContent}isContentLoaded(){return this._bodySections!==void 0}async loadContent(){if(this._bodySections===void 0)return this._loadingContent?this._loadingContent:(this._loadingContent=(async()=>{try{const e=this.website.basePath||"",t=this.website.activeLocale,s=this.website.defaultLocale,r=this.website.config?.pageHashes?.[t]?.[this.route];let a;if(r)a=`${e}${r}`;else{const c=t!==s?`/${t}`:"",u=this.route==="/"?"/index":this.route;a=`${e}${c}/_pages${u}.json`}const o=await fetch(a);if(o.status===404&&pn(r)){window.location.reload();return}if(!o.ok){console.warn(`[Page] Failed to load content for ${this.route}: ${o.status}`),this._bodySections=[];return}const l=await o.json();this._bodySections=l.sections||[],this._bodyBlocks=null,typeof sessionStorage<"u"&&sessionStorage.removeItem("uniwebReloadCount")}finally{this._loadingContent=null}})(),this._loadingContent)}getNavigableRoute(){if(this.hasContent())return this.route;const e=this.children||[];if(e.find(s=>s.isIndex))return this.route;for(const s of e){const i=s.getNavigableRoute();if(i)return i}return this.route}getRenderableSelf(){return this.hasContent()?this:this.children?.find(t=>t.isIndex)||this}getNormalizedRoute(){return this.website.normalizeRoute(this.route)}isActiveFor(e){return this.website.isRouteActive(this.route,e)}isActiveOrAncestor(e){if(this.website.isRouteActive(this.route,e))return!0;const t=this.sourcePath||this.route;return this.website.isRouteActiveOrAncestor(t,e)}isVersioned(){return this.version!==null}getVersion(){return this.version}getVersions(){return this.versionMeta?.versions||[]}isLatestVersion(){return this.version?.latest===!0}isDeprecatedVersion(){return this.version?.deprecated===!0}getVersionUrl(e){return this.isVersioned()?this.website.getVersionUrl(e,this.route):null}}function pn(n){if(!n||typeof sessionStorage>"u"||typeof window>"u"||!window.location)return!1;try{const e=parseInt(sessionStorage.getItem("uniwebReloadCount")||"0",10)||0;return e>=2?!1:(sessionStorage.setItem("uniwebReloadCount",String(e+1)),!0)}catch{return!1}}const Et="data",De=`/${Et}/`;function Mn(n){return`${De}${n}.json`}function gn(n,e){return`${De}${n}/${e}.json`}function Rn(n){return typeof n!="string"?"":n.replace(new RegExp(`^/?${Et}/`),"").replace(/\.json$/i,"")}function mn(n){return typeof n=="string"&&n.startsWith(De)}function yn(n){return n?.refine===!0||n?.inherit===!0}function bn(n,e,t){return!n.path||!e||e===t||!mn(n.path)?n:{...n,path:`/${e}${n.path}`}}function kn(n,e){if(n.detail!==void 0)return n;const t=n.schema;if(!t||!e)return n;const s=e[t];if(!s||typeof s!="object")return n;const i=Array.isArray(s.deferred)?s.deferred:null;if(!i||i.length===0)return n;const r=typeof s.detailUrl=="string"?s.detailUrl:gn(t,"{slug}");return{...n,detail:r}}function vn(n,e={}){const{schemas:t=[],locale:s=null,defaultLocale:i=null,collections:r=null}=e,a=new Map,o=t.length===0;for(const l of n){if(!l)continue;const c=Array.isArray(l)?l:[l];for(const u of c){if(!u?.schema||a.has(u.schema)||!o&&!t.includes(u.schema))continue;const f=bn(u,s,i);a.set(u.schema,kn(f,r))}}return a}const re=yn;let tt=!1;function wn(n){tt||(tt=!0,console.warn(`[uniweb] 'fetch: { inherit: true }' is deprecated; rename to 'fetch: { refine: true }'. Accepted for one release; will be removed in the next minor. First seen on block ${n?.id??"(unknown)"} of page ${n?.page?.route??"(unknown)"}.`))}class In{constructor({website:e}){this.website=e,Object.seal(this)}_shouldInheritDetail(e,t){const s=t?.fetch;return re(s)&&s?.detail!==void 0?s.detail!==!1:e?e.inheritDetail!==!1:!0}_inheritLimit(e,t){const s=t?.fetch;return re(s)&&s?.limit>0?s.limit:e?.inheritLimit>0?e.inheritLimit:null}_inheritOrder(e){const t=e?.fetch;return re(t)&&t?.order?.orderBy?t.order:null}_sortItems(e,t){if(!t?.orderBy||!Array.isArray(e)||e.length===0)return e;const{orderBy:s,sortOrder:i="ASC"}=t,r=i==="DESC";return[...e].sort((a,o)=>{const l=a[s]??"",c=o[s]??"",u=typeof l=="string"&&typeof c=="string"?l.localeCompare(c):l>c?1:l<c?-1:0;return r?-u:u})}_getRequestedSchemas(e){return e?e.inheritData===!1?null:[]:[]}_findFetchConfigs(e,t){e.fetch?.inherit===!0&&e.fetch?.refine!==!0&&wn(e);const s=e.page,i=e.website;return vn([e.fetch&&!re(e.fetch)?e.fetch:null,s?.fetch,s?.parent?.fetch,i?.config?.fetch],{schemas:t,locale:i?.getActiveLocale?.()??null,defaultLocale:i?.getDefaultLocale?.()??null,collections:i?.config?.collections??null})}_applyDetailRoutes(e,t,s){if(!(!e||!s?.resolveDetailPageTemplate))for(const[i,r]of t){if(!r.detailPage)continue;const a=e[i];if(!Array.isArray(a)||a.length===0)continue;const o=s.resolveDetailPageTemplate(r.detailPage);o&&(e[i]=a.map(l=>Sn(l,o)))}}_buildDetailConfig(e,t){const{detail:s}=e;if(!s)return null;const{paramName:i,paramValue:r}=t;if(!i||r===void 0)return null;const a=e.url||e.path;if(!a)return null;const o=!!e.path&&!e.url;if(s&&typeof s=="object"){const c={...o?{path:a}:{url:a},schema:e.schema,transform:e.transform};return e.method&&(c.method=e.method),s.body!==void 0?c.body=ge(s.body,{[i]:r},{encode:!1}):e.body!==void 0&&(c.body=ge(e.body,{[i]:r},{encode:!1})),s.envelope&&(c.envelope=s.envelope),c}let l;if(s==="rest"){const[c,u]=a.split("?"),f=c.replace(/\/$/,"");l=u?`${f}/${encodeURIComponent(r)}?${u}`:`${f}/${encodeURIComponent(r)}`}else if(s==="query"){const c=a.includes("?")?"&":"?";l=`${a}${c}${i}=${encodeURIComponent(r)}`}else l=ge(s,{[i]:r});return{...o?{path:l}:{url:l},schema:e.schema,transform:e.transform}}_ctx(e,t={}){return{website:this.website,page:e?.page||null,block:e||null,signal:t.signal}}resolve(e,t){const s=this.website?.fetcher;let i=this._getRequestedSchemas(t);if(i===null&&e.fetch){const d=(Array.isArray(e.fetch)?e.fetch:[e.fetch]).filter(g=>g.schema).map(g=>g.schema);d.length>0&&(i=d)}if(i===null)return{status:"none",data:null};const r=this._findFetchConfigs(e,i);if(r.size===0)return{status:"none",data:null};const a=e.dynamicContext||e.page?.dynamicContext,o=this._shouldInheritDetail(t,e),l=this._inheritLimit(t,e),c=this._inheritOrder(e),u=this._ctx(e),f={};let h=!0;const p=a?.schema;for(const[m,d]of r){const g=a&&m===p;if(g&&!o){const k=s?.peek(d,u);if(k){const{paramName:v,paramValue:S}=a,I=k.data;let w=Array.isArray(I)?I.filter(b=>String(b[v])!==String(S)):I;c&&(w=this._sortItems(w,c)),f[m]=l&&Array.isArray(w)?w.slice(0,l):w}else h=!1}else if(g){const k=s?.peek(d,u);if(k){const{paramName:v,paramValue:S}=a,I=k.data,w=Array.isArray(I)?I.find(b=>String(b[v])===String(S)):null;if(!w)f[m]=[];else if(d.detail){const b=this._buildDetailConfig(d,a),_=b?s?.peek(b,u):null;b&&_?f[m]=[_.data]:b?h=!1:f[m]=[w]}else f[m]=[w]}else h=!1}else{const k=s?.peek(d,u);if(k){const v=k.data;f[m]=c?this._sortItems(v,c):v}else h=!1}}return h?(this._applyDetailRoutes(f,r,e.website),{status:"ready",data:f}):{status:"pending",data:null}}async fetch(e,t,{signal:s}={}){const i=this.website?.fetcher;if(!i)return{data:null};let r=this._getRequestedSchemas(t);if(r===null&&e.fetch){const g=(Array.isArray(e.fetch)?e.fetch:[e.fetch]).filter(k=>k.schema).map(k=>k.schema);g.length>0&&(r=g)}if(r===null)return{data:null};const a=this._findFetchConfigs(e,r);if(a.size===0)return{data:null};const o=e.dynamicContext||e.page?.dynamicContext,l=this._shouldInheritDetail(t,e),c=this._inheritLimit(t,e),u=this._inheritOrder(e),f=this._ctx(e,{signal:s}),h={},p=[],m=o?.schema;for(const[d,g]of a){const k=o&&d===m;if(k&&!l){let v=st(i,g,f);if(v===null){const b=await i.dispatch(g,f);v=Array.isArray(b?.data)?b.data:null}const{paramName:S,paramValue:I}=o;let w=Array.isArray(v)?v.filter(b=>String(b[S])!==String(I)):v??[];u&&(w=this._sortItems(w,u)),h[d]=c&&Array.isArray(w)?w.slice(0,c):w}else if(k){const{paramName:v,paramValue:S}=o;let I=st(i,g,f);if(I===null){const b=await i.dispatch(g,f);I=Array.isArray(b?.data)?b.data:null}const w=I?.find(b=>String(b[v])===String(S))??null;if(!w){h[d]=[];continue}if(g.detail){const b=this._buildDetailConfig(g,o);b?p.push(i.dispatch(b,f).then(_=>{const y=_?.data!==void 0&&_?.data!==null?_.data:w;h[d]=[y]})):h[d]=[w]}else h[d]=[w]}else p.push(i.dispatch(g,f).then(v=>{v?.data!==void 0&&v?.data!==null&&(h[d]=v.data)}))}return p.length>0&&await Promise.all(p),this._applyDetailRoutes(h,a,e.website),{data:h}}}function st(n,e,t){const s=n.peek(e,t);return s&&Array.isArray(s.data)?s.data:null}function Sn(n,e){if(!n||typeof n!="object"||n.route!==void 0)return n;let t=!1;const s=e.replace(/:(\w+)/g,(i,r)=>{const a=n[r];return a==null?(t=!0,""):encodeURIComponent(String(a))});return t?n:{...n,route:s}}function nt(n){return n?n.default&&typeof n.default=="object"?n.default:typeof n=="object"?n:null:null}function Pt(n){return!!n&&typeof n.resolve=="function"}function it(n,{source:e,dev:t}){const s=new Map;if(!n)return s;let i;try{i=n.capabilities?.transports}catch(r){return t&&console.warn(`[FetcherDispatcher] ${e} transports getter threw:`,r),s}if(!i||typeof i!="object"||Array.isArray(i))return s;for(const r of Object.keys(i)){let a;try{a=i[r]}catch(o){t&&console.warn(`[FetcherDispatcher] ${e} transport "${r}" getter threw:`,o);continue}if(!Pt(a)){t&&console.warn(`[FetcherDispatcher] ${e} transport "${r}" missing resolve(); skipped.`);continue}s.set(r,a)}return s}class rt{constructor({foundation:e,extensions:t=[],dataStore:s,defaultFetcher:i=null,transport:r=null,dev:a=!1}){if(!s)throw new Error("FetcherDispatcher: dataStore is required");this._dataStore=s,this._defaultFetcher=i,this._transportOverride=Pt(r)?r:null,this._dev=!!a;const o=new Map,l=it(nt(e),{source:"primary foundation",dev:this._dev});for(const[c,u]of l)o.set(c,u);for(const c of t){let u;try{u=it(nt(c),{source:"extension",dev:this._dev})}catch(f){this._dev&&console.warn("[FetcherDispatcher] extension transports collection threw:",f);continue}for(const[f,h]of u){if(o.has(f)){this._dev&&console.warn(`[FetcherDispatcher] extension transport "${f}" ignored — primary foundation already provides it.`);continue}o.set(f,h)}}this._namedTransports=o,Object.freeze(this)}_selectFetcher(e,t){if(this._transportOverride)return this._transportOverride;const s=t?.website?.config?.fetcher?.transports;if(s&&typeof s=="object"){const i=e?.schema,r=i&&s[i]||s.default;if(r){const a=this._namedTransports.get(r);if(a)return a;this._dev&&console.warn(`[FetcherDispatcher] site selected transport "${r}" for schema "${i??"(none)"}" but no foundation or extension registered it; falling back to the framework default.`)}}return this._defaultFetcher}_cacheKey(e,t){if(e&&typeof e.cacheKey=="function")try{return String(e.cacheKey(t))}catch(s){console.warn("[FetcherDispatcher] fetcher.cacheKey threw:",s)}return Zt(t)}peek(e,t={}){const s=this._selectFetcher(e,t),i=this._cacheKey(s,e);return this._dataStore.get(i)}async dispatch(e,t={}){const s=this._selectFetcher(e,t);if(!s)return{data:[],error:"FetcherDispatcher: no fetcher selected and no default configured"};const i=this._cacheKey(s,e),r=this._dataStore.get(i);if(r)return{data:r.data,meta:r.meta};const a=this._dataStore.inflight.get(i);if(a)return this._attachSignal(a,t.signal),a.promise;const o=typeof AbortController<"u"?new AbortController:null,l={promise:null,master:o,signals:new Set,everAttached:!1};this._attachSignal(l,t.signal),this._dataStore.inflight.set(i,l);const c=o?{...t,signal:o.signal}:t;return l.promise=this._runFetcher(s,e,c,i,l),l.promise}_attachSignal(e,t){if(!t||!e.master)return;if(e.everAttached=!0,t.aborted){this._maybeAbortMaster(e);return}e.signals.add(t);const s=()=>{e.signals.delete(t),this._maybeAbortMaster(e)};t.addEventListener("abort",s,{once:!0})}_maybeAbortMaster(e){e.master&&(e.master.signal.aborted||e.everAttached&&(e.signals.size>0||e.master.abort()))}async _runFetcher(e,t,s,i,r){try{const a=await e.resolve(t,s);if(this._dataStore.inflight.get(i)===r&&this._dataStore.inflight.delete(i),!a||typeof a!="object")return this._dev&&console.warn("[FetcherDispatcher] Fetcher returned a non-object; expected { data, error?, meta? }.",{request:t,result:a}),{data:[],error:"Fetcher returned a non-object"};const{data:o,error:l,meta:c}=a;if(this._dev&&this._validateReturnShape(a,t),l)return{data:o??[],error:l,meta:c};if(o==null)return{data:o??[],meta:c};const u=c!==void 0?{data:o,meta:c}:{data:o};return this._dataStore.set(i,u),{data:o,meta:c}}catch(a){return this._dataStore.inflight.get(i)===r&&this._dataStore.inflight.delete(i),{data:[],error:String(a?.message||a)}}}_validateReturnShape(e,t){const s=new Set(["data","error","meta"]),i=Object.keys(e).filter(r=>!s.has(r));i.length>0&&console.warn(`[FetcherDispatcher] Fetcher return has unexpected keys: ${i.join(", ")}. Expected { data, error?, meta? }.`,{request:t,result:e})}}function Mt(n){return typeof n=="string"&&n.trim()&&n.trim()!=="*"?n.trim():n&&typeof n=="object"&&typeof n.code=="string"&&n.code.trim()?n.code.trim():null}function _n(n){return n==="*"||Array.isArray(n)&&n.includes("*")}function Ae(n){if(!Array.isArray(n))return[];const e=new Set,t=[];for(const s of n){const i=Mt(s);!i||e.has(i)||(e.add(i),t.push(i))}return t}function Le(n={}){return typeof n?.defaultLanguage=="string"&&n.defaultLanguage.trim()?n.defaultLanguage.trim():Ae(n?.languages)[0]||"en"}function An(n={}){const e=Ae(n?.languages),t=n?.publishLanguages;if(t==null)return{publishable:e,dangling:[],explicit:!1};const s=Ae(t);if(_n(n?.languages))return{publishable:s,dangling:[],explicit:!0};const i=new Set(e),r=new Set(s);return{publishable:e.filter(a=>r.has(a)),dangling:s.filter(a=>!i.has(a)),explicit:!0}}function Dn(n={}){const e=[],t=[],s=(o,l,c)=>{if(o==null||o==="*")return;if(!Array.isArray(o)){t.push({code:c,message:`${l} must be a list of locale codes (got ${typeof o}) — ignored`});return}const u=new Set;for(const f of o){if(f==="*")continue;const h=Mt(f);if(!h){t.push({code:c,message:`${l} entry ${JSON.stringify(f)} is not a locale code string — dropped`});continue}typeof f!="string"&&t.push({code:c,message:`${l} entry for '${h}' uses the legacy object form — use the plain string '${h}'`}),u.has(h)&&t.push({code:"duplicate-language",message:`${l} lists '${h}' more than once — deduped`}),u.add(h)}};s(n?.languages,"languages","invalid-language-entry"),s(n?.publishLanguages,"publishLanguages","invalid-publish-language-entry");const{publishable:i,dangling:r,explicit:a}=An(n);for(const o of r)t.push({code:"dangling-publish-language",message:`publishLanguages lists '${o}' but languages does not declare it — ignored at publish (kept in the file so a re-declared language keeps its publish intent)`});if(a&&i.length===0)e.push({code:"nothing-publishable",message:"publishLanguages leaves no publishable language (empty list, or nothing it lists is declared) — a publishable default language is required"});else if(a){const o=Le(n);i.includes(o)||e.push({code:"default-not-publishable",message:`the default language '${o}' is not in publishLanguages — the effective default must be publishable`})}return{errors:e,warnings:t}}const Ln="[A-Za-z0-9_-]+",Tn=/[.*+?^${}()|[\]\\]/g;function Rt(n){return typeof n!="string"||n===""||n==="/"?"/":n.replace(/\/+$/,"")||"/"}function Nn(n){const e=[],t=Rt(n).replace(Tn,"\\$&").replace(new RegExp(`:(${Ln})`,"g"),(s,i)=>(e.push(i),"([^/]+)"));return{regex:new RegExp(`^${t}$`),paramNames:e}}function Cn(n,e){const{regex:t,paramNames:s}=Nn(n),i=Rt(e).match(t);if(!i)return null;const r={};return s.forEach((a,o)=>{r[a]=decodeURIComponent(i[o+1])}),{params:r}}class xn{constructor({content:e={},foundation:t=null,extensions:s=[],defaultFetcher:i=null,transport:r=null,dev:a=!1}={}){this._foundation=t,this._extensions=s,this._defaultFetcher=i,this._transport=r,this._dev=a,this.dataStore=new es,this.fetcher=new rt({foundation:t,extensions:s,dataStore:this.dataStore,defaultFetcher:i,transport:r,dev:a}),this.entityStore=new In({website:this}),this._state=null,this.name="",this.description="",this.url="",this._layoutSets={},this.notFoundPage=null,this._dynamicPageData=new Map,this._dynamicPageCache=new Map,this.pages=[],this.activePage=null,this.pageRoutes=[],this.themeData={},this.config={},this.seo={},this.keywords=null,this.siteDefaultLocale="en",this.defaultLocale="en",this.activeLocale="en",this.locales=[],this.activeLang="en",this.langs=[],this._routeTranslations={},this.basePath="",this.versionedScopes={},this.assets={},this._pageIdMap=new Map,this._applyContent(e),Object.seal(this)}_applyContent(e){const{pages:t=[],theme:s={},config:i={},layouts:r,notFound:a,versionedScopes:o={},assets:l={}}=e||{};if(this.name=i.name||"",this.description=i.description||"",this.url=i.url||"",this._layoutSets={},r&&typeof r=="object")for(const[f,h]of Object.entries(r)){this._layoutSets[f]={};for(const[p,m]of Object.entries(h))m&&(this._layoutSets[f][p]=new ie(m,`layout-${f}-${p}`,this))}const c=a||t.find(f=>f.route==="/404")||null;this.notFoundPage=c?new ie(c,"notFound",this):null;const u=t.filter(f=>f.route!=="/404");this._dynamicPageData=new Map;for(const f of u)(f.isDynamic||f.route?.includes(":"))&&this._dynamicPageData.set(f.route,f);this._dynamicPageCache=new Map,this.pages=u.map((f,h)=>new ie(f,h,this)),this.buildPageHierarchy(),this.activePage=this.pages.find(f=>f.isIndex&&f.getNavRoute()==="/")||this.pages[0]||null,this.pageRoutes=this.pages.map(f=>f.route),this.themeData=s,this.config=i,this.seo=Bt(i.seo),this.keywords=i.keywords||null,this.siteDefaultLocale=Le(i),this.defaultLocale=i.domainLocale||this.siteDefaultLocale,this.activeLocale=i.activeLocale||this.defaultLocale,this.locales=this.buildLocalesList(i),this.activeLang=this.activeLocale,this.langs=this.locales.map(f=>({label:f.label||f.code,value:f.code})),this._routeTranslations=this._buildRouteTranslations(i),this.versionedScopes=o,this.assets=l}rebuild({content:e,foundation:t,extensions:s}={}){const i=t!==void 0,r=s!==void 0;return i&&(this._foundation=t),r&&(this._extensions=s),(i||r)&&(this.fetcher=new rt({foundation:this._foundation,extensions:this._extensions,dataStore:this.dataStore,defaultFetcher:this._defaultFetcher,transport:this._transport,dev:this._dev})),e!==void 0&&this._applyContent(e),this}get state(){return this._state||(this._state=new Ot),this._state}buildLocalesList(e){const t=Le(e),s=e.languages||[],i=a=>typeof a=="string"?{code:a}:{code:a.code,...a.label&&{label:a.label}},r=new Map;r.set(t,{code:t});for(const a of s){const o=i(a);if(r.has(o.code)){const l=r.get(o.code);r.set(o.code,{...l,...o})}else r.set(o.code,o)}return Array.from(r.values()).map(a=>({...a,isDefault:a.code===t}))}_buildRouteTranslations(e){const t=e.i18n?.routeTranslations||{},s={};for(const[i,r]of Object.entries(t)){const a=new Map,o=new Map;for(const[l,c]of Object.entries(r))a.set(l,c),o.set(c,l);s[i]={forward:a,reverse:o}}return s}translateRoute(e,t=this.activeLocale){if(!t||t===this.siteDefaultLocale)return e;const s=this._routeTranslations[t];if(!s)return e;const i=s.forward.get(e);if(i)return i;for(const[r,a]of s.forward)if(e.startsWith(r+"/"))return a+e.slice(r.length);return e}reverseTranslateRoute(e,t=this.activeLocale){if(!t||t===this.siteDefaultLocale)return e;const s=this._routeTranslations[t];if(!s)return e;const i=s.reverse.get(e);if(i)return i;for(const[r,a]of s.reverse)if(e.startsWith(r+"/"))return a+e.slice(r.length);return e}buildPageHierarchy(){const e=new Map;for(const t of this.pages)e.set(t.route,t);for(const t of this.pages)if(t.parentRoute){const s=e.get(t.parentRoute);s&&(s.children.push(t),t.parent=s)}for(const t of this.pages){if(t.parent||t.route==="/")continue;const s=t.route.replace(/\/[^/]+$/,"");if(!s||s==="/"||s===t.route)continue;const i=e.get(s);i&&(i.children.push(t),t.parent=i)}this._pageIdMap=new Map;for(const t of this.pages){t.stableId&&this._pageIdMap.set(t.stableId,t);const s=this.normalizeRoute(t.route);if(s&&!this._pageIdMap.has(s)&&this._pageIdMap.set(s,t),t.sourcePath){const i=t.sourcePath.replace(/^\//,"").replace(/\/$/,"");i&&!this._pageIdMap.has(i)&&this._pageIdMap.set(i,t)}}}getPage(e){let t=e;if(this.activeLocale&&this.activeLocale!==this.defaultLocale){const l=`/${this.activeLocale}`;t===l||t===`${l}/`?t="/":t.startsWith(`${l}/`)&&(t=t.slice(l.length))}const s=t==="/"?"/":t.replace(/\/$/,""),i=this.pages.find(l=>l.route===s);if(i){const l=i.children.find(c=>c.isIndex);return l||i}t=this.reverseTranslateRoute(t);const r=t==="/"?"/":t.replace(/\/$/,""),a=this.pages.find(l=>l.route===r);if(a){const l=a.children.find(c=>c.isIndex);return l||a}const o=this.pages.find(l=>l.isIndex&&l.getNavRoute()===r);if(o)return o;if(this._dynamicPageCache.has(r))return this._dynamicPageCache.get(r);for(const l of this.pages){if(!l.route.includes(":"))continue;const c=this._matchDynamicRoute(l.route,r);if(c){const u=this._createDynamicPage(l,r,c.params);if(u){const{page:f,collectionLoaded:h}=u;return h&&this._dynamicPageCache.set(r,f),f}}}}_matchDynamicRoute(e,t){return Cn(e,t)}_createDynamicPage(e,t,s){const i=this._dynamicPageData.get(e.route);if(!i)return null;const r=JSON.parse(JSON.stringify(i));r.route=t,r.isDynamic=!1;const a=Object.keys(s)[0],o=Object.values(s)[0],l=i.parentSchema;if(r.dynamicContext={templateRoute:e.route,params:s,paramName:a,paramValue:o,schema:l},r.sections&&Array.isArray(r.sections))for(const h of r.sections)h.dynamicContext=r.dynamicContext;const c=e.route.replace(/\/:[\w]+$/,"")||"/",u=this.pages.find(h=>h.route===c||h.getNavRoute()===c);if(u&&l){const h=u.fetch;let p=[];if(h&&this.fetcher){const d=Array.isArray(h)?h.find(g=>g.schema===l):h.schema===l?h:null;if(d){const g=this.fetcher.peek(d,{website:this});p=Array.isArray(g?.data)?g.data:[]}}const m=p.find(d=>String(d[a])===String(o));m?(m.title&&(r.title=m.title),(m.description||m.excerpt)&&(r.description=m.description||m.excerpt)):p.length>0&&(r.title="Not found",r.notFound=!0),r._collectionLoaded=p.length>0}const f=new ie(r,`dynamic-${t}`,this);return f.parent=e.parent,{page:f,collectionLoaded:r._collectionLoaded??!0}}setActivePage(e){const t=this.getPage(e);t&&(this.activePage=t)}setBasePath(e){!e||e==="/"?this.basePath="":this.basePath=e.endsWith("/")?e.slice(0,-1):e}getRemoteLayout(e){const t=globalThis.uniweb?.foundationConfig;return t?.layouts&&e&&t.layouts[e]?t.layouts[e]:null}getDefaultLayoutName(){return globalThis.uniweb?.foundationConfig?.defaultLayout||null}getDefaultBlockType(){return globalThis.uniweb?.foundationConfig?.defaultSection||"Section"}getAreaBlocks(e,t){return t&&this._layoutSets[t]?this._layoutSets[t][e]?.bodyBlocks||null:this._layoutSets.default&&this._layoutSets.default[e]?.bodyBlocks||null}getLayoutAreas(e){const t=e||"default",s=this._layoutSets[t]||this._layoutSets.default;if(!s)return{};const i={};for(const[r,a]of Object.entries(s))a?.bodyBlocks&&(i[r]=a.bodyBlocks);return i}getLayoutMeta(e){return globalThis.uniweb?.foundationConfig?.layoutMeta?.[e]||null}get viewTransitions(){return globalThis.uniweb.foundationConfig?.viewTransitions!==!1}getRemoteProps(){return globalThis.uniweb?.foundationConfig?.props||null}getRoutingComponents(){return globalThis.uniweb?.routingComponents||{}}makeHref(e){if(!e)return e;let t;if(e.startsWith("page:"))t=e.slice(5);else if(e.startsWith("topic:"))t=e.slice(6);else return e;const[s,i]=t.split("#"),r=this._pageIdMap?.get(s);if(!r)return e;let a=r.route;return i&&(a+=`#section-${i}`),a}resolveDetailPageTemplate(e){if(!e||typeof e!="string")return null;const t=e.startsWith("page:")?e.slice(5):e,s=this._pageIdMap?.get(t);return!s||!s.route?null:this.translateRoute(s.route)}getLanguages(){return this.langs}getLanguage(){return this.activeLang}getLocales(){return this.locales}getActiveLocale(){return this.activeLocale}getDefaultLocale(){return this.defaultLocale}hasMultipleLocales(){return this.locales.length>1}setActiveLocale(e){this.locales.find(s=>s.code===e)&&(this.activeLocale=e,this.activeLang=e)}getLocaleUrl(e,t=null){let s=t||this.activePage.getNavRoute();if(this.activeLocale&&this.activeLocale!==this.defaultLocale){const a=`/${this.activeLocale}`;s===a||s===`${a}/`?s="/":s.startsWith(`${a}/`)&&(s=s.slice(a.length))}s=this.reverseTranslateRoute(s);const i=this.config?.domainLocales;if(i){const a=Object.entries(i).find(([,o])=>o===e);if(a){const o=a[0],l=this.translateRoute(s,e);return`https://${o}${l==="/"?"/":l}`}}if(e===this.defaultLocale)return s;const r=this.translateRoute(s,e);return r==="/"?`/${e}/`:`/${e}${r}`}getLocale(e){return this.locales.find(t=>t.code===e)}localize(e,t="",s="",i=!1){const r=s||this.activeLang,a=this.langs[0]?.value||"en";if(typeof e=="object"&&!Array.isArray(e))return i?e?.[r]||e?.[a]||t:e?.[r]||t;if(typeof e=="string"){if(!e.startsWith("{")&&!e.startsWith('"'))return e;try{const o=JSON.parse(e);return typeof o=="object"?i?o?.[r]||o?.[a]||t:o?.[r]||t:o}catch{return e}}return t}isSearchEnabled(){return this.config?.search?.enabled!==!1}getSearchConfig(){const e=this.config?.search||{};return{enabled:this.isSearchEnabled(),provider:e.provider||"index",endpoint:e.endpoint,indexUrl:this.getSearchIndexUrl(),locale:this.getActiveLocale(),include:{pages:e.include?.pages!==!1,sections:e.include?.sections!==!1,headings:e.include?.headings!==!1,paragraphs:e.include?.paragraphs!==!1,links:e.include?.links!==!1,lists:e.include?.lists!==!1},exclude:{routes:e.exclude?.routes||[],components:e.exclude?.components||[]}}}getSearchIndexUrl(){const e=this.getActiveLocale(),s=e===this.getDefaultLocale()?"/search-index.json":`/${e}/search-index.json`;return`${this.basePath||""}${s}`}getSearchData(){return this.pages.map(e=>({id:e.id,title:e.title,href:e.route,route:e.route,description:e.description,content:e.getPageBlocks().map(t=>t.title).filter(Boolean).join(`
59
- `)}))}getPageHierarchy(e={}){const{nested:t=!0,for:s,includeHidden:i=!1,filter:r,sort:a}=e,o=u=>!(u.route.includes(":")||u.isIndex&&u.route.endsWith("/index")||!i&&(u.hidden||u.hideIn?.includes("*")||s&&u.hideIn?.includes(s))||!u.hasContent()&&!u.children?.some(h=>h.isIndex)&&!u.children?.some(o)||r&&!r(u));let l=this.pages.filter(o);t&&(l=l.filter(u=>!u.parent&&!u.parentRoute)),a&&l.sort(a);const c=u=>{const f=u.getNavRoute();return{id:u.id,route:f,navigableRoute:u.getNavigableRoute(),translatedRoute:this.translateRoute(f),title:u.getTitle(),label:u.getLabel(),description:u.description,hasContent:u.hasContent(),version:u.version||null,children:t&&u.hasChildren()?u.children.filter(o).map(c):[]}};return l.map(c)}getBranchHierarchy({route:e="",for:t,includeHidden:s=!1}={}){const i=l=>(l||"").replace(/^\/+/,"").replace(/\/+$/,""),r=this.getPageHierarchy({for:t,includeHidden:s}),a=i(e).split("/")[0];if(!a)return r;const o=r.find(l=>i(l.route)===a);return o?o.children?.length?o.children:[o]:r}getHeaderPages(){return this.getPageHierarchy({for:"header"})}getFooterPages(){return this.getPageHierarchy({for:"footer"})}getAllPages(e=!1){return this.getPageHierarchy({nested:!1,includeHidden:e})}getNotFoundPage(){return this.notFoundPage}getActiveRoute(){return this.activePage.getNormalizedRoute()}getActiveRootSegment(){return this.getActiveRoute().split("/")[0]}normalizeRoute(e){let t=(e||"").replace(/^\/+/,"").replace(/\/+$/,"");if(this.activeLocale&&this.activeLocale!==this.defaultLocale){const r=this.activeLocale;t===r?t="":t.startsWith(`${r}/`)&&(t=t.slice(r.length+1))}const s="/"+t;return t=this.reverseTranslateRoute(s).replace(/^\//,""),t}isRouteActive(e,t){return this.normalizeRoute(e)===this.normalizeRoute(t)}isRouteActiveOrAncestor(e,t){const s=this.normalizeRoute(e),i=this.normalizeRoute(t);return s===i?!0:s===""?!1:i.startsWith(s+"/")}getVersionedScopes(){return this.versionedScopes}hasVersionedContent(){return Object.keys(this.versionedScopes).length>0}getVersionScope(e){const t=e||"";for(const s of Object.keys(this.versionedScopes)){if(t===s)return s;if(s==="/"){if(t.startsWith("/")||t==="")return s}else if(t.startsWith(s+"/"))return s}return null}isVersionedRoute(e){return this.getVersionScope(e)!==null}getVersionMeta(e){return this.versionedScopes[e]||null}getPageVersion(e){return e?.version||null}getVersionsForRoute(e){const t=this.getVersionScope(e);return t?this.versionedScopes[t]?.versions||[]:[]}getVersionUrl(e,t){const s=this.getVersionScope(t);if(!s)return null;const i=this.versionedScopes[s];if(!i)return null;const r=i.versions.find(l=>l.id===e);if(!r)return null;const a=s==="/"?t:t.slice(s.length);let o=a;for(const l of i.versions){const c=`/${l.id}`;if(a.startsWith(c+"/")||a===c){o=a.slice(c.length);break}}return r.latest?s==="/"?o:s+o:s==="/"?"/"+e+o:s+"/"+e+o}getLatestVersion(e){return this.versionedScopes[e]?.latestId||null}}const we=typeof window<"u"&&typeof document<"u";class $n{constructor(e={}){this.endpoint=e.endpoint||null,this.flushInterval=e.flushInterval||5e3,this.maxQueueSize=e.maxQueueSize||10,this.debug=e.debug||!1,this.queue=[],this.scrollMilestones=new Set,this.sessionId=this.generateSessionId(),this.sessionStart=Date.now(),this.flushIntervalId=null,we&&this.isEnabled()&&(this.setupFlushInterval(),this.setupUnloadHandler()),Object.seal(this)}isEnabled(){return!!this.endpoint}generateSessionId(){return`${Date.now()}-${Math.random().toString(36).substr(2,9)}`}setupFlushInterval(){this.flushIntervalId=setInterval(()=>{this.flush()},this.flushInterval)}setupUnloadHandler(){const e=()=>{this.flush(!0)};window.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&e()}),window.addEventListener("pagehide",e)}addToQueue(e,t){if(!this.isEnabled()||!we)return;const s={type:e,data:t,timestamp:Date.now(),sessionId:this.sessionId,url:window.location.href,referrer:document.referrer||null};this.queue.push(s),this.debug&&console.log("[Analytics] Event queued:",s),this.queue.length>=this.maxQueueSize&&this.flush()}trackPageView(e,t,s={}){this.scrollMilestones.clear(),this.addToQueue("pageview",{path:e,title:t,...s})}trackEvent(e,t={}){this.addToQueue("event",{name:e,...t})}trackScrollDepth(e){[25,50,75,100].includes(e)&&(this.scrollMilestones.has(e)||(this.scrollMilestones.add(e),this.addToQueue("scroll_depth",{depth:e})))}flush(e=!1){if(!this.isEnabled()||!we||this.queue.length===0)return;const t=[...this.queue];this.queue=[];const s=JSON.stringify({events:t,sessionId:this.sessionId,sessionDuration:Date.now()-this.sessionStart});if(this.debug&&console.log("[Analytics] Flushing",t.length,"events"),e&&navigator.sendBeacon){const i=new Blob([s],{type:"application/json"});!navigator.sendBeacon(this.endpoint,i)&&this.debug&&console.warn("[Analytics] sendBeacon failed, events may be lost");return}fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:s,keepalive:!0}).catch(i=>{this.debug&&console.warn("[Analytics] Flush failed:",i),this.queue.unshift(...t)})}destroy(){this.flushIntervalId&&clearInterval(this.flushIntervalId),this.flush(!0)}}class On{constructor({content:e={},foundation:t=null,extensions:s=[],defaultFetcher:i=null,transport:r=null,dev:a=!1}={}){this.activeWebsite=new xn({content:e,foundation:t,extensions:s,defaultFetcher:i,transport:r,dev:a}),this.foundation=t,this.foundationConfig={},this.meta=t?.default?.meta||{},this.extensions=[],t?.default?.capabilities&&(this.foundationConfig={...t.default.capabilities}),t?.default?.layoutMeta&&(this.foundationConfig.layoutMeta=t.default.layoutMeta),t?.default?.handlers&&(this.foundationConfig.handlers=t.default.handlers),t?.default?.viewTransitions!==void 0&&(this.foundationConfig.viewTransitions=t.default.viewTransitions);for(const o of s)this._wireExtension(o);this.childBlockRenderer=null,this.routingComponents={},this.language="en",this.defaultInsets=null,this.iconResolver=null,this.iconCache=new Map,this.analytics=new $n(e?.analytics||e?.config?.analytics||{}),Object.seal(this)}_wireExtension(e){const t=e?.default?.meta||{};this.extensions.push({foundation:e,meta:t})}async resolveIcon(e,t){return this.iconResolver?this.iconResolver(e,t):(console.warn("[Uniweb] No icon resolver configured"),null)}getIconSync(e,t){return this.iconCache.get(`${e}:${t}`)||null}getComponentMeta(e){const t=this.meta[e];if(t)return t;for(const s of this.extensions){const i=s.meta[e];if(i)return i}return null}getComponentDefaults(e){return this.getComponentMeta(e)?.defaults||{}}getComponent(e){if(!this.foundation){console.warn("[Runtime] No foundation loaded");return}const t=this.foundation[e];if(t)return t;for(const s of this.extensions){const i=s.foundation[e];if(i)return i}if(this.defaultInsets&&this.defaultInsets[e])return this.defaultInsets[e]}listComponents(){const e=new Set;if(this.foundation)for(const t of Object.keys(this.foundation))t!=="default"&&e.add(t);for(const t of this.extensions)for(const s of Object.keys(t.foundation))s!=="default"&&e.add(s);return[...e]}}function jn(n){return!n||typeof n!="object"?!1:!!(Array.isArray(n.fields)||n.isComposite===!0||n.childSchema&&typeof n.childSchema=="object")}function Fn(n){if(!n||typeof n!="object"||Array.isArray(n))return null;if(Array.isArray(n.fields)||n.isComposite===!0||n.childSchema)return n;if(n.sections!==void 0)return null;const e=i=>Object.entries(i).map(([r,a])=>typeof a=="string"?{id:r,type:a}:{id:r,...a});if(n.fields&&typeof n.fields=="object"){const{fields:i,...r}=n;return{...r,fields:e(i)}}const t=Object.entries(n);if(!t.length)return null;const s=([,i])=>i&&typeof i=="object"&&!Array.isArray(i)&&i.type!==void 0;return t.every(s)?{fields:e(n)}:null}function Kn(){return globalThis.uniweb}function Un(n,e=null,t=[],{defaultFetcher:s=null,transport:i=null,dev:r=!1}={}){const a=new On({content:n,foundation:e,extensions:t,defaultFetcher:s,transport:i,dev:r});return globalThis.uniweb=a,a}export{C as B,Et as D,In as E,rt as F,Ot as O,ie as P,On as U,xn as W,De as a,Rn as b,Mn as c,Un as d,jn as e,_n as f,Kn as g,Fn as h,mn as i,Le as j,An as k,Ae as n,gn as r,Dn as v};
@@ -1 +0,0 @@
1
- var A={exports:{}},n={};var N;function J(){if(N)return n;N=1;var E=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),U=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),D=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),S=Symbol.iterator;function G(t){return t===null||typeof t!="object"?null:(t=S&&t[S]||t["@@iterator"],typeof t=="function"?t:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,g={};function a(t,e,u){this.props=t,this.context=e,this.refs=g,this.updater=u||h}a.prototype.isReactComponent={},a.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")},a.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function H(){}H.prototype=a.prototype;function y(t,e,u){this.props=t,this.context=e,this.refs=g,this.updater=u||h}var v=y.prototype=new H;v.constructor=y,w(v,a.prototype),v.isPureReactComponent=!0;var O=Array.isArray;function R(){}var f={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function T(t,e,u){var r=u.ref;return{$$typeof:E,type:t,key:e,ref:r!==void 0?r:null,props:u}}function K(t,e){return T(t.type,e,t.props)}function m(t){return typeof t=="object"&&t!==null&&t.$$typeof===E}function B(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(u){return e[u]})}var j=/\/+/g;function C(t,e){return typeof t=="object"&&t!==null&&t.key!=null?B(""+t.key):e.toString(36)}function W(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(R,R):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function _(t,e,u,r,o){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var i=!1;if(t===null)i=!0;else switch(s){case"bigint":case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case E:case I:i=!0;break;case d:return i=t._init,_(i(t._payload),e,u,r,o)}}if(i)return o=o(t),i=r===""?"."+C(t,0):r,O(o)?(u="",i!=null&&(u=i.replace(j,"$&/")+"/"),_(o,e,u,"",function(Z){return Z})):o!=null&&(m(o)&&(o=K(o,u+(o.key==null||t&&t.key===o.key?"":(""+o.key).replace(j,"$&/")+"/")+i)),e.push(o)),1;i=0;var p=r===""?".":r+":";if(O(t))for(var c=0;c<t.length;c++)r=t[c],s=p+C(r,c),i+=_(r,e,u,s,o);else if(c=G(t),typeof c=="function")for(t=c.call(t),c=0;!(r=t.next()).done;)r=r.value,s=p+C(r,c++),i+=_(r,e,u,s,o);else if(s==="object"){if(typeof t.then=="function")return _(W(t),e,u,r,o);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return i}function l(t,e,u){if(t==null)return t;var r=[],o=0;return _(t,r,"","",function(s){return e.call(u,s,o++)}),r}function Q(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(u){(t._status===0||t._status===-1)&&(t._status=1,t._result=u)},function(u){(t._status===0||t._status===-1)&&(t._status=2,t._result=u)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var $=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},X={map:l,forEach:function(t,e,u){l(t,function(){e.apply(this,arguments)},u)},count:function(t){var e=0;return l(t,function(){e++}),e},toArray:function(t){return l(t,function(e){return e})||[]},only:function(t){if(!m(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};return n.Activity=z,n.Children=X,n.Component=a,n.Fragment=M,n.Profiler=L,n.PureComponent=y,n.StrictMode=x,n.Suspense=b,n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=f,n.__COMPILER_RUNTIME={__proto__:null,c:function(t){return f.H.useMemoCache(t)}},n.cache=function(t){return function(){return t.apply(null,arguments)}},n.cacheSignal=function(){return null},n.cloneElement=function(t,e,u){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var r=w({},t.props),o=t.key;if(e!=null)for(s in e.key!==void 0&&(o=""+e.key),e)!P.call(e,s)||s==="key"||s==="__self"||s==="__source"||s==="ref"&&e.ref===void 0||(r[s]=e[s]);var s=arguments.length-2;if(s===1)r.children=u;else if(1<s){for(var i=Array(s),p=0;p<s;p++)i[p]=arguments[p+2];r.children=i}return T(t.type,o,r)},n.createContext=function(t){return t={$$typeof:U,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:k,_context:t},t},n.createElement=function(t,e,u){var r,o={},s=null;if(e!=null)for(r in e.key!==void 0&&(s=""+e.key),e)P.call(e,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(o[r]=e[r]);var i=arguments.length-2;if(i===1)o.children=u;else if(1<i){for(var p=Array(i),c=0;c<i;c++)p[c]=arguments[c+2];o.children=p}if(t&&t.defaultProps)for(r in i=t.defaultProps,i)o[r]===void 0&&(o[r]=i[r]);return T(t,s,o)},n.createRef=function(){return{current:null}},n.forwardRef=function(t){return{$$typeof:q,render:t}},n.isValidElement=m,n.lazy=function(t){return{$$typeof:d,_payload:{_status:-1,_result:t},_init:Q}},n.memo=function(t,e){return{$$typeof:D,type:t,compare:e===void 0?null:e}},n.startTransition=function(t){var e=f.T,u={};f.T=u;try{var r=t(),o=f.S;o!==null&&o(u,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(R,$)}catch(s){$(s)}finally{e!==null&&u.types!==null&&(e.types=u.types),f.T=e}},n.unstable_useCacheRefresh=function(){return f.H.useCacheRefresh()},n.use=function(t){return f.H.use(t)},n.useActionState=function(t,e,u){return f.H.useActionState(t,e,u)},n.useCallback=function(t,e){return f.H.useCallback(t,e)},n.useContext=function(t){return f.H.useContext(t)},n.useDebugValue=function(){},n.useDeferredValue=function(t,e){return f.H.useDeferredValue(t,e)},n.useEffect=function(t,e){return f.H.useEffect(t,e)},n.useEffectEvent=function(t){return f.H.useEffectEvent(t)},n.useId=function(){return f.H.useId()},n.useImperativeHandle=function(t,e,u){return f.H.useImperativeHandle(t,e,u)},n.useInsertionEffect=function(t,e){return f.H.useInsertionEffect(t,e)},n.useLayoutEffect=function(t,e){return f.H.useLayoutEffect(t,e)},n.useMemo=function(t,e){return f.H.useMemo(t,e)},n.useOptimistic=function(t,e){return f.H.useOptimistic(t,e)},n.useReducer=function(t,e,u){return f.H.useReducer(t,e,u)},n.useRef=function(t){return f.H.useRef(t)},n.useState=function(t){return f.H.useState(t)},n.useSyncExternalStore=function(t,e,u){return f.H.useSyncExternalStore(t,e,u)},n.useTransition=function(){return f.H.useTransition()},n.version="19.2.5",n}var Y;function V(){return Y||(Y=1,A.exports=J()),A.exports}export{V as r};
@@ -1 +0,0 @@
1
- import{r as O}from"./index-CxUeIbEw.js";var y={exports:{}},n={};var o;function S(){if(o)return n;o=1;var u=O();function g(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var i={d:{f:c,r:function(){throw Error(g(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},m=Symbol.for("react.portal");function v(r,e,t){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:a==null?null:""+a,children:r,containerInfo:e,implementation:t}}var f=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}return n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,n.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(g(299));return v(r,e,null,t)},n.flushSync=function(r){var e=f.T,t=i.p;try{if(f.T=null,i.p=2,r)return r()}finally{f.T=e,i.p=t,i.d.f()}},n.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,i.d.C(r,e))},n.prefetchDNS=function(r){typeof r=="string"&&i.d.D(r)},n.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,a=d(t,e.crossOrigin),s=typeof e.integrity=="string"?e.integrity:void 0,l=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?i.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:a,integrity:s,fetchPriority:l}):t==="script"&&i.d.X(r,{crossOrigin:a,integrity:s,fetchPriority:l,nonce:typeof e.nonce=="string"?e.nonce:void 0})}},n.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=d(e.as,e.crossOrigin);i.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&i.d.M(r)},n.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,a=d(t,e.crossOrigin);i.d.L(r,t,{crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}},n.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=d(e.as,e.crossOrigin);i.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else i.d.m(r)},n.requestFormReset=function(r){i.d.r(r)},n.unstable_batchedUpdates=function(r,e){return r(e)},n.useFormState=function(r,e,t){return f.H.useFormState(r,e,t)},n.useFormStatus=function(){return f.H.useHostTransitionStatus()},n.version="19.2.5",n}var _;function T(){if(_)return y.exports;_=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(g){console.error(g)}}return u(),y.exports=S(),y.exports}export{T as r};
@@ -1,74 +0,0 @@
1
- const Te=Symbol.for("yaml.alias"),ct=Symbol.for("yaml.document"),F=Symbol.for("yaml.map"),Ve=Symbol.for("yaml.pair"),Be=Symbol.for("yaml.scalar"),ee=Symbol.for("yaml.seq"),B=Symbol.for("yaml.node.type"),J=n=>!!n&&typeof n=="object"&&n[B]===Te,pe=n=>!!n&&typeof n=="object"&&n[B]===ct,ye=n=>!!n&&typeof n=="object"&&n[B]===F,A=n=>!!n&&typeof n=="object"&&n[B]===Ve,k=n=>!!n&&typeof n=="object"&&n[B]===Be,ge=n=>!!n&&typeof n=="object"&&n[B]===ee;function E(n){if(n&&typeof n=="object")switch(n[B]){case F:case ee:return!0}return!1}function N(n){if(n&&typeof n=="object")switch(n[B]){case Te:case F:case Be:case ee:return!0}return!1}const He=n=>(k(n)||E(n))&&!!n.anchor,_=Symbol("break visit"),ut=Symbol("skip children"),X=Symbol("remove node");function z(n,e){const t=ht(e);pe(n)?Q(null,n.contents,t,Object.freeze([n]))===X&&(n.contents=null):Q(null,n,t,Object.freeze([]))}z.BREAK=_;z.SKIP=ut;z.REMOVE=X;function Q(n,e,t,s){const i=dt(n,e,t,s);if(N(i)||A(i))return pt(n,s,i),Q(n,i,t,s);if(typeof i!="symbol"){if(E(e)){s=Object.freeze(s.concat(e));for(let r=0;r<e.items.length;++r){const o=Q(r,e.items[r],t,s);if(typeof o=="number")r=o-1;else{if(o===_)return _;o===X&&(e.items.splice(r,1),r-=1)}}}else if(A(e)){s=Object.freeze(s.concat(e));const r=Q("key",e.key,t,s);if(r===_)return _;r===X&&(e.key=null);const o=Q("value",e.value,t,s);if(o===_)return _;o===X&&(e.value=null)}}return i}function ht(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function dt(n,e,t,s){if(typeof t=="function")return t(n,e,s);if(ye(e))return t.Map?.(n,e,s);if(ge(e))return t.Seq?.(n,e,s);if(A(e))return t.Pair?.(n,e,s);if(k(e))return t.Scalar?.(n,e,s);if(J(e))return t.Alias?.(n,e,s)}function pt(n,e,t){const s=e[e.length-1];if(E(s))s.items[n]=t;else if(A(s))n==="key"?s.key=t:s.value=t;else if(pe(s))s.contents=t;else{const i=J(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const yt={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},gt=n=>n.replace(/[!,[\]{}]/g,e=>yt[e]);class C{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},C.defaultYaml,e),this.tags=Object.assign({},C.defaultTags,t)}clone(){const e=new C(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new C(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:C.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},C.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:C.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},C.defaultTags),this.atNextDocument=!1);const s=e.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[r,o]=s;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[r]=s;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}const[,s,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);const r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return s==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,s]of Object.entries(this.tags))if(e.startsWith(s))return t+gt(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let i;if(e&&s.length>0&&N(e.contents)){const r={};z(e.contents,(o,l)=>{N(l)&&l.tag&&(r[l.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,o]of s)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
2
- `)}}C.defaultYaml={explicit:!1,version:"1.2"};C.defaultTags={"!!":"tag:yaml.org,2002:"};function Ze(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function mt(n){const e=new Set;return z(n,{Value(t,s){s.anchor&&e.add(s.anchor)}}),e}function bt(n,e){for(let t=1;;++t){const s=`${n}${t}`;if(!e.has(s))return s}}function xt(n,e){const t=[],s=new Map;let i=null;return{onAnchor:r=>{t.push(r),i??(i=mt(n));const o=bt(e,i);return i.add(o),o},setAnchors:()=>{for(const r of t){const o=s.get(r);if(typeof o=="object"&&o.anchor&&(k(o.node)||E(o.node)))o.node.anchor=o.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=r,l}}},sourceObjects:s}}function H(n,e,t,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;i<r;++i){const o=s[i],l=H(n,s,String(i),o);l===void 0?delete s[i]:l!==o&&(s[i]=l)}else if(s instanceof Map)for(const i of Array.from(s.keys())){const r=s.get(i),o=H(n,s,i,r);o===void 0?s.delete(i):o!==r&&s.set(i,o)}else if(s instanceof Set)for(const i of Array.from(s)){const r=H(n,s,i,i);r===void 0?s.delete(i):r!==i&&(s.delete(i),s.add(r))}else for(const[i,r]of Object.entries(s)){const o=H(n,s,i,r);o===void 0?delete s[i]:o!==r&&(s[i]=o)}return n.call(e,t,s)}function M(n,e,t){if(Array.isArray(n))return n.map((s,i)=>M(s,String(i),t));if(n&&typeof n.toJSON=="function"){if(!t||!He(n))return n.toJSON(e,t);const s={aliasCount:0,count:1,res:void 0};t.anchors.set(n,s),t.onCreate=r=>{s.res=r,delete t.onCreate};const i=n.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof n=="bigint"&&!t?.keep?Number(n):n}class Ie{constructor(e){Object.defineProperty(this,B,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:s,onAnchor:i,reviver:r}={}){if(!pe(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=M(this,"",o);if(typeof i=="function")for(const{count:f,res:a}of o.anchors.values())i(a,f);return typeof r=="function"?H(r,{"":l},"",l):l}}class wt extends Ie{constructor(e){super(Te),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let s;t?.aliasResolveCache?s=t.aliasResolveCache:(s=[],z(e,{Node:(r,o)=>{(J(o)||He(o))&&s.push(o)}}),t&&(t.aliasResolveCache=s));let i;for(const r of s){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(e,t){if(!t)return{source:this.source};const{anchors:s,doc:i,maxAliasCount:r}=t,o=this.resolve(i,t);if(!o){const f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let l=s.get(o);if(l||(M(o,null,t),l=s.get(o)),l?.res===void 0){const f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(r>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=oe(i,o,s)),l.count*l.aliasCount>r)){const f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return l.res}toString(e,t,s){const i=`*${this.source}`;if(e){if(Ze(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}}function oe(n,e,t){if(J(e)){const s=e.resolve(n),i=t&&s&&t.get(s);return i?i.count*i.aliasCount:0}else if(E(e)){let s=0;for(const i of e.items){const r=oe(n,i,t);r>s&&(s=r)}return s}else if(A(e)){const s=oe(n,e.key,t),i=oe(n,e.value,t);return Math.max(s,i)}return 1}const Xe=n=>!n||typeof n!="function"&&typeof n!="object";class S extends Ie{constructor(e){super(Be),this.value=e}toJSON(e,t){return t?.keep?this.value:M(this.value,e,t)}toString(){return String(this.value)}}S.BLOCK_FOLDED="BLOCK_FOLDED";S.BLOCK_LITERAL="BLOCK_LITERAL";S.PLAIN="PLAIN";S.QUOTE_DOUBLE="QUOTE_DOUBLE";S.QUOTE_SINGLE="QUOTE_SINGLE";const St="tag:yaml.org,2002:";function Ot(n,e,t){if(e){const s=t.filter(r=>r.tag===e),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(s=>s.identify?.(n)&&!s.format)}function ce(n,e,t){if(pe(n)&&(n=n.contents),N(n))return n;if(A(n)){const u=t.schema[F].createNode?.(t.schema,null,t);return u.items.push(n),u}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());const{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:o,sourceObjects:l}=t;let f;if(s&&n&&typeof n=="object"){if(f=l.get(n),f)return f.anchor??(f.anchor=i(n)),new wt(f.anchor);f={anchor:null,node:null},l.set(n,f)}e?.startsWith("!!")&&(e=St+e.slice(2));let a=Ot(n,e,o.tags);if(!a){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){const u=new S(n);return f&&(f.node=u),u}a=n instanceof Map?o[F]:Symbol.iterator in Object(n)?o[ee]:o[F]}r&&(r(a),delete t.onTagObj);const y=a?.createNode?a.createNode(t.schema,n,t):typeof a?.nodeClass?.from=="function"?a.nodeClass.from(t.schema,n,t):new S(n);return e?y.tag=e:a.default||(y.tag=a.tag),f&&(f.node=y),y}function Fe(n,e,t){let s=t;for(let i=e.length-1;i>=0;--i){const r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=s,s=o}else s=new Map([[r,s]])}return ce(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}const $t=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done;class ve extends Ie{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(s=>N(s)||A(s)?s.clone(e):s),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if($t(e))this.add(t);else{const[s,...i]=e,r=this.get(s,!0);if(E(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(s,Fe(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(e){const[t,...s]=e;if(s.length===0)return this.delete(t);const i=this.get(t,!0);if(E(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){const[s,...i]=e,r=this.get(s,!0);return i.length===0?!t&&k(r)?r.value:r:E(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!A(t))return!1;const s=t.value;return s==null||e&&k(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){const[t,...s]=e;if(s.length===0)return this.has(t);const i=this.get(t,!0);return E(i)?i.hasIn(s):!1}setIn(e,t){const[s,...i]=e;if(i.length===0)this.set(s,t);else{const r=this.get(s,!0);if(E(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(s,Fe(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}}const kt=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function x(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}const Y=(n,e,t)=>n.endsWith(`
3
- `)?x(t,e):t.includes(`
4
- `)?`
5
- `+x(t,e):(n.endsWith(" ")?"":" ")+t,xe="flow",Ee="block",le="quoted";function me(n,e,t="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return n;i<r&&(r=0);const f=Math.max(1+r,1+i-e.length);if(n.length<=f)return n;const a=[],y={};let u=i-e.length;typeof s=="number"&&(s>i-Math.max(2,r)?a.push(0):u=i-s);let d,p,g=!1,c=-1,h=-1,w=-1;t===Ee&&(c=Je(n,c,e.length),c!==-1&&(u=c+f));for(let b;b=n[c+=1];){if(t===le&&b==="\\"){switch(h=c,n[c+1]){case"x":c+=3;break;case"u":c+=5;break;case"U":c+=9;break;default:c+=1}w=c}if(b===`
6
- `)t===Ee&&(c=Je(n,c,e.length)),u=c+e.length+f,d=void 0;else{if(b===" "&&p&&p!==" "&&p!==`
7
- `&&p!==" "){const O=n[c+1];O&&O!==" "&&O!==`
8
- `&&O!==" "&&(d=c)}if(c>=u)if(d)a.push(d),u=d+f,d=void 0;else if(t===le){for(;p===" "||p===" ";)p=b,b=n[c+=1],g=!0;const O=c>w+1?c-2:h-1;if(y[O])return n;a.push(O),y[O]=!0,u=O+f,d=void 0}else g=!0}p=b}if(g&&l&&l(),a.length===0)return n;o&&o();let m=n.slice(0,a[0]);for(let b=0;b<a.length;++b){const O=a[b],$=a[b+1]||n.length;O===0?m=`
9
- ${e}${n.slice(0,$)}`:(t===le&&y[O]&&(m+=`${n[O]}\\`),m+=`
10
- ${e}${n.slice(O+1,$)}`)}return m}function Je(n,e,t){let s=e,i=e+1,r=n[i];for(;r===" "||r===" ";)if(e<i+t)r=n[++e];else{do r=n[++e];while(r&&r!==`
11
- `);s=e,i=e+1,r=n[i]}return s}const be=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),we=n=>/^(%|---|\.\.\.)/m.test(n);function At(n,e,t){if(!e||e<0)return!1;const s=e-t,i=n.length;if(i<=s)return!1;for(let r=0,o=0;r<i;++r)if(n[r]===`
12
- `){if(r-o>s)return!0;if(o=r+1,i-o<=s)return!1}return!0}function v(n,e){const t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:s}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(we(n)?" ":"");let o="",l=0;for(let f=0,a=t[f];a;a=t[++f])if(a===" "&&t[f+1]==="\\"&&t[f+2]==="n"&&(o+=t.slice(l,f)+"\\ ",f+=1,l=f,a="\\"),a==="\\")switch(t[f+1]){case"u":{o+=t.slice(l,f);const y=t.substr(f+2,4);switch(y){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:y.substr(0,2)==="00"?o+="\\x"+y.substr(2):o+=t.substr(f,6)}f+=5,l=f+1}break;case"n":if(s||t[f+2]==='"'||t.length<i)f+=1;else{for(o+=t.slice(l,f)+`
13
-
14
- `;t[f+2]==="\\"&&t[f+3]==="n"&&t[f+4]!=='"';)o+=`
15
- `,f+=2;o+=r,t[f+2]===" "&&(o+="\\"),f+=1,l=f+1}break;default:f+=1}return o=l?o+t.slice(l):t,s?o:me(o,r,le,be(e,!1))}function je(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
16
- `)||/[ \t]\n|\n[ \t]/.test(n))return v(n,e);const t=e.indent||(we(n)?" ":""),s="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
17
- ${t}`)+"'";return e.implicitKey?s:me(s,t,xe,be(e,!1))}function q(n,e){const{singleQuote:t}=e.options;let s;if(t===!1)s=v;else{const i=n.includes('"'),r=n.includes("'");i&&!r?s=je:r&&!i?s=v:s=t?je:v}return s(n,e)}let Le;try{Le=new RegExp(`(^|(?<!
18
- ))
19
- +(?!
20
- |$)`,"g")}catch{Le=/\n+(?!\n|$)/g}function fe({comment:n,type:e,value:t},s,i,r){const{blockQuote:o,commentString:l,lineWidth:f}=s.options;if(!o||/\n[\t ]+$/.test(t))return q(t,s);const a=s.indent||(s.forceBlockIndent||we(t)?" ":""),y=o==="literal"?!0:o==="folded"||e===S.BLOCK_FOLDED?!1:e===S.BLOCK_LITERAL?!0:!At(t,f,a.length);if(!t)return y?`|
21
- `:`>
22
- `;let u,d;for(d=t.length;d>0;--d){const $=t[d-1];if($!==`
23
- `&&$!==" "&&$!==" ")break}let p=t.substring(d);const g=p.indexOf(`
24
- `);g===-1?u="-":t===p||g!==p.length-1?(u="+",r&&r()):u="",p&&(t=t.slice(0,-p.length),p[p.length-1]===`
25
- `&&(p=p.slice(0,-1)),p=p.replace(Le,`$&${a}`));let c=!1,h,w=-1;for(h=0;h<t.length;++h){const $=t[h];if($===" ")c=!0;else if($===`
26
- `)w=h;else break}let m=t.substring(0,w<h?w+1:h);m&&(t=t.substring(m.length),m=m.replace(/\n+/g,`$&${a}`));let O=(c?a?"2":"1":"")+u;if(n&&(O+=" "+l(n.replace(/ ?[\r\n]+/g," ")),i&&i()),!y){const $=t.replace(/\n+/g,`
27
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${a}`);let j=!1;const T=be(s,!0);o!=="folded"&&e!==S.BLOCK_FOLDED&&(T.onOverflow=()=>{j=!0});const V=me(`${m}${$}${p}`,a,Ee,T);if(!j)return`>${O}
28
- ${a}${V}`}return t=t.replace(/\n+/g,`$&${a}`),`|${O}
29
- ${a}${m}${t}${p}`}function Nt(n,e,t,s){const{type:i,value:r}=n,{actualString:o,implicitKey:l,indent:f,indentStep:a,inFlow:y}=e;if(l&&r.includes(`
30
- `)||y&&/[[\]{},]/.test(r))return q(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return l||y||!r.includes(`
31
- `)?q(r,e):fe(n,e,t,s);if(!l&&!y&&i!==S.PLAIN&&r.includes(`
32
- `))return fe(n,e,t,s);if(we(r)){if(f==="")return e.forceBlockIndent=!0,fe(n,e,t,s);if(l&&f===a)return q(r,e)}const u=r.replace(/\n+/g,`$&
33
- ${f}`);if(o){const d=c=>c.default&&c.tag!=="tag:yaml.org,2002:str"&&c.test?.test(u),{compat:p,tags:g}=e.doc.schema;if(g.some(d)||p?.some(d))return q(r,e)}return l?u:me(u,f,xe,be(e,!1))}function Et(n,e,t,s){const{implicitKey:i,inFlow:r}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)});let{type:l}=n;l!==S.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=S.QUOTE_DOUBLE);const f=y=>{switch(y){case S.BLOCK_FOLDED:case S.BLOCK_LITERAL:return i||r?q(o.value,e):fe(o,e,t,s);case S.QUOTE_DOUBLE:return v(o.value,e);case S.QUOTE_SINGLE:return je(o.value,e);case S.PLAIN:return Nt(o,e,t,s);default:return null}};let a=f(l);if(a===null){const{defaultKeyType:y,defaultStringType:u}=e.options,d=i&&y||u;if(a=f(d),a===null)throw new Error(`Unsupported default string type ${d}`)}return a}function jt(n,e){const t=Object.assign({blockQuote:!0,commentString:kt,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},n.schema.toStringOptions,e);let s;switch(t.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:s,options:t}}function Lt(n,e){if(e.tag){const i=n.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let t,s;if(k(e)){s=e.value;let i=n.filter(r=>r.identify?.(s));if(i.length>1){const r=i.filter(o=>o.test);r.length>0&&(i=r)}t=i.find(r=>r.format===e.format)??i.find(r=>!r.format)}else s=e,t=n.find(i=>i.nodeClass&&s instanceof i.nodeClass);if(!t){const i=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${i} value`)}return t}function Ct(n,e,{anchors:t,doc:s}){if(!s.directives)return"";const i=[],r=(k(n)||E(n))&&n.anchor;r&&Ze(r)&&(t.add(r),i.push(`&${r}`));const o=n.tag??(e.default?null:e.tag);return o&&i.push(s.directives.tagString(o)),i.join(" ")}function ue(n,e,t,s){if(A(n))return n.toString(e,t,s);if(J(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let i;const r=N(n)?n:e.doc.createNode(n,{onTagObj:f=>i=f});i??(i=Lt(e.doc.schema.tags,r));const o=Ct(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const l=typeof i.stringify=="function"?i.stringify(r,e,t,s):k(r)?Et(r,e,t,s):r.toString(e,t,s);return o?k(r)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
34
- ${e.indent}${l}`:l}function Mt({key:n,value:e},t,s,i){const{allNullValues:r,doc:o,indent:l,indentStep:f,options:{commentString:a,indentSeq:y,simpleKeys:u}}=t;let d=N(n)&&n.comment||null;if(u){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(E(n)||!N(n)&&typeof n=="object"){const T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let p=!u&&(!n||d&&e==null&&!t.inFlow||E(n)||(k(n)?n.type===S.BLOCK_FOLDED||n.type===S.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!p&&(u||!r),indent:l+f});let g=!1,c=!1,h=ue(n,t,()=>g=!0,()=>c=!0);if(!p&&!t.inFlow&&h.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(t.inFlow){if(r||e==null)return g&&s&&s(),h===""?"?":p?`? ${h}`:h}else if(r&&!u||e==null&&p)return h=`? ${h}`,d&&!g?h+=Y(h,t.indent,a(d)):c&&i&&i(),h;g&&(d=null),p?(d&&(h+=Y(h,t.indent,a(d))),h=`? ${h}
35
- ${l}:`):(h=`${h}:`,d&&(h+=Y(h,t.indent,a(d))));let w,m,b;N(e)?(w=!!e.spaceBefore,m=e.commentBefore,b=e.comment):(w=!1,m=null,b=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!p&&!d&&k(e)&&(t.indentAtStart=h.length+1),c=!1,!y&&f.length>=2&&!t.inFlow&&!p&&ge(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let O=!1;const $=ue(e,t,()=>O=!0,()=>c=!0);let j=" ";if(d||w||m){if(j=w?`
36
- `:"",m){const T=a(m);j+=`
37
- ${x(T,t.indent)}`}$===""&&!t.inFlow?j===`
38
- `&&b&&(j=`
39
-
40
- `):j+=`
41
- ${t.indent}`}else if(!p&&E(e)){const T=$[0],V=$.indexOf(`
42
- `),Ke=V!==-1,at=t.inFlow??e.flow??e.items.length===0;if(Ke||!at){let De=!1;if(Ke&&(T==="&"||T==="!")){let I=$.indexOf(" ");T==="&"&&I!==-1&&I<V&&$[I+1]==="!"&&(I=$.indexOf(" ",I+1)),(I===-1||V<I)&&(De=!0)}De||(j=`
43
- ${t.indent}`)}}else($===""||$[0]===`
44
- `)&&(j="");return h+=j+$,t.inFlow?O&&s&&s():b&&!O?h+=Y(h,t.indent,a(b)):c&&i&&i(),h}function Pt(n,e){(n==="debug"||n==="warn")&&console.warn(e)}const te="<<",Se={identify:n=>n===te||typeof n=="symbol"&&n.description===te,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new S(Symbol(te)),{addToJSMap:et}),stringify:()=>te},Tt=(n,e)=>(Se.identify(e)||k(e)&&(!e.type||e.type===S.PLAIN)&&Se.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===Se.tag&&t.default);function et(n,e,t){if(t=n&&J(t)?t.resolve(n.doc):t,ge(t))for(const s of t.items)Oe(n,e,s);else if(Array.isArray(t))for(const s of t)Oe(n,e,s);else Oe(n,e,t)}function Oe(n,e,t){const s=n&&J(t)?t.resolve(n.doc):t;if(!ye(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,n,Map);for(const[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function tt(n,e,{key:t,value:s}){if(N(t)&&t.addToJSMap)t.addToJSMap(n,e,s);else if(Tt(n,t))et(n,e,s);else{const i=M(t,"",n);if(e instanceof Map)e.set(i,M(s,i,n));else if(e instanceof Set)e.add(i);else{const r=Bt(t,i,n),o=M(s,r,n);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function Bt(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(N(n)&&t?.doc){const s=jt(t.doc,{});s.anchors=new Set;for(const r of t.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;const i=n.toString(s);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),Pt(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}function _e(n,e,t){const s=ce(n,void 0,t),i=ce(e,void 0,t);return new P(s,i)}class P{constructor(e,t=null){Object.defineProperty(this,B,{value:Ve}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;return N(t)&&(t=t.clone(e)),N(s)&&(s=s.clone(e)),new P(t,s)}toJSON(e,t){const s=t?.mapAsMap?new Map:{};return tt(t,s,this)}toString(e,t,s){return e?.doc?Mt(this,e,t,s):JSON.stringify(this)}}function nt(n,e,t){return(e.inFlow??n.flow?_t:It)(n,e,t)}function It({comment:n,items:e},t,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:o,onComment:l}){const{indent:f,options:{commentString:a}}=t,y=Object.assign({},t,{indent:r,type:null});let u=!1;const d=[];for(let g=0;g<e.length;++g){const c=e[g];let h=null;if(N(c))!u&&c.spaceBefore&&d.push(""),he(t,d,c.commentBefore,u),c.comment&&(h=c.comment);else if(A(c)){const m=N(c.key)?c.key:null;m&&(!u&&m.spaceBefore&&d.push(""),he(t,d,m.commentBefore,u))}u=!1;let w=ue(c,y,()=>h=null,()=>u=!0);h&&(w+=Y(w,r,a(h))),u&&h&&(u=!1),d.push(s+w)}let p;if(d.length===0)p=i.start+i.end;else{p=d[0];for(let g=1;g<d.length;++g){const c=d[g];p+=c?`
45
- ${f}${c}`:`
46
- `}}return n?(p+=`
47
- `+x(a(n),f),l&&l()):u&&o&&o(),p}function _t({items:n},e,{flowChars:t,itemIndent:s}){const{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:l}}=e;s+=r;const f=Object.assign({},e,{indent:s,inFlow:!0,type:null});let a=!1,y=0;const u=[];for(let g=0;g<n.length;++g){const c=n[g];let h=null;if(N(c))c.spaceBefore&&u.push(""),he(e,u,c.commentBefore,!1),c.comment&&(h=c.comment);else if(A(c)){const m=N(c.key)?c.key:null;m&&(m.spaceBefore&&u.push(""),he(e,u,m.commentBefore,!1),m.comment&&(a=!0));const b=N(c.value)?c.value:null;b?(b.comment&&(h=b.comment),b.commentBefore&&(a=!0)):c.value==null&&m?.comment&&(h=m.comment)}h&&(a=!0);let w=ue(c,f,()=>h=null);a||(a=u.length>y||w.includes(`
48
- `)),g<n.length-1?w+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(a||(a=u.reduce((m,b)=>m+b.length+2,2)+(w.length+2)>e.options.lineWidth)),a&&(w+=",")),h&&(w+=Y(w,s,l(h))),u.push(w),y=u.length}const{start:d,end:p}=t;if(u.length===0)return d+p;if(!a){const g=u.reduce((c,h)=>c+h.length+2,2);a=e.options.lineWidth>0&&g>e.options.lineWidth}if(a){let g=d;for(const c of u)g+=c?`
49
- ${r}${i}${c}`:`
50
- `;return`${g}
51
- ${i}${p}`}else return`${d}${o}${u.join(" ")}${o}${p}`}function he({indent:n,options:{commentString:e}},t,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const r=x(e(s),n);t.push(r.trimStart())}}function D(n,e){const t=k(e)?e.value:e;for(const s of n)if(A(s)&&(s.key===e||s.key===t||k(s.key)&&s.key.value===t))return s}class U extends ve{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(F,e),this.items=[]}static from(e,t,s){const{keepUndefined:i,replacer:r}=s,o=new this(e),l=(f,a)=>{if(typeof r=="function")a=r.call(t,f,a);else if(Array.isArray(r)&&!r.includes(f))return;(a!==void 0||i)&&o.items.push(_e(f,a,s))};if(t instanceof Map)for(const[f,a]of t)l(f,a);else if(t&&typeof t=="object")for(const f of Object.keys(t))l(f,t[f]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let s;A(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new P(e,e?.value):s=new P(e.key,e.value);const i=D(this.items,s.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${s.key} already set`);k(i.value)&&Xe(s.value)?i.value.value=s.value:i.value=s.value}else if(r){const o=this.items.findIndex(l=>r(s,l)<0);o===-1?this.items.push(s):this.items.splice(o,0,s)}else this.items.push(s)}delete(e){const t=D(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){const i=D(this.items,e)?.value;return(!t&&k(i)?i.value:i)??void 0}has(e){return!!D(this.items,e)}set(e,t){this.add(new P(e,t),!0)}toJSON(e,t,s){const i=s?new s:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(const r of this.items)tt(t,i,r);return i}toString(e,t,s){if(!e)return JSON.stringify(this);for(const i of this.items)if(!A(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),nt(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}}class st extends ve{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(ee,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=ne(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const s=ne(e);if(typeof s!="number")return;const i=this.items[s];return!t&&k(i)?i.value:i}has(e){const t=ne(e);return typeof t=="number"&&t<this.items.length}set(e,t){const s=ne(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[s];k(i)&&Xe(t)?i.value=t:this.items[s]=t}toJSON(e,t){const s=[];t?.onCreate&&t.onCreate(s);let i=0;for(const r of this.items)s.push(M(r,String(i++),t));return s}toString(e,t,s){return e?nt(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:t}):JSON.stringify(this)}static from(e,t,s){const{replacer:i}=s,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let l of t){if(typeof i=="function"){const f=t instanceof Set?l:String(o++);l=i.call(t,f,l)}r.items.push(ce(l,void 0,s))}}return r}}function ne(n){let e=k(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}function it(n,e){if(ge(n))for(let t=0;t<n.items.length;++t){let s=n.items[t];if(!A(s)){if(ye(s)){s.items.length>1&&e("Each pair must have its own sequence indicator");const i=s.items[0]||new P(new S(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore}
52
- ${i.key.commentBefore}`:s.commentBefore),s.comment){const r=i.value??i.key;r.comment=r.comment?`${s.comment}
53
- ${r.comment}`:s.comment}s=i}n.items[t]=A(s)?s:new P(s)}}else e("Expected a sequence for this tag");return n}function rt(n,e,t){const{replacer:s}=t,i=new st(n);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.call(e,String(r++),o));let l,f;if(Array.isArray(o))if(o.length===2)l=o[0],f=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const a=Object.keys(o);if(a.length===1)l=a[0],f=o[l];else throw new TypeError(`Expected tuple with one key, not ${a.length} keys`)}else l=o;i.items.push(_e(l,f,t))}return i}const en={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:it,createNode:rt};class W extends st{constructor(){super(),this.add=U.prototype.add.bind(this),this.delete=U.prototype.delete.bind(this),this.get=U.prototype.get.bind(this),this.has=U.prototype.has.bind(this),this.set=U.prototype.set.bind(this),this.tag=W.tag}toJSON(e,t){if(!t)return super.toJSON(e);const s=new Map;t?.onCreate&&t.onCreate(s);for(const i of this.items){let r,o;if(A(i)?(r=M(i.key,"",t),o=M(i.value,r,t)):r=M(i,"",t),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,o)}return s}static from(e,t,s){const i=rt(e,t,s),r=new this;return r.items=i.items,r}}W.tag="tag:yaml.org,2002:omap";const tn={collection:"seq",identify:n=>n instanceof Map,nodeClass:W,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){const t=it(n,e),s=[];for(const{key:i}of t.items)k(i)&&(s.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new W,t)},createNode:(n,e,t)=>W.from(n,e,t)};class G extends U{constructor(e){super(e),this.tag=G.tag}add(e){let t;A(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new P(e.key,null):t=new P(e,null),D(this.items,t.key)||this.items.push(t)}get(e,t){const s=D(this.items,e);return!t&&A(s)?k(s.key)?s.key.value:s.key:s}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const s=D(this.items,e);s&&!t?this.items.splice(this.items.indexOf(s),1):!s&&t&&this.items.push(new P(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);throw new Error("Set items must all have null values")}static from(e,t,s){const{replacer:i}=s,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(_e(o,null,s));return r}}G.tag="tag:yaml.org,2002:set";const nn={collection:"map",identify:n=>n instanceof Set,nodeClass:G,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>G.from(n,e,t),resolve(n,e){if(ye(n)){if(n.hasAllNullValues(!0))return Object.assign(new G,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}},ot="\uFEFF",lt="",ft="",Ce="";function sn(n){switch(n){case ot:return"byte-order-mark";case lt:return"doc-mode";case ft:return"flow-error-end";case Ce:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
54
- `:case`\r
55
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function L(n){switch(n){case void 0:case" ":case`
56
- `:case"\r":case" ":return!0;default:return!1}}const Re=new Set("0123456789ABCDEFabcdef"),Kt=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),se=new Set(",[]{}"),Dt=new Set(` ,[]{}
57
- \r `),$e=n=>!n||Dt.has(n);class rn{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let s=this.next??"stream";for(;s&&(t||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
58
- `?!0:t==="\r"?this.buffer[e+1]===`
59
- `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let s=0;for(;t===" ";)t=this.buffer[++s+e];if(t==="\r"){const i=this.buffer[s+e+1];if(i===`
60
- `||!i&&!this.atEnd)return e+s+1}return t===`
61
- `||s>=this.indentNext||!t&&!this.atEnd?e+s:-1}if(t==="-"||t==="."){const s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&L(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
62
- `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===ot&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,s=e.indexOf("#");for(;s!==-1;){const r=e[s-1];if(r===" "||r===" "){t=s-1;break}else s=e.indexOf("#",s+1)}for(;;){const r=e[t-1];if(r===" "||r===" ")t-=1;else break}const i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield lt,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const t=this.peek(3);if((t==="---"||t==="...")&&L(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!L(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&L(t)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil($e),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,s=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=s=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&i[0]!=="#"||s===0&&(i.startsWith("---")||i.startsWith("..."))&&L(i[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield ft,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil($e),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||L(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}const s=this.buffer.substring(0,t);let i=s.indexOf(`
63
- `,this.pos);if(i!==-1){for(;i!==-1;){const r=this.continueScalar(i+1);if(r===-1)break;i=s.indexOf(`
64
- `,r)}i!==-1&&(t=i-(s[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>L(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,s;e:for(let r=this.pos;s=this.buffer[r];++r)switch(s){case" ":t+=1;break;case`
65
- `:e=r,t=0;break;case"\r":{const o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
66
- `)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
67
- `,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(s=this.buffer[i];s===" ";)s=this.buffer[++i];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
68
- `;)s=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);const l=r;for(;o===" ";)o=this.buffer[--r];if(o===`
69
- `&&r>=this.pos&&r+1+t>l)e=r;else break}while(!0);return yield Ce,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,s=this.pos-1,i;for(;i=this.buffer[++s];)if(i===":"){const r=this.buffer[s+1];if(L(r)||e&&se.has(r))break;t=s}else if(L(i)){let r=this.buffer[s+1];if(i==="\r"&&(r===`
70
- `?(s+=1,i=`
71
- `,r=this.buffer[s+1]):t=s),r==="#"||e&&se.has(r))break;if(i===`
72
- `){const o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(e&&se.has(i))break;t=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Ce,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil($e))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(L(t)||e&&se.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!L(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Kt.has(t))t=this.buffer[++e];else if(t==="%"&&Re.has(this.buffer[e+1])&&Re.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
73
- `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
74
- `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,s;do s=this.buffer[++t];while(s===" "||e&&s===" ");const i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,s=this.buffer[t];for(;!e(s);)s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}function on(n){const{path:e,url:t,schema:s,transform:i}=n||{},r=n?.method&&n.method.toUpperCase()!=="GET"?n.method.toUpperCase():void 0,o=r==="POST"?n?.body:void 0;return JSON.stringify({path:e,url:t,schema:s,transform:i,method:r,body:o})}class ln{constructor(){this._cache=new Map,this._inflight=new Map,this._listeners=new Set,this._keyedListeners=new Map,Object.seal(this)}subscribe(e,t){if(typeof e=="string"&&typeof t=="function"){const s=e;let i=this._keyedListeners.get(s);return i||(i=new Set,this._keyedListeners.set(s,i)),i.add(t),()=>{const r=this._keyedListeners.get(s);r&&(r.delete(t),r.size===0&&this._keyedListeners.delete(s))}}if(typeof e=="function")return this._listeners.add(e),()=>this._listeners.delete(e);throw new TypeError("DataStore.subscribe: expected (fn) or (key, fn)")}has(e){return this._cache.has(e)}get(e){return this._cache.has(e)?this._cache.get(e):null}set(e,t){this._cache.set(e,t);for(const i of this._listeners)i();const s=this._keyedListeners.get(e);if(s)for(const i of s)i()}get inflight(){return this._inflight}clear(){this._cache.clear(),this._inflight.clear()}}const Ft=/\{([A-Za-z_][A-Za-z0-9_]*)\}/g;function Ue(n,e,t={}){const{encode:s=!0}=t;if(typeof n=="string")return n.replace(Ft,(i,r)=>{if(!(r in(e||{})))return i;const o=e[r];return o==null?i:s?encodeURIComponent(String(o)):String(o)});if(Array.isArray(n))return n.map(i=>Ue(i,e,t));if(n&&typeof n=="object"){const i={};for(const r of Object.keys(n))i[r]=Ue(n[r],e,t);return i}return n}const Jt=new Set(["eq","ne","gt","gte","lt","lte","in","nin","like","exists"]);function ae(n,e){if(n==null)return!0;if(typeof n!="object"||Array.isArray(n)||e==null||typeof e!="object")return!1;for(const t of Object.keys(n))if(!Rt(t,n[t],e))return!1;return!0}function fn(n,e){return Array.isArray(e)?n==null?e.slice():e.filter(t=>ae(n,t)):[]}function Rt(n,e,t){if(n==="and")return Array.isArray(e)?e.every(i=>ae(i,t)):!1;if(n==="or")return Array.isArray(e)?e.some(i=>ae(i,t)):!1;if(n==="not")return!ae(e,t);const s=qt(t,n);return e===null?s==null:typeof e=="object"&&!Array.isArray(e)&&Ut(e)?Qt(e,s):Z(s,e)}function Ut(n){if(n==null||typeof n!="object"||Array.isArray(n))return!1;const e=Object.keys(n);return e.length===0?!1:e.every(t=>Jt.has(t))}function Qt(n,e){for(const t of Object.keys(n))if(!Yt(t,n[t],e))return!1;return!0}function Yt(n,e,t){switch(n){case"eq":return Z(t,e);case"ne":return!Z(t,e);case"gt":return ie(t,e)&&t>e;case"gte":return ie(t,e)&&t>=e;case"lt":return ie(t,e)&&t<e;case"lte":return ie(t,e)&&t<=e;case"in":return Array.isArray(e)?e.some(s=>Z(t,s)):!1;case"nin":return Array.isArray(e)?!e.some(s=>Z(t,s)):!1;case"like":return typeof t!="string"||typeof e!="string"?!1:Wt(e,t);case"exists":return!!t==!!e;default:return!1}}function Z(n,e){return n===e?!0:n==null||e==null?!1:Array.isArray(n)&&!Array.isArray(e)?n.some(t=>t===e):!1}function ie(n,e){return n==null||e==null?!1:typeof n==typeof e}function qt(n,e){if(typeof e!="string")return;if(e.indexOf(".")===-1)return n[e];let t=n;for(const s of e.split(".")){if(t==null||typeof t!="object")return;t=t[s]}return t}function Wt(n,e){const t="^"+n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".")+"$";return new RegExp(t).test(e)}const de={name:"json-body",canPush:new Set(["where","limit","sort"]),defaultEnvelope:null,encode(n,{method:e,pushCandidates:t,rename:s}){const i=new Set,r=[];let o=null;if(e==="GET")t.has("where")&&n.where!==void 0&&(r.push([R("where","_where",s),JSON.stringify(n.where)]),i.add("where")),t.has("limit")&&n.limit!==void 0&&(r.push([R("limit","_limit",s),String(n.limit)]),i.add("limit")),t.has("sort")&&n.sort!==void 0&&(r.push([R("sort","_sort",s),String(n.sort)]),i.add("sort"));else if(e==="POST"){const l={};t.has("where")&&n.where!==void 0&&(l[R("where","where",s)]=n.where,i.add("where")),t.has("limit")&&n.limit!==void 0&&(l[R("limit","limit",s)]=n.limit,i.add("limit")),t.has("sort")&&n.sort!==void 0&&(l[R("sort","sort",s)]=n.sort,i.add("sort")),Object.keys(l).length>0&&(o=l)}return{queryParams:r,bodyMerge:o,pushed:i}}};function R(n,e,t){return t&&typeof t[n]=="string"&&t[n].length>0?t[n]:e}const Qe={name:"flat-query",canPush:new Set(["where","limit","sort"]),defaultEnvelope:null,encode(n,{method:e,pushCandidates:t,rename:s}){const i=new Set,r=[];if(e!=="GET")return{queryParams:r,bodyMerge:null,pushed:i};if(t.has("where")&&n.where!==void 0){const o=Gt(n.where);if(o!==null){for(const[l,f]of o)r.push([Vt(l),f]);i.add("where")}}if(t.has("limit")&&n.limit!==void 0&&(r.push([We("limit","limit",s),String(n.limit)]),i.add("limit")),t.has("sort")&&n.sort!==void 0){const o=zt(n.sort);o!==null&&(r.push([We("sort","sort",s),o]),i.add("sort"))}return{queryParams:r,bodyMerge:null,pushed:i}}};function Gt(n){if(!n||typeof n!="object"||Array.isArray(n))return null;const e=[];for(const[t,s]of Object.entries(n)){if(t==="and"||t==="or"||t==="not"||t.includes("."))return null;if(Ye(s)){e.push([t,qe(s)]);continue}if(s&&typeof s=="object"&&!Array.isArray(s)){const i=Object.keys(s);if(i.length===1&&i[0]==="eq"&&Ye(s.eq)){e.push([t,qe(s.eq)]);continue}}return null}return e}function zt(n){if(typeof n!="string"||n.length===0)return null;const e=n.split(",").map(s=>s.trim()).filter(Boolean);if(e.length===0)return null;const t=[];for(const s of e){const[i,r]=s.split(/\s+/);if(!i)return null;const o=(r||"asc").toLowerCase()==="desc";t.push(o?`-${i}`:i)}return t.join(",")}function Ye(n){if(n===null)return!0;const e=typeof n;return e==="string"||e==="number"||e==="boolean"}function qe(n){return n===null?"":String(n)}function We(n,e,t){return t&&typeof t[n]=="string"&&t[n].length>0?t[n]:e}function Vt(n,e){return n}const Ge={name:"strapi",canPush:new Set(["where","limit","sort"]),defaultEnvelope:{collection:"data",item:"data"},encode(n,{method:e,pushCandidates:t,rename:s}){const i=new Set,r=[];if(e!=="GET")return{queryParams:r,bodyMerge:null,pushed:i};if(t.has("where")&&n.where!==void 0){const o=Ne("where","filters",s),l=Zt(n.where,o);if(l!==null){for(const f of l)r.push(f);i.add("where")}}if(t.has("limit")&&n.limit!==void 0){const o=Ne("limit","pagination[limit]",s);r.push([o,String(n.limit)]),i.add("limit")}if(t.has("sort")&&n.sort!==void 0){const o=vt(n.sort,Ne("sort","sort",s));if(o!==null){for(const l of o)r.push(l);i.add("sort")}}return{queryParams:r,bodyMerge:null,pushed:i}}},Ht={eq:"[$eq]",ne:"[$ne]",gt:"[$gt]",gte:"[$gte]",lt:"[$lt]",lte:"[$lte]",in:"[$in]",nin:"[$notIn]",like:"[$containsi]",exists:"[$notNull]"};function Zt(n,e){const t=[];try{Me(n,[e],t)}catch(s){if(s&&s.unencodable)return null;throw s}return t.length>0?t:null}function Me(n,e,t){(!n||typeof n!="object"||Array.isArray(n))&&K();for(const[s,i]of Object.entries(n))s==="and"||s==="or"?(Array.isArray(i)||K(),i.forEach((r,o)=>{Me(r,[...e,`[$${s}]`,`[${o}]`],t)})):s==="not"?Me(i,[...e,"[$not]"],t):Xt(s,i,e,t)}function Xt(n,e,t,s){const i=n.split(".").map(o=>`[${o}]`),r=[...t,...i];if(ke(e)){s.push([re(r)+"[$eq]",Ae(e)]);return}if(e&&typeof e=="object"&&!Array.isArray(e)){for(const[o,l]of Object.entries(e)){const f=Ht[o];if(f||K(),o==="in"||o==="nin"){Array.isArray(l)||K(),l.forEach((a,y)=>{ke(a)||K(),s.push([re(r)+f+`[${y}]`,Ae(a)])});continue}if(o==="exists"){const a=!!l;s.push([re(r)+(a?"[$notNull]":"[$null]"),"true"]);continue}ke(l)||K(),s.push([re(r)+f,Ae(l)])}return}K()}function re(n){return n.join("")}function K(){const n=new Error("unencodable predicate");throw n.unencodable=!0,n}function vt(n,e){if(typeof n!="string"||n.length===0)return null;const t=n.split(",").map(i=>i.trim()).filter(Boolean);if(t.length===0)return null;const s=[];for(const i of t){const[r,o]=i.split(/\s+/);if(!r)return null;const l=(o||"asc").toLowerCase()==="desc"?"desc":"asc";s.push(`${r}:${l}`)}return s.length===1?[[e,s[0]]]:s.map((i,r)=>[`${e}[${r}]`,i])}function ke(n){if(n===null)return!0;const e=typeof n;return e==="string"||e==="number"||e==="boolean"}function Ae(n){return n===null?"":String(n)}function Ne(n,e,t){return t&&typeof t[n]=="string"&&t[n].length>0?t[n]:e}const Pe=new Map([[de.name,de],[Qe.name,Qe],[Ge.name,Ge]]);function an(n,{dev:e=!1}={}){if(!n)return de;const t=Pe.get(n);return t||(e&&!ze.has(n)&&(ze.add(n),console.warn(`[default-fetcher] unknown request style "${n}"; falling back to "json-body". Known styles: ${[...Pe.keys()].join(", ")}.`)),de)}const ze=new Set;function cn(){return[...Pe.keys()]}export{wt as A,A as B,sn as C,ct as D,Pt as E,Ue as F,on as G,ln as H,ae as I,cn as J,fn as K,rn as L,F as M,B as N,an as O,P,S,U as Y,st as a,ge as b,nn as c,Be as d,ee as e,jt as f,x as g,N as h,ye as i,ue as j,C as k,Y as l,Se as m,mt as n,tn as o,en as p,bt as q,ce as r,Et as s,E as t,$t as u,k as v,Fe as w,M as x,H as y,xt as z};
@@ -1 +0,0 @@
1
- import{g as v}from"./_commonjsHelpers-CqkleIqs.js";var n={exports:{}},e={};var i;function l(){if(i)return e;i=1;var a=Symbol.for("react.transitional.element"),R=Symbol.for("react.fragment");function o(p,r,t){var s=null;if(t!==void 0&&(s=""+t),r.key!==void 0&&(s=""+r.key),"key"in r){t={};for(var u in r)u!=="key"&&(t[u]=r[u])}else t=r;return r=t.ref,{$$typeof:a,type:p,key:s,ref:r!==void 0?r:null,props:t}}return e.Fragment=R,e.jsx=o,e.jsxs=o,e}var x;function E(){return x||(x=1,n.exports=l()),n.exports}var d=E();const m=v(d);export{m as a,d as j};
@@ -1 +0,0 @@
1
- const i=new Set([50,100,200,300,400,500,600,700,800,900,950]),f=/^([a-z][a-z0-9]*)-(\d+)$/,h=/^([a-z][a-z0-9]*-\d+)\/(\d+)$/,p=/^rgba\(\s*(var\(--[^)]+\))\s*\/\s*([\d.]+)\s*\)$/;function E(t){if(typeof t!="string")return t;const s=t.match(p);if(s){const r=s[1],n=parseFloat(s[2]);return n>=.999?r:`color-mix(in srgb, ${r} ${Math.round(n*100)}%, transparent)`}if(t.includes("(")||t.startsWith("#"))return t;const a=t.replace(/^-{0,2}/,""),c=a.match(h);if(c){const r=c[1],n=parseInt(c[2],10),e=r.match(f);if(e&&i.has(parseInt(e[2],10)))return n>=100?`var(--${r})`:`color-mix(in srgb, var(--${r}) ${n}%, transparent)`}const o=a.match(f);if(o){const r=parseInt(o[2],10);if(i.has(r))return`var(--${a})`}return t}export{E as n};