@amp-labs/react 2.11.1 → 2.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/amp-react.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
component is wrapped with AmpersandProvider`);return e}const Xw=new Ow({defaultOptions:{queries:{retry:(e,t)=>{if(t instanceof ea){const n=t.response.status;if(n>=400&&n<500)return!1}return e<3}}}});function Yw(e){const{options:{apiKey:t,projectId:n,project:r,getToken:i},children:o}=e,s=r||n;if(n&&r)throw new Error("Use AmpersandProvider either with projectId or project but not both.");if(!s)throw new Error("Cannot use AmpersandProvider without a projectId or name.");if(!t&&!i)throw new Error("Cannot use AmpersandProvider without an apiKey or getToken.");if(t&&i)throw new Error("Cannot use AmpersandProvider with both apiKey and getToken.");const a={options:e.options,projectIdOrName:s};return p.jsx(Ew,{client:Xw,children:p.jsx(oa.Provider,{value:a,children:p.jsx(Vw,{children:p.jsx(Qw,{getTokenCallback:i||null,children:p.jsx(Lw,{value:t||null,children:o})})})})})}var od=Symbol.for("immer-nothing"),ql=Symbol.for("immer-draftable"),jt=Symbol.for("immer-state"),Zw=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Nt(e,...t){if(process.env.NODE_ENV!=="production"){const n=Zw[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ti=Object.getPrototypeOf;function yr(e){return!!e&&!!e[jt]}function Gn(e){return e?sd(e)||Array.isArray(e)||!!e[ql]||!!e.constructor?.[ql]||ci(e)||go(e):!1}var ex=Object.prototype.constructor.toString(),$l=new WeakMap;function sd(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=$l.get(n);return r===void 0&&(r=Function.toString.call(n),$l.set(n,r)),r===ex}function Zi(e,t,n=!0){mo(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function mo(e){const t=e[jt];return t?t.type_:Array.isArray(e)?1:ci(e)?2:go(e)?3:0}function Os(e,t){return mo(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ad(e,t,n){const r=mo(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function tx(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ci(e){return e instanceof Map}function go(e){return e instanceof Set}function zn(e){return e.copy_||e.base_}function Es(e,t){if(ci(e))return new Map(e);if(go(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=sd(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[jt];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const s=i[o],a=r[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(ti(e),r)}else{const r=ti(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function sa(e,t=!1){return yo(e)||yr(e)||!Gn(e)||(mo(e)>1&&Object.defineProperties(e,{set:Ai,add:Ai,clear:Ai,delete:Ai}),Object.freeze(e),t&&Object.values(e).forEach(n=>sa(n,!0))),e}function nx(){Nt(2)}var Ai={value:nx};function yo(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var rx={};function Xn(e){const t=rx[e];return t||Nt(0,e),t}var ni;function ld(){return ni}function ix(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function zl(e,t){t&&(Xn("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function _s(e){Ns(e),e.drafts_.forEach(ox),e.drafts_=null}function Ns(e){e===ni&&(ni=e.parent_)}function Kl(e){return ni=ix(ni,e)}function ox(e){const t=e[jt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Hl(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[jt].modified_&&(_s(t),Nt(4)),Gn(e)&&(e=eo(t,e),t.parent_||to(t,e)),t.patches_&&Xn("Patches").generateReplacementPatches_(n[jt].base_,e,t.patches_,t.inversePatches_)):e=eo(t,n,[]),_s(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==od?e:void 0}function eo(e,t,n){if(yo(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[jt];if(!i)return Zi(t,(o,s)=>Jl(e,i,t,o,s,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return to(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const o=i.copy_;let s=o,a=!1;i.type_===3&&(s=new Set(o),o.clear(),a=!0),Zi(s,(l,c)=>Jl(e,i,o,l,c,n,a),r),to(e,o,!1),n&&e.patches_&&Xn("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function Jl(e,t,n,r,i,o,s){if(i==null||typeof i!="object"&&!s)return;const a=yo(i);if(!(a&&!s)){if(process.env.NODE_ENV!=="production"&&i===n&&Nt(5),yr(i)){const l=o&&t&&t.type_!==3&&!Os(t.assigned_,r)?o.concat(r):void 0,c=eo(e,i,l);if(ad(n,r,c),yr(c))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(Gn(i)&&!a){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&a)return;eo(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(ci(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&to(e,i)}}}function to(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&sa(t,n)}function sx(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:ld(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=aa;n&&(i=[r],o=ri);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var aa={get(e,t){if(t===jt)return e;const n=zn(e);if(!Os(n,t))return ax(e,n,t);const r=n[t];return e.finalized_||!Gn(r)?r:r===Bo(e.base_,t)?(Vo(e),e.copy_[t]=ks(r,e)):r},has(e,t){return t in zn(e)},ownKeys(e){return Reflect.ownKeys(zn(e))},set(e,t,n){const r=cd(zn(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Bo(zn(e),t),o=i?.[jt];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(tx(n,i)&&(n!==void 0||Os(e.base_,t)))return!0;Vo(e),Ts(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Bo(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Vo(e),Ts(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=zn(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Nt(11)},getPrototypeOf(e){return ti(e.base_)},setPrototypeOf(){Nt(12)}},ri={};Zi(aa,(e,t)=>{ri[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ri.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Nt(13),ri.set.call(this,e,t,void 0)};ri.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Nt(14),aa.set.call(this,e[0],t,n,e[0])};function Bo(e,t){const n=e[jt];return(n?zn(n):e)[t]}function ax(e,t,n){const r=cd(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function cd(e,t){if(!(t in e))return;let n=ti(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=ti(n)}}function Ts(e){e.modified_||(e.modified_=!0,e.parent_&&Ts(e.parent_))}function Vo(e){e.copy_||(e.copy_=Es(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var lx=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&Nt(6),r!==void 0&&typeof r!="function"&&Nt(7);let i;if(Gn(t)){const o=Kl(this),s=ks(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?_s(o):Ns(o)}return zl(o,r),Hl(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===od&&(i=void 0),this.autoFreeze_&&sa(i,!0),r){const o=[],s=[];Xn("Patches").generateReplacementPatches_(t,i,o,s),r(o,s)}return i}else Nt(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,i;return[this.produce(t,n,(s,a)=>{r=s,i=a}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Gn(e)||Nt(8),yr(e)&&(e=cx(e));const t=Kl(this),n=ks(e,void 0);return n[jt].isManual_=!0,Ns(t),n}finishDraft(e,t){const n=e&&e[jt];(!n||!n.isManual_)&&Nt(9);const{scope_:r}=n;return zl(r,t),Hl(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Xn("Patches").applyPatches_;return yr(e)?r(e,t):this.produce(e,i=>r(i,t))}};function ks(e,t){const n=ci(e)?Xn("MapSet").proxyMap_(e,t):go(e)?Xn("MapSet").proxySet_(e,t):sx(e,t);return(t?t.scope_:ld()).drafts_.push(n),n}function cx(e){return yr(e)||Nt(10,e),ud(e)}function ud(e){if(!Gn(e)||yo(e))return e;const t=e[jt];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Es(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Es(e,!0);return Zi(n,(i,o)=>{ad(n,i,ud(o))},r),t&&(t.finalized_=!1),n}var ux=new lx,St=ux.produce,kn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hr={exports:{}};Hr.exports;var Wl;function dx(){return Wl||(Wl=1,(function(e,t){var n=200,r="__lodash_hash_undefined__",i=1,o=2,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",h="[object Error]",f="[object Function]",y="[object GeneratorFunction]",v="[object Map]",g="[object Number]",w="[object Null]",m="[object Object]",b="[object Promise]",C="[object Proxy]",E="[object RegExp]",_="[object Set]",A="[object String]",k="[object Symbol]",L="[object Undefined]",M="[object WeakMap]",F="[object ArrayBuffer]",j="[object DataView]",G="[object Float32Array]",P="[object Float64Array]",V="[object Int8Array]",Y="[object Int16Array]",le="[object Int32Array]",pe="[object Uint8Array]",ge="[object Uint8ClampedArray]",x="[object Uint16Array]",J="[object Uint32Array]",B=/[\\^$.*+?()[\]{}|]/g,S=/^\[object .+?Constructor\]$/,$=/^(?:0|[1-9]\d*)$/,q={};q[G]=q[P]=q[V]=q[Y]=q[le]=q[pe]=q[ge]=q[x]=q[J]=!0,q[a]=q[l]=q[F]=q[u]=q[j]=q[d]=q[h]=q[f]=q[v]=q[g]=q[m]=q[E]=q[_]=q[A]=q[M]=!1;var X=typeof kn=="object"&&kn&&kn.Object===Object&&kn,ie=typeof self=="object"&&self&&self.Object===Object&&self,ne=X||ie||Function("return this")(),se=t&&!t.nodeType&&t,ee=se&&!0&&e&&!e.nodeType&&e,me=ee&&ee.exports===se,U=me&&X.process,ye=(function(){try{return U&&U.binding&&U.binding("util")}catch{}})(),Z=ye&&ye.isTypedArray;function Be(O,T){for(var z=-1,oe=O==null?0:O.length,Ve=0,ve=[];++z<oe;){var He=O[z];T(He,z,O)&&(ve[Ve++]=He)}return ve}function Fe(O,T){for(var z=-1,oe=T.length,Ve=O.length;++z<oe;)O[Ve+z]=T[z];return O}function Ae(O,T){for(var z=-1,oe=O==null?0:O.length;++z<oe;)if(T(O[z],z,O))return!0;return!1}function We(O,T){for(var z=-1,oe=Array(O);++z<O;)oe[z]=T(z);return oe}function et(O){return function(T){return O(T)}}function tt(O,T){return O.has(T)}function xe(O,T){return O?.[T]}function ot(O){var T=-1,z=Array(O.size);return O.forEach(function(oe,Ve){z[++T]=[Ve,oe]}),z}function bt(O,T){return function(z){return O(T(z))}}function at(O){var T=-1,z=Array(O.size);return O.forEach(function(oe){z[++T]=oe}),z}var Ge=Array.prototype,D=Function.prototype,K=Object.prototype,R=ne["__core-js_shared__"],re=D.toString,ce=K.hasOwnProperty,qe=(function(){var O=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||"");return O?"Symbol(src)_1."+O:""})(),wt=K.toString,lt=RegExp("^"+re.call(ce).replace(B,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ft=me?ne.Buffer:void 0,Pe=ne.Symbol,Oe=ne.Uint8Array,xt=K.propertyIsEnumerable,ct=Ge.splice,Ot=Pe?Pe.toStringTag:void 0,In=Object.getOwnPropertySymbols,Sn=ft?ft.isBuffer:void 0,Cn=bt(Object.keys,Object),nn=ar(ne,"DataView"),Qt=ar(ne,"Map"),On=ar(ne,"Promise"),$e=ar(ne,"Set"),nt=ar(ne,"WeakMap"),de=ar(Object,"create"),Se=Vn(nn),It=Vn(Qt),hn=Vn(On),te=Vn($e),fe=Vn(nt),ue=Pe?Pe.prototype:void 0,Ce=ue?ue.valueOf:void 0;function De(O){var T=-1,z=O==null?0:O.length;for(this.clear();++T<z;){var oe=O[T];this.set(oe[0],oe[1])}}function Vt(){this.__data__=de?de(null):{},this.size=0}function Ut(O){var T=this.has(O)&&delete this.__data__[O];return this.size-=T?1:0,T}function ut(O){var T=this.__data__;if(de){var z=T[O];return z===r?void 0:z}return ce.call(T,O)?T[O]:void 0}function Et(O){var T=this.__data__;return de?T[O]!==void 0:ce.call(T,O)}function Me(O,T){var z=this.__data__;return this.size+=this.has(O)?0:1,z[O]=de&&T===void 0?r:T,this}De.prototype.clear=Vt,De.prototype.delete=Ut,De.prototype.get=ut,De.prototype.has=Et,De.prototype.set=Me;function pt(O){var T=-1,z=O==null?0:O.length;for(this.clear();++T<z;){var oe=O[T];this.set(oe[0],oe[1])}}function Fo(){this.__data__=[],this.size=0}function Po(O){var T=this.__data__,z=Ci(T,O);if(z<0)return!1;var oe=T.length-1;return z==oe?T.pop():ct.call(T,z,1),--this.size,!0}function wi(O){var T=this.__data__,z=Ci(T,O);return z<0?void 0:T[z][1]}function xi(O){return Ci(this.__data__,O)>-1}function Ii(O,T){var z=this.__data__,oe=Ci(z,O);return oe<0?(++this.size,z.push([O,T])):z[oe][1]=T,this}pt.prototype.clear=Fo,pt.prototype.delete=Po,pt.prototype.get=wi,pt.prototype.has=xi,pt.prototype.set=Ii;function rn(O){var T=-1,z=O==null?0:O.length;for(this.clear();++T<z;){var oe=O[T];this.set(oe[0],oe[1])}}function Si(){this.size=0,this.__data__={hash:new De,map:new(Qt||pt),string:new De}}function Ee(O){var T=Oi(this,O).delete(O);return this.size-=T?1:0,T}function Gt(O){return Oi(this,O).get(O)}function Dr(O){return Oi(this,O).has(O)}function Bn(O,T){var z=Oi(this,O),oe=z.size;return z.set(O,T),this.size+=z.size==oe?0:1,this}rn.prototype.clear=Si,rn.prototype.delete=Ee,rn.prototype.get=Gt,rn.prototype.has=Dr,rn.prototype.set=Bn;function sr(O){var T=-1,z=O==null?0:O.length;for(this.__data__=new rn;++T<z;)this.add(O[T])}function Mr(O){return this.__data__.set(O,r),this}function Oh(O){return this.__data__.has(O)}sr.prototype.add=sr.prototype.push=Mr,sr.prototype.has=Oh;function En(O){var T=this.__data__=new pt(O);this.size=T.size}function Eh(){this.__data__=new pt,this.size=0}function _h(O){var T=this.__data__,z=T.delete(O);return this.size=T.size,z}function Nh(O){return this.__data__.get(O)}function Th(O){return this.__data__.has(O)}function kh(O,T){var z=this.__data__;if(z instanceof pt){var oe=z.__data__;if(!Qt||oe.length<n-1)return oe.push([O,T]),this.size=++z.size,this;z=this.__data__=new rn(oe)}return z.set(O,T),this.size=z.size,this}En.prototype.clear=Eh,En.prototype.delete=_h,En.prototype.get=Nh,En.prototype.has=Th,En.prototype.set=kh;function Rh(O,T){var z=Ei(O),oe=!z&&Hh(O),Ve=!z&&!oe&&Do(O),ve=!z&&!oe&&!Ve&&Sl(O),He=z||oe||Ve||ve,st=He?We(O.length,String):[],dt=st.length;for(var ze in O)ce.call(O,ze)&&!(He&&(ze=="length"||Ve&&(ze=="offset"||ze=="parent")||ve&&(ze=="buffer"||ze=="byteLength"||ze=="byteOffset")||Uh(ze,dt)))&&st.push(ze);return st}function Ci(O,T){for(var z=O.length;z--;)if(bl(O[z][0],T))return z;return-1}function Ah(O,T,z){var oe=T(O);return Ei(O)?oe:Fe(oe,z(O))}function jr(O){return O==null?O===void 0?L:w:Ot&&Ot in Object(O)?Bh(O):Kh(O)}function ml(O){return Lr(O)&&jr(O)==a}function gl(O,T,z,oe,Ve){return O===T?!0:O==null||T==null||!Lr(O)&&!Lr(T)?O!==O&&T!==T:Fh(O,T,z,oe,gl,Ve)}function Fh(O,T,z,oe,Ve,ve){var He=Ei(O),st=Ei(T),dt=He?l:_n(O),ze=st?l:_n(T);dt=dt==a?m:dt,ze=ze==a?m:ze;var At=dt==m,Xt=ze==m,ht=dt==ze;if(ht&&Do(O)){if(!Do(T))return!1;He=!0,At=!1}if(ht&&!At)return ve||(ve=new En),He||Sl(O)?yl(O,T,z,oe,Ve,ve):jh(O,T,dt,z,oe,Ve,ve);if(!(z&i)){var qt=At&&ce.call(O,"__wrapped__"),$t=Xt&&ce.call(T,"__wrapped__");if(qt||$t){var Nn=qt?O.value():O,mn=$t?T.value():T;return ve||(ve=new En),Ve(Nn,mn,z,oe,ve)}}return ht?(ve||(ve=new En),Lh(O,T,z,oe,Ve,ve)):!1}function Ph(O){if(!Il(O)||$h(O))return!1;var T=wl(O)?lt:S;return T.test(Vn(O))}function Dh(O){return Lr(O)&&xl(O.length)&&!!q[jr(O)]}function Mh(O){if(!zh(O))return Cn(O);var T=[];for(var z in Object(O))ce.call(O,z)&&z!="constructor"&&T.push(z);return T}function yl(O,T,z,oe,Ve,ve){var He=z&i,st=O.length,dt=T.length;if(st!=dt&&!(He&&dt>st))return!1;var ze=ve.get(O);if(ze&&ve.get(T))return ze==T;var At=-1,Xt=!0,ht=z&o?new sr:void 0;for(ve.set(O,T),ve.set(T,O);++At<st;){var qt=O[At],$t=T[At];if(oe)var Nn=He?oe($t,qt,At,T,O,ve):oe(qt,$t,At,O,T,ve);if(Nn!==void 0){if(Nn)continue;Xt=!1;break}if(ht){if(!Ae(T,function(mn,Un){if(!tt(ht,Un)&&(qt===mn||Ve(qt,mn,z,oe,ve)))return ht.push(Un)})){Xt=!1;break}}else if(!(qt===$t||Ve(qt,$t,z,oe,ve))){Xt=!1;break}}return ve.delete(O),ve.delete(T),Xt}function jh(O,T,z,oe,Ve,ve,He){switch(z){case j:if(O.byteLength!=T.byteLength||O.byteOffset!=T.byteOffset)return!1;O=O.buffer,T=T.buffer;case F:return!(O.byteLength!=T.byteLength||!ve(new Oe(O),new Oe(T)));case u:case d:case g:return bl(+O,+T);case h:return O.name==T.name&&O.message==T.message;case E:case A:return O==T+"";case v:var st=ot;case _:var dt=oe&i;if(st||(st=at),O.size!=T.size&&!dt)return!1;var ze=He.get(O);if(ze)return ze==T;oe|=o,He.set(O,T);var At=yl(st(O),st(T),oe,Ve,ve,He);return He.delete(O),At;case k:if(Ce)return Ce.call(O)==Ce.call(T)}return!1}function Lh(O,T,z,oe,Ve,ve){var He=z&i,st=vl(O),dt=st.length,ze=vl(T),At=ze.length;if(dt!=At&&!He)return!1;for(var Xt=dt;Xt--;){var ht=st[Xt];if(!(He?ht in T:ce.call(T,ht)))return!1}var qt=ve.get(O);if(qt&&ve.get(T))return qt==T;var $t=!0;ve.set(O,T),ve.set(T,O);for(var Nn=He;++Xt<dt;){ht=st[Xt];var mn=O[ht],Un=T[ht];if(oe)var Cl=He?oe(Un,mn,ht,T,O,ve):oe(mn,Un,ht,O,T,ve);if(!(Cl===void 0?mn===Un||Ve(mn,Un,z,oe,ve):Cl)){$t=!1;break}Nn||(Nn=ht=="constructor")}if($t&&!Nn){var _i=O.constructor,Ni=T.constructor;_i!=Ni&&"constructor"in O&&"constructor"in T&&!(typeof _i=="function"&&_i instanceof _i&&typeof Ni=="function"&&Ni instanceof Ni)&&($t=!1)}return ve.delete(O),ve.delete(T),$t}function vl(O){return Ah(O,Qh,Vh)}function Oi(O,T){var z=O.__data__;return qh(T)?z[typeof T=="string"?"string":"hash"]:z.map}function ar(O,T){var z=xe(O,T);return Ph(z)?z:void 0}function Bh(O){var T=ce.call(O,Ot),z=O[Ot];try{O[Ot]=void 0;var oe=!0}catch{}var Ve=wt.call(O);return oe&&(T?O[Ot]=z:delete O[Ot]),Ve}var Vh=In?function(O){return O==null?[]:(O=Object(O),Be(In(O),function(T){return xt.call(O,T)}))}:Gh,_n=jr;(nn&&_n(new nn(new ArrayBuffer(1)))!=j||Qt&&_n(new Qt)!=v||On&&_n(On.resolve())!=b||$e&&_n(new $e)!=_||nt&&_n(new nt)!=M)&&(_n=function(O){var T=jr(O),z=T==m?O.constructor:void 0,oe=z?Vn(z):"";if(oe)switch(oe){case Se:return j;case It:return v;case hn:return b;case te:return _;case fe:return M}return T});function Uh(O,T){return T=T??s,!!T&&(typeof O=="number"||$.test(O))&&O>-1&&O%1==0&&O<T}function qh(O){var T=typeof O;return T=="string"||T=="number"||T=="symbol"||T=="boolean"?O!=="__proto__":O===null}function $h(O){return!!qe&&qe in O}function zh(O){var T=O&&O.constructor,z=typeof T=="function"&&T.prototype||K;return O===z}function Kh(O){return wt.call(O)}function Vn(O){if(O!=null){try{return re.call(O)}catch{}try{return O+""}catch{}}return""}function bl(O,T){return O===T||O!==O&&T!==T}var Hh=ml((function(){return arguments})())?ml:function(O){return Lr(O)&&ce.call(O,"callee")&&!xt.call(O,"callee")},Ei=Array.isArray;function Jh(O){return O!=null&&xl(O.length)&&!wl(O)}var Do=Sn||Xh;function Wh(O,T){return gl(O,T)}function wl(O){if(!Il(O))return!1;var T=jr(O);return T==f||T==y||T==c||T==C}function xl(O){return typeof O=="number"&&O>-1&&O%1==0&&O<=s}function Il(O){var T=typeof O;return O!=null&&(T=="object"||T=="function")}function Lr(O){return O!=null&&typeof O=="object"}var Sl=Z?et(Z):Dh;function Qh(O){return Jh(O)?Rh(O):Mh(O)}function Gh(){return[]}function Xh(){return!1}e.exports=Wh})(Hr,Hr.exports)),Hr.exports}var fx=dx();const dd=Nr(fx),Ye=async(e,t)=>{if(e instanceof ea){const{status:n,statusText:r}=e.response;console.error(n===500?"Internal Server Error (500):":n===400?"Bad Request (400):":`Error (${n}):`,r);try{const o=await e.response.clone().json(),s=o?.causes?.join(`
|
|
3
3
|
`)||o?.detail;s?(console.error("[Error Message]",s),o?.remedy&&console.error("[Remedy]",o.remedy)):console.error("Unexpected error response:",o);const a=`${s} ${o?.remedy?`
|
|
4
4
|
|
|
5
|
-
[Remedy] ${o.remedy}`:""}`;t&&t(a)}catch(i){console.error("Error parsing error response body:",i)}}else console.error("Unexpected error:",e.message)};function vo(e,t){const n=mt(e,t),{projectIdOrName:r}=Ke(),{setError:i,removeError:o}=un(),s=er({queryKey:["amp","integrations",r],queryFn:async()=>{if(!r)throw new Error("Project ID or name is required");return(await n()).integrationApi.listIntegrations({projectIdOrName:r})},enabled:!!r});return I.useEffect(()=>{s.isError?(Ye(s.error),i(Ie.INTEGRATION_LIST,r)):o(Ie.INTEGRATION_LIST,r)},[s.isError,s.error,r,i,o]),s}const la=(e,t,n)=>{const r=mt(t,n),{projectIdOrName:i}=Ke(),{data:o,isError:s,error:a}=vo(t,n),l=o?.find(u=>u.name===e)?.id,c=er({queryKey:["amp","installations",i,l,t],queryFn:async()=>{if(!i)throw new Error("Project ID is required");if(!l)throw new Error("Integration ID is required");if(!t)throw new Error("Group reference is required");return(await r()).installationApi.listInstallations({projectIdOrName:i,integrationId:l,groupRef:t})},enabled:!s&&!!i&&!!l&&!!t&&!!o&&o.length>0});return{...c,isError:c.isError||s,error:c.error||a}},Mn=()=>{const{setError:e}=un(),t=mt(),{projectIdOrName:n}=Ke(),r=er({queryKey:["project",n],queryFn:async()=>(await t()).projectApi.getProject({projectIdOrName:n})});return I.useEffect(()=>{r.isError&&e(Ie.PROJECT,n)},[r.isError,n,e]),{...r,projectIdOrName:n,appName:r.data?.name,projectId:r.data?.id}};function dn(){const{integrationNameOrId:e,groupRef:t}=jn(),n=la(e,t),{isPending:r,isFetching:i,isError:o,isSuccess:s,error:a,data:l}=n;return{installation:l?.[0],isPending:r,isFetching:i,isError:o,isSuccess:s,error:a}}const tr=e=>{const t=vo(),r=t.data?.find(i=>i.name===e||i.id===e);return{...t,data:r,provider:r?.provider}},ca=()=>{const{groupRef:e,integrationNameOrId:t}=jn(),{provider:n}=tr(t),r=fa({groupRef:e,provider:n}),{isPending:i,isFetching:o,isError:s,isSuccess:a,error:l,data:c}=r;return{connection:c?.[0],error:l,isPending:i,isFetching:o,isError:s,isSuccess:a}},fd=()=>{const e=mt(),{connection:t,isPending:n,isFetching:r}=ca(),{projectIdOrName:i}=Ke(),{integrationNameOrId:o}=jn(),{data:s}=tr(o),a=t?.id,l=s?.id,c=s?.latestRevision?.id;return er({queryKey:["amp","hydratedRevision",i,l,c,a],queryFn:async()=>{if(!i)throw new Error("projectIdOrName is required");if(!l)throw new Error("integrationId is required");if(!c)throw new Error("revisionId is required");if(!a)throw new Error("connectionId is required");return(await e()).revisionApi.getHydratedRevision({projectIdOrName:i,integrationId:l,revisionId:c,connectionId:a})},enabled:!!i&&!!l&&!!c&&!!a&&!(n||r)})};function bo(){const e=fd(),{isLoading:t,isPending:n,isFetching:r,isError:i,isSuccess:o,error:s,data:a}=e,l=a?.content,c=I.useMemo(()=>({getReadObject:u=>{const d=l?.read?.objects?.find(h=>h.objectName===u);return d?{object:d,getRequiredFields:()=>d.requiredFields??[],getOptionalFields:()=>d.optionalFields??[]}:(console.error(`Object ${u} not found`),{object:null,getRequiredFields:()=>null,getOptionalFields:()=>null})},getWriteObject:u=>{const d=l?.write?.objects?.find(h=>h.objectName===u);return d?{object:d}:(console.error(`Object ${u} not found`),{object:null})},getCustomerFieldsForObject:u=>{const d=l?.read?.objects?.find(h=>h.objectName===u);return d?{allFields:d.allFieldsMetadata??{},getField:h=>{const f=d.allFieldsMetadata?.[h];return f||(console.error(`Field ${h} not found`),null)}}:(console.error(`Object ${u} not found`),{allFields:null,getField:()=>null})}}),[l?.read?.objects,l?.write?.objects]);return{data:a,isLoading:t,isPending:n,isFetching:r,isError:i,isSuccess:o,error:s,...c}}function px(e){const[t,n]=I.useState(e),r=I.useRef(void 0),{getReadObject:i,data:o}=bo(),{installation:s}=dn(),a=I.useCallback(()=>t,[t]),l=I.useCallback((f,y)=>{y.provider=y.provider||o?.content?.provider||"";const v=y.read||{objects:{}},g=v.objects||{},w=g[f]||{},m=i(f),b={};return m?.getRequiredFields()?.forEach(C=>{"fieldName"in C&&(b[C.fieldName]=!0)}),w.objectName=w.objectName||f,w.selectedFields=w.selectedFields||b,g[f]=w,v.objects=g,y.read=v,{read:v,objects:g,obj:w}},[i,o?.content?.provider]),c=I.useCallback(f=>({object:t.read?.objects?.[f],getSelectedField:y=>!!t.read?.objects?.[f]?.selectedFields?.[y],setSelectedField:({fieldName:y,selected:v})=>{n(g=>St(g,w=>{const{obj:m}=l(f,w);m.selectedFields=m.selectedFields||{},m.selectedFields[y]=v,m.selectedFields[y]===!1&&delete m.selectedFields[y]}))},getFieldMapping:y=>t.read?.objects?.[f]?.selectedFieldMappings?.[y],setFieldMapping:({fieldName:y,mapToName:v})=>{n(g=>St(g,w=>{const{obj:m}=l(f,w);m.selectedFieldMappings=m.selectedFieldMappings||{},m.selectedFieldMappings[v]=y}))},deleteFieldMapping:y=>{n(v=>St(v,g=>{const w=g.read?.objects?.[f]?.selectedFieldMappings;w&&y in w&&delete w[y]}))}}),[t.read?.objects,l]),u=I.useCallback(f=>{const y=t.write?.objects?.[f],v=m=>{const b=m.write||{},C=b.objects||{},E=C[f]||{objectName:f};return C[f]=E,b.objects=C,m.write=b,{write:b,objects:C,obj:E}},g=(m,b)=>y?.selectedFieldSettings?.[m]?.[b],w=(m,b,C)=>{n(E=>St(E,_=>{const{obj:A}=v(_);A.selectedFieldSettings={...A.selectedFieldSettings,[m]:{...A.selectedFieldSettings?.[m],[b]:C}}}))};return{object:y,setEnableWrite:()=>{n(m=>St(m,b=>{const{obj:C}=v(b);C.objectName=f}))},setDisableWrite:()=>{n(m=>St(m,b=>{const{objects:C}=v(b);delete C[f]}))},getWriteObject:()=>t.write?.objects?.[f],getSelectedFieldSettings:m=>y?.selectedFieldSettings?.[m],setSelectedFieldSettings:({fieldName:m,settings:b})=>{n(C=>St(C,E=>{const{obj:_}=v(E),A=_.selectedFieldSettings||{};_.selectedFieldSettings={...A,[m]:b},b===void 0&&delete _.selectedFieldSettings[m]}))},getDefaultValues:m=>g(m,"default"),setDefaultValues:({fieldName:m,value:b})=>w(m,"default",b),getWriteOnCreateSetting:m=>g(m,"writeOnCreate"),setWriteOnCreateSetting:({fieldName:m,value:b})=>w(m,"writeOnCreate",b),getWriteOnUpdateSetting:m=>g(m,"writeOnUpdate"),setWriteOnUpdateSetting:({fieldName:m,value:b})=>w(m,"writeOnUpdate",b),enableDeletion:()=>{n(m=>St(m,b=>{const{obj:C}=v(b);C.deletionSettings={enabled:!0}}))},disableDeletion:()=>{n(m=>St(m,b=>{const{obj:C}=v(b);C.deletionSettings={enabled:!1}}))}}},[t.write?.objects]),d=I.useCallback(()=>({object:t.proxy,setEnableProxy:()=>{n(f=>St(f,y=>{y.proxy={enabled:!0}}))},setDisableProxy:()=>{n(f=>St(f,y=>{y.proxy={enabled:!1}}))},getProxyEnabled:()=>t.proxy?.enabled||!1}),[t.proxy]),h=I.useCallback(()=>{n(f=>St(f,y=>{Object.assign(y,s?.config?.content)}))},[s?.config?.content]);return I.useEffect(()=>{s&&(console.debug("Installation found",{installation:s}),r.current?dd(r.current,s)||(console.debug("Installation changed, resetting config",{previous:r.current,current:s}),h(),r.current=s):(r.current=s,h()))},[s,h]),{draft:t,get:a,reset:h,setDraft:n,readObject:c,writeObject:u,proxy:d}}const ua=I.createContext(null);function hx({children:e,initialConfig:t}){const n=px(t);return p.jsx(ua.Provider,{value:n,children:e})}function mx(){const e=I.useContext(ua);if(!e)throw new Error("useLocalConfig must be used within a ConfigProvider / InstallationProvider");return e}function gx(){console.warn("useConfig is deprecated. Please use useLocalConfig instead.");const e=I.useContext(ua);if(!e)throw new Error("useConfigContext must be used within a ConfigProvider / InstallationProvider");return e}const pd=I.createContext({integrationNameOrId:"",consumerRef:"",consumerName:void 0,groupRef:"",groupName:void 0});function jn(){const e=I.useContext(pd);if(!e)throw new Error("useInstallationProps must be used within an InstallationProvider");return e}function da({children:e,integration:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o}){const s=I.useMemo(()=>({integrationNameOrId:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o}),[t,n,r,i,o]);return p.jsx(pd.Provider,{value:s,children:p.jsx(hx,{initialConfig:{},children:e})})}class Rs{constructor(t){this.connectionApi=new Qb(t),this.installationApi=new Gb(t),this.integrationApi=new Xb(t),this.oAuthApi=new Yb(t),this.projectApi=new Zb(t),this.providerApi=new ew(t),this.providerAppApi=new tw(t),this.revisionApi=new nw(t)}}const hd="2.11.1",yx="v1",Fi="https://api.withampersand.com";function md(){try{const e=process.env.REACT_APP_AMP_SERVER;switch(e){case"local":return"http://localhost:8080";case"dev":return"https://dev-api.withampersand.com";case"staging":return"https://staging-api.withampersand.com";case"prod":return Fi;case"mock":return"http://127.0.0.1:4010";case"":return Fi;default:return e??Fi}}catch{return Fi}}const vx=(e,t)=>`${e}/${t}`;function bx(){return vx(md(),yx)}const gd=md(),yd=bx(),wx=new Zs({basePath:yd,headers:{"X-Amp-Client":"react","X-Amp-Client-Version":hd}});new Rs(wx);const xx=e=>({header:"X-Api-Key",value:e}),Ix=e=>{try{return{header:"Authorization",value:`Bearer ${e}`}}catch(t){throw console.error("Failed to get JWT token for API authentication:",t),new Error("Failed to authenticate with JWT token")}},Ql=(e,t)=>new Zs({basePath:yd,headers:{"X-Amp-Client":"react","X-Amp-Client-Version":hd,[e]:t}});function mt(e,t){const n=nd(),{getToken:r}=Gw(),i=jn(),o=t||i.consumerRef,s=e||i.groupRef;return I.useCallback(async()=>{if(n){const l=xx(n),c=Ql(l.header,l.value);return new Rs(c)}if(r){if(!o||!s)throw console.error("Unable to create JWT API service without consumerRef or groupRef.",{consumerRef:o,groupRef:s}),new Error("Unable to create JWT API service without consumerRef or groupRef. Provide via InstallationProvider or useAPI parameters.");const l=await r({consumerRef:o,groupRef:s}),c=Ix(l),u=Ql(c.header,c.value);return new Rs(u)}throw console.error("Unable to create API service without API key or JWT token."),new Error("Unable to create API service without API key or JWT token.")},[n,r,o,s])}const fa=({groupRef:e,provider:t})=>{const{projectIdOrName:n}=Ke(),r=mt();return er({queryKey:["amp","connections",n,e,t],queryFn:async()=>{if(!n)throw new Error("Project ID or name not found. Please wrap this component inside of AmpersandProvider");if(!e)throw new Error("Group reference not found.");if(!t)throw new Error("Provider not found.");return(await r()).connectionApi.listConnections({projectIdOrName:n,groupRef:e,provider:t})},retry:3,enabled:!!n&&!!e&&!!t})};function Sx({height:e="48",width:t="48"}){return p.jsxs("svg",{width:t,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{d:"M20.5796 7.72236L3.63955 36.0024C3.29029 36.6072 3.10549 37.293 3.10353 37.9914C3.10158 38.6898 3.28254 39.3766 3.62841 39.9834C3.97428 40.5902 4.473 41.0959 5.07497 41.4501C5.67693 41.8043 6.36115 41.9947 7.05955 42.0024H40.9396C41.638 41.9947 42.3222 41.8043 42.9241 41.4501C43.5261 41.0959 44.0248 40.5902 44.3707 39.9834C44.7166 39.3766 44.8975 38.6898 44.8956 37.9914C44.8936 37.293 44.7088 36.6072 44.3596 36.0024L27.4196 7.72236C27.063 7.13458 26.561 6.6486 25.9619 6.31133C25.3629 5.97406 24.687 5.79688 23.9996 5.79688C23.3121 5.79688 22.6362 5.97406 22.0372 6.31133C21.4381 6.6486 20.9361 7.13458 20.5796 7.72236Z",stroke:"#7F1D1D",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M24 18V26",stroke:"#7F1D1D",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M24 34H24.02",stroke:"#7F1D1D",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}const Cx="_box_1p7c5_1",Gl={box:Cx};function bn({children:e,className:t,style:n}){return p.jsx("div",{className:t?`${Gl.box} ${t}`:Gl.box,style:n,children:e})}const Ox="_container_1wvzr_1",Xl={container:Ox};function Tr({children:e,className:t,style:n}){return p.jsx("div",{className:t?`${Xl.container} ${t}`:Xl.container,style:n,children:e})}const Ex="_errorBoxContainer_19655_1",_x="_errorBox_19655_1",Nx="_errorIconWrapper_19655_23",Tx="_errorText_19655_34",Ki={errorBoxContainer:Ex,errorBox:_x,errorIconWrapper:Nx,errorText:Tx};function vd({message:e}){return p.jsxs(bn,{className:Ki.errorBox,children:[p.jsx("div",{className:Ki.errorIconWrapper,children:p.jsx(Sx,{width:"20",height:"20"})}),p.jsx("p",{className:Ki.errorText,children:e})]})}function bd({message:e,children:t}){return p.jsxs(Tr,{className:Ki.errorBoxContainer,children:[p.jsx(vd,{message:e}),t]})}const kx="_loader_6ubm6_1",Rx={loader:kx};function Ax(){return p.jsx("span",{className:Rx.loader})}function ii(){return p.jsx("div",{style:{display:"flex",width:"100%",height:"100%",justifyContent:"center",marginTop:"20%",marginBottom:"20%"},children:p.jsx(Ax,{})})}function wd({children:e}){return p.jsx(Tr,{style:{maxWidth:"55rem"},children:p.jsx(bn,{children:e})})}function kr(){return p.jsx(wd,{children:p.jsx(ii,{})})}function Tt({message:e,children:t}){return p.jsx(wd,{children:p.jsx(bd,{message:e,children:t})})}function pa(e,t){try{return process.env[e]}catch{return t}}function Wt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Fx(e,t){return t?.displayName??Wt(e)}const Px=e=>e.split(`
|
|
5
|
+
[Remedy] ${o.remedy}`:""}`;t&&t(a)}catch(i){console.error("Error parsing error response body:",i)}}else console.error("Unexpected error:",e.message)};function vo(e,t){const n=mt(e,t),{projectIdOrName:r}=Ke(),{setError:i,removeError:o}=un(),s=er({queryKey:["amp","integrations",r],queryFn:async()=>{if(!r)throw new Error("Project ID or name is required");return(await n()).integrationApi.listIntegrations({projectIdOrName:r})},enabled:!!r});return I.useEffect(()=>{s.isError?(Ye(s.error),i(Ie.INTEGRATION_LIST,r)):o(Ie.INTEGRATION_LIST,r)},[s.isError,s.error,r,i,o]),s}const la=(e,t,n)=>{const r=mt(t,n),{projectIdOrName:i}=Ke(),{data:o,isError:s,error:a}=vo(t,n),l=o?.find(u=>u.name===e)?.id,c=er({queryKey:["amp","installations",i,l,t],queryFn:async()=>{if(!i)throw new Error("Project ID is required");if(!l)throw new Error("Integration ID is required");if(!t)throw new Error("Group reference is required");return(await r()).installationApi.listInstallations({projectIdOrName:i,integrationId:l,groupRef:t})},enabled:!s&&!!i&&!!l&&!!t&&!!o&&o.length>0});return{...c,isError:c.isError||s,error:c.error||a}},Mn=()=>{const{setError:e}=un(),t=mt(),{projectIdOrName:n}=Ke(),r=er({queryKey:["project",n],queryFn:async()=>(await t()).projectApi.getProject({projectIdOrName:n})});return I.useEffect(()=>{r.isError&&e(Ie.PROJECT,n)},[r.isError,n,e]),{...r,projectIdOrName:n,appName:r.data?.name,projectId:r.data?.id}};function dn(){const{integrationNameOrId:e,groupRef:t}=jn(),n=la(e,t),{isPending:r,isFetching:i,isError:o,isSuccess:s,error:a,data:l}=n;return{installation:l?.[0],isPending:r,isFetching:i,isError:o,isSuccess:s,error:a}}const tr=e=>{const t=vo(),r=t.data?.find(i=>i.name===e||i.id===e);return{...t,data:r,provider:r?.provider}},ca=()=>{const{groupRef:e,integrationNameOrId:t}=jn(),{provider:n}=tr(t),r=fa({groupRef:e,provider:n}),{isPending:i,isFetching:o,isError:s,isSuccess:a,error:l,data:c}=r;return{connection:c?.[0],error:l,isPending:i,isFetching:o,isError:s,isSuccess:a}},fd=()=>{const e=mt(),{connection:t,isPending:n,isFetching:r}=ca(),{projectIdOrName:i}=Ke(),{integrationNameOrId:o}=jn(),{data:s}=tr(o),a=t?.id,l=s?.id,c=s?.latestRevision?.id;return er({queryKey:["amp","hydratedRevision",i,l,c,a],queryFn:async()=>{if(!i)throw new Error("projectIdOrName is required");if(!l)throw new Error("integrationId is required");if(!c)throw new Error("revisionId is required");if(!a)throw new Error("connectionId is required");return(await e()).revisionApi.getHydratedRevision({projectIdOrName:i,integrationId:l,revisionId:c,connectionId:a})},enabled:!!i&&!!l&&!!c&&!!a&&!(n||r)})};function bo(){const e=fd(),{isLoading:t,isPending:n,isFetching:r,isError:i,isSuccess:o,error:s,data:a}=e,l=a?.content,c=I.useMemo(()=>({getReadObject:u=>{const d=l?.read?.objects?.find(h=>h.objectName===u);return d?{object:d,getRequiredFields:()=>d.requiredFields??[],getOptionalFields:()=>d.optionalFields??[]}:(console.error(`Object ${u} not found`),{object:null,getRequiredFields:()=>null,getOptionalFields:()=>null})},getWriteObject:u=>{const d=l?.write?.objects?.find(h=>h.objectName===u);return d?{object:d}:(console.error(`Object ${u} not found`),{object:null})},getCustomerFieldsForObject:u=>{const d=l?.read?.objects?.find(h=>h.objectName===u);return d?{allFields:d.allFieldsMetadata??{},getField:h=>{const f=d.allFieldsMetadata?.[h];return f||(console.error(`Field ${h} not found`),null)}}:(console.error(`Object ${u} not found`),{allFields:null,getField:()=>null})}}),[l?.read?.objects,l?.write?.objects]);return{data:a,isLoading:t,isPending:n,isFetching:r,isError:i,isSuccess:o,error:s,...c}}function px(e){const[t,n]=I.useState(e),r=I.useRef(void 0),{getReadObject:i,data:o}=bo(),{installation:s}=dn(),a=I.useCallback(()=>t,[t]),l=I.useCallback((f,y)=>{y.provider=y.provider||o?.content?.provider||"";const v=y.read||{objects:{}},g=v.objects||{},w=g[f]||{},m=i(f),b={};return m?.getRequiredFields()?.forEach(C=>{"fieldName"in C&&(b[C.fieldName]=!0)}),w.objectName=w.objectName||f,w.selectedFields=w.selectedFields||b,g[f]=w,v.objects=g,y.read=v,{read:v,objects:g,obj:w}},[i,o?.content?.provider]),c=I.useCallback(f=>({object:t.read?.objects?.[f],getSelectedField:y=>!!t.read?.objects?.[f]?.selectedFields?.[y],setSelectedField:({fieldName:y,selected:v})=>{n(g=>St(g,w=>{const{obj:m}=l(f,w);m.selectedFields=m.selectedFields||{},m.selectedFields[y]=v,m.selectedFields[y]===!1&&delete m.selectedFields[y]}))},getFieldMapping:y=>t.read?.objects?.[f]?.selectedFieldMappings?.[y],setFieldMapping:({fieldName:y,mapToName:v})=>{n(g=>St(g,w=>{const{obj:m}=l(f,w);m.selectedFieldMappings=m.selectedFieldMappings||{},m.selectedFieldMappings[v]=y}))},deleteFieldMapping:y=>{n(v=>St(v,g=>{const w=g.read?.objects?.[f]?.selectedFieldMappings;w&&y in w&&delete w[y]}))}}),[t.read?.objects,l]),u=I.useCallback(f=>{const y=t.write?.objects?.[f],v=m=>{const b=m.write||{},C=b.objects||{},E=C[f]||{objectName:f};return C[f]=E,b.objects=C,m.write=b,{write:b,objects:C,obj:E}},g=(m,b)=>y?.selectedFieldSettings?.[m]?.[b],w=(m,b,C)=>{n(E=>St(E,_=>{const{obj:A}=v(_);A.selectedFieldSettings={...A.selectedFieldSettings,[m]:{...A.selectedFieldSettings?.[m],[b]:C}}}))};return{object:y,setEnableWrite:()=>{n(m=>St(m,b=>{const{obj:C}=v(b);C.objectName=f}))},setDisableWrite:()=>{n(m=>St(m,b=>{const{objects:C}=v(b);delete C[f]}))},getWriteObject:()=>t.write?.objects?.[f],getSelectedFieldSettings:m=>y?.selectedFieldSettings?.[m],setSelectedFieldSettings:({fieldName:m,settings:b})=>{n(C=>St(C,E=>{const{obj:_}=v(E),A=_.selectedFieldSettings||{};_.selectedFieldSettings={...A,[m]:b},b===void 0&&delete _.selectedFieldSettings[m]}))},getDefaultValues:m=>g(m,"default"),setDefaultValues:({fieldName:m,value:b})=>w(m,"default",b),getWriteOnCreateSetting:m=>g(m,"writeOnCreate"),setWriteOnCreateSetting:({fieldName:m,value:b})=>w(m,"writeOnCreate",b),getWriteOnUpdateSetting:m=>g(m,"writeOnUpdate"),setWriteOnUpdateSetting:({fieldName:m,value:b})=>w(m,"writeOnUpdate",b),setEnableDeletion:()=>{n(m=>St(m,b=>{const{obj:C}=v(b);C.deletionSettings={enabled:!0}}))},setDisableDeletion:()=>{n(m=>St(m,b=>{const{obj:C}=v(b);C.deletionSettings={enabled:!1}}))}}},[t.write?.objects]),d=I.useCallback(()=>({object:t.proxy,setEnableProxy:()=>{n(f=>St(f,y=>{y.proxy={enabled:!0}}))},setDisableProxy:()=>{n(f=>St(f,y=>{y.proxy={enabled:!1}}))},getProxyEnabled:()=>t.proxy?.enabled||!1}),[t.proxy]),h=I.useCallback(()=>{n(f=>St(f,y=>{Object.assign(y,s?.config?.content)}))},[s?.config?.content]);return I.useEffect(()=>{s&&(console.debug("Installation found",{installation:s}),r.current?dd(r.current,s)||(console.debug("Installation changed, resetting config",{previous:r.current,current:s}),h(),r.current=s):(r.current=s,h()))},[s,h]),{draft:t,get:a,reset:h,setDraft:n,readObject:c,writeObject:u,proxy:d}}const ua=I.createContext(null);function hx({children:e,initialConfig:t}){const n=px(t);return p.jsx(ua.Provider,{value:n,children:e})}function mx(){const e=I.useContext(ua);if(!e)throw new Error("useLocalConfig must be used within a ConfigProvider / InstallationProvider");return e}function gx(){console.warn("useConfig is deprecated. Please use useLocalConfig instead.");const e=I.useContext(ua);if(!e)throw new Error("useConfigContext must be used within a ConfigProvider / InstallationProvider");return e}const pd=I.createContext({integrationNameOrId:"",consumerRef:"",consumerName:void 0,groupRef:"",groupName:void 0});function jn(){const e=I.useContext(pd);if(!e)throw new Error("useInstallationProps must be used within an InstallationProvider");return e}function da({children:e,integration:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o}){const s=I.useMemo(()=>({integrationNameOrId:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o}),[t,n,r,i,o]);return p.jsx(pd.Provider,{value:s,children:p.jsx(hx,{initialConfig:{},children:e})})}class Rs{constructor(t){this.connectionApi=new Qb(t),this.installationApi=new Gb(t),this.integrationApi=new Xb(t),this.oAuthApi=new Yb(t),this.projectApi=new Zb(t),this.providerApi=new ew(t),this.providerAppApi=new tw(t),this.revisionApi=new nw(t)}}const hd="2.11.2",yx="v1",Fi="https://api.withampersand.com";function md(){try{const e=process.env.REACT_APP_AMP_SERVER;switch(e){case"local":return"http://localhost:8080";case"dev":return"https://dev-api.withampersand.com";case"staging":return"https://staging-api.withampersand.com";case"prod":return Fi;case"mock":return"http://127.0.0.1:4010";case"":return Fi;default:return e??Fi}}catch{return Fi}}const vx=(e,t)=>`${e}/${t}`;function bx(){return vx(md(),yx)}const gd=md(),yd=bx(),wx=new Zs({basePath:yd,headers:{"X-Amp-Client":"react","X-Amp-Client-Version":hd}});new Rs(wx);const xx=e=>({header:"X-Api-Key",value:e}),Ix=e=>{try{return{header:"Authorization",value:`Bearer ${e}`}}catch(t){throw console.error("Failed to get JWT token for API authentication:",t),new Error("Failed to authenticate with JWT token")}},Ql=(e,t)=>new Zs({basePath:yd,headers:{"X-Amp-Client":"react","X-Amp-Client-Version":hd,[e]:t}});function mt(e,t){const n=nd(),{getToken:r}=Gw(),i=jn(),o=t||i.consumerRef,s=e||i.groupRef;return I.useCallback(async()=>{if(n){const l=xx(n),c=Ql(l.header,l.value);return new Rs(c)}if(r){if(!o||!s)throw console.error("Unable to create JWT API service without consumerRef or groupRef.",{consumerRef:o,groupRef:s}),new Error("Unable to create JWT API service without consumerRef or groupRef. Provide via InstallationProvider or useAPI parameters.");const l=await r({consumerRef:o,groupRef:s}),c=Ix(l),u=Ql(c.header,c.value);return new Rs(u)}throw console.error("Unable to create API service without API key or JWT token."),new Error("Unable to create API service without API key or JWT token.")},[n,r,o,s])}const fa=({groupRef:e,provider:t})=>{const{projectIdOrName:n}=Ke(),r=mt();return er({queryKey:["amp","connections",n,e,t],queryFn:async()=>{if(!n)throw new Error("Project ID or name not found. Please wrap this component inside of AmpersandProvider");if(!e)throw new Error("Group reference not found.");if(!t)throw new Error("Provider not found.");return(await r()).connectionApi.listConnections({projectIdOrName:n,groupRef:e,provider:t})},retry:3,enabled:!!n&&!!e&&!!t})};function Sx({height:e="48",width:t="48"}){return p.jsxs("svg",{width:t,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{d:"M20.5796 7.72236L3.63955 36.0024C3.29029 36.6072 3.10549 37.293 3.10353 37.9914C3.10158 38.6898 3.28254 39.3766 3.62841 39.9834C3.97428 40.5902 4.473 41.0959 5.07497 41.4501C5.67693 41.8043 6.36115 41.9947 7.05955 42.0024H40.9396C41.638 41.9947 42.3222 41.8043 42.9241 41.4501C43.5261 41.0959 44.0248 40.5902 44.3707 39.9834C44.7166 39.3766 44.8975 38.6898 44.8956 37.9914C44.8936 37.293 44.7088 36.6072 44.3596 36.0024L27.4196 7.72236C27.063 7.13458 26.561 6.6486 25.9619 6.31133C25.3629 5.97406 24.687 5.79688 23.9996 5.79688C23.3121 5.79688 22.6362 5.97406 22.0372 6.31133C21.4381 6.6486 20.9361 7.13458 20.5796 7.72236Z",stroke:"#7F1D1D",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M24 18V26",stroke:"#7F1D1D",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M24 34H24.02",stroke:"#7F1D1D",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}const Cx="_box_1p7c5_1",Gl={box:Cx};function bn({children:e,className:t,style:n}){return p.jsx("div",{className:t?`${Gl.box} ${t}`:Gl.box,style:n,children:e})}const Ox="_container_1wvzr_1",Xl={container:Ox};function Tr({children:e,className:t,style:n}){return p.jsx("div",{className:t?`${Xl.container} ${t}`:Xl.container,style:n,children:e})}const Ex="_errorBoxContainer_19655_1",_x="_errorBox_19655_1",Nx="_errorIconWrapper_19655_23",Tx="_errorText_19655_34",Ki={errorBoxContainer:Ex,errorBox:_x,errorIconWrapper:Nx,errorText:Tx};function vd({message:e}){return p.jsxs(bn,{className:Ki.errorBox,children:[p.jsx("div",{className:Ki.errorIconWrapper,children:p.jsx(Sx,{width:"20",height:"20"})}),p.jsx("p",{className:Ki.errorText,children:e})]})}function bd({message:e,children:t}){return p.jsxs(Tr,{className:Ki.errorBoxContainer,children:[p.jsx(vd,{message:e}),t]})}const kx="_loader_6ubm6_1",Rx={loader:kx};function Ax(){return p.jsx("span",{className:Rx.loader})}function ii(){return p.jsx("div",{style:{display:"flex",width:"100%",height:"100%",justifyContent:"center",marginTop:"20%",marginBottom:"20%"},children:p.jsx(Ax,{})})}function wd({children:e}){return p.jsx(Tr,{style:{maxWidth:"55rem"},children:p.jsx(bn,{children:e})})}function kr(){return p.jsx(wd,{children:p.jsx(ii,{})})}function Tt({message:e,children:t}){return p.jsx(wd,{children:p.jsx(bd,{message:e,children:t})})}function pa(e,t){try{return process.env[e]}catch{return t}}function Wt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Fx(e,t){return t?.displayName??Wt(e)}const Px=e=>e.split(`
|
|
6
6
|
`).filter(n=>n.trim()!==""),Dx=(e,t)=>t?.length===0||!e?null:t.find(n=>n.name===e)??null;function Mx(e){return!e||typeof e!="string"?"id_"+Math.random().toString(36).substr(2,9):e.toLowerCase().replace(/[^a-z0-9_-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").replace(/^[^a-z]/,"id-").substring(0,50)}const jx=()=>{const[e,t]=I.useState(!1),n=I.useCallback(()=>{t(!0)},[t]),r=I.useCallback(()=>{t(!1)},[t]);return{isIntegrationDeleted:e,setIntegrationDeleted:n,resetIntegrationDeleted:r}},xd=I.createContext({integrationId:"",provider:"",integrationObj:void 0,consumerRef:"",consumerName:"",groupRef:"",groupName:"",installation:void 0,setInstallation:()=>{},resetInstallations:()=>{},onInstallSuccess:void 0,onUpdateSuccess:void 0,onUninstallSuccess:void 0,isIntegrationDeleted:!1,setIntegrationDeleted:()=>{},resetComponent:()=>{}});function gt(){const e=I.useContext(xd);if(!e)throw new Error("useInstallIntegrationProps must be used within an InstallIntegrationProvider");return e}function Lx({children:e,integration:t,consumerRef:n,consumerName:r,groupRef:i,groupName:o,onInstallSuccess:s,onUpdateSuccess:a,onUninstallSuccess:l,fieldMapping:c,resetComponent:u}){const{data:d}=vo(),{setError:h,isError:f,removeError:y}=un(),{isIntegrationDeleted:v,setIntegrationDeleted:g,resetIntegrationDeleted:w}=jx(),m=I.useMemo(()=>Dx(t,d||[]),[t,d]),{data:b,isLoading:C,isError:E,error:_}=la(t,i),A=b?.[0]||null;I.useEffect(()=>{w()},[t,n,r,i,o,c]),I.useEffect(()=>{m===null&&d?.length&&console.error(`Integration "${t}" not found in integration list`)},[t,m,d]),I.useEffect(()=>{E?(h(Ie.INSTALLATION_LIST,m?.id||""),Ye(_)):y(Ie.INSTALLATION_LIST,m?.id||"")},[E,m,h,y,_]);const k=Ze(),L=I.useCallback(()=>{k.invalidateQueries({queryKey:["amp","installations"]})},[k]),M=I.useCallback(G=>{k.setQueryData(["amp","installations"],[G]),k.invalidateQueries({queryKey:["amp","installations"]})},[k]),F=m?.id||"",j=I.useMemo(()=>({integrationId:m?.id||"",provider:m?.provider||"",integrationObj:m,consumerRef:n,consumerName:r,groupRef:i,groupName:o,installation:A||void 0,setInstallation:M,resetInstallations:L,onInstallSuccess:s,onUpdateSuccess:a,onUninstallSuccess:l,isIntegrationDeleted:v,setIntegrationDeleted:g,fieldMapping:c,resetComponent:u}),[m,n,r,i,o,A,M,L,s,a,l,v,g,c,u]);if(C)return p.jsx(kr,{});if(m===null)return p.jsx(Tt,{message:`Integration "${t}" not found`});if(f(Ie.INSTALLATION_LIST,F)){const G=`Error retrieving installation information for integration "${m?.name||"unknown"}"`;return p.jsx(Tt,{message:G})}return p.jsx(xd.Provider,{value:j,children:e})}const Id=I.createContext({connections:null,isConnectionsLoading:!0,selectedConnection:null,setConnections:()=>{},setSelectedConnection:()=>{}}),fn=()=>{const e=I.useContext(Id);if(!e)throw new Error("useConnections must be used within a ConnectionsProvider");return e};function Sd({groupRef:e,provider:t,children:n}){const r=Ze(),{setError:i,isError:o}=un(),{projectIdOrName:s,isLoading:a}=Mn(),{integrationId:l,groupRef:c}=gt(),{provider:u}=tr(l),{data:d,isLoading:h,isError:f,error:y}=fa({groupRef:e||c,provider:u||t}),v=d?.[0],g=I.useCallback(b=>{r.setQueryData(["amp","connections"],()=>b),r.invalidateQueries({queryKey:["amp","connections"]})},[r]),w=I.useCallback(()=>{r.invalidateQueries({queryKey:["amp","connections"]})},[r]);I.useEffect(()=>{f?(i(Ie.CONNECTION_LIST,s,!0),Ye(y)):i(Ie.CONNECTION_LIST,s,!1)},[f,i,s,y]);const m=I.useMemo(()=>({connections:d||null,isConnectionsLoading:h,selectedConnection:v||null,setConnections:g,setSelectedConnection:w}),[d,h,v,g,w]);if(h||a)return p.jsx(kr,{});if(s&&o(Ie.PROJECT,s))return p.jsx(Tt,{message:`Error loading project ${s}`});if(s&&o(Ie.CONNECTION_LIST,s))return p.jsx(Tt,{message:"Error retrieving existing connections"});if(!s)throw new Error("Project ID or Project Name not found. ConnectionsProvider must be used within AmpersandProvider");return p.jsx(Id.Provider,{value:m,children:n})}const Cd=()=>{const e=mt(),t=Ze(),[n,r]=I.useState(null);return{...vn({mutationKey:["createInstallation"],mutationFn:async o=>(await e()).installationApi.createInstallation(o),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","installations"]}),r(null)},onError:o=>{console.error("Error creating installation"),Ye(o,r)}}),errorMsg:n}};function Bx(e){return typeof e.provider=="string"}function Vx(e){return Bx(e)?{data:e}:{error:new Error("Config must have a provider field for creation")}}function Od(){const{projectIdOrName:e}=Ke(),{groupRef:t,integrationNameOrId:n}=jn(),{data:r}=tr(n),{connection:i}=ca(),{installation:o}=dn(),s=Ze(),{mutate:a,isIdle:l,isPending:c,error:u,errorMsg:d}=Cd();return{createInstallation:({config:f,onSuccess:y,onError:v,onSettled:g})=>{if(o){const b=new Error("Installation already created. Try updating instead.");v?.(b),g?.();return}if(!r){const b=new Error("No integration found");v?.(b),g?.();return}const w=Vx(f);if(w.error||!w.data){v?.(w.error||new Error("Invalid configuration data")),g?.();return}const m={projectIdOrName:e,integrationId:r?.id,installation:{groupRef:t,connectionId:i?.id,config:{content:w.data}}};return a(m,{onSuccess:b=>{y?.(b)},onError:b=>{v?.(b)},onSettled:()=>{g?.(),s.invalidateQueries({queryKey:["amp","installations"]})}})},isIdle:l,isPending:c,error:u,errorMsg:d}}const Ed=()=>{const e=mt(),t=Ze(),[n,r]=I.useState(null);return{...vn({mutationKey:["updateInstallation"],mutationFn:async o=>(await e()).installationApi.updateInstallation(o),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","installations"]}),r(null)},onError:o=>{console.error("Error updating installation"),Ye(o,r)}}),errorMsg:n}};function _d(){const{projectIdOrName:e}=Ke(),{integrationNameOrId:t}=jn(),{data:n}=tr(t),{installation:r}=dn(),i=Ze(),{mutate:o,isIdle:s,isPending:a,error:l,errorMsg:c}=Ed();return{updateInstallation:({config:d,onSuccess:h,onError:f,onSettled:y})=>{if(!r){const w=new Error("Installation not created yet. Try creating the installation first.");f?.(w),y?.();return}if(!n){const w=new Error("No integration found");f?.(w),y?.();return}const v=[];if(d?.write?.objects){const w=Object.keys(d.write.objects).length,m=Object.keys(r?.config?.content?.write?.objects||{}).length;(w>0||w===0&&m>0)&&v.push("config.content.write.objects")}if(d?.read?.objects){const w=Object.keys(d.read.objects);v.push(...w.map(m=>`config.content.read.objects.${m}`))}const g={projectIdOrName:e,integrationId:n?.id,installationId:r.id,installationUpdate:{updateMask:v,installation:{config:{content:d}}}};return o(g,{onSuccess:w=>{h?.(w)},onError:w=>{f?.(w)},onSettled:()=>{y?.(),i.invalidateQueries({queryKey:["amp","installations"]})}})},isIdle:s,isPending:a,error:l,errorMsg:c}}const Ux=()=>{const e=mt(),t=Ze(),[n,r]=I.useState(null);return{...vn({mutationKey:["deleteInstallation"],mutationFn:async o=>(await e()).installationApi.deleteInstallation(o),onSuccess:()=>{t.invalidateQueries({queryKey:["amp","installations"]}),r(null)},onError:o=>{console.error("Error deleting installation"),Ye(o,r)}}),errorMsg:n}};function qx(){const{projectIdOrName:e}=Ke(),{integrationNameOrId:t}=jn(),{data:n}=tr(t),{installation:r}=dn(),i=Ze(),{mutate:o,isIdle:s,isPending:a,error:l,errorMsg:c}=Ux();return{deleteInstallation:({onSuccess:d,onError:h,onSettled:f})=>{if(!r){const y=new Error("Installation not found. Not able to delete installation.");h?.(y),f?.();return}if(!n){const y=new Error("No integration found");h?.(y),f?.();return}return o({projectIdOrName:e,integrationId:n?.id,installationId:r.id},{onSuccess:()=>{d?.()},onError:y=>{h?.(y)},onSettled:()=>{f?.(),i.invalidateQueries({queryKey:["amp","installations"]}),i.invalidateQueries({queryKey:["amp","connections"]})}})},isIdle:s,isPending:a,error:l,errorMsg:c}}function Nd(){const[e,t]=I.useState(1);return{seed:e,reset:()=>{t(Math.random())}}}var Jr={exports:{}};Jr.exports;var Yl;function $x(){return Yl||(Yl=1,(function(e,t){var n=9007199254740991,r="[object Arguments]",i="[object Function]",o="[object GeneratorFunction]",s="[object Map]",a="[object Object]",l="[object Promise]",c="[object Set]",u="[object WeakMap]",d="[object DataView]",h=/[\\^$.*+?()[\]{}|]/g,f=/^\[object .+?Constructor\]$/,y=typeof kn=="object"&&kn&&kn.Object===Object&&kn,v=typeof self=="object"&&self&&self.Object===Object&&self,g=y||v||Function("return this")(),w=t&&!t.nodeType&&t,m=w&&!0&&e&&!e.nodeType&&e,b=m&&m.exports===w;function C(R,re){return R?.[re]}function E(R){var re=!1;if(R!=null&&typeof R.toString!="function")try{re=!!(R+"")}catch{}return re}function _(R,re){return function(ce){return R(re(ce))}}var A=Function.prototype,k=Object.prototype,L=g["__core-js_shared__"],M=(function(){var R=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||"");return R?"Symbol(src)_1."+R:""})(),F=A.toString,j=k.hasOwnProperty,G=k.toString,P=RegExp("^"+F.call(j).replace(h,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),V=b?g.Buffer:void 0,Y=k.propertyIsEnumerable,le=V?V.isBuffer:void 0,pe=_(Object.keys,Object),ge=U(g,"DataView"),x=U(g,"Map"),J=U(g,"Promise"),B=U(g,"Set"),S=U(g,"WeakMap"),$=!Y.call({valueOf:1},"valueOf"),q=Fe(ge),X=Fe(x),ie=Fe(J),ne=Fe(B),se=Fe(S);function ee(R){return G.call(R)}function me(R){if(!Ge(R)||Z(R))return!1;var re=bt(R)||E(R)?P:f;return re.test(Fe(R))}function U(R,re){var ce=C(R,re);return me(ce)?ce:void 0}var ye=ee;(ge&&ye(new ge(new ArrayBuffer(1)))!=d||x&&ye(new x)!=s||J&&ye(J.resolve())!=l||B&&ye(new B)!=c||S&&ye(new S)!=u)&&(ye=function(R){var re=G.call(R),ce=re==a?R.constructor:void 0,qe=ce?Fe(ce):void 0;if(qe)switch(qe){case q:return d;case X:return s;case ie:return l;case ne:return c;case se:return u}return re});function Z(R){return!!M&&M in R}function Be(R){var re=R&&R.constructor,ce=typeof re=="function"&&re.prototype||k;return R===ce}function Fe(R){if(R!=null){try{return F.call(R)}catch{}try{return R+""}catch{}}return""}function Ae(R){return tt(R)&&j.call(R,"callee")&&(!Y.call(R,"callee")||G.call(R)==r)}var We=Array.isArray;function et(R){return R!=null&&at(R.length)&&!bt(R)}function tt(R){return D(R)&&et(R)}var xe=le||K;function ot(R){if(et(R)&&(We(R)||typeof R=="string"||typeof R.splice=="function"||xe(R)||Ae(R)))return!R.length;var re=ye(R);if(re==s||re==c)return!R.size;if($||Be(R))return!pe(R).length;for(var ce in R)if(j.call(R,ce))return!1;return!0}function bt(R){var re=Ge(R)?G.call(R):"";return re==i||re==o}function at(R){return typeof R=="number"&&R>-1&&R%1==0&&R<=n}function Ge(R){var re=typeof R;return!!R&&(re=="object"||re=="function")}function D(R){return!!R&&typeof R=="object"}function K(){return!1}e.exports=ot})(Jr,Jr.exports)),Jr.exports}var zx=$x();const Kx=Nr(zx),vr="other",no="manage-tab";function Rr(e){return!e.fieldName}function Td(e,t){return e?.objects?.find(n=>n.objectName===t)||null}function Hx(e){return e?.requiredFields?.filter(n=>Rr(n)&&!!n.mapToName)||[]}function Jx(e){return e?.optionalFields?.filter(n=>Rr(n)&&!!n.mapToName)||[]}function kd(e){return e?.optionalFields?.filter(t=>!Rr(t)&&!!t.fieldName)||null}const Rd=(e,t)=>e?.content?.read?.objects?.[t],Ad=(e,t)=>{const n=[];return t.content?.read?.objects?.forEach(r=>{const i=e?Rd(e,r.objectName):void 0;n.push({name:r?.objectName,displayName:r?.mapToDisplayName||r?.displayName||r?.objectName&&Wt(r?.objectName),completed:!!i,disabled:i?.disabled})}),n},Fd=e=>({name:vr,completed:e?!!e?.content?.write:!1});function Wx(e,t){const n=Ad(e,t),i=!!t?.content?.write?Fd(e):void 0;return i&&n.push(i),n}function Pd(e,t,n){const r=e?.filter(o=>!t?.[o?.mapToName])||[],i=r.map(o=>o.mapToName);return n(Ie.MAPPING,i),r?.length&&console.error("required fields not met",r.map(o=>o.mapToDisplayName)),{errorList:i}}function Zl(e,t){return Kx(e)?!0:Object.values(e).every(t)}function ha(e,t,n){const r=Zl(e,n),i=Zl(t,n);return r&&i?!0:r!==i?!1:dd(e,t)}function Dd(e,t){return ha(e,t,n=>n===!1||n===void 0)}function Md(e,t){return ha(e,t,n=>!n||n==="")}function jd(e,t){return ha(e,t,n=>!n||typeof n!="object"?!0:Object.keys(n).length===0)}function Ld(e,t){const n=new Set(Object.values(e).map(i=>i?.objectName)),r=new Set(Object.values(t).map(i=>i?.objectName));return n.size===r.size&&[...n].every(i=>r.has(i))}const Qx=(e,t,n)=>{if(!e)return null;const r=Td(e,t),i=r&&kd(r),o=r&&Hx(r),s=r&&Jx(r),a=r?.allFields||[],l=r?.allFieldsMetadata||{},c=n?.content,u=c?.read?.objects?.[t]?.selectedValueMappings||{},d=c?.read?.objects?.[t]?.selectedFieldMappings||{},h=ma(n,{content:{read:e}},t);return{allFields:a,allFieldsMetadata:l,optionalFields:i,requiredMapFields:o,optionalMapFields:s,selectedOptionalFields:h,selectedFieldMappings:d,selectedValueMappings:u}},Gx=(e,t)=>{if(!e)return null;const n=t?.content?.write?.objects;return{writeObjects:e?.objects||[],selectedWriteObjects:n||{}}};function Bd(e,t,n){const r=e?.content?.read,i=e?.content?.write;return{read:Qx(r,t,n),write:Gx(i,n)}}const Vd=(e,t,n,r)=>{const i=Bd(e,n,t);r(n,i)},Xx=(e,t,n)=>{const r=Wx(t,e),i={};r.forEach(({name:o,completed:s})=>{s&&(i[o]=Bd(e,o,t))}),n(i)},Ud=e=>{const{selectedOptionalFields:t}=e?.read||{};return t||{}},qd=e=>{const{selectedFieldMappings:t}=e?.read||{},n={};return t&&Object.keys(t).forEach(r=>{t[r]!==void 0?n[r]=t[r]||"":console.warn(`Error undefined when generating selectedRequiredMapFieldsSubmit for key: ${r}`)}),n},$d=(e,t)=>!t||!t[e]?[]:t[e],zd=e=>{const{selectedValueMappings:t}=e?.read||{};return t},ma=(e,t,n)=>{if(!e||!t)return{};const r=t?.content?.read;if(!r)return{};const i=Td(r,n),o=i&&kd(i),s=new Set(o?.filter(c=>!Rr(c)&&!!c.fieldName).map(c=>c.fieldName)||[]),a=e?.content?.read?.objects?.[n]?.selectedFields||{};return Object.entries(a).reduce((c,[u,d])=>(s.has(u)&&(c[u]=d),c),{})},Kd=(e,t)=>!e||!t?{}:e?.content?.read?.objects?.[t]?.selectedFieldMappings||{};function Hd(e,t){return t[e]||void 0}const Yx=(e,t,n,r,i)=>{const o=Ud(e),s=qd(e),a=$d(t,i),l=zd(e);return{createdBy:`consumer:${r}`,content:{provider:n.content.provider,read:{objects:{[t]:{objectName:t,selectedFields:o,selectedFieldMappings:s,dynamicMappingsInput:a,selectedValueMappings:l||{}}}}}}};function Jd(e){return e.content.proxy?.enabled}const Wd=e=>({...e.write?.selectedWriteObjects}),Zx=e=>e.content.write?.objects,eI=(e,t,n)=>{if(!Zx(t))return console.error("Error when getting write objects from hydratedRevision"),null;const i=Wd(e),o={createdBy:`consumer:${n}`,content:{provider:t.content.provider,read:{objects:{}},write:{objects:i}}};return Jd(t)&&(o.content.proxy={enabled:!0}),o};var Uo={exports:{}};var ec;function tI(){return ec||(ec=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(o=i(o,r(a)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var s="";for(var a in o)t.call(o,a)&&o[a]&&(s=i(s,a));return s}function i(o,s){return s?o?o+" "+s:o+s:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Uo)),Uo.exports}var nI=tI();const Jt=Nr(nI),rI="_button_kwfiu_1",iI="_danger_kwfiu_42",oI="_ghost_kwfiu_47",qo={button:rI,danger:iI,ghost:oI};function Je({className:e,style:t,type:n,children:r,variant:i,...o}){const s=Jt(qo.button,{[qo.danger]:i==="danger",[qo.ghost]:i==="ghost",[e||""]:!!e});return p.jsx("button",{type:n,className:s,style:t,...o,children:r})}const sI={backgroundColor:"var(--amp-colors-status-critical-muted)",borderColor:"var(--amp-colors-status-critical-muted)",color:"var(--amp-colors-status-critical-dark)",padding:".5rem 1rem"};function ui({children:e,style:t}){return p.jsx(bn,{style:{...sI,...t},children:e})}const Qd=e=>{const t=mt(),{provider:n}=gt(),r=e||n;return er({queryKey:["amp","providerInfo",r],queryFn:async()=>{if(!r)throw new Error("Provider not found");return(await t()).providerApi.getProvider({provider:r})},enabled:!!r})},yt=e=>{const t=Qd(e),{data:n}=t,{provider:r}=gt(),i=n&&Fx(n?.name,n);return{...t,providerName:i,selectedProvider:e||r}};function wn({error:e}){return e?p.jsx(ui,{style:{marginTop:"2em"},children:e}):null}const aI="_input_1ymb7_1",lI="_inputError_1ymb7_27",$o={input:aI,inputError:lI};function Gd({id:e,type:t,className:n,isError:r=!1,...i}){const o=r?Jt($o.inputError,$o.input):$o.input;return p.jsx("input",{id:e,type:t,className:Jt(o,n),...i})}function cI(){return p.jsx("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.jsxs("g",{opacity:"0.5",children:[p.jsx("path",{d:"M14.2821 11.0004C14.2821 12.8154 12.8154 14.2821 11.0004 14.2821C9.18542 14.2821 7.71875 12.8154 7.71875 11.0004C7.71875 9.18542 9.18542 7.71875 11.0004 7.71875C12.8154 7.71875 14.2821 9.18542 14.2821 11.0004Z",stroke:"currentColor",strokeWidth:"1.375",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M10.9999 18.581C14.2357 18.581 17.2515 16.6743 19.3507 13.3743C20.1757 12.0818 20.1757 9.90932 19.3507 8.61682C17.2515 5.31682 14.2357 3.41016 10.9999 3.41016C7.76402 3.41016 4.74819 5.31682 2.64902 8.61682C1.82402 9.90932 1.82402 12.0818 2.64902 13.3743C4.74819 16.6743 7.76402 18.581 10.9999 18.581Z",stroke:"currentColor",strokeWidth:"1.375",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function uI(){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[p.jsx("path",{d:"M13.3187 8.68036L8.68036 13.3187C8.06528 12.7036 7.71973 11.8694 7.71973 10.9995C7.71973 10.5688 7.80456 10.1423 7.96939 9.7444C8.13421 9.34648 8.3758 8.98491 8.68036 8.68036C8.98491 8.3758 9.34648 8.13421 9.7444 7.96939C10.1423 7.80456 10.5688 7.71973 10.9995 7.71973C11.8694 7.71973 12.7036 8.06528 13.3187 8.68036Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M16.3349 5.28895C14.7307 4.07895 12.8974 3.41895 10.9999 3.41895C7.76402 3.41895 4.74819 5.32561 2.64902 8.62561C1.82402 9.91811 1.82402 12.0906 2.64902 13.3831C3.37319 14.5198 4.21652 15.5006 5.13319 16.2889M7.71819 17.9023C8.76319 18.3423 9.87236 18.5806 10.9999 18.5806C14.2357 18.5806 17.2515 16.6739 19.3507 13.3739C20.1757 12.0814 20.1757 9.90895 19.3507 8.61645C19.0482 8.13978 18.7182 7.69061 18.379 7.26895",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M14.2172 11.6413C14.093 12.2808 13.7806 12.8685 13.32 13.3291C12.8594 13.7897 12.2716 14.1022 11.6322 14.2263M8.68051 13.3188L1.83301 20.1663M20.1663 1.83301L13.3188 8.68051",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function dI({id:e,name:t,placeholder:n="Password",onChange:r,value:i,className:o,isError:s}){const[a,l]=I.useState(!1),c=()=>l(u=>!u);return p.jsxs("div",{style:{display:"flex",gap:".5rem"},children:[p.jsx(yn.Input,{id:e,name:t,type:a?"text":"password",placeholder:n,onChange:r,value:i,className:o,isError:s}),p.jsx(Je,{type:"button","aria-label":a?"Hide password":"Show password",style:{height:"2.5rem",width:"2.5rem",display:"flex",alignItems:"center",justifyContent:"center"},onClick:c,variant:"ghost",children:p.jsx("span",{style:{height:"1.5rem",width:"1.5rem"},children:a?p.jsx(uI,{}):p.jsx(cI,{})})})]})}const fI="_textarea_18zl4_1",pI="_textareaError_18zl4_14",zo={textarea:fI,textareaError:pI};function hI({className:e,isError:t=!1,...n}){const r=t?Jt(zo.textareaError,zo.textarea):zo.textarea;return p.jsx("textarea",{className:Jt(e,r),...n})}const yn={Input:Gd,Textarea:hI,PasswordInput:dI},mI=()=>{const{projectIdOrName:e}=Ke(),t=mt();return er({queryKey:["project",e,"entitlements"],queryFn:async()=>{if(!e)throw new Error("Project ID is required");return(await t()).projectApi.getProject({projectIdOrName:e,includeEntitlements:!0})},enabled:!!e})};function Xd(){const{data:e}=mI();return e?.entitlements?.brandingRemoval?.value===!0?null:p.jsxs("footer",{style:{backgroundColor:"light-dark(#EFEFEF, #646266)",padding:"1em",fontSize:"0.8em",color:"gray",display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"0 0 4px 4px",gap:"0.4em"},children:[p.jsx("p",{style:{color:"light-dark(gray, #EFEFEF)"},children:"Secured by"}),p.jsx("a",{href:"https://www.withampersand.com/",target:"_blank","aria-label":"Go to Ampersand",rel:"noreferrer noopener",children:p.jsx("img",{style:{height:".8em"},src:"https://res.cloudinary.com/dycvts6vp/image/upload/v1723671980/ampersand-logo-black.svg",alt:"Ampersand"})})]})}function nr({children:e}){return p.jsx(Tr,{children:p.jsxs(bn,{children:[p.jsx("div",{style:{padding:"3rem 2rem"},children:e}),p.jsx(Xd,{})]})})}function rr({children:e}){return p.jsx("h1",{style:{fontWeight:600,lineHeight:1.2,fontSize:"1.2em"},children:e})}function gI({children:e}){return p.jsx("p",{style:{padding:".5em 0"},children:e})}const yI="_link_oo2kv_1",vI={link:yI};function Yd({href:e,className:t,style:n,label:r,children:i,newTab:o=!1}){return p.jsx("a",{className:Jt(vI.link,t),style:n,href:e,"aria-label":r||void 0,target:o?"_blank":"_self",rel:o?"noopener noreferrer":void 0,children:i})}function bI(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const wI=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xI=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,II={};function tc(e,t){return(II.jsx?xI:wI).test(e)}const SI=/[ \t\n\f\r]/g;function CI(e){return typeof e=="object"?e.type==="text"?nc(e.value):!1:nc(e)}function nc(e){return e.replace(SI,"")===""}class di{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}di.prototype.normal={};di.prototype.property={};di.prototype.space=void 0;function Zd(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new di(n,r,t)}function As(e){return e.toLowerCase()}class Rt{constructor(t,n){this.attribute=n,this.property=t}}Rt.prototype.attribute="";Rt.prototype.booleanish=!1;Rt.prototype.boolean=!1;Rt.prototype.commaOrSpaceSeparated=!1;Rt.prototype.commaSeparated=!1;Rt.prototype.defined=!1;Rt.prototype.mustUseProperty=!1;Rt.prototype.number=!1;Rt.prototype.overloadedBoolean=!1;Rt.prototype.property="";Rt.prototype.spaceSeparated=!1;Rt.prototype.space=void 0;let OI=0;const be=ir(),Xe=ir(),Fs=ir(),W=ir(),je=ir(),pr=ir(),Ft=ir();function ir(){return 2**++OI}const Ps=Object.freeze(Object.defineProperty({__proto__:null,boolean:be,booleanish:Xe,commaOrSpaceSeparated:Ft,commaSeparated:pr,number:W,overloadedBoolean:Fs,spaceSeparated:je},Symbol.toStringTag,{value:"Module"})),Ko=Object.keys(Ps);class ga extends Rt{constructor(t,n,r,i){let o=-1;if(super(t,n),rc(this,"space",i),typeof r=="number")for(;++o<Ko.length;){const s=Ko[o];rc(this,Ko[o],(r&Ps[s])===Ps[s])}}}ga.prototype.defined=!0;function rc(e,t,n){n&&(e[t]=n)}function Ar(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new ga(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[As(r)]=r,n[As(o.attribute)]=r}return new di(t,n,e.space)}const ef=Ar({properties:{ariaActiveDescendant:null,ariaAtomic:Xe,ariaAutoComplete:null,ariaBusy:Xe,ariaChecked:Xe,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:je,ariaCurrent:null,ariaDescribedBy:je,ariaDetails:null,ariaDisabled:Xe,ariaDropEffect:je,ariaErrorMessage:null,ariaExpanded:Xe,ariaFlowTo:je,ariaGrabbed:Xe,ariaHasPopup:null,ariaHidden:Xe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:je,ariaLevel:W,ariaLive:null,ariaModal:Xe,ariaMultiLine:Xe,ariaMultiSelectable:Xe,ariaOrientation:null,ariaOwns:je,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:Xe,ariaReadOnly:Xe,ariaRelevant:null,ariaRequired:Xe,ariaRoleDescription:je,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:Xe,ariaSetSize:W,ariaSort:null,ariaValueMax:W,ariaValueMin:W,ariaValueNow:W,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function tf(e,t){return t in e?e[t]:t}function nf(e,t){return tf(e,t.toLowerCase())}const EI=Ar({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:pr,acceptCharset:je,accessKey:je,action:null,allow:null,allowFullScreen:be,allowPaymentRequest:be,allowUserMedia:be,alt:null,as:null,async:be,autoCapitalize:null,autoComplete:je,autoFocus:be,autoPlay:be,blocking:je,capture:null,charSet:null,checked:be,cite:null,className:je,cols:W,colSpan:null,content:null,contentEditable:Xe,controls:be,controlsList:je,coords:W|pr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:be,defer:be,dir:null,dirName:null,disabled:be,download:Fs,draggable:Xe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:be,formTarget:null,headers:je,height:W,hidden:Fs,high:W,href:null,hrefLang:null,htmlFor:je,httpEquiv:je,id:null,imageSizes:null,imageSrcSet:null,inert:be,inputMode:null,integrity:null,is:null,isMap:be,itemId:null,itemProp:je,itemRef:je,itemScope:be,itemType:je,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:be,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:be,muted:be,name:null,nonce:null,noModule:be,noValidate:be,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:be,optimum:W,pattern:null,ping:je,placeholder:null,playsInline:be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:be,referrerPolicy:null,rel:je,required:be,reversed:be,rows:W,rowSpan:W,sandbox:je,scope:null,scoped:be,seamless:be,selected:be,shadowRootClonable:be,shadowRootDelegatesFocus:be,shadowRootMode:null,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:Xe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:W,step:null,style:null,tabIndex:W,target:null,title:null,translate:null,type:null,typeMustMatch:be,useMap:null,value:Xe,width:W,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:je,axis:null,background:null,bgColor:null,border:W,borderColor:null,bottomMargin:W,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:be,declare:be,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:be,noHref:be,noShade:be,noWrap:be,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:Xe,standby:null,summary:null,text:null,topMargin:W,valueType:null,version:null,vAlign:null,vLink:null,vSpace:W,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:be,disableRemotePlayback:be,prefix:null,property:null,results:W,security:null,unselectable:null},space:"html",transform:nf}),_I=Ar({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ft,accentHeight:W,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:W,amplitude:W,arabicForm:null,ascent:W,attributeName:null,attributeType:null,azimuth:W,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:W,by:null,calcMode:null,capHeight:W,className:je,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:W,diffuseConstant:W,direction:null,display:null,dur:null,divisor:W,dominantBaseline:null,download:be,dx:null,dy:null,edgeMode:null,editable:null,elevation:W,enableBackground:null,end:null,event:null,exponent:W,externalResourcesRequired:null,fill:null,fillOpacity:W,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:pr,g2:pr,glyphName:pr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:W,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:W,horizOriginX:W,horizOriginY:W,id:null,ideographic:W,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:W,k:W,k1:W,k2:W,k3:W,k4:W,kernelMatrix:Ft,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:W,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:W,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:W,overlineThickness:W,paintOrder:null,panose1:null,path:null,pathLength:W,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:je,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ft,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ft,rev:Ft,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ft,requiredFeatures:Ft,requiredFonts:Ft,requiredFormats:Ft,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:W,specularExponent:W,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:W,strikethroughThickness:W,string:null,stroke:null,strokeDashArray:Ft,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:W,strokeOpacity:W,strokeWidth:null,style:null,surfaceScale:W,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ft,tabIndex:W,tableValues:null,target:null,targetX:W,targetY:W,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ft,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:W,underlineThickness:W,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:W,values:null,vAlphabetic:W,vMathematical:W,vectorEffect:null,vHanging:W,vIdeographic:W,version:null,vertAdvY:W,vertOriginX:W,vertOriginY:W,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:W,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:tf}),rf=Ar({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),of=Ar({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:nf}),sf=Ar({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),NI={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},TI=/[A-Z]/g,ic=/-[a-z]/g,kI=/^data[-\w.:]+$/i;function RI(e,t){const n=As(t);let r=t,i=Rt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&kI.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(ic,FI);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!ic.test(o)){let s=o.replace(TI,AI);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=ga}return new i(r,t)}function AI(e){return"-"+e.toLowerCase()}function FI(e){return e.charAt(1).toUpperCase()}const PI=Zd([ef,EI,rf,of,sf],"html"),ya=Zd([ef,_I,rf,of,sf],"svg");function DI(e){return e.join(" ").trim()}var cr={},Ho,oc;function MI(){if(oc)return Ho;oc=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
|
|
7
7
|
`,c="/",u="*",d="",h="comment",f="declaration";function y(g,w){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];w=w||{};var m=1,b=1;function C(P){var V=P.match(t);V&&(m+=V.length);var Y=P.lastIndexOf(l);b=~Y?P.length-Y:b+P.length}function E(){var P={line:m,column:b};return function(V){return V.position=new _(P),L(),V}}function _(P){this.start=P,this.end={line:m,column:b},this.source=w.source}_.prototype.content=g;function A(P){var V=new Error(w.source+":"+m+":"+b+": "+P);if(V.reason=P,V.filename=w.source,V.line=m,V.column=b,V.source=g,!w.silent)throw V}function k(P){var V=P.exec(g);if(V){var Y=V[0];return C(Y),g=g.slice(Y.length),V}}function L(){k(n)}function M(P){var V;for(P=P||[];V=F();)V!==!1&&P.push(V);return P}function F(){var P=E();if(!(c!=g.charAt(0)||u!=g.charAt(1))){for(var V=2;d!=g.charAt(V)&&(u!=g.charAt(V)||c!=g.charAt(V+1));)++V;if(V+=2,d===g.charAt(V-1))return A("End of comment missing");var Y=g.slice(2,V-2);return b+=2,C(Y),g=g.slice(V),b+=2,P({type:h,comment:Y})}}function j(){var P=E(),V=k(r);if(V){if(F(),!k(i))return A("property missing ':'");var Y=k(o),le=P({type:f,property:v(V[0].replace(e,d)),value:Y?v(Y[0].replace(e,d)):d});return k(s),le}}function G(){var P=[];M(P);for(var V;V=j();)V!==!1&&(P.push(V),M(P));return P}return L(),G()}function v(g){return g?g.replace(a,d):d}return Ho=y,Ho}var sc;function jI(){if(sc)return cr;sc=1;var e=cr&&cr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(cr,"__esModule",{value:!0}),cr.default=n;const t=e(MI());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const s=(0,t.default)(r),a=typeof i=="function";return s.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:u}=l;a?i(c,u,l):u&&(o=o||{},o[c]=u)}),o}return cr}var Br={},ac;function LI(){if(ac)return Br;ac=1,Object.defineProperty(Br,"__esModule",{value:!0}),Br.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(c){return!c||n.test(c)||e.test(c)},s=function(c,u){return u.toUpperCase()},a=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),o(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(i,a):c=c.replace(r,a),c.replace(t,s))};return Br.camelCase=l,Br}var Vr,lc;function BI(){if(lc)return Vr;lc=1;var e=Vr&&Vr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(jI()),n=LI();function r(i,o){var s={};return!i||typeof i!="string"||(0,t.default)(i,function(a,l){a&&l&&(s[(0,n.camelCase)(a,o)]=l)}),s}return r.default=r,Vr=r,Vr}var VI=BI();const UI=Nr(VI),af=lf("end"),va=lf("start");function lf(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function qI(e){const t=va(e),n=af(e);if(t&&n)return{start:t,end:n}}function Wr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?cc(e.position):"start"in e||"end"in e?cc(e):"line"in e||"column"in e?Ds(e):""}function Ds(e){return uc(e&&e.line)+":"+uc(e&&e.column)}function cc(e){return Ds(e&&e.start)+"-"+Ds(e&&e.end)}function uc(e){return e&&typeof e=="number"?e:1}class vt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Wr(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vt.prototype.file="";vt.prototype.name="";vt.prototype.reason="";vt.prototype.message="";vt.prototype.stack="";vt.prototype.column=void 0;vt.prototype.line=void 0;vt.prototype.ancestors=void 0;vt.prototype.cause=void 0;vt.prototype.fatal=void 0;vt.prototype.place=void 0;vt.prototype.ruleId=void 0;vt.prototype.source=void 0;const ba={}.hasOwnProperty,$I=new Map,zI=/[A-Z]/g,KI=new Set(["table","tbody","thead","tfoot","tr"]),HI=new Set(["td","th"]),cf="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function JI(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=tS(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=eS(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ya:PI,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=uf(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function uf(e,t,n){if(t.type==="element")return WI(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return QI(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return XI(e,t,n);if(t.type==="mdxjsEsm")return GI(e,t);if(t.type==="root")return YI(e,t,n);if(t.type==="text")return ZI(e,t)}function WI(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ya,e.schema=i),e.ancestors.push(t);const o=ff(e,t.tagName,!1),s=nS(e,t);let a=xa(e,t);return KI.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!CI(l):!0})),df(e,s,o,t),wa(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function QI(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}oi(e,t.position)}function GI(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);oi(e,t.position)}function XI(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ya,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:ff(e,t.name,!0),s=rS(e,t),a=xa(e,t);return df(e,s,o,t),wa(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function YI(e,t,n){const r={};return wa(r,xa(e,t)),e.create(t,e.Fragment,r,n)}function ZI(e,t){return t.value}function df(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function wa(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function eS(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function tS(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=va(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function nS(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ba.call(t.properties,i)){const o=iS(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&HI.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function rS(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else oi(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else oi(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function xa(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:$I;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;s=l+"-"+c,i.set(l,c+1)}}const a=uf(e,o,s);a!==void 0&&n.push(a)}return n}function iS(e,t,n){const r=RI(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?bI(n):DI(n)),r.property==="style"){let i=typeof n=="object"?n:oS(e,String(n));return e.stylePropertyNameCase==="css"&&(i=sS(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?NI[r.property]||r.property:r.attribute,n]}}function oS(e,t){try{return UI(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new vt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=cf+"#cannot-parse-style-attribute",i}}function ff(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=tc(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=tc(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return ba.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);oi(e)}function oi(e,t){const n=new vt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=cf+"#cannot-handle-mdx-estrees-without-createevaluater",n}function sS(e){const t={};let n;for(n in e)ba.call(e,n)&&(t[aS(n)]=e[n]);return t}function aS(e){let t=e.replace(zI,lS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function lS(e){return"-"+e.toLowerCase()}const Jo={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},cS={};function uS(e,t){const n=cS,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return pf(e,r,i)}function pf(e,t,n){if(dS(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return dc(e.children,t,n)}return Array.isArray(e)?dc(e,t,n):""}function dc(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=pf(e[i],t,n);return r.join("")}function dS(e){return!!(e&&typeof e=="object")}const fc=document.createElement("i");function Ia(e){const t="&"+e+";";fc.innerHTML=t;const n=fc.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ln(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Ht(e,t){return e.length>0?(ln(e,e.length,0,t),e):t}const pc={}.hasOwnProperty;function fS(e){const t={};let n=-1;for(;++n<e.length;)pS(t,e[n]);return t}function pS(e,t){let n;for(n in t){const i=(pc.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){pc.call(i,s)||(i[s]=[]);const a=o[s];hS(i[s],Array.isArray(a)?a:a?[a]:[])}}}function hS(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ln(e,0,0,r)}function hf(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function hr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const sn=Ln(/[A-Za-z]/),Dt=Ln(/[\dA-Za-z]/),mS=Ln(/[#-'*+\--9=?A-Z^-~]/);function Ms(e){return e!==null&&(e<32||e===127)}const js=Ln(/\d/),gS=Ln(/[\dA-Fa-f]/),yS=Ln(/[!-/:-@[-`{-~]/);function he(e){return e!==null&&e<-2}function kt(e){return e!==null&&(e<0||e===32)}function _e(e){return e===-2||e===-1||e===32}const vS=Ln(new RegExp("\\p{P}|\\p{S}","u")),bS=Ln(/\s/);function Ln(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Fr(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&Dt(e.charCodeAt(n+1))&&Dt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Le(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return _e(l)?(e.enter(n),a(l)):t(l)}function a(l){return _e(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const wS={tokenize:xS};function xS(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Le(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return he(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const IS={tokenize:SS},hc={tokenize:CS};function SS(e){const t=this,n=[];let r=0,i,o,s;return a;function a(b){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,l,c)(b)}return c(b)}function l(b){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&m();const C=t.events.length;let E=C,_;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){_=t.events[E][1].end;break}w(r);let A=C;for(;A<t.events.length;)t.events[A][1].end={..._},A++;return ln(t.events,E+1,0,t.events.slice(C)),t.events.length=A,c(b)}return a(b)}function c(b){if(r===n.length){if(!i)return h(b);if(i.currentConstruct&&i.currentConstruct.concrete)return y(b);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(hc,u,d)(b)}function u(b){return i&&m(),w(r),h(b)}function d(b){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,y(b)}function h(b){return t.containerState={},e.attempt(hc,f,y)(b)}function f(b){return r++,n.push([t.currentConstruct,t.containerState]),h(b)}function y(b){if(b===null){i&&m(),w(0),e.consume(b);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),v(b)}function v(b){if(b===null){g(e.exit("chunkFlow"),!0),w(0),e.consume(b);return}return he(b)?(e.consume(b),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(b),v)}function g(b,C){const E=t.sliceStream(b);if(C&&E.push(null),b.previous=o,o&&(o.next=b),o=b,i.defineSkip(b.start),i.write(E),t.parser.lazy[b.start.line]){let _=i.events.length;for(;_--;)if(i.events[_][1].start.offset<s&&(!i.events[_][1].end||i.events[_][1].end.offset>s))return;const A=t.events.length;let k=A,L,M;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){if(L){M=t.events[k][1].end;break}L=!0}for(w(r),_=A;_<t.events.length;)t.events[_][1].end={...M},_++;ln(t.events,k+1,0,t.events.slice(A)),t.events.length=_}}function w(b){let C=n.length;for(;C-- >b;){const E=n[C];t.containerState=E[1],E[0].exit.call(t,e)}n.length=b}function m(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function CS(e,t,n){return Le(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function mc(e){if(e===null||kt(e)||bS(e))return 1;if(vS(e))return 2}function Sa(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const Ls={name:"attention",resolveAll:OS,tokenize:ES};function OS(e,t){let n=-1,r,i,o,s,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},h={...e[n][1].start};gc(d,-l),gc(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Ht(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Ht(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=Ht(c,Sa(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Ht(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Ht(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,ln(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function ES(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=mc(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const c=e.exit("attentionSequence"),u=mc(l),d=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(o===42?d:d&&(i||!h)),c._close=!!(o===42?h:h&&(u||!d)),t(l)}}function gc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const _S={name:"autolink",tokenize:NS};function NS(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(f){return sn(f)?(e.consume(f),s):f===64?n(f):c(f)}function s(f){return f===43||f===45||f===46||Dt(f)?(r=1,a(f)):c(f)}function a(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||Dt(f))&&r++<32?(e.consume(f),a):(r=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||Ms(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),u):mS(f)?(e.consume(f),c):n(f)}function u(f){return Dt(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||Dt(f))&&r++<63){const y=f===45?h:d;return e.consume(f),y}return n(f)}}const wo={partial:!0,tokenize:TS};function TS(e,t,n){return r;function r(o){return _e(o)?Le(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||he(o)?t(o):n(o)}}const mf={continuation:{tokenize:RS},exit:AS,name:"blockQuote",tokenize:kS};function kS(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return _e(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function RS(e,t,n){const r=this;return i;function i(s){return _e(s)?Le(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(mf,t,n)(s)}}function AS(e){e.exit("blockQuote")}const gf={name:"characterEscape",tokenize:FS};function FS(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return yS(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const yf={name:"characterReference",tokenize:PS};function PS(e,t,n){const r=this;let i=0,o,s;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,s=Dt,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=gS,u):(e.enter("characterReferenceValue"),o=7,s=js,u(d))}function u(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return s===Dt&&!Ia(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<o?(e.consume(d),u):n(d)}}const yc={partial:!0,tokenize:MS},vc={concrete:!0,name:"codeFenced",tokenize:DS};function DS(e,t,n){const r=this,i={partial:!0,tokenize:E};let o=0,s=0,a;return l;function l(_){return c(_)}function c(_){const A=r.events[r.events.length-1];return o=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,a=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(_)}function u(_){return _===a?(s++,e.consume(_),u):s<3?n(_):(e.exit("codeFencedFenceSequence"),_e(_)?Le(e,d,"whitespace")(_):d(_))}function d(_){return _===null||he(_)?(e.exit("codeFencedFence"),r.interrupt?t(_):e.check(yc,v,C)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(_))}function h(_){return _===null||he(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(_)):_e(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Le(e,f,"whitespace")(_)):_===96&&_===a?n(_):(e.consume(_),h)}function f(_){return _===null||he(_)?d(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(_))}function y(_){return _===null||he(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(_)):_===96&&_===a?n(_):(e.consume(_),y)}function v(_){return e.attempt(i,C,g)(_)}function g(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),w}function w(_){return o>0&&_e(_)?Le(e,m,"linePrefix",o+1)(_):m(_)}function m(_){return _===null||he(_)?e.check(yc,v,C)(_):(e.enter("codeFlowValue"),b(_))}function b(_){return _===null||he(_)?(e.exit("codeFlowValue"),m(_)):(e.consume(_),b)}function C(_){return e.exit("codeFenced"),t(_)}function E(_,A,k){let L=0;return M;function M(V){return _.enter("lineEnding"),_.consume(V),_.exit("lineEnding"),F}function F(V){return _.enter("codeFencedFence"),_e(V)?Le(_,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):j(V)}function j(V){return V===a?(_.enter("codeFencedFenceSequence"),G(V)):k(V)}function G(V){return V===a?(L++,_.consume(V),G):L>=s?(_.exit("codeFencedFenceSequence"),_e(V)?Le(_,P,"whitespace")(V):P(V)):k(V)}function P(V){return V===null||he(V)?(_.exit("codeFencedFence"),A(V)):k(V)}}}function MS(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Wo={name:"codeIndented",tokenize:LS},jS={partial:!0,tokenize:BS};function LS(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Le(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):he(c)?e.attempt(jS,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||he(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function BS(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):he(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Le(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):he(s)?i(s):n(s)}}const VS={name:"codeText",previous:qS,resolve:US,tokenize:$S};function US(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function qS(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function $S(e,t,n){let r=0,i,o;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(o=e.enter("codeTextSequence"),i=0,u(d)):he(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||he(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(o.type="codeTextData",c(d))}}class zS{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ur(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ur(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ur(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ur(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ur(this.left,n.reverse())}}}function Ur(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function vf(e){const t={};let n=-1,r,i,o,s,a,l,c;const u=new zS(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,KS(u,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=u.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},a=u.slice(i,n),a.unshift(r),u.splice(i,n-i+1,a))}}return ln(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function KS(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,d,h=-1,f=n,y=0,v=0;const g=[v];for(;f;){for(;e.get(++i)[1]!==f;);o.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(v=h+1,g.push(v),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),h=g.length;h--;){const w=a.slice(g[h],g[h+1]),m=o.pop();l.push([m,m+w.length-1]),e.splice(m,2,w)}for(l.reverse(),h=-1;++h<l.length;)c[y+l[h][0]]=y+l[h][1],y+=l[h][1]-l[h][0]-1;return c}const HS={resolve:WS,tokenize:QS},JS={partial:!0,tokenize:GS};function WS(e){return vf(e),e}function QS(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):he(a)?e.check(JS,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function GS(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Le(e,o,"linePrefix")}function o(s){if(s===null||he(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function bf(e,t,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(w){return w===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(w),e.exit(o),h):w===null||w===32||w===41||Ms(w)?n(w):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),v(w))}function h(w){return w===62?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(w))}function f(w){return w===62?(e.exit("chunkString"),e.exit(a),h(w)):w===null||w===60||he(w)?n(w):(e.consume(w),w===92?y:f)}function y(w){return w===60||w===62||w===92?(e.consume(w),f):f(w)}function v(w){return!u&&(w===null||w===41||kt(w))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(w)):u<c&&w===40?(e.consume(w),u++,v):w===41?(e.consume(w),u--,v):w===null||w===32||w===40||Ms(w)?n(w):(e.consume(w),w===92?g:v)}function g(w){return w===40||w===41||w===92?(e.consume(w),v):v(w)}}function wf(e,t,n,r,i,o){const s=this;let a=0,l;return c;function c(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(o),u}function u(f){return a>999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):he(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||he(f)||a++>999?(e.exit("chunkString"),u(f)):(e.consume(f),l||(l=!_e(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(e.consume(f),a++,d):d(f)}}function xf(e,t,n,r,i,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),c(h))}function c(h){return h===s?(e.exit(o),l(s)):h===null?n(h):he(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Le(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===s||h===null||he(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===s||h===92?(e.consume(h),u):u(h)}}function Qr(e,t){let n;return r;function r(i){return he(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):_e(i)?Le(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const XS={name:"definition",tokenize:ZS},YS={partial:!0,tokenize:eC};function ZS(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),s(f)}function s(f){return wf.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=hr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return kt(f)?Qr(e,c)(f):c(f)}function c(f){return bf(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(YS,d,d)(f)}function d(f){return _e(f)?Le(e,h,"whitespace")(f):h(f)}function h(f){return f===null||he(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function eC(e,t,n){return r;function r(a){return kt(a)?Qr(e,i)(a):n(a)}function i(a){return xf(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return _e(a)?Le(e,s,"whitespace")(a):s(a)}function s(a){return a===null||he(a)?t(a):n(a)}}const tC={name:"hardBreakEscape",tokenize:nC};function nC(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return he(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const rC={name:"headingAtx",resolve:iC,tokenize:oC};function iC(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ln(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function oC(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||kt(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||he(u)?(e.exit("atxHeading"),t(u)):_e(u)?Le(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||kt(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const sC=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],bc=["pre","script","style","textarea"],aC={concrete:!0,name:"htmlFlow",resolveTo:uC,tokenize:dC},lC={partial:!0,tokenize:pC},cC={partial:!0,tokenize:fC};function uC(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function dC(e,t,n){const r=this;let i,o,s,a,l;return c;function c(S){return u(S)}function u(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),d}function d(S){return S===33?(e.consume(S),h):S===47?(e.consume(S),o=!0,v):S===63?(e.consume(S),i=3,r.interrupt?t:x):sn(S)?(e.consume(S),s=String.fromCharCode(S),g):n(S)}function h(S){return S===45?(e.consume(S),i=2,f):S===91?(e.consume(S),i=5,a=0,y):sn(S)?(e.consume(S),i=4,r.interrupt?t:x):n(S)}function f(S){return S===45?(e.consume(S),r.interrupt?t:x):n(S)}function y(S){const $="CDATA[";return S===$.charCodeAt(a++)?(e.consume(S),a===$.length?r.interrupt?t:j:y):n(S)}function v(S){return sn(S)?(e.consume(S),s=String.fromCharCode(S),g):n(S)}function g(S){if(S===null||S===47||S===62||kt(S)){const $=S===47,q=s.toLowerCase();return!$&&!o&&bc.includes(q)?(i=1,r.interrupt?t(S):j(S)):sC.includes(s.toLowerCase())?(i=6,$?(e.consume(S),w):r.interrupt?t(S):j(S)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):o?m(S):b(S))}return S===45||Dt(S)?(e.consume(S),s+=String.fromCharCode(S),g):n(S)}function w(S){return S===62?(e.consume(S),r.interrupt?t:j):n(S)}function m(S){return _e(S)?(e.consume(S),m):M(S)}function b(S){return S===47?(e.consume(S),M):S===58||S===95||sn(S)?(e.consume(S),C):_e(S)?(e.consume(S),b):M(S)}function C(S){return S===45||S===46||S===58||S===95||Dt(S)?(e.consume(S),C):E(S)}function E(S){return S===61?(e.consume(S),_):_e(S)?(e.consume(S),E):b(S)}function _(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),l=S,A):_e(S)?(e.consume(S),_):k(S)}function A(S){return S===l?(e.consume(S),l=null,L):S===null||he(S)?n(S):(e.consume(S),A)}function k(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||kt(S)?E(S):(e.consume(S),k)}function L(S){return S===47||S===62||_e(S)?b(S):n(S)}function M(S){return S===62?(e.consume(S),F):n(S)}function F(S){return S===null||he(S)?j(S):_e(S)?(e.consume(S),F):n(S)}function j(S){return S===45&&i===2?(e.consume(S),Y):S===60&&i===1?(e.consume(S),le):S===62&&i===4?(e.consume(S),J):S===63&&i===3?(e.consume(S),x):S===93&&i===5?(e.consume(S),ge):he(S)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(lC,B,G)(S)):S===null||he(S)?(e.exit("htmlFlowData"),G(S)):(e.consume(S),j)}function G(S){return e.check(cC,P,B)(S)}function P(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),V}function V(S){return S===null||he(S)?G(S):(e.enter("htmlFlowData"),j(S))}function Y(S){return S===45?(e.consume(S),x):j(S)}function le(S){return S===47?(e.consume(S),s="",pe):j(S)}function pe(S){if(S===62){const $=s.toLowerCase();return bc.includes($)?(e.consume(S),J):j(S)}return sn(S)&&s.length<8?(e.consume(S),s+=String.fromCharCode(S),pe):j(S)}function ge(S){return S===93?(e.consume(S),x):j(S)}function x(S){return S===62?(e.consume(S),J):S===45&&i===2?(e.consume(S),x):j(S)}function J(S){return S===null||he(S)?(e.exit("htmlFlowData"),B(S)):(e.consume(S),J)}function B(S){return e.exit("htmlFlow"),t(S)}}function fC(e,t,n){const r=this;return i;function i(s){return he(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function pC(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(wo,t,n)}}const hC={name:"htmlText",tokenize:mC};function mC(e,t,n){const r=this;let i,o,s;return a;function a(x){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(x),l}function l(x){return x===33?(e.consume(x),c):x===47?(e.consume(x),E):x===63?(e.consume(x),b):sn(x)?(e.consume(x),k):n(x)}function c(x){return x===45?(e.consume(x),u):x===91?(e.consume(x),o=0,y):sn(x)?(e.consume(x),m):n(x)}function u(x){return x===45?(e.consume(x),f):n(x)}function d(x){return x===null?n(x):x===45?(e.consume(x),h):he(x)?(s=d,le(x)):(e.consume(x),d)}function h(x){return x===45?(e.consume(x),f):d(x)}function f(x){return x===62?Y(x):x===45?h(x):d(x)}function y(x){const J="CDATA[";return x===J.charCodeAt(o++)?(e.consume(x),o===J.length?v:y):n(x)}function v(x){return x===null?n(x):x===93?(e.consume(x),g):he(x)?(s=v,le(x)):(e.consume(x),v)}function g(x){return x===93?(e.consume(x),w):v(x)}function w(x){return x===62?Y(x):x===93?(e.consume(x),w):v(x)}function m(x){return x===null||x===62?Y(x):he(x)?(s=m,le(x)):(e.consume(x),m)}function b(x){return x===null?n(x):x===63?(e.consume(x),C):he(x)?(s=b,le(x)):(e.consume(x),b)}function C(x){return x===62?Y(x):b(x)}function E(x){return sn(x)?(e.consume(x),_):n(x)}function _(x){return x===45||Dt(x)?(e.consume(x),_):A(x)}function A(x){return he(x)?(s=A,le(x)):_e(x)?(e.consume(x),A):Y(x)}function k(x){return x===45||Dt(x)?(e.consume(x),k):x===47||x===62||kt(x)?L(x):n(x)}function L(x){return x===47?(e.consume(x),Y):x===58||x===95||sn(x)?(e.consume(x),M):he(x)?(s=L,le(x)):_e(x)?(e.consume(x),L):Y(x)}function M(x){return x===45||x===46||x===58||x===95||Dt(x)?(e.consume(x),M):F(x)}function F(x){return x===61?(e.consume(x),j):he(x)?(s=F,le(x)):_e(x)?(e.consume(x),F):L(x)}function j(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),i=x,G):he(x)?(s=j,le(x)):_e(x)?(e.consume(x),j):(e.consume(x),P)}function G(x){return x===i?(e.consume(x),i=void 0,V):x===null?n(x):he(x)?(s=G,le(x)):(e.consume(x),G)}function P(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===47||x===62||kt(x)?L(x):(e.consume(x),P)}function V(x){return x===47||x===62||kt(x)?L(x):n(x)}function Y(x){return x===62?(e.consume(x),e.exit("htmlTextData"),e.exit("htmlText"),t):n(x)}function le(x){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),pe}function pe(x){return _e(x)?Le(e,ge,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):ge(x)}function ge(x){return e.enter("htmlTextData"),s(x)}}const Ca={name:"labelEnd",resolveAll:bC,resolveTo:wC,tokenize:xC},gC={tokenize:IC},yC={tokenize:SC},vC={tokenize:CC};function bC(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&ln(e,0,e.length,n),e}function wC(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=Ht(a,e.slice(o+1,o+r+3)),a=Ht(a,[["enter",u,t]]),a=Ht(a,Sa(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=Ht(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=Ht(a,e.slice(s+1)),a=Ht(a,[["exit",l,t]]),ln(e,o,e.length,a),e}function xC(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(h){return o?o._inactive?d(h):(s=r.parser.defined.includes(hr(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(gC,u,s?u:d)(h):h===91?e.attempt(yC,u,s?c:d)(h):s?u(h):d(h)}function c(h){return e.attempt(vC,u,d)(h)}function u(h){return t(h)}function d(h){return o._balanced=!0,n(h)}}function IC(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return kt(d)?Qr(e,o)(d):o(d)}function o(d){return d===41?u(d):bf(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return kt(d)?Qr(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?xf(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return kt(d)?Qr(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function SC(e,t,n){const r=this;return i;function i(a){return wf.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(hr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function CC(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const OC={name:"labelStartImage",resolveAll:Ca.resolveAll,tokenize:EC};function EC(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const _C={name:"labelStartLink",resolveAll:Ca.resolveAll,tokenize:NC};function NC(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Qo={name:"lineEnding",tokenize:TC};function TC(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Le(e,t,"linePrefix")}}const Hi={name:"thematicBreak",tokenize:kC};function kC(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||he(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),_e(c)?Le(e,a,"whitespace")(c):a(c))}}const _t={continuation:{tokenize:PC},exit:MC,name:"list",tokenize:FC},RC={partial:!0,tokenize:jC},AC={partial:!0,tokenize:DC};function FC(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(f){const y=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:js(f)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Hi,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return js(f)&&++s<10?(e.consume(f),l):(!r.interrupt||s<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(wo,r.interrupt?n:u,e.attempt(RC,h,d))}function u(f){return r.containerState.initialBlankLine=!0,o++,h(f)}function d(f){return _e(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function PC(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(wo,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Le(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!_e(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(AC,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Le(e,e.attempt(_t,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function DC(e,t,n){const r=this;return Le(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function MC(e){e.exit(this.containerState.type)}function jC(e,t,n){const r=this;return Le(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!_e(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const wc={name:"setextUnderline",resolveTo:LC,tokenize:BC};function LC(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function BC(e,t,n){const r=this;let i;return o;function o(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),_e(c)?Le(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||he(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const VC={tokenize:UC};function UC(e){const t=this,n=e.attempt(wo,r,e.attempt(this.parser.constructs.flowInitial,i,Le(e,e.attempt(this.parser.constructs.flow,i,e.attempt(HS,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const qC={resolveAll:Sf()},$C=If("string"),zC=If("text");function If(e){return{resolveAll:Sf(e==="text"?KC:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(u){return c(u)?o(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let h=-1;if(d)for(;++h<d.length;){const f=d[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function Sf(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function KC(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const HC={42:_t,43:_t,45:_t,48:_t,49:_t,50:_t,51:_t,52:_t,53:_t,54:_t,55:_t,56:_t,57:_t,62:mf},JC={91:XS},WC={[-2]:Wo,[-1]:Wo,32:Wo},QC={35:rC,42:Hi,45:[wc,Hi],60:aC,61:wc,95:Hi,96:vc,126:vc},GC={38:yf,92:gf},XC={[-5]:Qo,[-4]:Qo,[-3]:Qo,33:OC,38:yf,42:Ls,60:[_S,hC],91:_C,92:[tC,gf],93:Ca,95:Ls,96:VS},YC={null:[Ls,qC]},ZC={null:[42,95]},e0={null:[]},t0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ZC,contentInitial:JC,disable:e0,document:HC,flow:QC,flowInitial:WC,insideSpan:YC,string:GC,text:XC},Symbol.toStringTag,{value:"Module"}));function n0(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const l={attempt:A(E),check:A(_),consume:m,enter:b,exit:C,interrupt:A(_,{interrupt:!0})},c={code:null,containerState:{},defineSkip:v,events:[],now:y,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function d(F){return s=Ht(s,F),g(),s[s.length-1]!==null?[]:(k(t,0),c.events=Sa(o,c.events,c),c.events)}function h(F,j){return i0(f(F),j)}function f(F){return r0(s,F)}function y(){const{_bufferIndex:F,_index:j,line:G,column:P,offset:V}=r;return{_bufferIndex:F,_index:j,line:G,column:P,offset:V}}function v(F){i[F.line]=F.column,M()}function g(){let F;for(;r._index<s.length;){const j=s[r._index];if(typeof j=="string")for(F=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===F&&r._bufferIndex<j.length;)w(j.charCodeAt(r._bufferIndex));else w(j)}}function w(F){u=u(F)}function m(F){he(F)?(r.line++,r.column=1,r.offset+=F===-3?2:1,M()):F!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=F}function b(F,j){const G=j||{};return G.type=F,G.start=y(),c.events.push(["enter",G,c]),a.push(G),G}function C(F){const j=a.pop();return j.end=y(),c.events.push(["exit",j,c]),j}function E(F,j){k(F,j.from)}function _(F,j){j.restore()}function A(F,j){return G;function G(P,V,Y){let le,pe,ge,x;return Array.isArray(P)?B(P):"tokenize"in P?B([P]):J(P);function J(X){return ie;function ie(ne){const se=ne!==null&&X[ne],ee=ne!==null&&X.null,me=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return B(me)(ne)}}function B(X){return le=X,pe=0,X.length===0?Y:S(X[pe])}function S(X){return ie;function ie(ne){return x=L(),ge=X,X.partial||(c.currentConstruct=X),X.name&&c.parser.constructs.disable.null.includes(X.name)?q():X.tokenize.call(j?Object.assign(Object.create(c),j):c,l,$,q)(ne)}}function $(X){return F(ge,x),V}function q(X){return x.restore(),++pe<le.length?S(le[pe]):Y}}}function k(F,j){F.resolveAll&&!o.includes(F)&&o.push(F),F.resolve&&ln(c.events,j,c.events.length-j,F.resolve(c.events.slice(j),c)),F.resolveTo&&(c.events=F.resolveTo(c.events,c))}function L(){const F=y(),j=c.previous,G=c.currentConstruct,P=c.events.length,V=Array.from(a);return{from:P,restore:Y};function Y(){r=F,c.previous=j,c.currentConstruct=G,c.events.length=P,a=V,M()}}function M(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function r0(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function i0(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
8
8
|
`;break}case-3:{s=`\r
|