1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,824177,(e,t,r)=>{"use strict";function i(){var e=Object.create(null),t=0,r=0,i=0,n=!1;function s(t){i--,delete e[t]}this.put=function(t,r,a,o){if(n&&console.log("caching: %s = %j (@%s)",t,r,a),void 0!==a&&("number"!=typeof a||isNaN(a)||a<=0))throw Error("Cache timeout must be a positive number");if(void 0!==o&&"function"!=typeof o)throw Error("Cache timeout callback must be a function");var l=e[t];l?clearTimeout(l.timeout):i++;var u={value:r,expire:a+Date.now()};return isNaN(u.expire)||(u.timeout=setTimeout((function(){s(t),o&&o(t,r)}).bind(this),a)),e[t]=u,r},this.del=function(t){var r=!0,i=e[t];return i?(clearTimeout(i.timeout),!isNaN(i.expire)&&i.expire<Date.now()&&(r=!1)):r=!1,r&&s(t),r},this.clear=function(){for(var s in e)clearTimeout(e[s].timeout);i=0,e=Object.create(null),n&&(t=0,r=0)},this.get=function(s){var a=e[s];if(void 0!==a)if(isNaN(a.expire)||a.expire>=Date.now())return n&&t++,a.value;else n&&r++,i--,delete e[s];else n&&r++;return null},this.size=function(){return i},this.memsize=function(){var t,r=0;for(t in e)r++;return r},this.debug=function(e){n=e},this.hits=function(){return t},this.misses=function(){return r},this.keys=function(){return Object.keys(e)},this.exportJson=function(){var t={};for(var r in e){var i=e[r];t[r]={value:i.value,expire:i.expire||"NaN"}}return JSON.stringify(t)},this.importJson=function(t,r){var i=JSON.parse(t),s=Date.now(),a=r&&r.skipDuplicates;for(var o in i)if(i.hasOwnProperty(o)){if(a&&e[o]){n&&console.log("Skipping duplicate imported key '%s'",o);continue}var l=i[o],u=l.expire-s;if(u<=0){this.del(o);continue}u=u>0?u:void 0,this.put(o,l.value,u)}return this.size()}}t.exports=new i,t.exports.Cache=i},303424,(e,t,r)=>{var i="u">typeof globalThis&&globalThis||"u">typeof self&&self||e.g,n=function(){function e(){this.fetch=!1,this.DOMException=i.DOMException}return e.prototype=i,new e}();(function(t){var r=void 0!==n&&n||"u">typeof self&&self||e.g||{},i={searchParams:"URLSearchParams"in r,iterable:"Symbol"in r&&"iterator"in Symbol,blob:"FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};if(i.arrayBuffer)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function o(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function u(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i.iterable&&(t[Symbol.iterator]=function(){return t}),t}function c(e){this.map={},e instanceof c?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){if(2!=e.length)throw TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function h(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function p(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function d(e){var t=new FileReader,r=p(t);return t.readAsArrayBuffer(e),r}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){if(this.bodyUsed=this.bodyUsed,this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(i.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(i.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var t;i.arrayBuffer&&i.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(e))?this._bodyArrayBuffer=f(e):this._bodyText=e=Object.prototype.toString.call(e)}else this._noBody=!0,this._bodyText="";!this.headers.get("content-type")&&("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=h(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(i.blob)return this.blob().then(d);throw Error("could not read as ArrayBuffer")},this.text=function(){var e,t,r,i,n,s=h(this);if(s)return s;if(this._bodyBlob)return e=this._bodyBlob,r=p(t=new FileReader),n=(i=/charset=([A-Za-z0-9_-]+)/.exec(e.type))?i[1]:"utf-8",t.readAsText(e,n),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=Array(t.length),i=0;i<t.length;i++)r[i]=String.fromCharCode(t[i]);return r.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},i.formData&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(e,t){e=o(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},c.prototype.delete=function(e){delete this.map[o(e)]},c.prototype.get=function(e){return e=o(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(o(e))},c.prototype.set=function(e,t){this.map[o(e)]=l(t)},c.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},c.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),u(e)},c.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),u(e)},c.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),u(e)},i.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var y=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function m(e,t){if(!(this instanceof m))throw TypeError('Please use the "new" operator, this DOM object c
1onstructor cannot be called as a function.');var i,n,s=(t=t||{}).body;if(e instanceof m){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new c(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,s||null==e._bodyInit||(s=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new c(t.headers)),this.method=(n=(i=t.method||this.method||"GET").toUpperCase(),y.indexOf(n)>-1?n:i),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in r)return new AbortController().signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(s),("GET"===this.method||"HEAD"===this.method)&&("no-store"===t.cache||"no-cache"===t.cache)){var a=/([?&])_=[^&]*/;a.test(this.url)?this.url=this.url.replace(a,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function v(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(n))}}),t}function E(e,t){if(!(this instanceof E))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new c(t.headers),this.url=t.url||"",this._initBody(e)}m.prototype.clone=function(){return new m(this,{body:this._bodyInit})},g.call(m.prototype),g.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},E.error=function(){var e=new E(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var b=[301,302,303,307,308];E.redirect=function(e,t){if(-1===b.indexOf(t))throw RangeError("Invalid status code");return new E(null,{status:t,headers:{location:e}})},t.DOMException=r.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function T(e,n){return new Promise(function(s,a){var u=new m(e,n);if(u.signal&&u.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var h=new XMLHttpRequest;function p(){h.abort()}if(h.onload=function(){var e,t,r={statusText:h.statusText,headers:(e=h.getAllResponseHeaders()||"",t=new c,e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var r=e.split(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();try{t.append(i,n)}catch(e){console.warn("Response "+e.message)}}}),t)};0===u.url.indexOf("file://")&&(h.status<200||h.status>599)?r.status=200:r.status=h.status,r.url="responseURL"in h?h.responseURL:r.headers.get("X-Request-URL");var i="response"in h?h.response:h.responseText;setTimeout(function(){s(new E(i,r))},0)},h.onerror=function(){setTimeout(function(){a(TypeError("Network request failed"))},0)},h.ontimeout=function(){setTimeout(function(){a(TypeError("Network request timed out"))},0)},h.onabort=function(){setTimeout(function(){a(new t.DOMException("Aborted","AbortError"))},0)},h.open(u.method,function(e){try{return""===e&&r.location.href?r.location.href:e}catch(t){return e}}(u.url),!0),"include"===u.credentials?h.withCredentials=!0:"omit"===u.credentials&&(h.withCredentials=!1),"responseType"in h&&(i.blob?h.responseType="blob":i.arrayBuffer&&(h.responseType="arraybuffer")),n&&"object"==typeof n.headers&&!(n.headers instanceof c||r.Headers&&n.headers instanceof r.Headers)){var d=[];
1Object.getOwnPropertyNames(n.headers).forEach(function(e){d.push(o(e)),h.setRequestHeader(e,l(n.headers[e]))}),u.headers.forEach(function(e,t){-1===d.indexOf(t)&&h.setRequestHeader(t,e)})}else u.headers.forEach(function(e,t){h.setRequestHeader(t,e)});u.signal&&(u.signal.addEventListener("abort",p),h.onreadystatechange=function(){4===h.readyState&&u.signal.removeEventListener("abort",p)}),h.send(void 0===u._bodyInit?null:u._bodyInit)})}T.polyfill=!0,r.fetch||(r.fetch=T,r.Headers=c,r.Request=m,r.Response=E),t.Headers=c,t.Request=m,t.Response=E,t.fetch=T,Object.defineProperty(t,"__esModule",{value:!0})})({}),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var s=i.fetch?i:n;(r=s.fetch).default=s.fetch,r.fetch=s.fetch,r.Headers=s.Headers,r.Request=s.Request,r.Response=s.Response,t.exports=r},856873,(e,t,r)=>{"use strict";let i=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,n=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,s=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,a=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,o=new Map([["n","\n"],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1b"],["a","\x07"]]);function l(e){let t="u"===e[0],r="{"===e[1];return t&&!r&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(parseInt(e.slice(2,-1),16)):o.get(e)||e}function u(e,t){let r={};for(let e of t)for(let t of e.styles)r[t[0]]=e.inverse?null:t.slice(1);let i=e;for(let[e,t]of Object.entries(r))if(Array.isArray(t)){if(!(e in i))throw Error(`Unknown Chalk style: ${e}`);i=t.length>0?i[e](...t):i[e]}return i}t.exports=(e,t)=>{let r=[],o=[],c=[];if(t.replace(i,(t,i,h,p,d,f)=>{if(i)c.push(l(i));else if(p){let t=c.join("");c=[],o.push(0===r.length?t:u(e,r)(t)),r.push({inverse:h,styles:function(e){let t;n.lastIndex=0;let r=[];for(;null!==(t=n.exec(e));){let e=t[1];if(t[2]){let i=function(e,t){let r,i=[];for(let n of t.trim().split(/\s*,\s*/g)){let t=Number(n);if(Number.isNaN(t))if(r=n.match(s))i.push(r[2].replace(a,(e,t,r)=>t?l(t):r));else throw Error(`Invalid Chalk template style argument: ${n} (in style '${e}')`);else i.push(t)}return i}(e,t[2]);r.push([e].concat(i))}else r.push([e])}return r}(p)})}else if(d){if(0===r.length)throw Error("Found extraneous } in Chalk template literal");o.push(u(e,r)(c.join(""))),c=[],r.pop()}else c.push(f)}),o.push(c.join("")),r.length>0)throw Error(`Chalk template literal is missing ${r.length} closing bracket${1===r.length?"":"s"} (\`}\`)`);return o.join("")}},672034,(e,t,r)=>{"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],ol
1ive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},61379,(e,t,r)=>{let i=e.r(672034),n={};for(let e of Object.keys(i))n[i[e]]=e;let s={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(let e of(t.exports=s,Object.keys(s))){if(!("channels"in s[e]))throw Error("missing channels property: "+e);if(!("labels"in s[e]))throw Error("missing channel labels property: "+e);if(s[e].labels.length!==s[e].channels)throw Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=s[e];delete s[e].channels,delete s[e].labels,Object.defineProperty(s[e],"channels",{value:t}),Object.defineProperty(s[e],"labels",{value:r})}s.rgb.hsl=function(e){let t,r=e[0]/255,i=e[1]/255,n=e[2]/255,s=Math.min(r,i,n),a=Math.max(r,i,n),o=a-s;a===s?t=0:r===a?t=(i-n)/o:i===a?t=2+(n-r)/o:n===a&&(t=4+(r-i)/o),(t=Math.min(60*t,360))<0&&(t+=360);let l=(s+a)/2;return[t,100*(a===s?0:l<=.5?o/(a+s):o/(2-a-s)),100*l]},s.rgb.hsv=function(e){let t,r,i,n,s,a=e[0]/255,o=e[1]/255,l=e[2]/255,u=Math.max(a,o,l),c=u-Math.min(a,o,l),h=function(e){return(u-e)/6/c+.5};return 0===c?(n=0,s=0):(s=c/u,t=h(a),r=h(o),i=h(l),a===u?n=i-r:o===u?n=1/3+t-i:l===u&&(n=2/3+r-t),n<0?n+=1:n>1&&(n-=1)),[360*n,100*s,100*u]},s.rgb.hwb=function(e){let t=e[0],r=e[1],i=e[2];return[s.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(r,i))*100,100*(i=1-1/255*Math.max(t,Math.max(r,i)))]},s.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,i=e[2]/255,n=Math.min(1-t,1-r,1-i);return[100*((1-t-n)/(1-n)||0),100*((1-r-n)/(1-n)||0),100*((1-i-n)/(1-n)||0),100*n]},s.rgb.keyword=function(e){let t,r=n[e];if(r)return r;let s=1/0;for(let r of Object.keys(i)){let n=i[r],a=(e[0]-n[0])**2+(e[1]-n[1])**2+(e[2]-n[2])**2;a<s&&(s=a,t=r)}return t},s.keyword.rgb=function(e){return i[e]},s.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,i=e[2]/255;return[100*(.4124*(t=t>.04045?((t+.055)/1.055)**2.4:t/12.92)+.3576*(r=r>.04045?((r+.055)/1.055)**2.4:r/12.92)+.1805*(i=i>.04045?((i+.055)/1.055)**2.4:i/12.92)),100*(.2126*t+.7152*r+.0722*i),100*(.0193*t+.1192*r+.9505*i)]},s.rgb.lab=function(e){let t=s.rgb.xyz(e),r=t[0],i=t[1],n=t[2];return r/=95.047,i/=100,n/=108.883,[116*(i=i>.008856?i**(1/3):7.787*i+16/116)-16,500*((r=r>.008856?r**(1/3):7.787*r+16/116)-i),200*(i-(n=n>.008856?n**(1/3):7.787*n+16/116))]},s.hsl.rgb=function(e){let t,r,i,n=e[0]/360,s=e[1]/100,a=e[2]/100;if(0===s)return[i=255*a,i,i];t=a<.5?a*(1+s):a+s-a*s;let o=2*a-t,l=[0,0,0];for(let e=0;e<3;e++)(r=n+-(1/3*(e-1)))<0&&r++,r>1&&r--,i=6*r<1?o+(t-o)*6*r:2*r<1?t:3*r<2?o+(t-o)*(2/3-r)*6:o,l[e]=255*i;return l},s.hsl.hsv=function(e){let t=e[0],r=e[1]/100,i=e[2]/100,n=r,s=Math.max(i,.01);i*=2,r*=i<=1?i:2-i,n*=s<=1?s:2-s;let a=(i+r)/2;return[t,100*(0===i?2*n/(s+n):2*r/(i+r)),100*a]},s.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,i=e[2]/100,n=Math.floor(t)%6,s=t-Math.floor(t),a=255*i*(1-r),o=255*i*(1-r*s),l=255*i*(1-r*(1-s));switch(i*=255,n){case 0:return[i,l,a];case 1:return[o,i,a];case 2:return[a,i,l];case 3:return[a,o,i];case 4:return[l,a,i];case 5:return[i,a,o]}},s.hsv.hsl=function(e){let t,r,i=e[0],n=e[1]/100,s=e[2]/100,a=Math.max(s,.01);r=(2-n)*s;let o=(2-n)*a;return[i,100*(t=(t=n*a/(o<=1?o:2-o))||0),100*(r/=2)]},s.hwb.rgb=function(e){let t,r,i,n,s=e[0]/360,a=e[1]/100,o=e[2]/100,l=a+o;l>1&&(a/=l,o/=l);let u=Math.floor(6*s),c=1-o;t=6*s-u,(1&u)!=0&&(t=1-t);let h=a+t*(c-a);switch(u){default:case 6:case 0:r=c,i=h,n=a;break;case 1:r=h,i=c,n=a;break;case 2:r=a,i=c,n=h;break;case 3:r=a,i=h,n=c;break;case 4:r=h,i=a,n=c;break;case 5:r=c,i=a,n=h}return[255*r,255*i,255*n]},s.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,i=e[2]/100,n=e[3]/100;return[255*(1-Math.min(1,t*(1-n)+n)),255*(1-Math.min(1,r*(1-n)+n)),255*(1-Math.min(1,i*(1-n)+n))]},s.xyz.rgb=function(e){let t,r,i,n=e[0]/100,s=e[1]/100,a=e[2]/100;return t=(t=3.2406*n+-1.5372*s+-.4986*a)>.0031308?1.055*t**(1/2.4)-.055:12.92*t,r=(r=-.9689*n+1.8758*s+.0415*a)>.0031308?1.055*r**(1/2.4)-.055:12.92*r,i=(i=.0557*n+-.204*s+1.057*a)>.0031308?1.055*i**(1/2.4)-.055:12.92*i,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(i=Math.min(Math.max(0,i),1))]},s.xyz.lab=function(e){let t=e[0],r=e[1],i=e[2];return t/=95.047,r/=100,i/=108.883,[116*(r=r>.008856?r**(1/3):7.787*r+16/116)-16,500*((t=t>.008856?t**(1/3):7.787*t+16/116)-r),200*(r-(i=i>.008856?i**(1/3):7.787*i+16/116))]},s.lab.xyz=function(e){let t,r,i,n=e[0],s=e[1],a=e[2];t=s/500+(r=(n+16)/116),i=r-a/200;let o=r**3,l=t**3,u=i**3;return r=(o>.008856?o:(r-16/116)/7.787)*100,[t=(l>.008856?l:(t-16/116)/7.787)*95.047,r,i=(u>.008856?u:(i-16/116)/7.787)*108.883]},s.lab.lch=function(e){let t,r=e[0],i=e[1],n=e[2];return(t=360*Math.atan2(n,i)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(i*i+n*n),t]},s.lch.lab=function(e){let t=e[0],r=e[1],i=e[2]/360*2*Math.PI;return[t,r*Math.cos(i),r*Math.sin(i)]},s.rgb.ansi16=function(e,t=null){let[r,i,n]=e,a=null===t?s.rgb.hsv(e)[2]:t;if(0===(a=Math.round(a/50)))return 30;let o=30+(Math.round(n/255)<<2|Math.round(i/255)<<1|Math.round(r/255));return 2===a&&(o+=60),o},s.hsv.ansi16=function(e){return s.rgb.ansi16(s.hsv.rgb(e),e[2])},s.rgb.ansi256=function(e){let t=e[0],r=e[1],i=e[2];return t===r&&r===i?t<8?16:t>
1248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},s.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];let r=(~~(e>50)+1)*.5;return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},s.ansi256.rgb=function(e){let t;if(e>=232){let t=(e-232)*10+8;return[t,t,t]}return[Math.floor((e-=16)/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},s.rgb.hex=function(e){let t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},s.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];3===t[0].length&&(r=r.split("").map(e=>e+e).join(""));let i=parseInt(r,16);return[i>>16&255,i>>8&255,255&i]},s.rgb.hcg=function(e){let t,r=e[0]/255,i=e[1]/255,n=e[2]/255,s=Math.max(Math.max(r,i),n),a=Math.min(Math.min(r,i),n),o=s-a;return t=o<1?a/(1-o):0,[360*((o<=0?0:s===r?(i-n)/o%6:s===i?2+(n-r)/o:4+(r-i)/o)/6%1),100*o,100*t]},s.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,i=r<.5?2*t*r:2*t*(1-r),n=0;return i<1&&(n=(r-.5*i)/(1-i)),[e[0],100*i,100*n]},s.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,i=t*r,n=0;return i<1&&(n=(r-i)/(1-i)),[e[0],100*i,100*n]},s.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,i=e[2]/100;if(0===r)return[255*i,255*i,255*i];let n=[0,0,0],s=t%1*6,a=s%1,o=1-a,l=0;switch(Math.floor(s)){case 0:n[0]=1,n[1]=a,n[2]=0;break;case 1:n[0]=o,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=a;break;case 3:n[0]=0,n[1]=o,n[2]=1;break;case 4:n[0]=a,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=o}return l=(1-r)*i,[(r*n[0]+l)*255,(r*n[1]+l)*255,(r*n[2]+l)*255]},s.hcg.hsv=function(e){let t=e[1]/100,r=t+e[2]/100*(1-t),i=0;return r>0&&(i=t/r),[e[0],100*i,100*r]},s.hcg.hsl=function(e){let t=e[1]/100,r=e[2]/100*(1-t)+.5*t,i=0;return r>0&&r<.5?i=t/(2*r):r>=.5&&r<1&&(i=t/(2*(1-r))),[e[0],100*i,100*r]},s.hcg.hwb=function(e){let t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],(r-t)*100,(1-r)*100]},s.hwb.hcg=function(e){let t=e[1]/100,r=1-e[2]/100,i=r-t,n=0;return i<1&&(n=(r-i)/(1-i)),[e[0],100*i,100*n]},s.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},s.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},s.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},s.gray.hsl=function(e){return[0,0,e[0]]},s.gray.hsv=s.gray.hsl,s.gray.hwb=function(e){return[0,100,e[0]]},s.gray.cmyk=function(e){return[0,0,0,e[0]]},s.gray.lab=function(e){return[e[0],0,0]},s.gray.hex=function(e){let t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},s.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},662006,(e,t,r)=>{let i=e.r(61379);t.exports=function(e){let t=function(e){let t=function(){let e={},t=Object.keys(i);for(let r=t.length,i=0;i<r;i++)e[t[i]]={distance:-1,parent:null};return e}(),r=[e];for(t[e].distance=0;r.length;){let e=r.pop(),n=Object.keys(i[e]);for(let i=n.length,s=0;s<i;s++){let i=n[s],a=t[i];-1===a.distance&&(a.distance=t[e].distance+1,a.parent=e,r.unshift(i))}}return t}(e),r={},n=Object.keys(t);for(let e=n.length,s=0;s<e;s++){let e=n[s];null!==t[e].parent&&(r[e]=function(e,t){let r=[t[e].parent,e],n=i[t[e].parent][e],s=t[e].parent;for(;t[s].parent;)r.unshift(t[s].parent),n=function(e,t){return function(r){return t(e(r))}}(i[t[s].parent][s],n),s=t[s].parent;return n.conversion=r,n}(e,t))}return r}},679230,(e,t,r)=>{let i=e.r(61379),n=e.r(662006),s={};
1Object.keys(i).forEach(e=>{s[e]={},Object.defineProperty(s[e],"channels",{value:i[e].channels}),Object.defineProperty(s[e],"labels",{value:i[e].labels});let t=n(e);Object.keys(t).forEach(r=>{let i,n,a=t[r];s[e][r]=(i=function(...e){let t=e[0];if(null==t)return t;t.length>1&&(e=t);let r=a(e);if("object"==typeof r)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r},"conversion"in a&&(i.conversion=a.conversion),i),s[e][r].raw=(n=function(...e){let t=e[0];return null==t?t:(t.length>1&&(e=t),a(e))},"conversion"in a&&(n.conversion=a.conversion),n)})}),t.exports=s},288945,(e,t,r)=>{"use strict";let i,n=(e,t)=>(...r)=>{let i=e(...r);return`\u001B[${i+t}m`},s=(e,t)=>(...r)=>{let i=e(...r);return`\u001B[${38+t};5;${i}m`},a=(e,t)=>(...r)=>{let i=e(...r);return`\u001B[${38+t};2;${i[0]};${i[1]};${i[2]}m`},o=e=>e,l=(e,t,r)=>[e,t,r],u=(e,t,r)=>{Object.defineProperty(e,t,{get:()=>{let i=r();return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0}),i},enumerable:!0,configurable:!0})},c=(t,r,n,s)=>{void 0===i&&(i=e.r(679230));let a=10*!!s,o={};for(let[e,s]of Object.entries(i)){let i="ansi16"===e?"ansi":e;e===r?o[i]=t(n,a):"object"==typeof s&&(o[i]=t(s[r],a))}return o};Object.defineProperty(t,"exports",{enumerable:!0,get:function(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};for(let[r,i]of(t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright,Object.entries(t))){for(let[r,n]of Object.entries(i))t[r]={open:`\u001B[${n[0]}m`,close:`\u001B[${n[1]}m`},i[r]=t[r],e.set(n[0],n[1]);Object.defineProperty(t,r,{value:i,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1b[39m",t.bgColor.close="\x1b[49m",u(t.color,"ansi",()=>c(n,"ansi16",o,!1)),u(t.color,"ansi256",()=>c(s,"ansi256",o,!1)),u(t.color,"ansi16m",()=>c(a,"rgb",l,!1)),u(t.bgColor,"ansi",()=>c(n,"ansi16",o,!0)),u(t.bgColor,"ansi256",()=>c(s,"ansi256",o,!0)),u(t.bgColor,"ansi16m",()=>c(a,"rgb",l,!0)),t}})},13596,(e,t,r)=>{"use strict";t.exports={stdout:!1,stderr:!1}},773203,(e,t,r)=>{"use strict";t.exports={stringReplaceAll:(e,t,r)=>{let i=e.indexOf(t);if(-1===i)return e;let n=t.length,s=0,a="";do a+=e.substr(s,i-s)+t+r,s=i+n,i=e.indexOf(t,s);while(-1!==i)return a+e.substr(s)},stringEncaseCRLFWithFirstIndex:(e,t,r,i)=>{let n=0,s="";do{let a="\r"===e[i-1];s+=e.substr(n,(a?i-1:i)-n)+t+(a?"\r\n":"\n")+r,n=i+1,i=e.indexOf("\n",n)}while(-1!==i)return s+e.substr(n)}}},771786,(e,t,r)=>{"use strict";let i,n=e.r(288945),{stdout:s,stderr:a}=e.r(13596),{stringReplaceAll:o,stringEncaseCRLFWithFirstIndex:l}=e.r(773203),{isArray:u}=Array,c=["ansi","ansi","ansi256","ansi16m"],h=Object.create(null);class p{constructor(e){return d(e)}}let d=e=>{let t={};return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let r=s?s.level:0;e.level=void 0===t.level?r:t.level})(t,e),t.template=(...e)=>b(t.template,...e),Object.setPrototypeOf(t,f.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=p,t.template};function f(e){return d(e)}for(let[e,t]of Object.entries(n))h[e]={get(){let r=v(this,m(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};h.visible={get(){let e=v(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};let g=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of g)h[e]={get(){let{level:t}=this;return function(...r){return v(this,m(n.color[c[t]][e](...r),n.color.close,this._styler),this._isEmpty)}}};for(let e of g)h["bg"+e[0].toUpperCase()+e.slice(1)]={get(){let{level:t}=this;return function(...r){return v(this,m(n.bgColor[c[t]][e](...r),n.bgColor.close,this._styler),this._isEmpty)}}};let y=Object.defineProperties(()=>{},{...h,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),m=(e,t,r)=>{let i,n;return void 0===r?(i=e,n=t):(i=r.openAll+e,n=t+r.closeAll),{open:e,close:t,openAll:i,closeAll:n,parent:r}},v=(e,t,r)=>{let i=(...e)=>u(e[0])&&u(e[0].raw)?E(i,b(i,...e)):E(i,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(i,y),i._generator=e,i._styler=t,i._isEmpty=r,i},E=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let r=e._styler;if(void 0===r)return t;let{openAll:i,closeAll:n}=r;if(-1!==t.indexOf("\x1b"))for(;void 0!==r;)t=o(t,r.close,r.open),r=r.parent;let s=t.indexOf("\n");
1return -1!==s&&(t=l(t,n,i,s)),i+t+n},b=(t,...r)=>{let[n]=r;if(!u(n)||!u(n.raw))return r.join(" ");let s=r.slice(1),a=[n.raw[0]];for(let e=1;e<n.length;e++)a.push(String(s[e-1]).replace(/[{}\\]/g,"\\$&"),String(n.raw[e]));return void 0===i&&(i=e.r(856873)),i(t,a.join(""))};Object.defineProperties(f.prototype,h);let T=d(void 0);T.supportsColor=s,T.stderr=d({level:a?a.level:0}),T.stderr.supportsColor=a,t.exports=T},904322,e=>{"use strict";var t,r,i,n,s,a,o,l,u,c,h=e.i(922062),p=e.i(512157),d=e.i(645860),f=e.i(982257),g=e.i(824177);let y=Object.freeze({cacheTimeout:60,cacheEnabled:!0});class m{constructor(e){var t;this.options=e,this.cache=new g.Cache,this.options.cacheTimeout=(null!=(t=this.options.cacheTimeout)?t:y.cacheTimeout)*1e3,void 0===this.options.cacheEnabled&&(this.options.cacheEnabled=y.cacheEnabled)}getCacheValue(e){return this.options.cacheEnabled?this.cache.get(e):null}setCacheValue(e,t){return this.options.cacheEnabled?this.cache.put(e,t,this.options.cacheTimeout):t}}var v=e.i(852248);let{ERROR_MESSAGES:E}=d.constants,b=` 2 query DictionarySiteQuery( 3 $siteName: String! 4 $language: String! 5 $pageSize: Int = 500 6 $after: String 7 ) { 8 site { 9 siteInfo(site: $siteName) { 10 dictionary(language: $language, first: $pageSize, after: $after) { 11 pageInfo { 12 endCursor 13 hasNext 14 } 15 results { 16 key 17 value 18 } 19 } 20 } 21 } 22 } 23`;class T{constructor(e){this.options=e,this.cache=this.getCacheClient(),this.graphQLClient=this.getGraphQLClient()}async fetchDictionaryData(e,t,r){var i,n;let s=t+e,a=this.getCacheValue(s);if(a)return v.default.dictionary("using cached dictionary data for %s %s",e,t),a;let o={};v.default.dictionary("fetching dictionary data for %s %s",e,t);let l=[],u=!0,c="";if(!t)throw RangeError(E.MV_002);if(!e)throw RangeError(E.MV_009);for(;u;){let s=await this.graphQLClient.request(b,{siteName:t,language:e,pageSize:this.options.pageSize,after:c},r);(null==(n=null==(i=null==s?void 0:s.site)?void 0:i.siteInfo)?void 0:n.dictionary)?(l=l.concat(s.site.siteInfo.dictionary.results),c=s.site.siteInfo.dictionary.pageInfo.endCursor,u=s.site.siteInfo.dictionary.pageInfo.hasNext):u=!1}return l.forEach(e=>o[e.key]=e.value),this.setCacheValue(s,o),o}setCacheValue(e,t){return this.cache.setCacheValue(e,t)}getCacheValue(e){return this.cache.getCacheValue(e)}getCacheClient(){return new m(this.options)}getGraphQLClient(){var e,t;if(!this.options.clientFactory)throw Error("clientFactory needs to be provided when initializing GraphQL client.");return this.options.clientFactory({debugger:v.default.dictionary,retries:null==(e=this.options.retries)?void 0:e.count,retryStrategy:null==(t=this.options.retries)?void 0:t.retryStrategy})}}var O=d,N=e.i(731468),x=e.i(502592);let I=/-library--([^\s]+)/,S=(e,t)=>{var r,i,n,s;let a;if("params"in e&&e.params){let t=(0,x.getRenderingParamString)(e.params.CSSStyles),n=(0,x.getRenderingParamString)(e.params.Styles),s=(0,x.getRenderingParamString)(e.params.LibraryId);a=(null==(r=null==t?void 0:t.match(I))?void 0:r[1])||(null==(i=null==n?void 0:n.match(I))?void 0:i[1])||s||void 0}if(!a&&"fields"in e&&e.fields){let t=(0,x.getRenderingParamString)((0,x.getFieldValue)(e.fields,"CSSStyles","")),r=(0,x.getRenderingParamString)((0,x.getFieldValue)(e.fields,"Styles","")),i=(0,x.getRenderingParamString)((0,x.getFieldValue)(e.fields,"LibraryId",""));a=(null==(n=null==t?void 0:t.match(I))?void 0:n[1])||(null==(s=null==r?void 0:r.match(I))?void 0:s[1])||i||void 0}a&&t.add(a);let o=e.placeholders||{};Object.keys(o).forEach(e=>{var r;r=o[e],r.map(e=>S(e,t))})};
23var C=d;let D=/class=".*(\bck-content\b).*"/g,_=(e,t)=>{e&&"object"==typeof e&&!t.loadStyles&&("value"in e&&"string"==typeof e.value?t.loadStyles=D.test(e.value):"fields"in e?Object.values(e.fields).forEach(e=>{_(e,t)}):Array.isArray(e)&&e.forEach(e=>{_(e,t)}))},A=(e,t)=>{if(t.loadStyles)return;"fields"in e&&e.fields&&Object.values(e.fields).forEach(e=>{_(e,t)});let r=e.placeholders||{};Object.keys(r).forEach(e=>{var i;i=r[e],t.loadStyles||i.forEach(e=>{A(e,t)})})};class w{constructor(e){this.serviceConfig=e,this.graphQLClient=this.getGraphQLClient()}getGraphQLClient(){var e,t;if(!this.serviceConfig.clientFactory)throw Error("clientFactory needs to be provided when initializing GraphQL client.");return this.serviceConfig.clientFactory({debugger:this.serviceConfig.debugger||p.debug.http,retries:null==(e=this.serviceConfig.retries)?void 0:e.count,retryStrategy:null==(t=this.serviceConfig.retries)?void 0:t.retryStrategy})}}class k extends w{constructor(e){super(e),this.serviceConfig=e}async fetchLayoutData(e,t,r){var i,n;let s=t.site,a=this.getLayoutQuery(e,s,null==t?void 0:t.locale);v.default.layout("fetching layout data for %s %s %s",e,null==t?void 0:t.locale,s);let o=await this.graphQLClient.request(a,{},r);return(null==(n=null==(i=null==o?void 0:o.layout)?void 0:i.item)?void 0:n.rendered)||{sitecore:{context:{pageEditing:!1,language:null==t?void 0:t.locale},route:null}}}getLayoutQuery(e,t,r){let i=r?`, language:"${r}"`:"",n=this.serviceConfig.formatLayoutQuery?this.serviceConfig.formatLayoutQuery(t,e,r):`layout(site:"${t}", routePath:"${e}"${i})`;return`query ContentSdkLayoutQuery { 24 ${n}{ 25 item { 26 rendered 27 } 28 } 29 }`}}var R=e.i(657046);let P=new URL(d.constants.SITECORE_EXPERIENCE_EDGE_URL_DEFAULT).hostname;function L(e){try{return new URL(e.startsWith("http")?e:`https://${e}`).hostname.toLowerCase()!==P}catch(e){return!1}}let F=RegExp(`https?://${P.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`,"gi");function M(e,t){let r=(0,N.normalizeUrl)(t);return L(r)?function e(t,r){if(null==t)return t;if("string"==typeof t)return j(t,r);if(Array.isArray(t))return t.map(t=>e(t,r));if("object"==typeof t){if(Object.getPrototypeOf(t)!==Object.prototype)return t;let i={};for(let n of Object.keys(t))i[n]=e(t[n],r);return i}return t}(e,r):e}function j(e,t){return F.lastIndex=0,e.replace(F,t)}var B=e.i(617888);let U=e=>Object.assign(Object.assign({},e),{componentName:B.HIDDEN_RENDERING_NAME,experiences:{}}),{ERROR_MESSAGES:$}=d.constants,q=` 30 query ErrorPagesQuery($siteName: String!, $language: String!) { 31 site { 32 siteInfo(site: $siteName) { 33 errorHandling(language: $language) { 34 notFoundPage { 35 rendered 36 } 37 notFoundPagePath 38 serverErrorPage { 39 rendered 40 } 41 serverErrorPagePath 42 } 43 } 44 } 45 } 46`;class V{constructor(e){this.options=e,this.graphQLClient=this.getGraphQLClient()}get query(){return q}async fetchErrorPages(e,t,r){let i=t||this.options.language;if(!e)throw Error($.MV_002);return this.graphQLClient.request(this.query,{siteName:e,language:i},r).then(e=>{var t,r;if(!e.site.siteInfo)return null;let i=e.site.siteInfo.errorHandling,n=(null==(t=i.notFoundPage)?void 0:t.rendered)?{rendered:i.notFoundPage.rendered}:null,s=(null==(r=i.serverErrorPage)?void 0:r.rendered)?{rendered:i.serverErrorPage.rendered}:null;return Object.assign(Object.assign({},i),{notFoundPage:n,serverErrorPage:s})}).catch(e=>Promise.reject(e))}getGraphQLClient(){var e,t;if(!this.options.clientFactory)throw Error("clientFactory needs to be provided when initializing GraphQL client.");return this.options.clientFactory({debugger:v.default.errorpages,retries:null==(e=this.options.retries)?void 0:e.count,retryStrategy:null==(t=this.options.retries)?void 0:t.retryStrategy})}}var G=e.i(830883);let Q="_site_";function z(e){let t=e.match(`${Q}.*?(?:\\/|$)`);return null===t?e:e.replace(t[0],"")}let{ERROR_MESSAGES:K}=d.constants;class H{constructor(e){this.options=e,this._graphQLClient=this.getGraphQLClient()}get graphQLClient(){return this._graphQLClient}get query(){let e;return e=this.options.includePersonalizedRoutes,` 47query ${e?"PersonalizeSitemapQuery":"DefaultSitemapQuery"}( 48 $siteName: String! 49 $language: String! 50 $includedPaths: [String] 51 $excludedPaths: [String] 52 $pageSize: Int = 100 53 $after: String 54) { 55 site { 56 siteInfo(site: $siteName) { 57 routes( 58 language: $language 59 includedPaths: $includedPaths 60 excludedPaths: $excludedPaths 61 first: $pageSize 62 after: $after 63 ){ 64 total 65 pageInfo { 66 endCursor 67 hasNext 68 } 69 results { 70 path: routePath 71 ${e?` 72 route { 73 personalization { 74 variantIds 75 } 76 }`:""} 77 } 78 } 79 } 80 } 81} 82`}async fetchSiteRoutes(e,t,r){let i=(e,t)=>({params:{path:e},locale:t}),n=[];if(!t.length)throw RangeError(K.MV_009);if(!e||!e.length)throw RangeError("The list of sites cannot be empty");for(let s=0;s<e.length;s++)for(let a of t){let t=await this.fetchLanguageSitePaths(a,e[s],r),o=await this.transformLanguageSitePaths(t,i,a);n.push(...o)}return[].concat(...n)}async transformLanguageSitePaths(e,t,r){let i=e=>decodeURI(e).replace(/^\/|\/$/g,"").split("/"),n=[];
82return e.forEach(e=>{var s,a,o;if(!e)return;n.push(t(i(e.path),r));let l=null==(o=null==(a=null==(s=e.route)?void 0:s.personalization)?void 0:a.variantIds)?void 0:o.filter(e=>!e.includes("_"));(null==l?void 0:l.length)&&n.push(...l.map(n=>t(i((0,G.getPersonalizedRewrite)(e.path,[n])),r)))}),n}getGraphQLClient(){if(!this.options.clientFactory)throw Error("clientFactory needs to be provided when initializing GraphQL client.");return this.options.clientFactory({debugger:v.default.sitemap})}async fetchLanguageSitePaths(e,t,r){var i,n,s,a;let o={siteName:t,language:e,pageSize:this.options.pageSize,includedPaths:this.options.includedPaths,excludedPaths:this.options.excludedPaths},l=[],u=!0,c="";for(v.default.sitemap("fetching sitemap data for %s %s",e,t);u;){let e=await this.graphQLClient.request(this.query,Object.assign(Object.assign({},o),{after:c}),r);if(null==(i=null==e?void 0:e.site)?void 0:i.siteInfo)l=l.concat(null==(n=e.site.siteInfo.routes)?void 0:n.results),u=null==(s=e.site.siteInfo.routes)?void 0:s.pageInfo.hasNext,c=null==(a=e.site.siteInfo.routes)?void 0:a.pageInfo.endCursor;else throw RangeError(K.IV_007(t))}return l.forEach(e=>{var r;let i;e&&(r=e.path,i=r.startsWith("/")?r:"/"+r,e.path=`/${Q}${({siteName:t}).siteName}${i}`)}),l}}let{ERROR_MESSAGES:Y}=d.constants,J="sitemap",X=` 83 query SitemapQuery($siteName: String!) { 84 site { 85 siteInfo(site: $siteName) { 86 sitemap 87 } 88 } 89 } 90`;class W{constructor(e){this.options=e,this.graphQLClient=this.getGraphQLClient()}get query(){return X}async fetchSitemaps(e){let t=this.options.siteName;if(!t)throw Error(Y.MV_002);let r=this.graphQLClient.request(this.query,{siteName:t},e);try{return r.then(e=>e.site.siteInfo.sitemap)}catch(e){return Promise.reject(e)}}async getSitemap(e){let t;if(void 0!==e){if(""===e)t=`${J}.xml`;else{let r=e.startsWith("-")?e.slice(1):e;t=`${J}-${r}.xml`}return(await this.fetchSitemaps()).find(e=>e.includes(t))}}getGraphQLClient(){if(!this.options.clientFactory)throw Error("clientFactory needs to be provided when initializing GraphQL client.");return this.options.clientFactory({debugger:v.default.sitemap})}}let Z=JSON,ee=/\r\n|[\n\r]/g;function et(e,t){let r=0,i=1;for(let n of e.body.matchAll(ee)){if("number"==typeof n.index||function(e){if(!e)throw Error("Unexpected invariant triggered.")}(!1),n.index>=t)break;r=n.index+n[0].length,i+=1}return{line:i,column:t+1-r}}function er(e,t){let r=e.locationOffset.column-1,i="".padStart(r)+e.body,n=t.line-1,s=e.locationOffset.line-1,a=t.line+s,o=1===t.line?r:0,l=t.column+o,u=`${e.name}:${a}:${l} 91`,c=i.split(/\r\n|[\n\r]/g),h=c[n];if(h.length>120){let e=Math.floor(l/80),t=[];for(let e=0;e<h.length;e+=80)t.push(h.slice(e,e+80));return u+ei([[`${a} |`,t[0]],...t.slice(1,e+1).map(e=>["|",e]),["|","^".padStart(l%80)],["|",t[e+1]]])}return u+ei([[`${a-1} |`,c[n-1]],[`${a} |`,h],["|","^".padStart(l)],[`${a+1} |`,c[n+1]]])}function ei(e){let t=e.filter(([e,t])=>void 0!==t),r=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(r)+(t?" "+t:"")).join("\n")}class en extends Error{constructor(e,...t){var r,i,n;const{nodes:s,source:a,positions:o,path:l,originalError:u,extensions:c}=function(e){let t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=l?l:void 0,this.originalError=null!=u?u:void 0,this.nodes=es(Array.isArray(s)?s:s?[s]:void 0);const h=es(null==(r=this.nodes)?void 0:r.map(e=>e.loc).filter(e=>null!=e));this.source=null!=a?a:null==h||null==(i=h[0])?void 0:i.source,this.positions=null!=o?o:null==h?void 0:h.map(e=>e.start),this.locations=o&&a?o.map(e=>et(a,e)):null==h?void 0:h.map(e=>et(e.source,e.start));const p=!function(e){return"object"==typeof e&&null!==e}(null==u?void 0:u.extensions)||null==u?void 0:u.extensions;this.extensions=null!=(n=null!=c?c:p)?n:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=u&&u.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,en):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(let r of this.nodes){var t;r.loc&&(e+="\n\n"+er((t=r.loc).source,et(t.source,t.start)))}else if(this.source&&this.locations)for(let t of this.locations)e+="\n\n"+er(this.source,t);return e}toJSON(){let e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function es(e){return void 0===e||0===e.length?void 0:e}function ea(e,t,r){return new en(`Syntax Error: ${r}`,{source:e,positions:[t]})}class eo{constructor(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}
91class el{constructor(e,t,r,i,n,s){this.kind=e,this.start=t,this.end=r,this.line=i,this.column=n,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}let eu={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},ec=new Set(Object.keys(eu));function eh(e){let t=null==e?void 0:e.kind;return"string"==typeof t&&ec.has(t)}function ep(e){return 9===e||32===e}function ed(e){return e>=48&&e<=57}function ef(e){return e>=97&&e<=122||e>=65&&e<=90}function eg(e){return ef(e)||95===e}(t=a||(a={})).QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription",(r=o||(o={})).QUERY="QUERY",r.MUTATION="MUTATION",r.SUBSCRIPTION="SUBSCRIPTION",r.FIELD="FIELD",r.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",r.FRAGMENT_SPREAD="FRAGMENT_SPREAD",r.INLINE_FRAGMENT="INLINE_FRAGMENT",r.VARIABLE_DEFINITION="VARIABLE_DEFINITION",r.SCHEMA="SCHEMA",r.SCALAR="SCALAR",r.OBJECT="OBJECT",r.FIELD_DEFINITION="FIELD_DEFINITION",r.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",r.INTERFACE="INTERFACE",r.UNION="UNION",r.ENUM="ENUM",r.ENUM_VALUE="ENUM_VALUE",r.INPUT_OBJECT="INPUT_OBJECT",r.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION",r.DIRECTIVE_DEFINITION="DIRECTIVE_DEFINITION",(i=l||(l={})).NAME="Name",i.DOCUMENT="Document",i.OPERATION_DEFINITION="OperationDefinition",i.VARIABLE_DEFINITION="VariableDefinition",i.SELECTION_SET="SelectionSet",i.FIELD="Field",i.ARGUMENT="Argument",i.FRAGMENT_SPREAD="FragmentSpread",i.INLINE_FRAGMENT="InlineFragment",i.FRAGMENT_DEFINITION="FragmentDefinition",i.VARIABLE="Variable",i.INT="IntValue",i.FLOAT="FloatValue",i.STRING="StringValue",i.BOOLEAN="BooleanValue",i.NULL="NullValue",i.ENUM="EnumValue",i.LIST="ListValue",i.OBJECT="ObjectValue",i.OBJECT_FIELD="ObjectField",i.DIRECTIVE="Directive",i.NAMED_TYPE="NamedType",i.LIST_TYPE="ListType",i.NON_NULL_TYPE="NonNullType",i.SCHEMA_DEFINITION="SchemaDefinition",i.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",i.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",i.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",i.FIELD_DEFINITION="FieldDefinition",i.INPUT_VALUE_DEFINITION="InputValueDefinition",i.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",i.UNION_TYPE_DEFINITION="UnionTypeDefinition",i.ENUM_TYPE_DEFINITION="EnumTypeDefinition",i.ENUM_VALUE_DEFINITION="EnumValueDefinition",i.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",i.DIRECTIVE_DEFINITION="DirectiveDefinition",i.SCHEMA_EXTENSION="SchemaExtension",i.DIRECTIVE_EXTENSION="DirectiveExtension",i.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",i.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",i.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",i.UNION_TYPE_EXTENSION="UnionTypeExtension",i.ENUM_TYPE_EXTENSION="EnumTypeExtension",i.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",i.TYPE_COORDINATE="TypeCoordinate",i.MEMBER_COORDINATE="MemberCoordinate",i.ARGUMENT_COORDINATE="ArgumentCoordinate",i.DIRECTIVE_COORDINATE="DirectiveCoordinate",i.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate",(n=u||(u={})).SOF="<SOF>",n.EOF="<EOF>",n.BANG="!",n.DOLLAR="$",n.AMP="&",n.PAREN_L="(",n.PAREN_R=")",n.DOT=".",n.SPREAD="...",n.COLON=":",n.EQUALS="=",n.AT="@",n.BRACKET_L="[",n.BRACKET_R="]",n.BRACE_L="{",n.PIPE="|",n.BRACE_R="}
91",n.NAME="Name",n.INT="Int",n.FLOAT="Float",n.STRING="String",n.BLOCK_STRING="BlockString",n.COMMENT="Comment";class ey{constructor(e){const t=new el(u.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==u.EOF)do if(e.next)e=e.next;else{let t=function(e,t){let r=e.source.body,i=r.length,n=t;for(;n<i;){let t=r.charCodeAt(n);switch(t){case 65279:case 9:case 32:case 44:++n;continue;case 10:++n,++e.line,e.lineStart=n;continue;case 13:10===r.charCodeAt(n+1)?n+=2:++n,++e.line,e.lineStart=n;continue;case 35:return function(e,t){let r=e.source.body,i=r.length,n=t+1;for(;n<i;){let e=r.charCodeAt(n);if(10===e||13===e)break;if(em(e))++n;else if(ev(r,n))n+=2;else break}return eO(e,u.COMMENT,t,n,r.slice(t+1,n))}(e,n);case 33:return eO(e,u.BANG,n,n+1);case 36:return eO(e,u.DOLLAR,n,n+1);case 38:return eO(e,u.AMP,n,n+1);case 40:return eO(e,u.PAREN_L,n,n+1);case 41:return eO(e,u.PAREN_R,n,n+1);case 46:if(46===r.charCodeAt(n+1)&&46===r.charCodeAt(n+2))return eO(e,u.SPREAD,n,n+3);break;case 58:return eO(e,u.COLON,n,n+1);case 61:return eO(e,u.EQUALS,n,n+1);case 64:return eO(e,u.AT,n,n+1);case 91:return eO(e,u.BRACKET_L,n,n+1);case 93:return eO(e,u.BRACKET_R,n,n+1);case 123:return eO(e,u.BRACE_L,n,n+1);case 124:return eO(e,u.PIPE,n,n+1);case 125:return eO(e,u.BRACE_R,n,n+1);case 34:if(34===r.charCodeAt(n+1)&&34===r.charCodeAt(n+2))return function(e,t){let r=e.source.body,i=r.length,n=e.lineStart,s=t+3,a=s,o="",l=[];for(;s<i;){let i=r.charCodeAt(s);if(34===i&&34===r.charCodeAt(s+1)&&34===r.charCodeAt(s+2)){o+=r.slice(a,s),l.push(o);let i=eO(e,u.BLOCK_STRING,t,s+3,(function(e){var t,r;let i=Number.MAX_SAFE_INTEGER,n=null,s=-1;for(let t=0;t<e.length;++t){let a=e[t],o=function(e){let t=0;for(;t<e.length&&ep(e.charCodeAt(t));)++t;return t}(a);o!==a.length&&(n=null!=(r=n)?r:t,s=t,0!==t&&o<i&&(i=o))}return e.map((e,t)=>0===t?e:e.slice(i)).slice(null!=(t=n)?t:0,s+1)})(l).join("\n"));return e.line+=l.length-1,e.lineStart=n,i}if(92===i&&34===r.charCodeAt(s+1)&&34===r.charCodeAt(s+2)&&34===r.charCodeAt(s+3)){o+=r.slice(a,s),a=s+1,s+=4;continue}if(10===i||13===i){o+=r.slice(a,s),l.push(o),13===i&&10===r.charCodeAt(s+1)?s+=2:++s,o="",a=s,n=s;continue}if(em(i))++s;else if(ev(r,s))s+=2;else throw ea(e.source,s,`Invalid character within String: ${eT(e,s)}.`)}throw ea(e.source,s,"Unterminated string.")}(e,n);return function(e,t){let r=e.source.body,i=r.length,n=t+1,s=n,a="";for(;n<i;){let i=r.charCodeAt(n);if(34===i)return a+=r.slice(s,n),eO(e,u.STRING,t,n+1,a);if(92===i){a+=r.slice(s,n);let t=117===r.charCodeAt(n+1)?123===r.charCodeAt(n+2)?function(e,t){let r=e.source.body,i=0,n=3;for(;n<12;){let e=r.charCodeAt(t+n++);if(125===e){if(n<5||!em(i))break;return{value:String.fromCodePoint(i),size:n}}if((i=i<<4|eI(e))<0)break}throw ea(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+n)}".`)}(e,n):function(e,t){let r=e.source.body,i=ex(r,t+2);if(em(i))return{value:String.fromCodePoint(i),size:6};if(eE(i)&&92===r.charCodeAt(t+6)&&117===r.charCodeAt(t+7)){let e=ex(r,t+8);if(eb(e))return{value:String.fromCodePoint(i,e),size:12}}throw ea(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+6)}".`)}(e,n):function(e,t){let r=e.source.body;switch(r.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw ea(e.source,t,`Invalid character escape sequence: "${r.slice(t,t+2)}".`)}(e,n);a+=t.value,n+=t.size,s=n;continue}if(10===i||13===i)break;if(em(i))++n;else if(ev(r,n))n+=2;else throw ea(e.source,n,`Invalid character within String: ${eT(e,n)}.`)}throw ea(e.source,n,"Unterminated string.")}(e,n)}if(ed(t)||45===t)return function(e,t,r){let i=e.source.body,n=t,s=r,a=!1;if(45===s&&(s=i.charCodeAt(++n)),48===s){if(ed(s=i.charCodeAt(++n)))throw ea(e.source,n,`Invalid number, unexpected digit after 0: ${eT(e,n)}.`)}else n=eN(e,n,s),s=i.charCodeAt(n);if(46===s&&(a=!0,s=i.charCodeAt(++n),n=eN(e,n,s),s=i.charCodeAt(n)),(69===s||101===s)&&(a=!0,(43===(s=i.charCodeAt(++n))||45===s)&&(s=i.charCodeAt(++n)),n=eN(e,n,s),s=i.charCodeAt(n)),46===s||eg(s))throw ea(e.source,n,`Invalid number, expected digit but got: ${eT(e,n)}.`);return eO(e,a?u.FLOAT:u.INT,t,n,i.slice(t,n))}(e,n,t);if(eg(t))return function(e,t){let r=e.source.body,i=r.length,n=t+1;for(;n<i;){var s;if(ef(s=r.charCodeAt(n))||ed(s)||95===s)++n;else break}return eO(e,u.NAME,t,n,r.slice(t,n))}(e,n);throw ea(e.source,n,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":em(t)||ev(r,n)?`Unexpected character: ${eT(e,n)}.`:`Invalid character: ${eT(e,n)}.`)}return eO(e,u.EOF,i,i)}(this,e.end);e.next=t,t.prev=e,e=t}while(e.kind===u.COMMENT)return e}}function em(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function ev(e,t){return eE(e.charCodeAt(t))&&eb(e.charCodeAt(t+1))}function eE(e){return e>=55296&&e<=56319}function eb(e){return e>=56320&&e<=57343}function eT(e,t){let r=e.source.body.codePointAt(t);if(void 0===r)return u.EOF;if(r>=32&&r<=126){let e=String.fromCodePoint(r);return'"'===e?"'\"'":`"${e}"`}return"U+"+r.toString(16).toUpperCase().padStart(4,"0")}function eO(e,t,r,i,n){let s=e.line,a=1+r-e.lineStart;return new el(t,r,i,s,a,n)}function eN(e,t,r){if(!ed(r))throw ea(e.source,t,`Invalid number, expected digit but got: ${eT(e,t)}.`);let i=e.source.body,n=t+1;for(;ed(i.charCodeAt(n));)++n;return n}function ex(e,t){return eI(e.charCodeAt(t))<<12|eI(e.charCodeAt(t+1))<<8|eI(e.charCodeAt(t+2))<<4|eI(e.charCodeAt(t+3))}function eI(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function eS(e,t){if(!e)throw Error(t)}function eC(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){let r;if(null===e)return"null";if(t.includes(e))return"[Circular]";let i=[...t,e];if("function"==typeof e.toJSON){let t=e.toJSON();if(t!==e)return"string"==typeof t?t:eC(t,i)}else if(Array.isArray(e)){var n,s,a=e,o=i;if(0===a.length)return"[]";if(o.length>2)return"[Array]";let t=Math.min(10,a.length),r=a.length-t,l=[];for(let e=0;e<t;++e)l.push(eC(a[e],o));return 1===r?l.push("... 1 more item"):r>1&&l.push(`... ${r} more items`),"["+l.join(", ")+"]"}return n=e,s=i,0===(r=Object.entries(n)).length?"{}":s.length>2?"["+function(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){let t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(n)+"]":"{ "+r.map(([e,t])=>e+": "+eC(t,s)).join(", ")+" }"}(e,t);default:return String(e)}}e.i(288044);let eD=globalThis.process&&1?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;
91if("object"==typeof e&&null!==e){var r;let i=t.prototype[Symbol.toStringTag];if(i===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null==(r=e.constructor)?void 0:r.name)){let t=eC(e,[]);throw Error(`Cannot use ${i} "${t}" from another module or realm. 92 93Ensure that there is only one instance of "graphql" in the node_modules 94directory. If different versions of "graphql" are the dependencies of other 95relied on modules, use "resolutions" to ensure only one version is installed. 96 97https://yarnpkg.com/en/docs/selective-version-resolutions 98 99Duplicate "graphql" modules cannot be used at the same time since different 100versions may have different capabilities and behavior. The data from one 101version used in the function from another could produce confusing and 102spurious results.`)}}return!1};class e_{constructor(e,t="GraphQL request",r={line:1,column:1}){"string"==typeof e||eS(!1,`Body must be a string. Received: ${function(e){return eC(e,[])}(e)}.`),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||eS(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||eS(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class eA{constructor(e,t={}){const{lexer:r,...i}=t;if(r)this._lexer=r;else{const t=!function(e){return eD(e,e_)}(e)?new e_(e):e;this._lexer=new ey(t)}this._options=i,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let e=this.expectToken(u.NAME);return this.node(e,{kind:l.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:l.DOCUMENT,definitions:this.many(u.SOF,this.parseDefinition,u.EOF)})}parseDefinition(){if(this.peek(u.BRACE_L))return this.parseOperationDefinition();let e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===u.BRACE_L)throw ea(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===u.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(e)throw ea(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if("extend"===t.value)return this.parseTypeSystemExtension()}throw this.unexpected(t)}parseOperationDefinition(){let e,t=this._lexer.token;if(this.peek(u.BRACE_L))return this.node(t,{kind:l.OPERATION_DEFINITION,operation:a.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let r=this.parseDescription(),i=this.parseOperationType();return this.peek(u.NAME)&&(e=this.parseName()),this.node(t,{kind:l.OPERATION_DEFINITION,operation:i,description:r,name:e,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let e=this.expectToken(u.NAME);switch(e.value){case"query":return a.QUERY;case"mutation":return a.MUTATION;case"subscription":return a.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(u.PAREN_L,this.parseVariableDefinition,u.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:l.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(u.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(u.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let e=this._lexer.token;return this.expectToken(u.DOLLAR),this.node(e,{kind:l.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:l.SELECTION_SET,selections:this.many(u.BRACE_L,this.parseSelection,u.BRACE_R)})}parseSelection(){return this.peek(u.SPREAD)?this.parseFragment():this.parseField()}parseField(){let e,t,r=this._lexer.token,i=this.parseName();return this.expectOptionalToken(u.COLON)?(e=i,t=this.parseName()):t=i,this.node(r,{kind:l.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(u.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){let t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(u.PAREN_L,t,u.PAREN_R)}parseArgument(e=!1){let t=this._lexer.token,r=this.parseName();return this.expectToken(u.COLON),this.node(t,{kind:l.ARGUMENT,name:r,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let e=this._lexer.token;this.expectToken(u.SPREAD);let t=this.expectOptionalKeyword("on");return!t&&this.peek(u.NAME)?this.node(e,{kind:l.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:l.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let e=this._lexer.token,t=this.parseDescription();return(this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables)?this.node(e,{kind:l.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:l.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){let t=this._lexer.token;switch(t.kind){case u.BRACKET_L:return this.parseList(e);case u.BRACE_L:return this.parseObject(e);case u.INT:return this.advanceLexer(),this.node(t,{kind:l.INT,value:t.value});case u.FLOAT:return this.advanceLexer(),this.node(t,{kind:l.FLOAT,value:t.value});case u.STRING:case u.BLOCK_STRING:return this.parseStringLiteral();case u.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:l.BOOLEAN,value:!0});case"false":return this.node(t,{kind:l.BOOLEAN,value:!1});case"null":return this.node(t,{kind:l.NULL});default:return this.node(t,{kind:l.ENUM,value:t.value})}case u.DOLLAR:if(e){if(this.expectToken(u.DOLLAR),this._lexer.token.kind===u.NAME){let e=this._lexer.token.value;throw ea(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:l.STRING,value:e.value,block:e.kind===u.BLOCK_STRING})}parseList(e){let t=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:l.LIST,values:this.any(u.BRACKET_L,t,u.BRACKET_R)})}parseObject(e){let t=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:l.OBJECT,fields:this.any(u.BRACE_L,t,u.BRACE_R)})}parseObjectField(e){let t=this._lexer.token,r=this.parseName();return this.expectToken(u.COLON),this.node(t,{kind:l.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e)})}parseDirectives(e){let t=[];for(;this.peek(u.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){let t=this._lexer.token;return this.expectToken(u.AT),this.node(t,{kind:l.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){let e,t=this._lexer.token;if(this.expectOptionalToken(u.BRACKET_L)){let r=this.parseTypeReference();this.expectToken(u.BRACKET_R),e=this.node(t,{kind:l.LIST_TYPE,type:r})}else e=this.parseNamedType();return this.expectOptionalToken(u.BANG)?this.node(t,{kind:l.NON_NULL_TYPE,type:e}):e}parseNamedType(){return this.node(this._lexer.token,{kind:l.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(u.STRING)||this.peek(u.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");let r=this.parseConstDirectives(),i=this.many(u.BRACE_L,this.parseOperationTypeDefinition,u.BRACE_R);return this.node(e,{kind:l.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:i})}parseOperationTypeDefinition(){let e=this._lexer.token,t=this.parseOperationType();this.expectToken(u.COLON);let r=this.parseNamedType();return this.node(e,{kind:l.OPERATION_TYPE_DEFINITION,operation:t,type:r})}parseScalarTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");let r=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:l.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:i})}parseObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");let r=this.parseName(),i=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:l.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:i,directives:n,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(u.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(u.BRACE_L,this.parseFieldDefinition,u.BRACE_R)}parseFieldDefinition(){let e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(u.COLON);let n=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:l.FIELD_DEFINITION,description:t,name:r,arguments:i,type:n,directives:s})}parseArgumentDefs(){return this.optionalMany(u.PAREN_L,this.parseInputValueDef,u.PAREN_R)}parseInputValueDef(){let e,t=this._lexer.token,r=this.parseDescription(),i=this.parseName();this.expectToken(u.COLON);let n=this.parseTypeReference();this.expectOptionalToken(u.EQUALS)&&(e=this.parseConstValueLiteral());let s=this.parseConstDirectives();return this.node(t,{kind:l.INPUT_VALUE_DEFINITION,description:r,name:i,type:n,defaultValue:e,directives:s})}parseInterfaceTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");let r=this.parseName(),i=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:l.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:i,directives:n,fields:s})}parseUnionTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");let r=this.parseName(),i=this.parseConstDirectives(),n=this.parseUnionMemberTypes();return this.node(e,{kind:l.UNION_TYPE_DEFINITION,description:t,name:r,directives:i,types:n})}parseUnionMemberTypes(){return this.expectOptionalToken(u.EQUALS)?this.delimitedMany(u.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");let r=this.parseName(),i=this.parseConstDirectives(),n=this.parseEnumValuesDefinition();return this.node(e,{kind:l.ENUM_TYPE_DEFINITION,description:t,name:r,directives:i,values:n})}parseEnumValuesDefinition(){return this.optionalMany(u.BRACE_L,this.parseEnumValueDefinition,u.BRACE_R)}parseEnumValueDefinition(){let e=this._lexer.token,t=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:l.ENUM_VALUE_DEFINITION,description:t,name:r,directives:i})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw ea(this._lexer.source,this._lexer.token.start,`${ew(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");let r=this.parseName(),i=this.parseConstDirectives(),n=this.parseInputFieldsDefinition();return this.node(e,{kind:l.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:i,fields:n})}parseInputFieldsDefinition(){return this.optionalMany(u.BRACE_L,this.parseInputValueDef,u.BRACE_R)}parseTypeSystemExtension(){let e=this._lexer.lookahead();if(e.kind===u.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension();case"directive":if(this._options.experimentalDirectivesOnDirectiveDefinitions)return this.parseDirectiveDefinitionExtension()}throw this.unexpected(e)}parseSchemaExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let t=this.parseConstDirectives(),r=this.optionalMany(u.BRACE_L,this.parseOperationTypeDefinition,u.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:l.SCHEMA_EXTENSION,directives:t,operationTypes:r})}parseScalarTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let t=this.parseName(),r=this.parseConstDirectives();if(0===r.length)throw this.unexpected();return this.node(e,{kind:l.SCALAR_TYPE_EXTENSION,name:t,directives:r})}parseObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let t=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),n=this.parseFieldsDefinition();if(0===r.length&&0===i.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:l.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:i,fields:n})}parseInterfaceTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let t=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),n=this.parseFieldsDefinition();if(0===r.length&&0===i.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:l.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:i,fields:n})}parseUnionTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let t=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:l.UNION_TYPE_EXTENSION,name:t,directives:r,types:i})}parseEnumTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let t=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:l.ENUM_TYPE_EXTENSION,name:t,directives:r,values:i})}parseInputObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let t=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:l.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:i})}parseDirectiveDefinitionExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(u.AT);let t=this.parseName(),r=this.parseConstDirectives();if(0===r.length)throw this.unexpected();return this.node(e,{kind:l.DIRECTIVE_EXTENSION,name:t,directives:r})}parseDirectiveDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(u.AT);let r=this.parseName(),i=this.parseArgumentDefs(),n=this._options.experimentalDirectivesOnDirectiveDefinitions?this.parseConstDirectives():[],s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return t
102his.node(e,{kind:l.DIRECTIVE_DEFINITION,description:t,name:r,arguments:i,directives:n,repeatable:s,locations:a})}parseDirectiveLocations(){return this.delimitedMany(u.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(o,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){let e,t,r=this._lexer.token,i=this.expectOptionalToken(u.AT),n=this.parseName();return(!i&&this.expectOptionalToken(u.DOT)&&(e=this.parseName()),(i||e)&&this.expectOptionalToken(u.PAREN_L)&&(t=this.parseName(),this.expectToken(u.COLON),this.expectToken(u.PAREN_R)),i)?t?this.node(r,{kind:l.DIRECTIVE_ARGUMENT_COORDINATE,name:n,argumentName:t}):this.node(r,{kind:l.DIRECTIVE_COORDINATE,name:n}):e?t?this.node(r,{kind:l.ARGUMENT_COORDINATE,name:n,fieldName:e,argumentName:t}):this.node(r,{kind:l.MEMBER_COORDINATE,name:n,memberName:e}):this.node(r,{kind:l.TYPE_COORDINATE,name:n})}node(e,t){return!0!==this._options.noLocation&&(t.loc=new eo(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){let t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw ea(this._lexer.source,t.start,`Expected ${ek(e)}, found ${ew(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){let t=this._lexer.token;if(t.kind===u.NAME&&t.value===e)this.advanceLexer();else throw ea(this._lexer.source,t.start,`Expected "${e}", found ${ew(t)}.`)}expectOptionalKeyword(e){let t=this._lexer.token;return t.kind===u.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){let t=null!=e?e:this._lexer.token;return ea(this._lexer.source,t.start,`Unexpected ${ew(t)}.`)}any(e,t,r){this.expectToken(e);let i=[];for(;!this.expectOptionalToken(r);)i.push(t.call(this));return i}optionalMany(e,t,r){if(this.expectOptionalToken(e)){let e=[];do e.push(t.call(this));while(!this.expectOptionalToken(r))return e}return[]}many(e,t,r){this.expectToken(e);let i=[];do i.push(t.call(this));while(!this.expectOptionalToken(r))return i}delimitedMany(e,t){this.expectOptionalToken(e);let r=[];do r.push(t.call(this));while(this.expectOptionalToken(e))return r}advanceLexer(){let{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==u.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw ea(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function ew(e){let t=e.value;return ek(e.kind)+(null!=t?` "${t}"`:"")}function ek(e){return e===u.BANG||e===u.DOLLAR||e===u.AMP||e===u.PAREN_L||e===u.PAREN_R||e===u.DOT||e===u.SPREAD||e===u.COLON||e===u.EQUALS||e===u.AT||e===u.BRACKET_L||e===u.BRACKET_R||e===u.BRACE_L||e===u.PIPE||e===u.BRACE_R?`"${e}"`:e}let eR=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function eP(e){return eL[e.charCodeAt(0)]}let eL=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],eF=Object.freeze({}),eM={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>ej(e.definitions,"\n\n")},OperationDefinition:{leave(e){let t=eq(e.variableDefinitions)?eU("(\n",ej(e.variableDefinitions,"\n"),"\n)"):eU("(",ej(e.variableDefinitions,", "),")"),r=eU("",e.description,"\n")+ej([e.operation,ej([e.name,t]),ej(e.directives," ")]," ");return("query"===r?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:i,description:n})=>eU("",n,"\n")+e+": "+t+eU(" = ",r)+eU(" ",ej(i," "))},SelectionSet:{leave:({selections:e})=>eB(e)},Field:{leave({alias:e,name:t,arguments:r,directives:i,selectionSet:n}){let s=eU("",e,": ")+t,a=s+eU("(",ej(r,", "),")");return a.length>80&&(a=s+eU("(\n",e$(ej(r,"\n")),"\n)")),ej([a,ej(i," "),n]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+eU(" ",ej(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>ej(["...",eU("on ",e),ej(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:i,selectionSet:n,description:s})=>eU("",s,"\n")+`fragment ${e}${eU("(",ej(r,", "),")")} `+`on ${t} ${eU("",ej(i," ")," ")}`+n},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e}
102,StringValue:{leave:({value:e,block:t})=>{let r,i,n,s,a,o,l,u,c,h,p;return t?(n=1===(i=(r=e.replace(/"""/g,'\\"""')).split(/\r\n|[\n\r]/g)).length,s=i.length>1&&i.slice(1).every(e=>0===e.length||ep(e.charCodeAt(0))),a=r.endsWith('\\"""'),o=e.endsWith('"')&&!a,l=e.endsWith("\\"),u=o||l,c=!n||e.length>70||u||s||a,h="",p=n&&ep(e.charCodeAt(0)),(c&&!p||s)&&(h+="\n"),h+=r,(c||u)&&(h+="\n"),'"""'+h+'"""'):`"${e.replace(eR,eP)}"`}},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+ej(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+ej(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+eU("(",ej(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:r})=>eU("",e,"\n")+ej(["schema",ej(t," "),eB(r)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:r})=>eU("",e,"\n")+ej(["scalar",t,ej(r," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:i,fields:n})=>eU("",e,"\n")+ej(["type",t,eU("implements ",ej(r," & ")),ej(i," "),eB(n)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:r,type:i,directives:n})=>eU("",e,"\n")+t+(eq(r)?eU("(\n",e$(ej(r,"\n")),"\n)"):eU("(",ej(r,", "),")"))+": "+i+eU(" ",ej(n," "))},InputValueDefinition:{leave:({description:e,name:t,type:r,defaultValue:i,directives:n})=>eU("",e,"\n")+ej([t+": "+r,eU("= ",i),ej(n," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:i,fields:n})=>eU("",e,"\n")+ej(["interface",t,eU("implements ",ej(r," & ")),ej(i," "),eB(n)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:r,types:i})=>eU("",e,"\n")+ej(["union",t,ej(r," "),eU("= ",ej(i," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:r,values:i})=>eU("",e,"\n")+ej(["enum",t,ej(r," "),eB(i)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:r})=>eU("",e,"\n")+ej([t,ej(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:r,fields:i})=>eU("",e,"\n")+ej(["input",t,ej(r," "),eB(i)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:r,directives:i,repeatable:n,locations:s})=>eU("",e,"\n")+"directive @"+t+(eq(r)?eU("(\n",e$(ej(r,"\n")),"\n)"):eU("(",ej(r,", "),")"))+eU(" ",ej(i," "))+(n?" repeatable":"")+" on "+ej(s," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>ej(["extend schema",ej(e," "),eB(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>ej(["extend scalar",e,ej(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:i})=>ej(["extend type",e,eU("implements ",ej(t," & ")),ej(r," "),eB(i)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:i})=>ej(["extend interface",e,eU("implements ",ej(t," & ")),ej(r," "),eB(i)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:r})=>ej(["extend union",e,ej(t," "),eU("= ",ej(r," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:r})=>ej(["extend enum",e,ej(t," "),eB(r)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:r})=>ej(["extend input",e,ej(t," "),eB(r)]," ")},DirectiveExtension:{leave:({name:e,directives:t})=>ej(["extend directive @"+e,ej(t," ")]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>ej([e,eU(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:r})=>ej([e,eU(".",t),eU("(",r,":)")])},DirectiveCoordinate:{leave:({name:e})=>ej(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>ej(["@",e,eU("(",t,":)")])}};function ej(e,t=""){var r;return null!=(r=null==e?void 0:e.filter(e=>e).join(t))?r:""}function eB(e){return eU("{\n",e$(ej(e,"\n")),"\n}")}function eU(e,t,r=""){return null!=t&&""!==t?e+t+r:""}function e$(e){return eU(" ",e.replace(/\n/g,"\n "))}function eq(e){var t;return null!=(t=null==e?void 0:e.some(e=>e.includes("\n")))&&t}let eV=e=>{let t,r=e.definitions.filter(e=>"OperationDefinition"===e.kind);return 1===r.length&&(t=r[0]?.name?.value),t},eG=e=>{if("string"==typeof e){let t;try{let r,i,n=(i=(r=new eA(e,void 0)).parseDocument(),Object.defineProperty(i,"tokenCount",{enumerable:!1,value:r.tokenCount}),i);t=eV(n)}catch(e){}return{query:e,operationName:t}}let t=eV(e);return{query:function(e,t,r=eu){let i,n,s,a=new Map;for(let e of Object.values(l))a.set(e,function(e,t){let r=e[t];return"object"==typeof r?r:"function"==typeof r?{enter:r,leave:void 0}:{enter:e.enter,leave:e.leave}}(t,e));let o=Array.isArray(e),u=[e],c=-1,h=[],p=e,d=[],f=[];do{var g,y,m;let e,l=++c===u.length,v=l&&0!==h.length;if(l){if(n=0===f.length?void 0:d[d.length-1],p=s,s=f.pop(),v)if(o){p=p.slice();let e=0;for(let[t,r]of h){let i=t-e;null===r?(p.splice(i,1),e++):p[i]=r}}else for(let[e,t]of(p={...p},h))p[e]=t;c=i.index,u=i.keys,h=i.edits,o=i.inArray,i=i.prev}else if(s){if(null==(p=s[n=o?c:u[c]]))continue;d.push(n)}if(!Array.isArray(p)){eh(p)||eS(!1,`Invalid AST Node: ${eC(p,[])}.`);let r=l?null==(g=a.get(p.kind))?void 0:g.leave:null==(y=a.get(p.kind))?void 0:y.enter;if((e=null==r?void 0:r.call(t,p,n,s,d,f))===eF)break;if(!1===e){if(!l){d.pop();continue}}else if(void 0!==e&&(h.push([n,e]),!l))if(eh(e))p=e;else{d.pop();continue}}void 0===e&&v&&h.push([n,p]),l?d.pop():(i={inArray:o,index:c,keys:u,edits:h,prev:i},u=(o=Array.isArray(p))?p:null!=(m=r[p.kind])?m:[],c=-1,h=[],s&&f.push(s),s=p)}while(void 0!==i)return 0!==h.length?h[h.length-1][1]:e}(e,eM),operationName:t}};
102class eQ extends Error{constructor(e,t){super(`${eQ.extractMessage(e)}: ${JSON.stringify({response:e,request:t})}`),Object.setPrototypeOf(this,eQ.prototype),this.response=e,this.request=t,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,eQ)}static extractMessage(e){return e.errors?.[0]?.message??`GraphQL Error (Code: ${e.status})`}}var ez=e.i(303424);let eK=e=>{let t={};if(e)if("u">typeof Headers&&e instanceof Headers||ez&&ez.Headers&&e instanceof ez.Headers){let r;r={},e.forEach((e,t)=>{r[t]=e}),t=r}else Array.isArray(e)?e.forEach(([e,r])=>{e&&void 0!==r&&(t[e]=r)}):t=e;return t},eH=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim();class eY{constructor(e,t={}){this.url=e,this.requestConfig=t,this.rawRequest=async(...e)=>{let[t,r,i]=e,n=t.query?t:{query:t,variables:r,requestHeaders:i,signal:void 0},{headers:s,fetch:a=ez.default,method:o="POST",requestMiddleware:l,responseMiddleware:u,...c}=this.requestConfig,{url:h}=this;void 0!==n.signal&&(c.signal=n.signal);let{operationName:p}=eG(n.query);return eJ({url:h,query:n.query,variables:n.variables,headers:{...eK(eZ(s)),...eK(n.requestHeaders)},operationName:p,fetch:a,method:o,fetchOptions:c,middleware:l}).then(e=>(u&&u(e),e)).catch(e=>{throw u&&u(e),e})}}async request(e,...t){let[r,i]=t,n=e.document?e:{document:e,variables:r,requestHeaders:i,signal:void 0},{headers:s,fetch:a=ez.default,method:o="POST",requestMiddleware:l,responseMiddleware:u,...c}=this.requestConfig,{url:h}=this;void 0!==n.signal&&(c.signal=n.signal);let{query:p,operationName:d}=eG(n.document);return eJ({url:h,query:p,variables:n.variables,headers:{...eK(eZ(s)),...eK(n.requestHeaders)},operationName:d,fetch:a,method:o,fetchOptions:c,middleware:l}).then(e=>(u&&u(e),e.data)).catch(e=>{throw u&&u(e),e})}batchRequests(e,t){let r=e.documents?e:{documents:e,requestHeaders:t,signal:void 0},{headers:i,...n}=this.requestConfig;void 0!==r.signal&&(n.signal=r.signal);let s=r.documents.map(({document:e})=>eG(e).query),a=r.documents.map(({variables:e})=>e);return eJ({url:this.url,query:s,variables:a,headers:{...eK(eZ(i)),...eK(r.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??ez.default,method:this.requestConfig.method||"POST",fetchOptions:n,middleware:this.requestConfig.requestMiddleware}).then(e=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(e),e.data)).catch(e=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(e),e})}setHeaders(e){return this.requestConfig.headers=e,this}setHeader(e,t){let{headers:r}=this.requestConfig;return r?r[e]=t:this.requestConfig.headers={[e]:t},this}setEndpoint(e){return this.url=e,this}}let eJ=async e=>{let t,{query:r,variables:i,fetchOptions:n}=e,s=(t=(e.method??"post").toUpperCase(),async e=>{let r,{url:i,query:n,variables:s,operationName:a,fetch:o,fetchOptions:l,middleware:u}=e,c={...e.headers},h="";"POST"===t?"string"==typeof(r=eX(n,s,a,l.jsonSerializer))&&(c["Content-Type"]="application/json"):h=(e=>{if(!Array.isArray(e.query)){let t=[`query=${encodeURIComponent(eH(e.query))}`];return e.variables&&t.push(`variables=${encodeURIComponent(e.jsonSerializer.stringify(e.variables))}`),e.operationName&&t.push(`operationName=${encodeURIComponent(e.operationName)}`),t.join("&")}if(void 0!==e.variables&&!Array.isArray(e.variables))throw Error("Cannot create query with given variable type, array expected");let t=e.query.reduce((t,r,i)=>(t.push({query:eH(r),variables:e.variables?e.jsonSerializer.stringify(e.variables[i]):void 0}),t),[]);return`query=${encodeURIComponent(e.jsonSerializer.stringify(t))}`})({query:n,variables:s,operationName:a,jsonSerializer:l.jsonSerializer??Z});let p={method:t,headers:c,body:r,...l},d=i,f=p;if(u){let{url:e,...t}=await Promise.resolve(u({...p,url:i,operationName:a,variables:s}));d=e,f=t}return h&&(d=`${d}?${h}`),await o(d,f)}),a=Array.isArray(e.query),o=await s(e),l=await eW(o,n.jsonSerializer??Z),u=Array.isArray(l)?!l.some(({data:e})=>!e):!!l.data,c=Array.isArray(l)||!l.errors||Array.isArray(l.errors)&&!l.errors.length||"all"===n.errorPolicy||"ignore"===n.errorPolicy;if(o.ok&&c&&u){let{errors:e,...t}=(Array.isArray(l),l),r="ignore"===n.errorPolicy?t:l;return{...a?{data:r}:r,headers:o.headers,status:o.status}}throw new eQ({..."string"==typeof l?{error:l}:l,status:o.status,headers:o.headers},{query:r,variables:i})},eX=(e,t,r,i)=>{let n=i??Z;if(!Array.isArray(e))return n.stringify({query:e,variables:t,operationName:r});if(void 0!==t&&!Array.isArray(t))throw Error("Cannot create request body with given variable type, array expected");let s=e.reduce((e,r,i)=>(e.push({query:r,variables:t?t[i]:void 0}),e),[]);return n.stringify(s)},eW=async(e,t)=>{let r;
102return(e.headers.forEach((e,t)=>{"content-type"===t.toLowerCase()&&(r=e)}),r&&(r.toLowerCase().startsWith("application/json")||r.toLowerCase().startsWith("application/graphql+json")||r.toLowerCase().startsWith("application/graphql-response+json")))?t.parse(await e.text()):e.text()},eZ=e=>"function"==typeof e?e():e;var e0=e.i(736),e1=e.i(703510),e2=e.i(778571),e5=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);n<i.length;n++)0>t.indexOf(i[n])&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]]);return r};class e3{constructor(e,t={}){var r;this.endpoint=e,this.headers={},t.apiKey&&(this.headers.sc_apikey=t.apiKey),t.headers&&(this.headers=Object.assign(Object.assign({},this.headers),t.headers)),t.contextId&&(this.headers["x-sitecore-contextid"]=t.contextId);let i=!1;try{i=!!new URL(e).hostname}catch(e){}if(!e||!i)throw Error(`Invalid GraphQL endpoint '${e}'. Verify that appropriate environment variable is set`);this.timeout=t.timeout,this.retries=null!=(r=t.retries)?r:3,this.retryStrategy=t.retryStrategy||new e2.DefaultRetryStrategy({statusCodes:[429,502,503,504,520,521,522,523,524]}),this.client=new eY(e,{headers:this.headers,fetch:t.fetch}),this.debug=t.debugger||e0.default.http}static createClientFactory(e){var{endpoint:t}=e,r=e5(e,["endpoint"]);return (e={})=>new e3(t,Object.assign(Object.assign({},r),e))}async request(e,t,r){let i=1,n=async()=>{let s=(null==r?void 0:r.retries)||this.retries,a=(null==r?void 0:r.retryStrategy)||this.retryStrategy,o=(null==r?void 0:r.debugger)||this.debug;o("request: %o",{url:this.endpoint,headers:Object.assign(Object.assign({},this.headers),null==r?void 0:r.headers),query:e,variables:t,timeout:this.timeout});let l=Object.assign(Object.assign({},this.headers),null==r?void 0:r.headers),u=performance.now(),c=[this.client.request(e,t,l)];return this.timeout&&(this.abortTimeout=new e1.default(this.timeout),c.push(this.abortTimeout.start)),Promise.race(c).then(e=>{var t;return null==(t=this.abortTimeout)||t.clear(),this.debug("response in %dms: %o",performance.now()-u,e),Promise.resolve(e)},async e=>{var t,r;null==(t=this.abortTimeout)||t.clear(),o("response error: %o",e.response||e.message||e);let l=(null==(r=e.response)?void 0:r.status)||e.code;if(!a.shouldRetry(e,i,s))return Promise.reject(e);{let t=a.getDelay(e,i);return o("Error: %s. Retrying in %dms (attempt %d).",l,t,i),i++,new Promise(e=>setTimeout(e,t)).then(n)}})};return n()}}var e4=e.i(971277);let{ERROR_MESSAGES:e6}=d.constants,e8=` 103 query RobotsQuery($siteName: String!) { 104 site { 105 siteInfo(site: $siteName) { 106 robots 107 } 108 } 109 } 110`;class e9{constructor(e){this.options=e,this.graphQLClient=this.getGraphQLClient()}get query(){return e8}async fetchRobots(e){let t=this.options.siteName;if(!t)throw Error(e6.MV_002);let r=this.graphQLClient.request(this.query,{siteName:t},e);try{return r.then(e=>{var t,r;return null==(r=null==(t=null==e?void 0:e.site)?void 0:t.siteInfo)?void 0:r.robots})}catch(e){return Promise.reject(e)}}getGraphQLClient(){if(!this.options.clientFactory)throw Error("clientFactory needs to be provided when initializing GraphQL client.");return this.options.clientFactory({debugger:v.default.robots})}}var e7=e.i(694532),te=e.i(845788),tt=e.i(141411);let{ERROR_MESSAGES:tr}=d.constants;(s=c||(c={})).NotFound="404",s.InternalServerError="500";class ti{constructor(e){var t,r,i,n,s,a,o,l,u,c;this.initOptions=e,this.clientFactory=this.getClientFactory(),this.graphQLClient=this.clientFactory({debugger:p.debug.http});const h=this.getBaseServiceOptions();this.layoutService=null!=(r=null==(t=e.custom)?void 0:t.layoutService)?r:this.getLayoutService(h),this.dictionaryService=null!=(n=null==(i=e.custom)?void 0:i.dictionaryService)?n:this.getDictionaryService(h),this.editingService=null!=(a=null==(s=e.custom)?void 0:s.editingService)?a:this.getEditingService(),this.errorPagesService=null!=(l=null==(o=e.custom)?void 0:o.errorPagesService)?l:this.getErrorPagesService(),this.sitePathService=null!=(c=null==(u=e.custom)?void 0:u.sitePathService)?c:this.getSitePathService(),this.componentService=this.getComponentService()}parsePath(e){return"string"==typeof e?e.startsWith("/")?e:`/${e}`:`/${e.filter(e=>"/"!==e).map(e=>e.replace(/^\/+/,"").replace(/\/+$/,"")).join("/")}`}getData(e,t,r){return this.graphQLClient.request(e,t,r)}async getPage(e,t,r){var i,n,s,a;let o=this.parsePath(e),l=null!=(i=null==t?void 0:t.locale)?i:this.initOptions.defaultLanguage,u=null!=(n=null==t?void 0:t.site)?n:this.initOptions.defaultSite,c=await this.layoutService.fetchLayoutData(o,{locale:l,site:u},r);return c.sitecore.route?((null==(s=null==t?void 0:t.personalize)?void 0:s.variantId)&&function(e,t,r){var i;e.sitecore.context.variantId=t;let n=(null==(i=e.sitecore.route)?void 0:i.placeholders)||{};if(0===Object.keys(n).length)return;let s=e.sitecore.context.pageEditing;
110Object.keys(n).forEach(e=>{n[e]=function e(t,r,i){return t.map(t=>{if(void 0!==t.experiences){var n=t,s=r,a=i;let o=Object.keys(n.experiences).find(e=>s.includes(e)),l=o&&n.experiences[o];if(l||n.componentName)if(l&&null===l.componentName&&null===l.dataSource)if(!a)return null;else n=U(n);else l&&(n=l);else{if(!a)return null;n=U(n)}return n.experiences&&(n.experiences={}),n.placeholders&&Object.keys(null==n?void 0:n.placeholders).forEach(t=>{n.placeholders&&(n.placeholders[t]=e(n.placeholders[t],s,a))}),n}if(t.placeholders){let n=t.placeholders;Object.keys(n).forEach(t=>{n[t]=e(n[t],r,i)})}return t}).filter(Boolean)}(n[e],[t,...r||[]],s)})}(c,t.personalize.variantId,t.personalize.componentVariantIds),{layout:c=this.applyContentRewrite(c),siteName:(null==(a=c.sitecore.context.site)?void 0:a.name)||u,locale:l,mode:this.getPageMode(R.LayoutServicePageState.Normal)}):null}getHeadLinks(e,t={}){let{enableStyles:r=!0,enableThemes:i=!0}=t,{contextId:n,clientContextId:s}=this.initOptions.api.edge,a=[],o=n||s,l=(0,f.resolveEdgeUrlForStaticFiles)();if(r){let t=((e,t,r=C.constants.SITECORE_EDGE_PLATFORM_URL_DEFAULT)=>{if(!e.sitecore.route)return null;let i={loadStyles:!1};return(A(e.sitecore.route,i),i.loadStyles)?{href:((e,t=C.constants.SITECORE_EDGE_PLATFORM_URL_DEFAULT)=>`${(0,N.normalizeUrl)(t)}/v1/files/pages/styles/content-styles.css?sitecoreContextId=${e}`)(t,r),rel:"stylesheet"}:null})(e,o,l);t&&a.push(t)}return i&&a.push(...function(e,t,r=O.constants.SITECORE_EDGE_PLATFORM_URL_DEFAULT){let i=new Set;return e.sitecore.route?(S(e.sitecore.route,i),[...i].map(e=>({href:((e,t,r=O.constants.SITECORE_EDGE_PLATFORM_URL_DEFAULT)=>`${(0,N.normalizeUrl)(r)}/v1/files/components/styles/${e}.css?sitecoreContextId=${t}`)(e,t,r),rel:"stylesheet"}))):[]}(e,o,l)),a}async getDictionary(e,t){let r=(null==e?void 0:e.locale)||this.initOptions.defaultLanguage,i=(null==e?void 0:e.site)||this.initOptions.defaultSite;return await this.dictionaryService.fetchDictionaryData(r,i,t)}async getErrorPages(e,t){let r=(null==e?void 0:e.locale)||this.initOptions.defaultLanguage,i=(null==e?void 0:e.site)||this.initOptions.defaultSite;return await this.errorPagesService.fetchErrorPages(i,r,t)}async getPreview(e,t){var r;if(!e)return console.error("Preview data missing"),null;let{site:i,itemId:n,language:s,version:a,layoutKind:o,mode:l,variantId:u,previewTime:c}=e,h=await this.editingService.fetchEditingData({itemId:n,language:s,version:a,layoutKind:o,mode:l,site:i,variantId:u,previewTime:c},t);if(!h)throw Error(`Unable to fetch editing data for preview ${JSON.stringify(e)}. ${tr.CONTACT_SUPPORT}`);if(!h.layoutData.sitecore.route)return null;let p=h.layoutData;return{locale:s,layout:p=this.applyContentRewrite(p),siteName:(null==(r=p.sitecore.context.site)?void 0:r.name)||i,mode:this.getPageMode(l)}}async getDesignLibraryData(e,t){var r;let{itemId:i,componentUid:n,site:s,language:a,renderingId:o,dataSourceId:l,version:u,mode:c,generation:h}=e,p=await this.componentService.fetchComponentData(Object.assign({siteName:s,itemId:i,language:a,componentUid:n,renderingId:o,dataSourceId:l,version:u,mode:c},h?{generation:h}:{}),t);if(!p)throw Error(`Unable to fetch editing data for preview ${JSON.stringify(e)}. ${tr.CONTACT_SUPPORT}`);let d=this.applyContentRewrite(p);return{locale:e.language,layout:d,siteName:(null==(r=d.sitecore.context.site)?void 0:r.name)||s,mode:this.getPageMode(c,h)}}async getErrorPage(e,t,r){var i,n;let s=(null==t?void 0:t.locale)||this.initOptions.defaultLanguage,a=(null==t?void 0:t.site)||this.initOptions.defaultSite,o=await this.getErrorPages({site:a,locale:s},r),l=null;switch(e){case c.NotFound:l=(null==(i=null==o?void 0:o.notFoundPage)?void 0:i.rendered)||null;break;case c.InternalServerError:l=(null==(n=null==o?void 0:o.serverErrorPage)?void 0:n.rendered)||null;break;default:return null}return l?{layout:l=this.applyContentRewrite(l),locale:s,mode:this.getPageMode(R.LayoutServicePageState.Normal),siteName:a}:null}async getPagePaths(e,t,r){return this.sitePathService.fetchSiteRoutes(e,t||[],r)}async getSiteMap(e,t){let{reqHost:r,reqProtocol:i,id:n,siteName:s}=e,a=this.getGraphqlSitemapXMLService(s||this.initOptions.defaultSite),o=await a.getSitemap(n);if(o)try{let e=(0,f.resolveExperienceEdgeUrl)(),t=M(o,e),r=new h.NativeDataFetcher,i=await r.fetch(t);if(!i.data)throw Error("REDIRECT_404");return M(i.data,e)}catch(e){throw Error("REDIRECT_404")}let l=await a.fetchSitemaps(t);
110if(!l.length)throw Error("REDIRECT_404");return`<?xml version="1.0" encoding="UTF-8"?> 111 <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> 112 ${l.map(e=>{let t=e.split("/"),n=t[t.length-1],s=`${i}://${r}/${n}`.replace(/&/g,"&");return`<sitemap><loc>${s}</loc></sitemap>`}).join("")} 113 </sitemapindex>`}async getRobots(e,t){let r=this.getRobotsService(e||this.initOptions.defaultSite);return await r.fetchRobots(t)||null}getGraphqlSitemapXMLService(e){return new W({clientFactory:this.clientFactory,siteName:e})}getRobotsService(e){return new e9({clientFactory:this.clientFactory,siteName:e})}getBaseServiceOptions(){return{defaultSite:this.initOptions.defaultSite,clientFactory:this.clientFactory,retries:this.initOptions.retries}}applyContentRewrite(e){let t,r=this.initOptions.rewriteMediaUrls;if(!r)return e;let i=(0,f.resolveExperienceEdgeUrl)();return function e(t,r){if(null==t)return t;if("string"==typeof t)return r(t);if(Array.isArray(t))return t.map(t=>e(t,r));if("object"==typeof t&&Object.getPrototypeOf(t)===Object.prototype){let i={};for(let n of Object.keys(t))i[n]=e(t[n],r);return i}return t}(e,!0===r?L(t=(0,N.normalizeUrl)(i))?e=>j(e,t):e=>e:r)}getPageMode(e,t){let r={name:e,isNormal:!1,isPreview:!1,isEditing:!1,isDesignLibrary:!1,designLibrary:{isVariantGeneration:!1}};switch(e){case R.LayoutServicePageState.Normal:r.isNormal=!0;break;case R.LayoutServicePageState.Preview:r.isPreview=!0;break;case R.LayoutServicePageState.Edit:r.isEditing=!0;break;case e7.DesignLibraryMode.Normal:r.isDesignLibrary=!0;break;case e7.DesignLibraryMode.Metadata:r.isDesignLibrary=!0,r.isEditing=!0}return r.isDesignLibrary&&t===e7.DesignLibraryVariantGeneration.Variant&&(r.designLibrary.isVariantGeneration=!0,r.isEditing=!0),r}getClientFactory(){return(e=>{let t,{api:r}=e,{edge:i,local:n}=null!=r?r:{},s="u">typeof window;if(null==i?void 0:i.contextId)t={endpoint:(0,e4.getEdgeProxyContentUrl)(i.edgeUrl),contextId:i.contextId};else if(s&&(null==i?void 0:i.clientContextId))t={endpoint:(0,e4.getEdgeProxyContentUrl)(i.edgeUrl),contextId:i.clientContextId};else if((null==n?void 0:n.apiKey)&&(null==n?void 0:n.apiHost))t={endpoint:`${n.apiHost}${n.path}`,apiKey:n.apiKey};else if(s)console.warn("GraphQL client initialised in the browser without Edge or local API configuration; client-side requests may fail."),t={endpoint:"/api/graphql"};else throw Error(`GraphQL client misconfigured. 114 Configure one of the following in sitecore.config or your .env file: 115 Edge mode: set both sitecore.edge.contextId (server-side) and sitecore.edge.clientContextId (browser). 116 Local API mode: set api.local.apiHost and api.local.apiKey. 117 Supplying only api.edge.clientContextId will cause the application to fail at runtime.`);return e3.createClientFactory(Object.assign(Object.assign({},t),e))})({api:this.initOptions.api,retries:this.initOptions.retries.count,retryStrategy:this.initOptions.retries.retryStrategy})}getLayoutService(e){return new k(Object.assign(Object.assign({},e),{formatLayoutQuery:this.initOptions.layout.formatLayoutQuery}))}getDictionaryService(e){return new T(Object.assign(Object.assign({},e),{cacheEnabled:this.initOptions.dictionary.caching.enabled,cacheTimeout:this.initOptions.dictionary.caching.timeout}))}getEditingService(){return new te.EditingService({clientFactory:this.clientFactory})}getErrorPagesService(){return new V(Object.assign(Object.assign({},this.initOptions),{language:this.initOptions.defaultLanguage,clientFactory:this.clientFactory}))}getComponentService(){return new tt.ComponentLayoutService(this.initOptions.api.edge)}getSitePathService(){return new H({clientFactory:this.clientFactory})}}var tn=e.i(771786);class ts{async fetchComponentProps(e){var t;let{layoutData:r,context:i,components:n}=e,s=await this.collectRequests({placeholders:null==(t=r.sitecore.route)?void 0:t.placeholders,components:n,layoutData:r,context:i});return await this.execRequests(s)}async collectRequests(e){let{placeholders:t={},components:r,layoutData:i,context:n}=e;e.requests||(e.requests=[]);let s=this.flatRenderings(t).map(async t=>{var s;let a=null==(s=await this.getModule(r,t.componentName))?void 0:s.getComponentServerProps;a&&e.requests&&e.requests.push({fetch:a,rendering:t,layoutData:i,context:n}),t.placeholders&&await this.collectRequests(Object.assign(Object.assign({},e),{placeholders:t.placeholders}))});return await Promise.all(s),e.requests}async execRequests(e){let t={},r=e.map(e=>{let{uid:r}=e.rendering;return r?e.fetch(e.rendering,e.layoutData,e.context).then(e=>{t[r]=e}).catch(i=>{let n=`Error during preload data for component ${e.rendering.componentName} (${r}): ${i.message||i}`;console.error(tn.default.red(n)),t[r]={error:i.message||n,componentName:e.rendering.componentName}}):void console.log(`Component ${e.rendering.componentName} doesn't have uid, can't store data for this component`)});return await Promise.all(r),t}flatRenderings(e){let t=[];
117return Object.values(e).forEach(e=>{t.push(...e)}),t}async getModule(e,t){var r;let i=e.get(t);return i?i.dynamicModule?await (null==(r=null==i?void 0:i.dynamicModule)?void 0:r.call(i)):i:null}}var ta=e.i(919373);let to=new class extends ti{constructor(e){super(e),this.initOptions=e,this.componentPropsService=this.getComponentPropsService()}getSiteNameFromPath(e){var t;let r,i;return(t=super.parsePath(e),r={siteName:this.initOptions.defaultSite},(i=(t.endsWith("/")?t:t+"/").match(`${Q}(.*?)\\/`))&&""!==i[1]&&(r.siteName=i[1]),r).siteName}parsePath(e){let t=super.parsePath(e);return z((0,G.normalizePersonalizedRewrite)(t))}async getPage(e,t,r){let i=this.parsePath(e),n=t.personalize||(0,G.getPersonalizedRewriteData)(super.parsePath(e)),s=t.site||this.getSiteNameFromPath(e);return await super.getPage(i,{locale:t.locale,site:s,personalize:n},r)}async getDesignLibraryData(e,t){return super.getDesignLibraryData(e,t)}async getPreview(e,t){return super.getPreview(e,t)}async getAppRouterStaticParams(e,t,r){let i=await super.getPagePaths(e,t,r),n=[];return i.map(e=>{var t;let r=z(e.params.path.join("/")).split("/");n.push({locale:null!=(t=e.locale)?t:this.initOptions.defaultLanguage,site:this.getSiteNameFromPath(e.params.path),path:r})}),n}async getPagePaths(e,t,r){var i;let n=await super.getPagePaths(e,t,r);return(null==(i=this.initOptions.multisite)?void 0:i.enabled)||n.map(e=>{e.params.path=z(e.params.path.join("/")).split("/")}),n}async getComponentData(e,t,r){let i={};if(!e.sitecore.route)return i;let n=Object.keys(i=await this.componentPropsService.fetchComponentProps({layoutData:e,context:t,components:r})).map(e=>{let t=i[e];return t.error?` 118Unable to get component props for ${t.componentName} (${e}): ${t.error}`:""}).join("");if(n.length)throw Error(n);return i}getPreviewData(e){var t;let r=null!=(t=e.get("x-sitecore-editing-params"))?t:"";if(!r)return{};try{return JSON.parse(r)}catch(e){return{}}}getComponentPropsService(){return new ts}}({...ta.default});e.s(["default",0,to],904322)}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.